@promptbook/cli 0.112.0-91 → 0.112.0-93
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/apps/agents-server/src/app/layout.tsx +11 -5
- package/apps/agents-server/src/constants/themeMode.ts +27 -1
- package/apps/agents-server/src/database/$provideClientSql.ts +1 -1
- package/apps/agents-server/src/database/metadataDefaults.ts +10 -0
- package/apps/agents-server/src/database/migrations/2026-05-2600-default-theme.sql +16 -0
- package/apps/agents-server/src/utils/externalChatRunner/createExternalAgentRepositoryFiles.ts +2 -2
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks.ts +532 -1
- package/apps/agents-server/src/utils/userThemeModeSettings.ts +10 -2
- package/esm/index.es.js +65 -65
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/main/agentIgnorePatterns.d.ts +2 -2
- package/esm/scripts/run-agent-messages/main/createCoderRunOptionsForAgent.d.ts +1 -1
- package/esm/scripts/run-agent-messages/main/runPersistentAgentWatch.d.ts +1 -1
- package/esm/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -1
- package/esm/scripts/run-agent-messages/main/validateAgentRunOptions.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/agentRunUiConstants.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/buildAgentRunUiFrame.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/initializeAgentRunUi.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/loadAgentRunUiMetadata.d.ts +2 -2
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/agentProjectPaths.d.ts +16 -16
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/agentRunCliOptions.d.ts +5 -5
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/init.d.ts +1 -1
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/initializeAgentProjectConfiguration.d.ts +2 -2
- package/esm/src/cli/cli-commands/{agent → agent-folder}/initializeAgentRunnerCommand.d.ts +4 -4
- package/esm/src/cli/cli-commands/{agent → agent-folder}/printAgentInitializationSummary.d.ts +1 -1
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/run.d.ts +1 -1
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/runMultiple.d.ts +1 -1
- package/esm/src/cli/cli-commands/{agent → agent-folder}/tick.d.ts +1 -1
- package/esm/src/cli/cli-commands/{agent.d.ts → agent-folder.d.ts} +3 -3
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli/cli-commands/{agent → agent-folder}/agentProjectPaths.ts +18 -18
- package/src/cli/cli-commands/{agent → agent-folder}/agentRunCliOptions.ts +7 -7
- package/src/cli/cli-commands/{agent → agent-folder}/init.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/initializeAgentProjectConfiguration.ts +3 -3
- package/src/cli/cli-commands/{agent → agent-folder}/initializeAgentRunnerCommand.ts +6 -6
- package/src/cli/cli-commands/{agent → agent-folder}/printAgentInitializationSummary.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/run.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/runMultiple.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/tick.ts +2 -2
- package/src/cli/cli-commands/{agent.ts → agent-folder.ts} +16 -16
- package/src/cli/promptbookCli.ts +2 -2
- package/src/other/templates/getTemplatesPipelineCollection.ts +865 -755
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -1
- package/umd/index.umd.js +65 -65
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/main/agentIgnorePatterns.d.ts +2 -2
- package/umd/scripts/run-agent-messages/main/createCoderRunOptionsForAgent.d.ts +1 -1
- package/umd/scripts/run-agent-messages/main/runPersistentAgentWatch.d.ts +1 -1
- package/umd/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -1
- package/umd/scripts/run-agent-messages/main/validateAgentRunOptions.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/agentRunUiConstants.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/buildAgentRunUiFrame.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/initializeAgentRunUi.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/loadAgentRunUiMetadata.d.ts +2 -2
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/agentProjectPaths.d.ts +16 -16
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/agentRunCliOptions.d.ts +5 -5
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/init.d.ts +1 -1
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/initializeAgentProjectConfiguration.d.ts +2 -2
- package/umd/src/cli/cli-commands/{agent → agent-folder}/initializeAgentRunnerCommand.d.ts +4 -4
- package/umd/src/cli/cli-commands/{agent → agent-folder}/printAgentInitializationSummary.d.ts +1 -1
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/run.d.ts +1 -1
- package/umd/src/cli/cli-commands/agent-folder/run.test.d.ts +1 -0
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/runMultiple.d.ts +1 -1
- package/umd/src/cli/cli-commands/{agent → agent-folder}/tick.d.ts +1 -1
- package/umd/src/cli/cli-commands/{agent.d.ts → agent-folder.d.ts} +3 -3
- package/umd/src/cli/other/vpsInstall.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- /package/esm/src/cli/cli-commands/{agent → agent-folder}/run.test.d.ts +0 -0
- /package/{umd/src/cli/cli-commands/agent/run.test.d.ts → esm/src/cli/other/vpsInstall.test.d.ts} +0 -0
package/esm/index.es.js
CHANGED
|
@@ -58,7 +58,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
58
58
|
* @generated
|
|
59
59
|
* @see https://github.com/webgptorg/promptbook
|
|
60
60
|
*/
|
|
61
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
61
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-93';
|
|
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
|
|
@@ -1719,51 +1719,51 @@ function $initializeAboutCommand(program) {
|
|
|
1719
1719
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1720
1720
|
|
|
1721
1721
|
/**
|
|
1722
|
-
* Relative path to the local agent source initialized by `ptbk agent init`.
|
|
1722
|
+
* Relative path to the local agent source initialized by `ptbk agent-folder init`.
|
|
1723
1723
|
*
|
|
1724
|
-
* @private internal utility of `ptbk agent`
|
|
1724
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1725
1725
|
*/
|
|
1726
1726
|
const AGENT_BOOK_FILE_PATH = 'agent.book';
|
|
1727
1727
|
/**
|
|
1728
|
-
* Relative path to local knowledge files initialized by `ptbk agent init`.
|
|
1728
|
+
* Relative path to local knowledge files initialized by `ptbk agent-folder init`.
|
|
1729
1729
|
*
|
|
1730
|
-
* @private internal utility of `ptbk agent`
|
|
1730
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1731
1731
|
*/
|
|
1732
1732
|
const AGENT_KNOWLEDGE_DIRECTORY_PATH = 'knowledge';
|
|
1733
1733
|
/**
|
|
1734
|
-
* Relative path to the message queue root initialized by `ptbk agent init`.
|
|
1734
|
+
* Relative path to the message queue root initialized by `ptbk agent-folder init`.
|
|
1735
1735
|
*
|
|
1736
|
-
* @private internal utility of `ptbk agent`
|
|
1736
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1737
1737
|
*/
|
|
1738
1738
|
const AGENT_MESSAGES_DIRECTORY_PATH = 'messages';
|
|
1739
1739
|
/**
|
|
1740
|
-
* Relative path to queued user messages consumed by `ptbk agent run-once`.
|
|
1740
|
+
* Relative path to queued user messages consumed by `ptbk agent-folder run-once`.
|
|
1741
1741
|
*
|
|
1742
|
-
* @private internal utility of `ptbk agent`
|
|
1742
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1743
1743
|
*/
|
|
1744
1744
|
const AGENT_QUEUED_MESSAGES_DIRECTORY_PATH = join(AGENT_MESSAGES_DIRECTORY_PATH, 'queued');
|
|
1745
1745
|
/**
|
|
1746
|
-
* Relative path to answered messages written by `ptbk agent run-once`.
|
|
1746
|
+
* Relative path to answered messages written by `ptbk agent-folder run-once`.
|
|
1747
1747
|
*
|
|
1748
|
-
* @private internal utility of `ptbk agent`
|
|
1748
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1749
1749
|
*/
|
|
1750
1750
|
const AGENT_FINISHED_MESSAGES_DIRECTORY_PATH = join(AGENT_MESSAGES_DIRECTORY_PATH, 'finished');
|
|
1751
1751
|
/**
|
|
1752
|
-
* Relative path to generated local agent documentation initialized by `ptbk agent init`.
|
|
1752
|
+
* Relative path to generated local agent documentation initialized by `ptbk agent-folder init`.
|
|
1753
1753
|
*
|
|
1754
|
-
* @private internal utility of `ptbk agent`
|
|
1754
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1755
1755
|
*/
|
|
1756
1756
|
const AGENT_DOCS_DIRECTORY_PATH = 'docs';
|
|
1757
1757
|
/**
|
|
1758
|
-
* Relative path to the local Book language manual initialized by `ptbk agent init`.
|
|
1758
|
+
* Relative path to the local Book language manual initialized by `ptbk agent-folder init`.
|
|
1759
1759
|
*
|
|
1760
|
-
* @private internal utility of `ptbk agent`
|
|
1760
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1761
1761
|
*/
|
|
1762
1762
|
const AGENT_BOOK_LANGUAGE_MANUAL_FILE_PATH = join(AGENT_DOCS_DIRECTORY_PATH, 'book-language-manual.md');
|
|
1763
1763
|
/**
|
|
1764
1764
|
* Returns the default local agent book content.
|
|
1765
1765
|
*
|
|
1766
|
-
* @private internal utility of `ptbk agent`
|
|
1766
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1767
1767
|
*/
|
|
1768
1768
|
function getDefaultAgentBookContent() {
|
|
1769
1769
|
return spaceTrim$1(`
|
|
@@ -1780,7 +1780,7 @@ function getDefaultAgentBookContent() {
|
|
|
1780
1780
|
/**
|
|
1781
1781
|
* Returns the default local Book language manual content.
|
|
1782
1782
|
*
|
|
1783
|
-
* @private internal utility of `ptbk agent`
|
|
1783
|
+
* @private internal utility of `ptbk agent-folder`
|
|
1784
1784
|
*/
|
|
1785
1785
|
function getDefaultBookLanguageManualContent() {
|
|
1786
1786
|
return spaceTrim$1(`
|
|
@@ -1808,10 +1808,10 @@ function getDefaultBookLanguageManualContent() {
|
|
|
1808
1808
|
CLOSED
|
|
1809
1809
|
\`\`\`
|
|
1810
1810
|
|
|
1811
|
-
For \`ptbk agent\`, the CLI compiles \`agent.book\` into the coding-runner instructions, and the runner edits only the queued message file by appending an answer that starts with \`MESSAGE @Agent\`.
|
|
1811
|
+
For \`ptbk agent-folder\`, the CLI compiles \`agent.book\` into the coding-runner instructions, and the runner edits only the queued message file by appending an answer that starts with \`MESSAGE @Agent\`.
|
|
1812
1812
|
`);
|
|
1813
1813
|
}
|
|
1814
|
-
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent/agentProjectPaths.ts) should never be published outside of `@promptbook/cli`
|
|
1814
|
+
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent-folder/agentProjectPaths.ts) should never be published outside of `@promptbook/cli`
|
|
1815
1815
|
// Note: [💞] Ignore a discrepancy between file name and exported helper names
|
|
1816
1816
|
|
|
1817
1817
|
/**
|
|
@@ -1870,7 +1870,7 @@ async function isExistingDirectory(path) {
|
|
|
1870
1870
|
/**
|
|
1871
1871
|
* Creates local agent queue, knowledge, and instruction files in the current project.
|
|
1872
1872
|
*
|
|
1873
|
-
* @private internal utility of `ptbk agent init`
|
|
1873
|
+
* @private internal utility of `ptbk agent-folder init`
|
|
1874
1874
|
*/
|
|
1875
1875
|
async function initializeAgentProjectConfiguration(projectPath) {
|
|
1876
1876
|
const messagesDirectoryStatus = await ensureDirectory(projectPath, AGENT_MESSAGES_DIRECTORY_PATH);
|
|
@@ -1890,12 +1890,12 @@ async function initializeAgentProjectConfiguration(projectPath) {
|
|
|
1890
1890
|
bookLanguageManualFileStatus,
|
|
1891
1891
|
};
|
|
1892
1892
|
}
|
|
1893
|
-
// Note: [🟡] Code for CLI command [agent init](src/cli/cli-commands/agent/initializeAgentProjectConfiguration.ts) should never be published outside of `@promptbook/cli`
|
|
1893
|
+
// Note: [🟡] Code for CLI command [agent init](src/cli/cli-commands/agent-folder/initializeAgentProjectConfiguration.ts) should never be published outside of `@promptbook/cli`
|
|
1894
1894
|
|
|
1895
1895
|
/**
|
|
1896
1896
|
* Prints a readable summary of initialized local agent files.
|
|
1897
1897
|
*
|
|
1898
|
-
* @private internal utility of `ptbk agent init`
|
|
1898
|
+
* @private internal utility of `ptbk agent-folder init`
|
|
1899
1899
|
*/
|
|
1900
1900
|
function printAgentInitializationSummary(summary) {
|
|
1901
1901
|
console.info(colors.green('Promptbook agent configuration initialized.'));
|
|
@@ -1925,10 +1925,10 @@ function formatInitializationStatus$2(status) {
|
|
|
1925
1925
|
function printInitializationStatusLine$2(relativePath, status) {
|
|
1926
1926
|
console.info(colors.gray(`✔ ${relativePath.replace(/\\/gu, '/')}: ${formatInitializationStatus$2(status)}`));
|
|
1927
1927
|
}
|
|
1928
|
-
// Note: [🟡] Code for CLI command [agent init](src/cli/cli-commands/agent/printAgentInitializationSummary.ts) should never be published outside of `@promptbook/cli`
|
|
1928
|
+
// Note: [🟡] Code for CLI command [agent init](src/cli/cli-commands/agent-folder/printAgentInitializationSummary.ts) should never be published outside of `@promptbook/cli`
|
|
1929
1929
|
|
|
1930
1930
|
/**
|
|
1931
|
-
* Initializes `agent init` command for Promptbook CLI utilities.
|
|
1931
|
+
* Initializes `agent-folder init` command for Promptbook CLI utilities.
|
|
1932
1932
|
*
|
|
1933
1933
|
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
1934
1934
|
*
|
|
@@ -1952,7 +1952,7 @@ function $initializeAgentInitCommand(program) {
|
|
|
1952
1952
|
printAgentInitializationSummary(summary);
|
|
1953
1953
|
}));
|
|
1954
1954
|
}
|
|
1955
|
-
// Note: [🟡] Code for CLI command [init](src/cli/cli-commands/agent/init.ts) should never be published outside of `@promptbook/cli`
|
|
1955
|
+
// Note: [🟡] Code for CLI command [init](src/cli/cli-commands/agent-folder/init.ts) should never be published outside of `@promptbook/cli`
|
|
1956
1956
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1957
1957
|
|
|
1958
1958
|
/**
|
|
@@ -2130,7 +2130,7 @@ function isPromptRunnerAgentName(agent) {
|
|
|
2130
2130
|
/**
|
|
2131
2131
|
* Converts Commander options into the `scripts/run-agent-messages` option shape.
|
|
2132
2132
|
*
|
|
2133
|
-
* @private internal utility of `ptbk agent`
|
|
2133
|
+
* @private internal utility of `ptbk agent-folder`
|
|
2134
2134
|
*/
|
|
2135
2135
|
function createAgentRunOptionsFromCliOptions(cliOptions) {
|
|
2136
2136
|
const runnerOptions = normalizePromptRunnerCliOptions(cliOptions, {
|
|
@@ -2145,19 +2145,19 @@ function createAgentRunOptionsFromCliOptions(cliOptions) {
|
|
|
2145
2145
|
/**
|
|
2146
2146
|
* Normalizes one or more `--ignore` option values into a stable pattern list.
|
|
2147
2147
|
*
|
|
2148
|
-
* @private internal utility of `ptbk agent`
|
|
2148
|
+
* @private internal utility of `ptbk agent-folder`
|
|
2149
2149
|
*/
|
|
2150
2150
|
function normalizeAgentIgnorePatterns(ignore) {
|
|
2151
2151
|
const patterns = Array.isArray(ignore) ? ignore : ignore ? [ignore] : [];
|
|
2152
2152
|
return patterns.map((pattern) => pattern.trim()).filter((pattern) => pattern.length > 0);
|
|
2153
2153
|
}
|
|
2154
|
-
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent/agentRunCliOptions.ts) should never be published outside of `@promptbook/cli`
|
|
2154
|
+
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent-folder/agentRunCliOptions.ts) should never be published outside of `@promptbook/cli`
|
|
2155
2155
|
// Note: [💞] Ignore a discrepancy between file name and exported helper names
|
|
2156
2156
|
|
|
2157
2157
|
/**
|
|
2158
|
-
* Registers one runner-backed `ptbk agent` subcommand with the shared option and error handling flow.
|
|
2158
|
+
* Registers one runner-backed `ptbk agent-folder` subcommand with the shared option and error handling flow.
|
|
2159
2159
|
*
|
|
2160
|
-
* @private internal utility of `ptbk agent`
|
|
2160
|
+
* @private internal utility of `ptbk agent-folder`
|
|
2161
2161
|
*/
|
|
2162
2162
|
function $initializeAgentRunnerCommand(program, options) {
|
|
2163
2163
|
var _a;
|
|
@@ -2182,7 +2182,7 @@ function $initializeAgentRunnerCommand(program, options) {
|
|
|
2182
2182
|
if (options.executionMode === 'watch') {
|
|
2183
2183
|
const { runPersistentAgentWatch } = await Promise.resolve().then(function () { return runPersistentAgentWatch$1; });
|
|
2184
2184
|
await runPersistentAgentWatch({
|
|
2185
|
-
commandDisplayName: `ptbk agent ${options.commandName}`,
|
|
2185
|
+
commandDisplayName: `ptbk agent-folder ${options.commandName}`,
|
|
2186
2186
|
logDirectoryPath: process.cwd(),
|
|
2187
2187
|
runWatch: async () => {
|
|
2188
2188
|
await execute(runOptions);
|
|
@@ -2203,11 +2203,11 @@ function $initializeAgentRunnerCommand(program, options) {
|
|
|
2203
2203
|
isExitingOnSuccess: options.executionMode === 'once',
|
|
2204
2204
|
}));
|
|
2205
2205
|
}
|
|
2206
|
-
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent/initializeAgentRunnerCommand.ts) should never be published outside of `@promptbook/cli`
|
|
2206
|
+
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent-folder/initializeAgentRunnerCommand.ts) should never be published outside of `@promptbook/cli`
|
|
2207
2207
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2208
2208
|
|
|
2209
2209
|
/**
|
|
2210
|
-
* Initializes `agent run-multiple` command for Promptbook CLI utilities.
|
|
2210
|
+
* Initializes `agent-folder run-multiple` command for Promptbook CLI utilities.
|
|
2211
2211
|
*
|
|
2212
2212
|
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
2213
2213
|
*
|
|
@@ -2234,11 +2234,11 @@ function $initializeAgentRunMultipleCommand(program) {
|
|
|
2234
2234
|
},
|
|
2235
2235
|
});
|
|
2236
2236
|
}
|
|
2237
|
-
// Note: [🟡] Code for CLI command [run-multiple](src/cli/cli-commands/agent/runMultiple.ts) should never be published outside of `@promptbook/cli`
|
|
2237
|
+
// Note: [🟡] Code for CLI command [run-multiple](src/cli/cli-commands/agent-folder/runMultiple.ts) should never be published outside of `@promptbook/cli`
|
|
2238
2238
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2239
2239
|
|
|
2240
2240
|
/**
|
|
2241
|
-
* Initializes `agent run` command for Promptbook CLI utilities.
|
|
2241
|
+
* Initializes `agent-folder run` command for Promptbook CLI utilities.
|
|
2242
2242
|
*
|
|
2243
2243
|
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
2244
2244
|
*
|
|
@@ -2264,11 +2264,11 @@ function $initializeAgentRunCommand(program) {
|
|
|
2264
2264
|
},
|
|
2265
2265
|
});
|
|
2266
2266
|
}
|
|
2267
|
-
// Note: [🟡] Code for CLI command [run](src/cli/cli-commands/agent/run.ts) should never be published outside of `@promptbook/cli`
|
|
2267
|
+
// Note: [🟡] Code for CLI command [run](src/cli/cli-commands/agent-folder/run.ts) should never be published outside of `@promptbook/cli`
|
|
2268
2268
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2269
2269
|
|
|
2270
2270
|
/**
|
|
2271
|
-
* Initializes `agent tick` command for Promptbook CLI utilities.
|
|
2271
|
+
* Initializes `agent-folder tick` command for Promptbook CLI utilities.
|
|
2272
2272
|
*
|
|
2273
2273
|
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
2274
2274
|
*
|
|
@@ -2293,13 +2293,13 @@ function $initializeAgentTickCommand(program) {
|
|
|
2293
2293
|
},
|
|
2294
2294
|
});
|
|
2295
2295
|
}
|
|
2296
|
-
// Note: [🟡] Code for CLI command [tick](src/cli/cli-commands/agent/tick.ts) should never be published outside of `@promptbook/cli`
|
|
2296
|
+
// Note: [🟡] Code for CLI command [tick](src/cli/cli-commands/agent-folder/tick.ts) should never be published outside of `@promptbook/cli`
|
|
2297
2297
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2298
2298
|
|
|
2299
2299
|
/**
|
|
2300
|
-
* Initializes `agent` command with subcommands for Promptbook CLI utilities.
|
|
2300
|
+
* Initializes `agent-folder` command with subcommands for Promptbook CLI utilities.
|
|
2301
2301
|
*
|
|
2302
|
-
* The agent command provides utilities for repository-backed message queues:
|
|
2302
|
+
* The agent-folder command provides utilities for repository-backed message queues:
|
|
2303
2303
|
* - init: Initialize local agent queue and instruction files
|
|
2304
2304
|
* - run-once (alias: tick): Answer one queued message and exit
|
|
2305
2305
|
* - run-agent (alias: run): Watch one queue and answer messages one by one
|
|
@@ -2309,9 +2309,9 @@ function $initializeAgentTickCommand(program) {
|
|
|
2309
2309
|
*
|
|
2310
2310
|
* @private internal function of `promptbookCli`
|
|
2311
2311
|
*/
|
|
2312
|
-
function $
|
|
2313
|
-
const
|
|
2314
|
-
|
|
2312
|
+
function $initializeAgentFolderCommand(program) {
|
|
2313
|
+
const agentFolderCommand = program.command('agent-folder');
|
|
2314
|
+
agentFolderCommand.description(spaceTrim$1(`
|
|
2315
2315
|
Non-coding agent utilities backed by repository message files
|
|
2316
2316
|
|
|
2317
2317
|
Subcommands:
|
|
@@ -2320,17 +2320,17 @@ function $initializeAgentCommand(program) {
|
|
|
2320
2320
|
- run-agent (alias: run): Watch one queue and answer messages one by one
|
|
2321
2321
|
- run-multiple: Watch direct child agent repositories in one shared session
|
|
2322
2322
|
`));
|
|
2323
|
-
$initializeAgentInitCommand(
|
|
2324
|
-
$initializeAgentTickCommand(
|
|
2325
|
-
$initializeAgentRunCommand(
|
|
2326
|
-
$initializeAgentRunMultipleCommand(
|
|
2327
|
-
|
|
2323
|
+
$initializeAgentInitCommand(agentFolderCommand);
|
|
2324
|
+
$initializeAgentTickCommand(agentFolderCommand);
|
|
2325
|
+
$initializeAgentRunCommand(agentFolderCommand);
|
|
2326
|
+
$initializeAgentRunMultipleCommand(agentFolderCommand);
|
|
2327
|
+
agentFolderCommand.action(() => {
|
|
2328
2328
|
console.info(colors.yellow('Please specify a subcommand.'));
|
|
2329
2329
|
console.info('');
|
|
2330
|
-
|
|
2330
|
+
agentFolderCommand.help();
|
|
2331
2331
|
});
|
|
2332
2332
|
}
|
|
2333
|
-
// Note: [🟡] Code for CLI command [agent](src/cli/cli-commands/agent.ts) should never be published outside of `@promptbook/cli`
|
|
2333
|
+
// Note: [🟡] Code for CLI command [agent-folder](src/cli/cli-commands/agent-folder.ts) should never be published outside of `@promptbook/cli`
|
|
2334
2334
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2335
2335
|
|
|
2336
2336
|
/**
|
|
@@ -4826,7 +4826,7 @@ function renderCoderRunUi(startTime, options = {}) {
|
|
|
4826
4826
|
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4827
4827
|
|
|
4828
4828
|
/**
|
|
4829
|
-
* Converts `ptbk agent` options into the shared runner option shape.
|
|
4829
|
+
* Converts `ptbk agent-folder` options into the shared runner option shape.
|
|
4830
4830
|
*/
|
|
4831
4831
|
function createCoderRunOptionsForAgent(options) {
|
|
4832
4832
|
return {
|
|
@@ -5674,7 +5674,7 @@ async function ensureWorkingTreeCleanForAgentQueue(projectPath) {
|
|
|
5674
5674
|
throw new NotAllowed(spaceTrim$1(`
|
|
5675
5675
|
Git working tree has changes outside of \`${normalizeGitPath(AGENT_QUEUED_MESSAGES_DIRECTORY_PATH)}/\`.
|
|
5676
5676
|
|
|
5677
|
-
Please commit or stash unrelated changes before running \`ptbk agent\`
|
|
5677
|
+
Please commit or stash unrelated changes before running \`ptbk agent-folder\`
|
|
5678
5678
|
OR run with \`--ignore-git-changes\`.
|
|
5679
5679
|
|
|
5680
5680
|
Unrelated changed files:
|
|
@@ -33343,9 +33343,9 @@ function normalizeGitHubCopilotRunnerError(error) {
|
|
|
33343
33343
|
\`\`\`
|
|
33344
33344
|
|
|
33345
33345
|
### What to check
|
|
33346
|
-
- Update to the newest \`ptbk\` package so \`ptbk agent run\` uses the compiled agent-system-message prompt shape.
|
|
33346
|
+
- Update to the newest \`ptbk\` package so \`ptbk agent-folder run\` uses the compiled agent-system-message prompt shape.
|
|
33347
33347
|
- Keep the local agent instructions in \`agent.book\` reasonably compact.
|
|
33348
|
-
- If needed, compare with the local source runner (\`ts-node src/cli/test/ptbk.ts agent run ...\`), which bypasses stale published bundles.
|
|
33348
|
+
- If needed, compare with the local source runner (\`ts-node src/cli/test/ptbk.ts agent-folder run ...\`), which bypasses stale published bundles.
|
|
33349
33349
|
`));
|
|
33350
33350
|
}
|
|
33351
33351
|
/**
|
|
@@ -34523,7 +34523,7 @@ function normalizeAgentBannerName(agentName) {
|
|
|
34523
34523
|
}
|
|
34524
34524
|
|
|
34525
34525
|
/**
|
|
34526
|
-
* Shared idle placeholder rendered in the rich `ptbk agent` terminal UI.
|
|
34526
|
+
* Shared idle placeholder rendered in the rich `ptbk agent-folder` terminal UI.
|
|
34527
34527
|
*/
|
|
34528
34528
|
const WAITING_FOR_MESSAGE_LABEL = 'Waiting for the message';
|
|
34529
34529
|
|
|
@@ -34556,7 +34556,7 @@ const MAX_AGENT_URL_COLUMN_WIDTH = 30;
|
|
|
34556
34556
|
*/
|
|
34557
34557
|
const AGENT_URL_COLUMN_RATIO = 0.38;
|
|
34558
34558
|
/**
|
|
34559
|
-
* Builds the complete boxed terminal frame for the rich `ptbk agent run` UI.
|
|
34559
|
+
* Builds the complete boxed terminal frame for the rich `ptbk agent-folder run` UI.
|
|
34560
34560
|
*/
|
|
34561
34561
|
function buildAgentRunUiFrame(options) {
|
|
34562
34562
|
const totalWidth = Math.max(MIN_FRAME_WIDTH, Math.min(options.terminalWidth, MAX_FRAME_WIDTH));
|
|
@@ -34729,7 +34729,7 @@ function countAgentStatuses(options) {
|
|
|
34729
34729
|
};
|
|
34730
34730
|
}
|
|
34731
34731
|
/**
|
|
34732
|
-
* Parses the multi-agent session label used by `ptbk agent run-multiple`.
|
|
34732
|
+
* Parses the multi-agent session label used by `ptbk agent-folder run-multiple`.
|
|
34733
34733
|
*/
|
|
34734
34734
|
function parseMultiAgentSessionCount(localAgentName) {
|
|
34735
34735
|
const match = /^(\d+) Agents?(?:\s+·\s+\d+ ignored)?$/u.exec(localAgentName || '');
|
|
@@ -35063,7 +35063,7 @@ function summarizeUserMessageLines(messageLines) {
|
|
|
35063
35063
|
}
|
|
35064
35064
|
|
|
35065
35065
|
/**
|
|
35066
|
-
* Creates and seeds the persistent rich terminal UI used by `ptbk agent run`.
|
|
35066
|
+
* Creates and seeds the persistent rich terminal UI used by `ptbk agent-folder run`.
|
|
35067
35067
|
*/
|
|
35068
35068
|
async function initializeAgentRunUi(projectPath, options, queueSnapshot) {
|
|
35069
35069
|
if (options.noUi || !process.stdout.isTTY) {
|
|
@@ -35190,7 +35190,7 @@ function normalizeAgentWatchError(error) {
|
|
|
35190
35190
|
}
|
|
35191
35191
|
|
|
35192
35192
|
/**
|
|
35193
|
-
* Validates cross-flag constraints for `ptbk agent` runs.
|
|
35193
|
+
* Validates cross-flag constraints for `ptbk agent-folder` runs.
|
|
35194
35194
|
*/
|
|
35195
35195
|
function validateAgentRunOptions(options) {
|
|
35196
35196
|
if (!options.agentName) {
|
|
@@ -35525,7 +35525,7 @@ const LEGACY_STATUS_WIDTH = 9;
|
|
|
35525
35525
|
async function runMultipleAgentMessages(options, controls = {}) {
|
|
35526
35526
|
var _a;
|
|
35527
35527
|
validateAgentRunOptions(options);
|
|
35528
|
-
validateAgentWatchOptions('ptbk agent run-multiple', options);
|
|
35528
|
+
validateAgentWatchOptions('ptbk agent-folder run-multiple', options);
|
|
35529
35529
|
const rootPath = process.cwd();
|
|
35530
35530
|
const shouldContinue = controls.shouldContinue || (() => just(true));
|
|
35531
35531
|
const ignoreMatcher = createAgentIgnoreMatcher(options.ignorePatterns);
|
|
@@ -35626,7 +35626,7 @@ async function runMultipleAgentMessages(options, controls = {}) {
|
|
|
35626
35626
|
continue;
|
|
35627
35627
|
}
|
|
35628
35628
|
await handleAgentWatchError({
|
|
35629
|
-
commandDisplayName: 'ptbk agent run-multiple',
|
|
35629
|
+
commandDisplayName: 'ptbk agent-folder run-multiple',
|
|
35630
35630
|
logDirectoryPath: controls.watchErrorLogDirectoryPath || rootPath,
|
|
35631
35631
|
error: tickResult.reason,
|
|
35632
35632
|
});
|
|
@@ -35634,7 +35634,7 @@ async function runMultipleAgentMessages(options, controls = {}) {
|
|
|
35634
35634
|
}
|
|
35635
35635
|
catch (error) {
|
|
35636
35636
|
await handleAgentWatchError({
|
|
35637
|
-
commandDisplayName: 'ptbk agent run-multiple',
|
|
35637
|
+
commandDisplayName: 'ptbk agent-folder run-multiple',
|
|
35638
35638
|
logDirectoryPath: controls.watchErrorLogDirectoryPath || rootPath,
|
|
35639
35639
|
error,
|
|
35640
35640
|
});
|
|
@@ -51071,7 +51071,7 @@ async function promptbookCli() {
|
|
|
51071
51071
|
$initializeListScrapersCommand(program);
|
|
51072
51072
|
$initializeStartAgentsServerCommand(program);
|
|
51073
51073
|
$initializeStartPipelinesServerCommand(program);
|
|
51074
|
-
$
|
|
51074
|
+
$initializeAgentFolderCommand(program);
|
|
51075
51075
|
$initializeAgentsServerCommand(program);
|
|
51076
51076
|
$initializeCoderCommand(program);
|
|
51077
51077
|
$deprecateTopLevelCommands(program);
|
|
@@ -61169,7 +61169,7 @@ const AGENT_IDLE_AUTO_PULL_INTERVAL_MS = 30000;
|
|
|
61169
61169
|
async function runAgentMessages(options, controls = {}) {
|
|
61170
61170
|
var _a;
|
|
61171
61171
|
validateAgentRunOptions(options);
|
|
61172
|
-
validateAgentWatchOptions('ptbk agent run-agent', options);
|
|
61172
|
+
validateAgentWatchOptions('ptbk agent-folder run-agent', options);
|
|
61173
61173
|
const projectPath = process.cwd();
|
|
61174
61174
|
let autoPullTimestamp = options.autoPull ? Date.now() : undefined;
|
|
61175
61175
|
const shouldContinue = controls.shouldContinue || (() => just(true));
|
|
@@ -61200,7 +61200,7 @@ async function runAgentMessages(options, controls = {}) {
|
|
|
61200
61200
|
}
|
|
61201
61201
|
catch (error) {
|
|
61202
61202
|
await handleAgentWatchError({
|
|
61203
|
-
commandDisplayName: 'ptbk agent run-agent',
|
|
61203
|
+
commandDisplayName: 'ptbk agent-folder run-agent',
|
|
61204
61204
|
logDirectoryPath: projectPath,
|
|
61205
61205
|
error,
|
|
61206
61206
|
});
|