@promptbook/cli 0.114.0-32 → 0.114.0-34
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/esm/index.es.js +1417 -400
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/createFreeDiskSpaceGuard.d.ts +25 -0
- package/esm/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +21 -3
- package/esm/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +77 -0
- package/esm/scripts/run-codex-prompts/prompts/buildPromptRunTracePath.d.ts +10 -0
- package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +11 -6
- package/esm/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +19 -0
- package/esm/scripts/run-codex-prompts/runners/common/buildHarnessAuthenticationError.d.ts +20 -0
- package/esm/scripts/run-codex-prompts/runners/common/createAuthenticationAwarePromptRunner.d.ts +11 -0
- package/esm/scripts/run-codex-prompts/runners/common/extractHarnessAuthenticationFailureReason.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +3 -0
- package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
- package/esm/src/book-components/Chat/MockedChat/MockedChat.test.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +2 -1
- package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +21 -0
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
- package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +33 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +4 -2
- package/esm/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
- package/esm/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +19 -1
- package/esm/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/$askForConfirmation.d.ts +4 -2
- package/esm/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
- package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +2 -1
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -2
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +4 -2
- package/esm/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +2 -1
- package/esm/src/cli/cli-commands/common/questionsCliOptions.d.ts +45 -0
- package/esm/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
- package/esm/src/cli/common/$deprecateCliCommand.d.ts +3 -0
- package/esm/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
- package/esm/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
- package/esm/src/cli/common/$requireCliSubcommand.d.ts +18 -0
- package/esm/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
- package/esm/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
- package/esm/src/version.d.ts +1 -1
- package/package.json +8 -11
- package/src/book-2.0/book-language-documentation/getSafeCodeBlock.ts +1 -1
- package/src/book-components/Chat/MockedChat/MockedChat.tsx +25 -1
- package/src/cli/cli-commands/agent-folder.ts +2 -6
- package/src/cli/cli-commands/agent.ts +2 -6
- package/src/cli/cli-commands/agents-server.ts +2 -6
- package/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.ts +3 -0
- package/src/cli/cli-commands/coder/add.ts +27 -2
- package/src/cli/cli-commands/coder/agentCliOptions.ts +32 -0
- package/src/cli/cli-commands/coder/boilerplateTemplates.ts +17 -44
- package/src/cli/cli-commands/coder/coderReferencedArtifacts.ts +106 -0
- package/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.ts +4 -2
- package/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.ts +5 -1
- package/src/cli/cli-commands/coder/ensureDirectory.ts +27 -1
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +99 -10
- package/src/cli/cli-commands/coder/init.ts +23 -14
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +18 -27
- package/src/cli/cli-commands/coder/list.ts +89 -0
- package/src/cli/cli-commands/coder/mergeStringRecordJsonFile.ts +31 -7
- package/src/cli/cli-commands/coder/ping.ts +25 -22
- package/src/cli/cli-commands/coder/printCoderRunFailure.ts +14 -0
- package/src/cli/cli-commands/coder/printInitializationSummary.ts +23 -16
- package/src/cli/cli-commands/coder/run.ts +36 -39
- package/src/cli/cli-commands/coder/server.ts +45 -48
- package/src/cli/cli-commands/coder.ts +6 -6
- package/src/cli/cli-commands/common/$askForConfirmation.ts +12 -2
- package/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.ts +35 -0
- package/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.ts +37 -0
- package/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.ts +39 -0
- package/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.ts +26 -0
- package/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.ts +33 -0
- package/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.ts +33 -0
- package/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.ts +21 -0
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +17 -5
- package/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.ts +8 -3
- package/src/cli/cli-commands/common/harness/HarnessDefinition.ts +36 -0
- package/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.ts +8 -3
- package/src/cli/cli-commands/common/promptPriorityCliOptions.ts +30 -0
- package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +5 -5
- package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +13 -2
- package/src/cli/cli-commands/common/questionsCliOptions.ts +89 -0
- package/src/cli/cli-commands/run.ts +3 -1
- package/src/cli/common/$deprecateCliCommand.ts +5 -0
- package/src/cli/common/$hideCliCommandFromHelp.ts +27 -0
- package/src/cli/common/$requireCliSubcommand.ts +35 -0
- package/src/cli/promptbookCli.ts +13 -9
- package/src/llm-providers/vercel/VercelExecutionToolsOptions.ts +7 -2
- package/src/llm-providers/vercel/createExecutionToolsFromVercelProvider.ts +18 -17
- package/src/other/templates/getTemplatesPipelineCollection.ts +695 -707
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +1416 -399
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/createFreeDiskSpaceGuard.d.ts +25 -0
- package/umd/scripts/run-codex-prompts/common/formatUnknownErrorDetails.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/common/resolveCoderAgent.d.ts +21 -3
- package/umd/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTraceContent.d.ts +77 -0
- package/umd/scripts/run-codex-prompts/prompts/buildPromptRunTracePath.d.ts +10 -0
- package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +11 -6
- package/umd/scripts/run-codex-prompts/prompts/loadPromptFiles.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/prompts/writePromptRunTrace.d.ts +19 -0
- package/umd/scripts/run-codex-prompts/runners/common/buildHarnessAuthenticationError.d.ts +20 -0
- package/umd/scripts/run-codex-prompts/runners/common/createAuthenticationAwarePromptRunner.d.ts +11 -0
- package/umd/scripts/run-codex-prompts/runners/common/extractHarnessAuthenticationFailureReason.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +3 -0
- package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
- package/umd/src/book-components/Chat/MockedChat/MockedChat.test.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +2 -1
- package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +21 -0
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
- package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +33 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +4 -2
- package/umd/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/init.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +7 -5
- package/umd/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/list.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +19 -1
- package/umd/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/$askForConfirmation.d.ts +4 -2
- package/umd/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
- package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +2 -1
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -2
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +4 -2
- package/umd/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +2 -1
- package/umd/src/cli/cli-commands/common/questionsCliOptions.d.ts +45 -0
- package/umd/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
- package/umd/src/cli/common/$deprecateCliCommand.d.ts +3 -0
- package/umd/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
- package/umd/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
- package/umd/src/cli/common/$requireCliSubcommand.d.ts +18 -0
- package/umd/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
- package/umd/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
- package/umd/src/version.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
- package/esm/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +0 -29
- package/src/cli/cli-commands/coder/agentCodingFile.ts +0 -25
- package/src/cli/cli-commands/common/harnessUpdateCliOptions.ts +0 -46
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
- package/umd/src/cli/cli-commands/common/harnessUpdateCliOptions.d.ts +0 -29
- /package/esm/src/cli/cli-commands/{common/harnessUpdateCliOptions.test.d.ts → coder/init.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harnessUpdateCliOptions.test.d.ts → esm/src/cli/cli-commands/coder/list.test.d.ts} +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Command as Program /* <- Note: [🔸] Using Program because Command is misleading name */,
|
|
3
|
+
} from 'commander';
|
|
4
|
+
import { spaceTrim } from 'spacetrim';
|
|
5
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
6
|
+
import { handleActionErrors } from '../common/handleActionErrors';
|
|
7
|
+
import { addPromptPriorityOptions } from '../common/promptPriorityCliOptions';
|
|
8
|
+
import type { PromptRunnerSelectionCliOptions } from '../common/promptRunnerCliOptions';
|
|
9
|
+
import {
|
|
10
|
+
addPromptRunnerSelectionOptions,
|
|
11
|
+
normalizePromptRunnerSelectionCliOptions,
|
|
12
|
+
PROMPT_RUNNER_DESCRIPTION,
|
|
13
|
+
} from '../common/promptRunnerCliOptions';
|
|
14
|
+
import { addCoderAgentOption, type CoderAgentCliOptions } from './agentCliOptions';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Initializes `coder list` command for Promptbook CLI utilities.
|
|
18
|
+
*
|
|
19
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
20
|
+
*
|
|
21
|
+
* @private internal function of `promptbookCli`
|
|
22
|
+
*/
|
|
23
|
+
export function $initializeCoderListCommand(program: Program): $side_effect {
|
|
24
|
+
const command = program.command('list');
|
|
25
|
+
command.description(
|
|
26
|
+
spaceTrim(`
|
|
27
|
+
List ready coding prompts by priority without executing them
|
|
28
|
+
|
|
29
|
+
${PROMPT_RUNNER_DESCRIPTION}
|
|
30
|
+
|
|
31
|
+
Features:
|
|
32
|
+
- Lists only ready, fully authored prompts
|
|
33
|
+
- Groups prompts from highest to lowest priority
|
|
34
|
+
- Optional --harness, --model and --agent filters show only prompts compatible with that selection
|
|
35
|
+
- Does not start a coding harness or modify prompt files
|
|
36
|
+
`),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
addPromptRunnerSelectionOptions(command);
|
|
40
|
+
addCoderAgentOption(command);
|
|
41
|
+
addPromptPriorityOptions(command);
|
|
42
|
+
|
|
43
|
+
command.action(
|
|
44
|
+
handleActionErrors(async (cliOptions) => {
|
|
45
|
+
const {
|
|
46
|
+
agent,
|
|
47
|
+
priority,
|
|
48
|
+
minPriority: minimumPriority,
|
|
49
|
+
maxPriority: maximumPriority,
|
|
50
|
+
} = cliOptions as {
|
|
51
|
+
readonly agent?: string;
|
|
52
|
+
readonly priority?: number;
|
|
53
|
+
readonly minPriority?: number;
|
|
54
|
+
readonly maxPriority?: number;
|
|
55
|
+
} & PromptRunnerSelectionCliOptions & CoderAgentCliOptions;
|
|
56
|
+
const runnerOptions = normalizePromptRunnerSelectionCliOptions(
|
|
57
|
+
cliOptions as PromptRunnerSelectionCliOptions,
|
|
58
|
+
{ isAgentRequired: false },
|
|
59
|
+
);
|
|
60
|
+
const resolvedCoderAgentBook =
|
|
61
|
+
agent === undefined
|
|
62
|
+
? undefined
|
|
63
|
+
: await (await import('../../../../scripts/run-codex-prompts/common/resolveCoderAgent'))
|
|
64
|
+
.resolveCoderAgentBook(agent, process.cwd());
|
|
65
|
+
const promptRunnerIdentity =
|
|
66
|
+
runnerOptions.agentName === undefined &&
|
|
67
|
+
runnerOptions.model === undefined &&
|
|
68
|
+
resolvedCoderAgentBook === undefined
|
|
69
|
+
? undefined
|
|
70
|
+
: {
|
|
71
|
+
harnessName: runnerOptions.agentName,
|
|
72
|
+
modelName: runnerOptions.model,
|
|
73
|
+
agentReferences: resolvedCoderAgentBook?.agentReferences,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Note: Import dynamically to avoid loading prompt parsing dependencies until this command is used.
|
|
77
|
+
const { listCoderPrompts } = await import('../../../../scripts/run-codex-prompts/main/listCoderPrompts');
|
|
78
|
+
await listCoderPrompts({
|
|
79
|
+
priority,
|
|
80
|
+
minimumPriority,
|
|
81
|
+
maximumPriority,
|
|
82
|
+
promptRunnerIdentity,
|
|
83
|
+
});
|
|
84
|
+
}),
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Note: [🟡] Code for CLI command [list](src/cli/cli-commands/coder/list.ts) should never be published outside of `@promptbook/cli`
|
|
89
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -30,6 +30,23 @@ type MergeStringRecordJsonFileOptions = {
|
|
|
30
30
|
readonly ensureParentDirectoryPath?: string;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Result of one additive string-record merge into a JSON file.
|
|
35
|
+
*
|
|
36
|
+
* @private internal utility of `coder init` command
|
|
37
|
+
*/
|
|
38
|
+
export type MergedStringRecordJsonFile = {
|
|
39
|
+
/**
|
|
40
|
+
* Status describing whether the JSON file had to be created or updated.
|
|
41
|
+
*/
|
|
42
|
+
readonly status: InitializationStatus;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Keys which were missing in the JSON file and therefore added by the merge.
|
|
46
|
+
*/
|
|
47
|
+
readonly addedEntryKeys: ReadonlyArray<string>;
|
|
48
|
+
};
|
|
49
|
+
|
|
33
50
|
/**
|
|
34
51
|
* Default indentation used when creating new JSON configuration files.
|
|
35
52
|
*/
|
|
@@ -43,6 +60,9 @@ const DEFAULT_JSON_FILE_NEWLINE = '\n';
|
|
|
43
60
|
/**
|
|
44
61
|
* Ensures one JSON object field contains the provided string-record entries.
|
|
45
62
|
*
|
|
63
|
+
* Entries which the project already defines are **never** overridden - only missing keys are added,
|
|
64
|
+
* so hand-tuned scripts and settings survive every repeated `ptbk coder init`.
|
|
65
|
+
*
|
|
46
66
|
* @private function of `initializeCoderProjectConfiguration`
|
|
47
67
|
*/
|
|
48
68
|
export async function mergeStringRecordJsonFile({
|
|
@@ -51,7 +71,7 @@ export async function mergeStringRecordJsonFile({
|
|
|
51
71
|
fieldPath,
|
|
52
72
|
nextEntries,
|
|
53
73
|
ensureParentDirectoryPath,
|
|
54
|
-
}: MergeStringRecordJsonFileOptions): Promise<
|
|
74
|
+
}: MergeStringRecordJsonFileOptions): Promise<MergedStringRecordJsonFile> {
|
|
55
75
|
if (ensureParentDirectoryPath) {
|
|
56
76
|
await mkdir(join(projectPath, ensureParentDirectoryPath), { recursive: true });
|
|
57
77
|
}
|
|
@@ -62,23 +82,27 @@ export async function mergeStringRecordJsonFile({
|
|
|
62
82
|
const jsonObject = fileContent === undefined ? {} : await parseJsonObjectFile(relativeFilePath, fileContent);
|
|
63
83
|
const existingEntries = getStringRecordOrDefault(jsonObject[fieldPath], relativeFilePath, fieldPath);
|
|
64
84
|
|
|
65
|
-
|
|
85
|
+
const addedEntryKeys: Array<string> = [];
|
|
66
86
|
const mergedEntries = { ...existingEntries };
|
|
67
87
|
for (const [entryKey, entryValue] of Object.entries(nextEntries)) {
|
|
68
|
-
if (mergedEntries
|
|
69
|
-
|
|
70
|
-
|
|
88
|
+
if (Object.prototype.hasOwnProperty.call(mergedEntries, entryKey)) {
|
|
89
|
+
// Note: The project already defines this entry, keep its own value untouched
|
|
90
|
+
continue;
|
|
71
91
|
}
|
|
92
|
+
|
|
93
|
+
mergedEntries[entryKey] = entryValue;
|
|
94
|
+
addedEntryKeys.push(entryKey);
|
|
72
95
|
}
|
|
73
96
|
|
|
97
|
+
const hasChanges = fileContent === undefined || addedEntryKeys.length > 0;
|
|
74
98
|
if (!hasChanges) {
|
|
75
|
-
return 'unchanged';
|
|
99
|
+
return { status: 'unchanged', addedEntryKeys };
|
|
76
100
|
}
|
|
77
101
|
|
|
78
102
|
const nextJsonObject: JsonObject = { ...jsonObject };
|
|
79
103
|
nextJsonObject[fieldPath] = mergedEntries;
|
|
80
104
|
await writeFile(absoluteFilePath, serializeJsonObject(nextJsonObject, formatting), 'utf-8');
|
|
81
|
-
return fileContent === undefined ? 'created' : 'updated';
|
|
105
|
+
return { status: fileContent === undefined ? 'created' : 'updated', addedEntryKeys };
|
|
82
106
|
}
|
|
83
107
|
|
|
84
108
|
/**
|
|
@@ -6,10 +6,11 @@ import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
|
6
6
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
7
7
|
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
addQuestionsOption,
|
|
10
|
+
normalizeQuestionsCliOptions,
|
|
11
|
+
QUESTIONS_DESCRIPTION,
|
|
12
|
+
type QuestionsCliOptions,
|
|
13
|
+
} from '../common/questionsCliOptions';
|
|
13
14
|
import type { PromptRunnerSelectionCliOptions } from '../common/promptRunnerCliOptions';
|
|
14
15
|
import {
|
|
15
16
|
addPromptRunnerRuntimeOptions,
|
|
@@ -30,24 +31,28 @@ import { $ensureCoderHarnessGitignoreRules } from './$ensureCoderHarnessGitignor
|
|
|
30
31
|
export function $initializeCoderPingCommand(program: Program): $side_effect {
|
|
31
32
|
const command = program.command('ping');
|
|
32
33
|
command.description(
|
|
33
|
-
spaceTrim(
|
|
34
|
-
|
|
34
|
+
spaceTrim(
|
|
35
|
+
(block) => `
|
|
36
|
+
Send one tiny dummy prompt to a harness and model to measure and warm them up
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
${block(PROMPT_RUNNER_DESCRIPTION)}
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
${block(QUESTIONS_DESCRIPTION)}
|
|
41
|
+
|
|
42
|
+
Features:
|
|
43
|
+
- Verifies that the selected harness, model, thinking level and authentication really work
|
|
44
|
+
- Reports the answer of the harness, the response time and the reported usage
|
|
45
|
+
- Starts the hourly/weekly quota window before you need it, so it is already refreshing when you do
|
|
46
|
+
- Optional --period keeps the quota window refreshing by pinging once per period until stopped
|
|
47
|
+
- Makes no coding changes or commits; if the selected harness has missing local ignore rules, offers to add them to .gitignore
|
|
48
|
+
- Checks that the selected harness is installed and up to date unless --no-questions is used
|
|
49
|
+
- Use --no-ui to stream the raw harness output instead of only the compact result
|
|
50
|
+
`,
|
|
51
|
+
),
|
|
47
52
|
);
|
|
48
53
|
|
|
49
54
|
addPromptRunnerSelectionOptions(command);
|
|
50
|
-
|
|
55
|
+
addQuestionsOption(command);
|
|
51
56
|
addPromptRunnerRuntimeOptions(command);
|
|
52
57
|
command.option(
|
|
53
58
|
'--period <duration>',
|
|
@@ -67,15 +72,13 @@ export function $initializeCoderPingCommand(program: Program): $side_effect {
|
|
|
67
72
|
cliOptions as PromptRunnerSelectionCliOptions,
|
|
68
73
|
{ isAgentRequired: true },
|
|
69
74
|
);
|
|
70
|
-
const
|
|
71
|
-
cliOptions as HarnessUpdateCliOptions,
|
|
72
|
-
);
|
|
75
|
+
const questionsOptions = normalizeQuestionsCliOptions(cliOptions as QuestionsCliOptions);
|
|
73
76
|
|
|
74
77
|
// Note: The period is validated before the harness installation check, so a mistyped duration fails fast
|
|
75
78
|
const periodMs = parseOptionalPeriodDuration('--period', periodValue);
|
|
76
79
|
|
|
77
|
-
await $ensureHarnessInstallations([runnerOptions.agentName],
|
|
78
|
-
await $ensureCoderHarnessGitignoreRules(process.cwd(), runnerOptions.agentName);
|
|
80
|
+
await $ensureHarnessInstallations([runnerOptions.agentName], questionsOptions);
|
|
81
|
+
await $ensureCoderHarnessGitignoreRules(process.cwd(), runnerOptions.agentName, questionsOptions);
|
|
79
82
|
|
|
80
83
|
const pingOptions = {
|
|
81
84
|
agentName: runnerOptions.agentName,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import colors from 'colors';
|
|
2
|
+
import { formatUnknownErrorDetails } from '../../../../scripts/run-codex-prompts/common/formatUnknownErrorDetails';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Prints why a coder run has ended to the terminal.
|
|
6
|
+
*
|
|
7
|
+
* @private internal utility of `coder run` and `coder server` commands
|
|
8
|
+
*/
|
|
9
|
+
export function printCoderRunFailure(error: Error): void {
|
|
10
|
+
console.error(colors.bgRed(`${error.name}`));
|
|
11
|
+
console.error(colors.red(formatUnknownErrorDetails(error)));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Note: [🟡] Code for coder failure reporting [printCoderRunFailure](src/cli/cli-commands/coder/printCoderRunFailure.ts) should never be published outside of `@promptbook/cli`
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import colors from 'colors';
|
|
2
|
-
import { AGENT_CODING_FILE_PATH } from './agentCodingFile';
|
|
3
|
-
import { AGENTS_FILE_PATH } from './agentsFile';
|
|
4
2
|
import type { InitializationStatus } from './boilerplateTemplates';
|
|
5
|
-
import {
|
|
3
|
+
import type { CoderReferencedArtifactStatus } from './coderReferencedArtifacts';
|
|
6
4
|
import { formatDisplayPath } from './formatDisplayPath';
|
|
7
5
|
import type { CoderInitializationSummary } from './initializeCoderProjectConfiguration';
|
|
8
6
|
|
|
@@ -16,23 +14,25 @@ export function printInitializationSummary(summary: CoderInitializationSummary):
|
|
|
16
14
|
printInitializationStatusLine('prompts/', summary.promptsDirectoryStatus);
|
|
17
15
|
printInitializationStatusLine('prompts/done/', summary.promptsDoneDirectoryStatus);
|
|
18
16
|
printInitializationStatusLine('prompts/templates/', summary.promptsTemplatesDirectoryStatus);
|
|
19
|
-
|
|
20
|
-
for (const templateFileStatus of summary.promptTemplateFileStatuses) {
|
|
21
|
-
printInitializationStatusLine(
|
|
22
|
-
formatDisplayPath(templateFileStatus.relativeFilePath),
|
|
23
|
-
templateFileStatus.status,
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
17
|
printInitializationStatusLine('agents/', summary.agentsDirectoryStatus);
|
|
28
|
-
printInitializationStatusLine(CODER_DEVELOPER_AGENT_FILE_PATH, summary.developerAgentFileStatus);
|
|
29
|
-
printInitializationStatusLine(AGENTS_FILE_PATH, summary.agentsFileStatus);
|
|
30
|
-
printInitializationStatusLine(AGENT_CODING_FILE_PATH, summary.agentCodingFileStatus);
|
|
31
18
|
printInitializationStatusLine('.env', summary.envFileStatus);
|
|
32
19
|
printInitializationStatusLine('.gitignore', summary.gitignoreFileStatus);
|
|
33
20
|
printInitializationStatusLine('package.json', summary.packageJsonFileStatus);
|
|
34
21
|
printInitializationStatusLine('.vscode/settings.json', summary.vscodeSettingsFileStatus);
|
|
35
22
|
|
|
23
|
+
for (const referencedArtifactStatus of summary.referencedArtifactStatuses) {
|
|
24
|
+
printInitializationStatusLine(
|
|
25
|
+
formatDisplayPath(referencedArtifactStatus.relativeFilePath),
|
|
26
|
+
referencedArtifactStatus.status,
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (summary.addedPackageJsonScriptNames.length > 0) {
|
|
31
|
+
printInitializationNote(`Added npm scripts: ${summary.addedPackageJsonScriptNames.join(', ')}`, colors.cyan);
|
|
32
|
+
} else {
|
|
33
|
+
printInitializationNote('All Promptbook coder npm scripts are already present.', colors.gray);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
36
|
if (summary.initializedEnvVariableNames.length > 0) {
|
|
37
37
|
printInitializationNote(`Added env variables: ${summary.initializedEnvVariableNames.join(', ')}`, colors.cyan);
|
|
38
38
|
} else {
|
|
@@ -43,7 +43,7 @@ export function printInitializationSummary(summary: CoderInitializationSummary):
|
|
|
43
43
|
/**
|
|
44
44
|
* Formats one initialization status into a human-readable label.
|
|
45
45
|
*/
|
|
46
|
-
function formatInitializationStatus(status: InitializationStatus): string {
|
|
46
|
+
function formatInitializationStatus(status: InitializationStatus | CoderReferencedArtifactStatus): string {
|
|
47
47
|
if (status === 'created') {
|
|
48
48
|
return 'created';
|
|
49
49
|
}
|
|
@@ -52,13 +52,20 @@ function formatInitializationStatus(status: InitializationStatus): string {
|
|
|
52
52
|
return 'updated';
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
if (status === 'not-referenced') {
|
|
56
|
+
return 'not referenced by the added scripts, kept as is';
|
|
57
|
+
}
|
|
58
|
+
|
|
55
59
|
return 'unchanged';
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
/**
|
|
59
63
|
* Prints one checked initialization-status line.
|
|
60
64
|
*/
|
|
61
|
-
function printInitializationStatusLine(
|
|
65
|
+
function printInitializationStatusLine(
|
|
66
|
+
relativePath: string,
|
|
67
|
+
status: InitializationStatus | CoderReferencedArtifactStatus,
|
|
68
|
+
): void {
|
|
62
69
|
console.info(colors.gray(`✔ ${relativePath}: ${formatInitializationStatus(status)}`));
|
|
63
70
|
}
|
|
64
71
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import colors from 'colors';
|
|
2
1
|
import {
|
|
3
2
|
Command as Program /* <- Note: [🔸] Using Program because Command is misleading name */,
|
|
4
3
|
Option,
|
|
@@ -6,15 +5,17 @@ import {
|
|
|
6
5
|
import { spaceTrim } from 'spacetrim';
|
|
7
6
|
import { assertsError } from '../../../errors/assertsError';
|
|
8
7
|
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
9
|
-
import { createNonNegativeIntegerOptionParser } from '../common/createNonNegativeIntegerOptionParser';
|
|
10
8
|
import { createPositiveIntegerOptionParser } from '../common/createPositiveIntegerOptionParser';
|
|
9
|
+
import { $assertSufficientFreeDiskSpace } from '../common/disk-space/$assertSufficientFreeDiskSpace';
|
|
11
10
|
import { handleActionErrors } from '../common/handleActionErrors';
|
|
12
11
|
import { $ensureHarnessInstallations } from '../common/harness/$ensureHarnessInstallations';
|
|
13
12
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
addQuestionsOption,
|
|
14
|
+
assertUserConfirmationIsAllowed,
|
|
15
|
+
normalizeQuestionsCliOptions,
|
|
16
|
+
QUESTIONS_DESCRIPTION,
|
|
17
|
+
type QuestionsCliOptions,
|
|
18
|
+
} from '../common/questionsCliOptions';
|
|
18
19
|
import { $ensurePromptbookCliInstallations } from '../common/promptbook-cli/$ensurePromptbookCliInstallations';
|
|
19
20
|
import type { PromptRunnerCliOptions } from '../common/promptRunnerCliOptions';
|
|
20
21
|
import {
|
|
@@ -23,6 +24,7 @@ import {
|
|
|
23
24
|
normalizePromptRunnerCliOptions,
|
|
24
25
|
PROMPT_RUNNER_DESCRIPTION,
|
|
25
26
|
} from '../common/promptRunnerCliOptions';
|
|
27
|
+
import { addPromptPriorityOptions } from '../common/promptPriorityCliOptions';
|
|
26
28
|
import {
|
|
27
29
|
DEFAULT_CODER_TEST_COMMAND,
|
|
28
30
|
TEST_BEFORE_MODE_VALUES,
|
|
@@ -30,6 +32,8 @@ import {
|
|
|
30
32
|
} from '../../../../scripts/run-codex-prompts/testing/TestBeforeMode';
|
|
31
33
|
import { DEFAULT_WAIT_AFTER_ERROR_MS, parseOptionalWaitDuration } from './waitOptions';
|
|
32
34
|
import { $ensureCoderHarnessGitignoreRules } from './$ensureCoderHarnessGitignoreRules';
|
|
35
|
+
import { addCoderAgentOption, type CoderAgentCliOptions } from './agentCliOptions';
|
|
36
|
+
import { printCoderRunFailure } from './printCoderRunFailure';
|
|
33
37
|
|
|
34
38
|
/**
|
|
35
39
|
* Initializes `coder run` command for Promptbook CLI utilities
|
|
@@ -41,10 +45,13 @@ import { $ensureCoderHarnessGitignoreRules } from './$ensureCoderHarnessGitignor
|
|
|
41
45
|
export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
42
46
|
const command = program.command('run');
|
|
43
47
|
command.description(
|
|
44
|
-
spaceTrim(
|
|
48
|
+
spaceTrim(
|
|
49
|
+
(block) => `
|
|
45
50
|
Execute coding prompts through selected AI agent
|
|
46
51
|
|
|
47
|
-
${PROMPT_RUNNER_DESCRIPTION}
|
|
52
|
+
${block(PROMPT_RUNNER_DESCRIPTION)}
|
|
53
|
+
|
|
54
|
+
${block(QUESTIONS_DESCRIPTION)}
|
|
48
55
|
|
|
49
56
|
Features:
|
|
50
57
|
- Automatically stages and commits changes with agent identity unless --no-commit is used
|
|
@@ -54,9 +61,11 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
54
61
|
- Optional post-commit git push with explicit --auto-push opt-in
|
|
55
62
|
- Optional pre-prompt git pull with explicit --auto-pull opt-in
|
|
56
63
|
- Optional --isolate runs every prompt in its own temporary git worktree and merges it back when verified
|
|
64
|
+
- Saves the run trace of every round into prompts/traces/, named after its prompt file
|
|
57
65
|
- Optional --preserve-logs keeps temp prompt/log artifacts after successful rounds
|
|
58
66
|
- Optional --no-ui keeps plain streaming console output for logging and debugging
|
|
59
|
-
-
|
|
67
|
+
- Refuses to start on a nearly full disk and pauses the run when the free disk space becomes critical, unless --no-questions is used
|
|
68
|
+
- Checks that the selected harness is installed and up to date before the first prompt unless --no-questions is used
|
|
60
69
|
- Offers to add missing project-local ignore rules for the selected harness
|
|
61
70
|
- In interactive mode, checks local and global Promptbook CLI installations and offers to update them
|
|
62
71
|
- Supports GPG signing of commits
|
|
@@ -64,16 +73,14 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
64
73
|
- Optional post-prompt verification with test-feedback retries
|
|
65
74
|
- Progress tracking and interactive P/S/X terminal controls
|
|
66
75
|
- Dry-run mode to preview prompts
|
|
67
|
-
|
|
76
|
+
`,
|
|
77
|
+
),
|
|
68
78
|
);
|
|
69
79
|
|
|
70
80
|
command.option('--dry-run', 'Print unwritten prompts without executing', false);
|
|
71
81
|
addPromptRunnerSelectionOptions(command);
|
|
72
|
-
|
|
73
|
-
command
|
|
74
|
-
'--agent <agent-book-path>',
|
|
75
|
-
'Path to a .book file whose compiled system message is prepended to each coding prompt',
|
|
76
|
-
);
|
|
82
|
+
addQuestionsOption(command);
|
|
83
|
+
addCoderAgentOption(command);
|
|
77
84
|
command.option(
|
|
78
85
|
'--context <context-or-file>',
|
|
79
86
|
'Append extra instructions either inline or from a file path relative to the current project',
|
|
@@ -107,21 +114,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
107
114
|
`),
|
|
108
115
|
false,
|
|
109
116
|
);
|
|
110
|
-
command
|
|
111
|
-
'--priority <minimum-priority>',
|
|
112
|
-
'Alias for --min-priority; filter prompts by minimum priority level',
|
|
113
|
-
createNonNegativeIntegerOptionParser('--priority'),
|
|
114
|
-
);
|
|
115
|
-
command.option(
|
|
116
|
-
'--min-priority <minimum-priority>',
|
|
117
|
-
'Filter prompts by minimum priority level',
|
|
118
|
-
createNonNegativeIntegerOptionParser('--min-priority'),
|
|
119
|
-
);
|
|
120
|
-
command.option(
|
|
121
|
-
'--max-priority <maximum-priority>',
|
|
122
|
-
'Filter prompts by maximum priority level',
|
|
123
|
-
createNonNegativeIntegerOptionParser('--max-priority'),
|
|
124
|
-
);
|
|
117
|
+
addPromptPriorityOptions(command);
|
|
125
118
|
command.option(
|
|
126
119
|
'--limit <run-count>',
|
|
127
120
|
'Stop after processing this many prompt runs',
|
|
@@ -201,16 +194,14 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
201
194
|
readonly auto: boolean;
|
|
202
195
|
readonly autoMigrate: boolean;
|
|
203
196
|
readonly allowDestructiveAutoMigrate: boolean;
|
|
204
|
-
} & PromptRunnerCliOptions;
|
|
197
|
+
} & PromptRunnerCliOptions & CoderAgentCliOptions;
|
|
205
198
|
|
|
206
199
|
const configuredTestCommand = normalizeCommandOptionValue(test);
|
|
207
200
|
const testCommand = configuredTestCommand ?? (testBefore === 'no' ? undefined : DEFAULT_CODER_TEST_COMMAND);
|
|
208
201
|
const runnerOptions = normalizePromptRunnerCliOptions(cliOptions as PromptRunnerCliOptions, {
|
|
209
202
|
isAgentRequired: !dryRun,
|
|
210
203
|
});
|
|
211
|
-
const
|
|
212
|
-
cliOptions as HarnessUpdateCliOptions,
|
|
213
|
-
);
|
|
204
|
+
const questionsOptions = normalizeQuestionsCliOptions(cliOptions as QuestionsCliOptions);
|
|
214
205
|
|
|
215
206
|
// [1] Parse the wait options and --no-auto:
|
|
216
207
|
// default: run automatically through the queue (no waiting between prompts)
|
|
@@ -220,12 +211,18 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
220
211
|
// --wait-after-error: wait before retrying after an error (default 10m)
|
|
221
212
|
const waitForUser = !auto;
|
|
222
213
|
|
|
223
|
-
|
|
214
|
+
assertUserConfirmationIsAllowed({ ...questionsOptions, isWaitingForUser: waitForUser });
|
|
215
|
+
|
|
216
|
+
// Note: Checked before anything is installed or written, because installing a harness, updating the
|
|
217
|
+
// Promptbook CLI and coding itself all need the disk space which is missing
|
|
218
|
+
await $assertSufficientFreeDiskSpace(process.cwd());
|
|
219
|
+
|
|
220
|
+
if (await $ensurePromptbookCliInstallations(questionsOptions)) {
|
|
224
221
|
return process.exit(0);
|
|
225
222
|
}
|
|
226
223
|
|
|
227
|
-
await $ensureHarnessInstallations([runnerOptions.agentName],
|
|
228
|
-
await $ensureCoderHarnessGitignoreRules(process.cwd(), runnerOptions.agentName);
|
|
224
|
+
await $ensureHarnessInstallations([runnerOptions.agentName], questionsOptions);
|
|
225
|
+
await $ensureCoderHarnessGitignoreRules(process.cwd(), runnerOptions.agentName, questionsOptions);
|
|
229
226
|
|
|
230
227
|
const waitAfterPrompt = parseOptionalWaitDuration(waitAfterPromptValue, 0);
|
|
231
228
|
const waitBetweenPrompts = parseOptionalWaitDuration(waitBetweenPromptsValue, 0);
|
|
@@ -260,6 +257,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
260
257
|
allowDestructiveAutoMigrate,
|
|
261
258
|
autoPush: runnerOptions.autoPush,
|
|
262
259
|
autoPull: runnerOptions.autoPull,
|
|
260
|
+
isAskingQuestionsEnabled: questionsOptions.isAskingQuestionsEnabled,
|
|
263
261
|
};
|
|
264
262
|
|
|
265
263
|
// Note: Import the function dynamically to avoid loading heavy dependencies until needed
|
|
@@ -270,8 +268,7 @@ export function $initializeCoderRunCommand(program: Program): $side_effect {
|
|
|
270
268
|
await runCodexPrompts(runOptions);
|
|
271
269
|
} catch (error) {
|
|
272
270
|
assertsError(error);
|
|
273
|
-
|
|
274
|
-
console.error(colors.red(error.stack || error.message));
|
|
271
|
+
printCoderRunFailure(error);
|
|
275
272
|
return process.exit(1);
|
|
276
273
|
}
|
|
277
274
|
|