@promptbook/cli 0.114.0-32 → 0.114.0-33
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 +183 -102
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +20 -0
- package/esm/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/list.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli/cli-commands/coder/list.ts +77 -0
- package/src/cli/cli-commands/coder/run.ts +2 -16
- package/src/cli/cli-commands/coder/server.ts +2 -16
- package/src/cli/cli-commands/coder.ts +4 -0
- package/src/cli/cli-commands/common/promptPriorityCliOptions.ts +30 -0
- package/src/cli/cli-commands/common/promptRunnerCliOptions.ts +5 -5
- package/src/other/templates/getTemplatesPipelineCollection.ts +896 -704
- package/src/version.ts +2 -2
- package/src/versions.txt +1 -0
- package/umd/index.umd.js +183 -102
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/main/listCoderPrompts.d.ts +20 -0
- 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.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/umd/src/version.d.ts +1 -1
package/src/version.ts
CHANGED
|
@@ -16,11 +16,11 @@ export const BOOK_LANGUAGE_VERSION: string_semantic_version = '2.0.0';
|
|
|
16
16
|
* @generated
|
|
17
17
|
* @see https://github.com/webgptorg/promptbook
|
|
18
18
|
*/
|
|
19
|
-
export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.114.0-
|
|
19
|
+
export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.114.0-33';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Represents the version string of the Promptbook engine.
|
|
23
|
-
* It follows semantic versioning (e.g., `0.114.0-
|
|
23
|
+
* It follows semantic versioning (e.g., `0.114.0-32`).
|
|
24
24
|
*
|
|
25
25
|
* @generated
|
|
26
26
|
*/
|
package/src/versions.txt
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
* @generated
|
|
59
59
|
* @see https://github.com/webgptorg/promptbook
|
|
60
60
|
*/
|
|
61
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
61
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-33';
|
|
62
62
|
/**
|
|
63
63
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
64
64
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1822,20 +1822,20 @@
|
|
|
1822
1822
|
*/
|
|
1823
1823
|
const PROMPT_RUNNER_DESCRIPTION = _spaceTrim.spaceTrim(`
|
|
1824
1824
|
Runners:
|
|
1825
|
-
- openai-codex: OpenAI Codex integration (requires --model)
|
|
1825
|
+
- openai-codex: OpenAI Codex integration (requires --model when executing)
|
|
1826
1826
|
- github-copilot: GitHub Copilot CLI integration
|
|
1827
1827
|
- cline: Cline CLI integration
|
|
1828
1828
|
- claude-code: Claude Code integration
|
|
1829
1829
|
- opencode: Opencode integration
|
|
1830
|
-
- gemini: Google Gemini CLI integration (requires --model)
|
|
1831
|
-
- qwen-code: Qwen Code CLI integration (requires --model)
|
|
1830
|
+
- gemini: Google Gemini CLI integration (requires --model when executing)
|
|
1831
|
+
- qwen-code: Qwen Code CLI integration (requires --model when executing)
|
|
1832
1832
|
`);
|
|
1833
1833
|
/**
|
|
1834
1834
|
* Commander description for the `--harness` option.
|
|
1835
1835
|
*
|
|
1836
1836
|
* @private internal utility of `promptbookCli`
|
|
1837
1837
|
*/
|
|
1838
|
-
const PROMPT_RUNNER_HARNESS_OPTION_DESCRIPTION = `Select runner: ${PROMPT_RUNNER_HARNESS_NAMES.join(', ')} (required
|
|
1838
|
+
const PROMPT_RUNNER_HARNESS_OPTION_DESCRIPTION = `Select runner: ${PROMPT_RUNNER_HARNESS_NAMES.join(', ')} (required when executing prompts)`;
|
|
1839
1839
|
/**
|
|
1840
1840
|
* Runner harness names listed as alternatives of the `--harness` option in error messages.
|
|
1841
1841
|
*
|
|
@@ -1848,7 +1848,7 @@
|
|
|
1848
1848
|
* @private internal utility of `promptbookCli`
|
|
1849
1849
|
*/
|
|
1850
1850
|
const PROMPT_RUNNER_MODEL_OPTION_DESCRIPTION = _spaceTrim.spaceTrim(`
|
|
1851
|
-
Model to use (required
|
|
1851
|
+
Model to use or filter by (required when executing with openai-codex, gemini and qwen-code)
|
|
1852
1852
|
|
|
1853
1853
|
OpenAI examples: gpt-5.2-codex, default
|
|
1854
1854
|
Gemini examples: gemini-3-flash-preview, default
|
|
@@ -42140,19 +42140,19 @@
|
|
|
42140
42140
|
*
|
|
42141
42141
|
* @private internal utility of `ptbk coder`
|
|
42142
42142
|
*/
|
|
42143
|
-
const PROMPTS_DIRECTORY_PATH = 'prompts';
|
|
42143
|
+
const PROMPTS_DIRECTORY_PATH$1 = 'prompts';
|
|
42144
42144
|
/**
|
|
42145
42145
|
* Relative path to the archive directory used by `coder verify`.
|
|
42146
42146
|
*
|
|
42147
42147
|
* @private internal utility of `ptbk coder`
|
|
42148
42148
|
*/
|
|
42149
|
-
const PROMPTS_DONE_DIRECTORY_PATH = path.join(PROMPTS_DIRECTORY_PATH, 'done');
|
|
42149
|
+
const PROMPTS_DONE_DIRECTORY_PATH = path.join(PROMPTS_DIRECTORY_PATH$1, 'done');
|
|
42150
42150
|
/**
|
|
42151
42151
|
* Relative path to the project-owned boilerplate templates directory.
|
|
42152
42152
|
*
|
|
42153
42153
|
* @private internal utility of `ptbk coder`
|
|
42154
42154
|
*/
|
|
42155
|
-
const PROMPTS_TEMPLATES_DIRECTORY_PATH = path.join(PROMPTS_DIRECTORY_PATH, 'templates');
|
|
42155
|
+
const PROMPTS_TEMPLATES_DIRECTORY_PATH = path.join(PROMPTS_DIRECTORY_PATH$1, 'templates');
|
|
42156
42156
|
/**
|
|
42157
42157
|
* Built-in boilerplate templates available to `coder generate-boilerplates`.
|
|
42158
42158
|
*
|
|
@@ -42436,7 +42436,7 @@
|
|
|
42436
42436
|
// Note: Import these dynamically to avoid circular dependencies and keep the CLI fast
|
|
42437
42437
|
const { buildPromptFilename, getPromptNumbering } = await Promise.resolve().then(function () { return getPromptNumbering$1; });
|
|
42438
42438
|
const { formatPromptEmojiTag, getFreshPromptEmojiTags } = await Promise.resolve().then(function () { return promptEmojiTags; });
|
|
42439
|
-
const promptsDirectory = path.join(projectPath, PROMPTS_DIRECTORY_PATH);
|
|
42439
|
+
const promptsDirectory = path.join(projectPath, PROMPTS_DIRECTORY_PATH$1);
|
|
42440
42440
|
fs.mkdirSync(promptsDirectory, { recursive: true });
|
|
42441
42441
|
const promptTemplate = await resolveCoderPromptTemplate({ projectPath, templateOption });
|
|
42442
42442
|
const promptNumbering = await getPromptNumbering({
|
|
@@ -42460,7 +42460,7 @@
|
|
|
42460
42460
|
});
|
|
42461
42461
|
const slug = buildAddPromptSlug(promptTemplate.slugPrefix, title);
|
|
42462
42462
|
const filename = buildPromptFilename(promptNumbering.datePrefix, promptNumbering.startNumber, slug);
|
|
42463
|
-
const filePath = path.join(PROMPTS_DIRECTORY_PATH, filename);
|
|
42463
|
+
const filePath = path.join(PROMPTS_DIRECTORY_PATH$1, filename);
|
|
42464
42464
|
const absoluteFilePath = path.join(projectPath, filePath);
|
|
42465
42465
|
fs.writeFileSync(absoluteFilePath, `${section}\n`, 'utf-8');
|
|
42466
42466
|
console.info(colors__default["default"].green(`✓ Added prompt ${emojiTag} in ${filePath}`));
|
|
@@ -43052,10 +43052,10 @@
|
|
|
43052
43052
|
const { buildPromptFilename, getPromptNumbering } = await Promise.resolve().then(function () { return getPromptNumbering$1; });
|
|
43053
43053
|
const { formatPromptEmojiTag, getFreshPromptEmojiTags } = await Promise.resolve().then(function () { return promptEmojiTags; });
|
|
43054
43054
|
console.info(`🚀 Generate prompt boilerplate files`);
|
|
43055
|
-
fs.mkdirSync(path.join(projectPath, PROMPTS_DIRECTORY_PATH), { recursive: true });
|
|
43055
|
+
fs.mkdirSync(path.join(projectPath, PROMPTS_DIRECTORY_PATH$1), { recursive: true });
|
|
43056
43056
|
const promptTemplate = await resolveCoderPromptTemplate({ projectPath, templateOption });
|
|
43057
43057
|
const promptNumbering = await getPromptNumbering({
|
|
43058
|
-
promptsDir: path.join(projectPath, PROMPTS_DIRECTORY_PATH),
|
|
43058
|
+
promptsDir: path.join(projectPath, PROMPTS_DIRECTORY_PATH$1),
|
|
43059
43059
|
step: 10,
|
|
43060
43060
|
ignoreGlobs: ['**/node_modules/**'],
|
|
43061
43061
|
});
|
|
@@ -43079,7 +43079,7 @@
|
|
|
43079
43079
|
const title = titles[i % titles.length];
|
|
43080
43080
|
const emojiTag = formatPromptEmojiTag(selectedEmojis[i]);
|
|
43081
43081
|
const filename = buildPromptFilename(promptNumbering.datePrefix, number, buildPromptSlug$1(promptTemplate.slugPrefix, title));
|
|
43082
|
-
const filepath = path.join(PROMPTS_DIRECTORY_PATH, filename);
|
|
43082
|
+
const filepath = path.join(PROMPTS_DIRECTORY_PATH$1, filename);
|
|
43083
43083
|
const absoluteFilepath = path.join(projectPath, filepath);
|
|
43084
43084
|
const content = buildBoilerplatePromptFileContent({
|
|
43085
43085
|
emojiTag,
|
|
@@ -44359,7 +44359,7 @@
|
|
|
44359
44359
|
* @private internal utility of `coder init` command
|
|
44360
44360
|
*/
|
|
44361
44361
|
async function initializeCoderProjectConfiguration(projectPath) {
|
|
44362
|
-
const promptsDirectoryStatus = await ensureDirectory(projectPath, PROMPTS_DIRECTORY_PATH);
|
|
44362
|
+
const promptsDirectoryStatus = await ensureDirectory(projectPath, PROMPTS_DIRECTORY_PATH$1);
|
|
44363
44363
|
const promptsDoneDirectoryStatus = await ensureDirectory(projectPath, PROMPTS_DONE_DIRECTORY_PATH);
|
|
44364
44364
|
const promptsTemplatesDirectoryStatus = await ensureDirectory(projectPath, PROMPTS_TEMPLATES_DIRECTORY_PATH);
|
|
44365
44365
|
const promptTemplateFileStatuses = await ensureDefaultCoderPromptTemplateFiles(projectPath);
|
|
@@ -44521,6 +44521,87 @@
|
|
|
44521
44521
|
// Note: [🟡] Code for CLI command [init](src/cli/cli-commands/coder/init.ts) should never be published outside of `@promptbook/cli`
|
|
44522
44522
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
44523
44523
|
|
|
44524
|
+
/**
|
|
44525
|
+
* Creates a Commander argument parser that accepts only non-negative integers.
|
|
44526
|
+
*
|
|
44527
|
+
* The returned parser is meant to be passed as the coercion callback of `command.option(...)`.
|
|
44528
|
+
* It throws a branded `NotAllowed` error with a clear message referencing the given option name
|
|
44529
|
+
* when the provided value is not a non-negative integer.
|
|
44530
|
+
*
|
|
44531
|
+
* @private internal utility of `promptbookCli`
|
|
44532
|
+
*/
|
|
44533
|
+
function createNonNegativeIntegerOptionParser(optionName) {
|
|
44534
|
+
return (value) => {
|
|
44535
|
+
const parsedValue = Number(value);
|
|
44536
|
+
if (!Number.isInteger(parsedValue) || parsedValue < 0) {
|
|
44537
|
+
throw new NotAllowed(_spaceTrim.spaceTrim(`
|
|
44538
|
+
Invalid value for \`${optionName}\`: \`${value}\`.
|
|
44539
|
+
|
|
44540
|
+
Use a non-negative integer.
|
|
44541
|
+
`));
|
|
44542
|
+
}
|
|
44543
|
+
return parsedValue;
|
|
44544
|
+
};
|
|
44545
|
+
}
|
|
44546
|
+
// Note: [🟡] Code for CLI option parser [createNonNegativeIntegerOptionParser](src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.ts) should never be published outside of `@promptbook/cli`
|
|
44547
|
+
|
|
44548
|
+
/**
|
|
44549
|
+
* Registers the shared prompt-priority filter options on a queue-based `ptbk coder` command.
|
|
44550
|
+
*
|
|
44551
|
+
* @private internal utility of `promptbookCli`
|
|
44552
|
+
*/
|
|
44553
|
+
function addPromptPriorityOptions(command) {
|
|
44554
|
+
command.option('--priority <minimum-priority>', 'Alias for --min-priority; filter prompts by minimum priority level', createNonNegativeIntegerOptionParser('--priority'));
|
|
44555
|
+
command.option('--min-priority <minimum-priority>', 'Filter prompts by minimum priority level', createNonNegativeIntegerOptionParser('--min-priority'));
|
|
44556
|
+
command.option('--max-priority <maximum-priority>', 'Filter prompts by maximum priority level', createNonNegativeIntegerOptionParser('--max-priority'));
|
|
44557
|
+
}
|
|
44558
|
+
// Note: [🟡] Code for CLI prompt priority options [promptPriorityCliOptions](src/cli/cli-commands/common/promptPriorityCliOptions.ts) should never be published outside of `@promptbook/cli`
|
|
44559
|
+
// Note: [💞] Ignore a discrepancy between file name and exported helper names
|
|
44560
|
+
|
|
44561
|
+
/**
|
|
44562
|
+
* Initializes `coder list` command for Promptbook CLI utilities.
|
|
44563
|
+
*
|
|
44564
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
44565
|
+
*
|
|
44566
|
+
* @private internal function of `promptbookCli`
|
|
44567
|
+
*/
|
|
44568
|
+
function $initializeCoderListCommand(program) {
|
|
44569
|
+
const command = program.command('list');
|
|
44570
|
+
command.description(_spaceTrim.spaceTrim(`
|
|
44571
|
+
List ready coding prompts by priority without executing them
|
|
44572
|
+
|
|
44573
|
+
${PROMPT_RUNNER_DESCRIPTION}
|
|
44574
|
+
|
|
44575
|
+
Features:
|
|
44576
|
+
- Lists only ready, fully authored prompts
|
|
44577
|
+
- Groups prompts from highest to lowest priority
|
|
44578
|
+
- Optional --harness and --model filters show only prompts compatible with that runner
|
|
44579
|
+
- Does not start a coding harness or modify prompt files
|
|
44580
|
+
`));
|
|
44581
|
+
addPromptRunnerSelectionOptions(command);
|
|
44582
|
+
addPromptPriorityOptions(command);
|
|
44583
|
+
command.action(handleActionErrors(async (cliOptions) => {
|
|
44584
|
+
const { priority, minPriority: minimumPriority, maxPriority: maximumPriority, } = cliOptions;
|
|
44585
|
+
const runnerOptions = normalizePromptRunnerSelectionCliOptions(cliOptions, { isAgentRequired: false });
|
|
44586
|
+
const promptRunnerIdentity = runnerOptions.agentName === undefined && runnerOptions.model === undefined
|
|
44587
|
+
? undefined
|
|
44588
|
+
: {
|
|
44589
|
+
harnessName: runnerOptions.agentName,
|
|
44590
|
+
modelName: runnerOptions.model,
|
|
44591
|
+
};
|
|
44592
|
+
// Note: Import dynamically to avoid loading prompt parsing dependencies until this command is used.
|
|
44593
|
+
const { listCoderPrompts } = await Promise.resolve().then(function () { return listCoderPrompts$1; });
|
|
44594
|
+
await listCoderPrompts({
|
|
44595
|
+
priority,
|
|
44596
|
+
minimumPriority,
|
|
44597
|
+
maximumPriority,
|
|
44598
|
+
promptRunnerIdentity,
|
|
44599
|
+
});
|
|
44600
|
+
}));
|
|
44601
|
+
}
|
|
44602
|
+
// Note: [🟡] Code for CLI command [list](src/cli/cli-commands/coder/list.ts) should never be published outside of `@promptbook/cli`
|
|
44603
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
44604
|
+
|
|
44524
44605
|
/**
|
|
44525
44606
|
* Default wait duration applied before retrying a prompt round after an error (10 minutes).
|
|
44526
44607
|
*
|
|
@@ -44661,30 +44742,6 @@
|
|
|
44661
44742
|
// Note: [🟡] Code for CLI command [ping](src/cli/cli-commands/coder/ping.ts) should never be published outside of `@promptbook/cli`
|
|
44662
44743
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
44663
44744
|
|
|
44664
|
-
/**
|
|
44665
|
-
* Creates a Commander argument parser that accepts only non-negative integers.
|
|
44666
|
-
*
|
|
44667
|
-
* The returned parser is meant to be passed as the coercion callback of `command.option(...)`.
|
|
44668
|
-
* It throws a branded `NotAllowed` error with a clear message referencing the given option name
|
|
44669
|
-
* when the provided value is not a non-negative integer.
|
|
44670
|
-
*
|
|
44671
|
-
* @private internal utility of `promptbookCli`
|
|
44672
|
-
*/
|
|
44673
|
-
function createNonNegativeIntegerOptionParser(optionName) {
|
|
44674
|
-
return (value) => {
|
|
44675
|
-
const parsedValue = Number(value);
|
|
44676
|
-
if (!Number.isInteger(parsedValue) || parsedValue < 0) {
|
|
44677
|
-
throw new NotAllowed(_spaceTrim.spaceTrim(`
|
|
44678
|
-
Invalid value for \`${optionName}\`: \`${value}\`.
|
|
44679
|
-
|
|
44680
|
-
Use a non-negative integer.
|
|
44681
|
-
`));
|
|
44682
|
-
}
|
|
44683
|
-
return parsedValue;
|
|
44684
|
-
};
|
|
44685
|
-
}
|
|
44686
|
-
// Note: [🟡] Code for CLI option parser [createNonNegativeIntegerOptionParser](src/cli/cli-commands/common/createNonNegativeIntegerOptionParser.ts) should never be published outside of `@promptbook/cli`
|
|
44687
|
-
|
|
44688
44745
|
/**
|
|
44689
44746
|
* Npm packages which directly provide the `ptbk` executable.
|
|
44690
44747
|
*
|
|
@@ -45141,9 +45198,7 @@
|
|
|
45141
45198
|
A verified task is merged back into the branch the coder runs on and the worktree is deleted.
|
|
45142
45199
|
A task that cannot be merged is marked as failed and its worktree is kept for a manual merge.
|
|
45143
45200
|
`), false);
|
|
45144
|
-
command
|
|
45145
|
-
command.option('--min-priority <minimum-priority>', 'Filter prompts by minimum priority level', createNonNegativeIntegerOptionParser('--min-priority'));
|
|
45146
|
-
command.option('--max-priority <maximum-priority>', 'Filter prompts by maximum priority level', createNonNegativeIntegerOptionParser('--max-priority'));
|
|
45201
|
+
addPromptPriorityOptions(command);
|
|
45147
45202
|
command.option('--limit <run-count>', 'Stop after processing this many prompt runs', createPositiveIntegerOptionParser('--limit'));
|
|
45148
45203
|
command.option('--wait-after-prompt <duration>', _spaceTrim.spaceTrim(`
|
|
45149
45204
|
Wait this long after each prompt has been implemented, verified and committed before starting the next prompt.
|
|
@@ -45294,9 +45349,7 @@
|
|
|
45294
45349
|
command.option('--test <test-command...>', 'Run a verification command after each prompt; quote it when the command itself contains top-level flags');
|
|
45295
45350
|
command.option('--preserve-logs', 'Keep generated temp prompt/log artifacts after successful rounds for debugging and analytics', false);
|
|
45296
45351
|
addPromptRunnerExecutionOptions(command);
|
|
45297
|
-
command
|
|
45298
|
-
command.option('--min-priority <minimum-priority>', 'Filter prompts by minimum priority level', createNonNegativeIntegerOptionParser('--min-priority'));
|
|
45299
|
-
command.option('--max-priority <maximum-priority>', 'Filter prompts by maximum priority level', createNonNegativeIntegerOptionParser('--max-priority'));
|
|
45352
|
+
addPromptPriorityOptions(command);
|
|
45300
45353
|
command.option('--wait-after-prompt <duration>', _spaceTrim.spaceTrim(`
|
|
45301
45354
|
Wait this long after each prompt has been implemented, verified and committed before starting the next prompt.
|
|
45302
45355
|
Accepts durations like 1h, 30m, 5s. Defaults to 0 (no wait).
|
|
@@ -45511,6 +45564,7 @@
|
|
|
45511
45564
|
* - add: Add one ready-to-run prompt file to the queue
|
|
45512
45565
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
45513
45566
|
* - find-refactor-candidates: Find files that need refactoring
|
|
45567
|
+
* - list: List ready prompts in priority order without running them
|
|
45514
45568
|
* - run: Run coding prompts with AI agents
|
|
45515
45569
|
* - ping: Test one harness and model with a tiny dummy prompt
|
|
45516
45570
|
* - verify: Verify completed prompts
|
|
@@ -45531,6 +45585,7 @@
|
|
|
45531
45585
|
- generate-boilerplates: Generate prompt boilerplate files
|
|
45532
45586
|
- find-refactor-candidates: Find files that need refactoring
|
|
45533
45587
|
- find-unwritten: List prompt sections that still need to be authored
|
|
45588
|
+
- list: List ready prompts in priority order without running them
|
|
45534
45589
|
- run: Run coding prompts with AI agents
|
|
45535
45590
|
- ping: Test the connection, response time and quota of one harness and model
|
|
45536
45591
|
- server: Start a long-running coder server with a kanban web UI
|
|
@@ -45543,6 +45598,7 @@
|
|
|
45543
45598
|
$initializeCoderGenerateBoilerplatesCommand(coderCommand);
|
|
45544
45599
|
$initializeCoderFindRefactorCandidatesCommand(coderCommand);
|
|
45545
45600
|
$initializeCoderFindUnwrittenCommand(coderCommand);
|
|
45601
|
+
$initializeCoderListCommand(coderCommand);
|
|
45546
45602
|
$initializeCoderRunCommand(coderCommand);
|
|
45547
45603
|
$initializeCoderPingCommand(coderCommand);
|
|
45548
45604
|
$initializeCoderServerCommand(coderCommand);
|
|
@@ -74909,6 +74965,88 @@
|
|
|
74909
74965
|
findUnwrittenPrompts: findUnwrittenPrompts
|
|
74910
74966
|
});
|
|
74911
74967
|
|
|
74968
|
+
/**
|
|
74969
|
+
* Lists todo prompts that are ready to run (no authoring placeholders).
|
|
74970
|
+
*/
|
|
74971
|
+
function listRunnablePrompts(files, priorityFilter = {}, promptRunnerIdentity) {
|
|
74972
|
+
return listTodoPrompts(files).filter((prompt) => !isPromptToBeWritten(prompt.file, prompt.section) &&
|
|
74973
|
+
isPromptInPriorityFilter(prompt.section, priorityFilter) &&
|
|
74974
|
+
isPromptCompatibleWithRunner(prompt.file, prompt.section, promptRunnerIdentity));
|
|
74975
|
+
}
|
|
74976
|
+
|
|
74977
|
+
/**
|
|
74978
|
+
* Lists upcoming tasks that are ready to run (no authoring placeholders).
|
|
74979
|
+
*/
|
|
74980
|
+
function listUpcomingTasks(files, priorityFilter = {}, promptRunnerIdentity) {
|
|
74981
|
+
return listRunnablePrompts(files, priorityFilter, promptRunnerIdentity).map(({ file, section }) => ({
|
|
74982
|
+
label: buildPromptLabelForDisplay(file, section),
|
|
74983
|
+
summary: buildPromptSummary(file, section),
|
|
74984
|
+
priority: section.priority,
|
|
74985
|
+
}));
|
|
74986
|
+
}
|
|
74987
|
+
|
|
74988
|
+
/**
|
|
74989
|
+
* Groups upcoming tasks by priority, high to low.
|
|
74990
|
+
*/
|
|
74991
|
+
function groupUpcomingTasksByPriority(tasks) {
|
|
74992
|
+
const grouped = new Map();
|
|
74993
|
+
for (const task of tasks) {
|
|
74994
|
+
const group = grouped.get(task.priority);
|
|
74995
|
+
if (group) {
|
|
74996
|
+
group.push(task);
|
|
74997
|
+
}
|
|
74998
|
+
else {
|
|
74999
|
+
grouped.set(task.priority, [task]);
|
|
75000
|
+
}
|
|
75001
|
+
}
|
|
75002
|
+
return Array.from(grouped.entries())
|
|
75003
|
+
.sort((a, b) => b[0] - a[0])
|
|
75004
|
+
.map(([priority, groupedTasks]) => ({ priority, tasks: groupedTasks }));
|
|
75005
|
+
}
|
|
75006
|
+
|
|
75007
|
+
/**
|
|
75008
|
+
* Prints upcoming tasks grouped by priority.
|
|
75009
|
+
*/
|
|
75010
|
+
function printUpcomingTasks(tasks) {
|
|
75011
|
+
if (tasks.length === 0) {
|
|
75012
|
+
console.info(colors__default["default"].green('No upcoming tasks.'));
|
|
75013
|
+
return;
|
|
75014
|
+
}
|
|
75015
|
+
console.info(colors__default["default"].cyan('Upcoming tasks (grouped by priority):'));
|
|
75016
|
+
for (const group of groupUpcomingTasksByPriority(tasks)) {
|
|
75017
|
+
console.info(colors__default["default"].cyan(`Priority ${group.priority}:`));
|
|
75018
|
+
for (const [index, task] of group.tasks.entries()) {
|
|
75019
|
+
const summary = task.summary ? ` - ${task.summary}` : '';
|
|
75020
|
+
console.info(` ${index + 1}. ${task.label}${summary}`);
|
|
75021
|
+
}
|
|
75022
|
+
}
|
|
75023
|
+
}
|
|
75024
|
+
|
|
75025
|
+
/**
|
|
75026
|
+
* Directory containing the prompt queue of the current project.
|
|
75027
|
+
*
|
|
75028
|
+
* @private internal constant of `listCoderPrompts`
|
|
75029
|
+
*/
|
|
75030
|
+
const PROMPTS_DIRECTORY_PATH = path.join(process.cwd(), 'prompts');
|
|
75031
|
+
/**
|
|
75032
|
+
* Lists ready, fully authored coding prompts in descending priority groups without starting a coding harness.
|
|
75033
|
+
*
|
|
75034
|
+
* @returns The number of prompts printed.
|
|
75035
|
+
* @public exported from `@promptbook/cli`
|
|
75036
|
+
*/
|
|
75037
|
+
async function listCoderPrompts(options = {}) {
|
|
75038
|
+
const priorityFilter = normalizePriorityFilter(options);
|
|
75039
|
+
const promptFiles = await loadPromptFiles(PROMPTS_DIRECTORY_PATH);
|
|
75040
|
+
const upcomingTasks = listUpcomingTasks(promptFiles, priorityFilter, options.promptRunnerIdentity);
|
|
75041
|
+
printUpcomingTasks(upcomingTasks);
|
|
75042
|
+
return upcomingTasks.length;
|
|
75043
|
+
}
|
|
75044
|
+
|
|
75045
|
+
var listCoderPrompts$1 = /*#__PURE__*/Object.freeze({
|
|
75046
|
+
__proto__: null,
|
|
75047
|
+
listCoderPrompts: listCoderPrompts
|
|
75048
|
+
});
|
|
75049
|
+
|
|
74912
75050
|
/**
|
|
74913
75051
|
* Formats one unknown error-like value into its readable message without the stack trace.
|
|
74914
75052
|
*
|
|
@@ -78781,15 +78919,6 @@
|
|
|
78781
78919
|
return path.relative(projectPath, path$1).replace(/\\/gu, '/');
|
|
78782
78920
|
}
|
|
78783
78921
|
|
|
78784
|
-
/**
|
|
78785
|
-
* Lists todo prompts that are ready to run (no authoring placeholders).
|
|
78786
|
-
*/
|
|
78787
|
-
function listRunnablePrompts(files, priorityFilter = {}, promptRunnerIdentity) {
|
|
78788
|
-
return listTodoPrompts(files).filter((prompt) => !isPromptToBeWritten(prompt.file, prompt.section) &&
|
|
78789
|
-
isPromptInPriorityFilter(prompt.section, priorityFilter) &&
|
|
78790
|
-
isPromptCompatibleWithRunner(prompt.file, prompt.section, promptRunnerIdentity));
|
|
78791
|
-
}
|
|
78792
|
-
|
|
78793
78922
|
/**
|
|
78794
78923
|
* Selects the next runnable prompt based on priority.
|
|
78795
78924
|
*/
|
|
@@ -78803,54 +78932,6 @@
|
|
|
78803
78932
|
return nextPrompt;
|
|
78804
78933
|
}
|
|
78805
78934
|
|
|
78806
|
-
/**
|
|
78807
|
-
* Lists upcoming tasks that are ready to run (no authoring placeholders).
|
|
78808
|
-
*/
|
|
78809
|
-
function listUpcomingTasks(files, priorityFilter = {}, promptRunnerIdentity) {
|
|
78810
|
-
return listRunnablePrompts(files, priorityFilter, promptRunnerIdentity).map(({ file, section }) => ({
|
|
78811
|
-
label: buildPromptLabelForDisplay(file, section),
|
|
78812
|
-
summary: buildPromptSummary(file, section),
|
|
78813
|
-
priority: section.priority,
|
|
78814
|
-
}));
|
|
78815
|
-
}
|
|
78816
|
-
|
|
78817
|
-
/**
|
|
78818
|
-
* Groups upcoming tasks by priority, high to low.
|
|
78819
|
-
*/
|
|
78820
|
-
function groupUpcomingTasksByPriority(tasks) {
|
|
78821
|
-
const grouped = new Map();
|
|
78822
|
-
for (const task of tasks) {
|
|
78823
|
-
const group = grouped.get(task.priority);
|
|
78824
|
-
if (group) {
|
|
78825
|
-
group.push(task);
|
|
78826
|
-
}
|
|
78827
|
-
else {
|
|
78828
|
-
grouped.set(task.priority, [task]);
|
|
78829
|
-
}
|
|
78830
|
-
}
|
|
78831
|
-
return Array.from(grouped.entries())
|
|
78832
|
-
.sort((a, b) => b[0] - a[0])
|
|
78833
|
-
.map(([priority, groupedTasks]) => ({ priority, tasks: groupedTasks }));
|
|
78834
|
-
}
|
|
78835
|
-
|
|
78836
|
-
/**
|
|
78837
|
-
* Prints upcoming tasks grouped by priority.
|
|
78838
|
-
*/
|
|
78839
|
-
function printUpcomingTasks(tasks) {
|
|
78840
|
-
if (tasks.length === 0) {
|
|
78841
|
-
console.info(colors__default["default"].green('No upcoming tasks.'));
|
|
78842
|
-
return;
|
|
78843
|
-
}
|
|
78844
|
-
console.info(colors__default["default"].cyan('Upcoming tasks (grouped by priority):'));
|
|
78845
|
-
for (const group of groupUpcomingTasksByPriority(tasks)) {
|
|
78846
|
-
console.info(colors__default["default"].cyan(`Priority ${group.priority}:`));
|
|
78847
|
-
for (const [index, task] of group.tasks.entries()) {
|
|
78848
|
-
const summary = task.summary ? ` - ${task.summary}` : '';
|
|
78849
|
-
console.info(` ${index + 1}. ${task.label}${summary}`);
|
|
78850
|
-
}
|
|
78851
|
-
}
|
|
78852
|
-
}
|
|
78853
|
-
|
|
78854
78935
|
/**
|
|
78855
78936
|
* Builds a label that identifies the prompt section by index.
|
|
78856
78937
|
*/
|