@promptbook/cli 0.112.0-110 → 0.112.0-112
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/admin/servers/CreateServerDialog.tsx +16 -0
- package/apps/agents-server/src/app/admin/servers/useCreateServerWizard.ts +31 -5
- package/apps/agents-server/src/app/agents/[agentName]/_utils.ts +7 -5
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +4 -86
- package/apps/agents-server/src/app/api/admin/servers/route.ts +5 -0
- package/apps/agents-server/src/app/api/metadata/route.ts +4 -0
- package/apps/agents-server/src/components/ApplicationErrorPage/ApplicationErrorPage.tsx +118 -12
- package/apps/agents-server/src/database/customJavascript.ts +62 -1
- package/apps/agents-server/src/database/customStylesheet.ts +60 -1
- package/apps/agents-server/src/database/getMetadata.ts +84 -3
- package/apps/agents-server/src/instrumentation.ts +3 -0
- package/apps/agents-server/src/utils/agentRouting/resolveAgentRouteTarget.ts +27 -62
- package/apps/agents-server/src/utils/errorReporting/applicationErrorHandling.ts +45 -0
- package/apps/agents-server/src/utils/errorReporting/refreshApplicationDocument.ts +10 -0
- package/apps/agents-server/src/utils/errorReporting/registerServerErrorSentryLogging.ts +331 -0
- package/apps/agents-server/src/utils/errorReporting/sendApplicationErrorReportToSentry.ts +8 -153
- package/apps/agents-server/src/utils/errorReporting/sentryStore.ts +177 -0
- package/apps/agents-server/src/utils/importAgent.ts +1 -57
- package/apps/agents-server/src/utils/importAgentWithFallback.ts +0 -10
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/bootstrapManagedServer.ts +3 -1
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/normalizeCreateServerInput.ts +6 -0
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +7 -3
- package/apps/agents-server/src/utils/serverManagement/createManagedServer.ts +5 -0
- package/apps/agents-server/src/utils/userChat/listUserChats.ts +109 -0
- package/apps/agents-server/src/utils/userChat.ts +0 -1
- package/esm/index.es.js +39 -13
- package/esm/index.es.js.map +1 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +2 -1
- package/esm/src/cli/cli-commands/agents-server/startAgentsServer.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer.ts +23 -2
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +91 -14
- package/src/other/templates/getTemplatesPipelineCollection.ts +801 -652
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +39 -13
- package/umd/index.umd.js.map +1 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +2 -1
- package/umd/src/cli/cli-commands/agents-server/startAgentsServer.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/utils/userChat/getUserChatRevision.ts +0 -145
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.112.0-
|
|
19
|
+
export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.112.0-112';
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Represents the version string of the Promptbook engine.
|
|
23
|
-
* It follows semantic versioning (e.g., `0.112.0-
|
|
23
|
+
* It follows semantic versioning (e.g., `0.112.0-111`).
|
|
24
24
|
*
|
|
25
25
|
* @generated
|
|
26
26
|
*/
|
package/src/versions.txt
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
* @generated
|
|
61
61
|
* @see https://github.com/webgptorg/promptbook
|
|
62
62
|
*/
|
|
63
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
63
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-112';
|
|
64
64
|
/**
|
|
65
65
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
66
66
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -34202,17 +34202,23 @@
|
|
|
34202
34202
|
var _a;
|
|
34203
34203
|
const delimiter = resolveShellHereDocumentDelimiter(CODEX_PROMPT_DELIMITER, options.prompt);
|
|
34204
34204
|
const projectPath = toPosixPath(options.projectPath);
|
|
34205
|
-
const loginMethodConfig =
|
|
34206
|
-
|
|
34207
|
-
|
|
34208
|
-
|
|
34209
|
-
|
|
34210
|
-
|
|
34211
|
-
|
|
34212
|
-
|
|
34205
|
+
const loginMethodConfig = spaceTrim(`
|
|
34206
|
+
${options.allowCredits ? 'CODEX_LOGIN_METHOD_ARGUMENTS=()' : 'CODEX_LOGIN_METHOD_ARGUMENTS=(-c forced_login_method=chatgpt)'}
|
|
34207
|
+
CODEX_USE_API_KEY="\${PTBK_OPENAI_CODEX_USE_API_KEY:-}"
|
|
34208
|
+
if [ -z "\$CODEX_USE_API_KEY" ] && [ -n "\${OPENAI_API_KEY:-}" ]; then
|
|
34209
|
+
CODEX_USE_API_KEY=1
|
|
34210
|
+
fi
|
|
34211
|
+
if [ "\$CODEX_USE_API_KEY" = "1" ] && [ -n "\${OPENAI_API_KEY:-}" ]; then
|
|
34212
|
+
CODEX_LOGIN_METHOD_ARGUMENTS=(-c forced_login_method=api)
|
|
34213
|
+
fi
|
|
34214
|
+
`);
|
|
34213
34215
|
const thinkingLevel = (_a = options.thinkingLevel) !== null && _a !== void 0 ? _a : DEFAULT_CODEX_THINKING_LEVEL;
|
|
34214
34216
|
const lines = [
|
|
34215
|
-
'if [ -f
|
|
34217
|
+
'if [ -n "${PTBK_AGENTS_SERVER_ENV_FILE:-}" ] && [ -f "${PTBK_AGENTS_SERVER_ENV_FILE}" ]; then',
|
|
34218
|
+
'set -a',
|
|
34219
|
+
'source "${PTBK_AGENTS_SERVER_ENV_FILE}"',
|
|
34220
|
+
'set +a',
|
|
34221
|
+
'elif [ -f .env ]; then',
|
|
34216
34222
|
'set -a',
|
|
34217
34223
|
'source .env',
|
|
34218
34224
|
'set +a',
|
|
@@ -34220,7 +34226,7 @@
|
|
|
34220
34226
|
'',
|
|
34221
34227
|
loginMethodConfig,
|
|
34222
34228
|
'',
|
|
34223
|
-
'if [ "${
|
|
34229
|
+
'if [ "${CODEX_USE_API_KEY:-0}" != "1" ] || [ -z "${OPENAI_API_KEY:-}" ]; then',
|
|
34224
34230
|
'unset OPENAI_API_KEY',
|
|
34225
34231
|
'unset OPENAI_BASE_URL',
|
|
34226
34232
|
'fi',
|
|
@@ -37274,6 +37280,12 @@
|
|
|
37274
37280
|
* @private internal constant of `ptbk agents-server`
|
|
37275
37281
|
*/
|
|
37276
37282
|
const PTBK_HOSTNAME_ENV = 'PTBK_HOSTNAME';
|
|
37283
|
+
/**
|
|
37284
|
+
* Explicit installed `.env` file passed by standalone VPS pm2/runtime launchers.
|
|
37285
|
+
*
|
|
37286
|
+
* @private internal constant of `ptbk agents-server`
|
|
37287
|
+
*/
|
|
37288
|
+
const PTBK_AGENTS_SERVER_ENV_FILE_ENV = 'PTBK_AGENTS_SERVER_ENV_FILE';
|
|
37277
37289
|
/**
|
|
37278
37290
|
* Entropy size for the local-only token shared by the CLI pump and the Next app.
|
|
37279
37291
|
*
|
|
@@ -37399,11 +37411,20 @@
|
|
|
37399
37411
|
});
|
|
37400
37412
|
}
|
|
37401
37413
|
/**
|
|
37402
|
-
* Loads
|
|
37414
|
+
* Loads Agents Server runtime environment from the installed `.env` file when explicitly configured and falls back
|
|
37415
|
+
* to the launch-directory `.env`.
|
|
37403
37416
|
*
|
|
37404
37417
|
* @private internal utility of `ptbk agents-server`
|
|
37405
37418
|
*/
|
|
37406
37419
|
function loadAgentsServerProjectEnvironment(launchWorkingDirectory) {
|
|
37420
|
+
var _a;
|
|
37421
|
+
const explicitEnvFilePath = (_a = process.env[PTBK_AGENTS_SERVER_ENV_FILE_ENV]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
37422
|
+
if (explicitEnvFilePath) {
|
|
37423
|
+
const explicitLoadResult = dotenv__namespace.config({ path: explicitEnvFilePath, override: true });
|
|
37424
|
+
if (!explicitLoadResult.error) {
|
|
37425
|
+
return;
|
|
37426
|
+
}
|
|
37427
|
+
}
|
|
37407
37428
|
dotenv__namespace.config({ path: path.join(launchWorkingDirectory, AGENTS_SERVER_PROJECT_ENV_FILE_NAME) });
|
|
37408
37429
|
}
|
|
37409
37430
|
/**
|
|
@@ -37429,7 +37450,12 @@
|
|
|
37429
37450
|
var _a;
|
|
37430
37451
|
const nextRuntimeModeLabel = describeAgentsServerNextRuntimeMode(options.options.nextRuntimeMode);
|
|
37431
37452
|
logRunnerEvent(options.logStreams.runner, `Starting the Agents Server Next process in ${nextRuntimeModeLabel} mode.`);
|
|
37432
|
-
const nextArguments = [
|
|
37453
|
+
const nextArguments = [
|
|
37454
|
+
options.nextCliPath,
|
|
37455
|
+
options.options.nextRuntimeMode,
|
|
37456
|
+
'--port',
|
|
37457
|
+
String(options.options.port),
|
|
37458
|
+
];
|
|
37433
37459
|
const hostname = (_a = options.childEnvironment[PTBK_HOSTNAME_ENV]) === null || _a === void 0 ? void 0 : _a.trim();
|
|
37434
37460
|
if (hostname) {
|
|
37435
37461
|
nextArguments.push('--hostname', hostname);
|