@promptbook/cli 0.112.0-111 → 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.
Files changed (31) hide show
  1. package/apps/agents-server/src/app/admin/servers/CreateServerDialog.tsx +16 -0
  2. package/apps/agents-server/src/app/admin/servers/useCreateServerWizard.ts +31 -5
  3. package/apps/agents-server/src/app/api/admin/servers/route.ts +5 -0
  4. package/apps/agents-server/src/app/api/metadata/route.ts +4 -0
  5. package/apps/agents-server/src/database/customJavascript.ts +62 -1
  6. package/apps/agents-server/src/database/customStylesheet.ts +60 -1
  7. package/apps/agents-server/src/database/getMetadata.ts +84 -3
  8. package/apps/agents-server/src/instrumentation.ts +3 -0
  9. package/apps/agents-server/src/utils/errorReporting/registerServerErrorSentryLogging.ts +331 -0
  10. package/apps/agents-server/src/utils/errorReporting/sendApplicationErrorReportToSentry.ts +8 -153
  11. package/apps/agents-server/src/utils/errorReporting/sentryStore.ts +177 -0
  12. package/apps/agents-server/src/utils/serverManagement/createManagedServer/bootstrapManagedServer.ts +3 -1
  13. package/apps/agents-server/src/utils/serverManagement/createManagedServer/normalizeCreateServerInput.ts +6 -0
  14. package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +7 -3
  15. package/apps/agents-server/src/utils/serverManagement/createManagedServer.ts +5 -0
  16. package/apps/agents-server/src/utils/userChat/listUserChats.ts +109 -0
  17. package/esm/index.es.js +23 -4
  18. package/esm/index.es.js.map +1 -1
  19. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +2 -1
  20. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.test.d.ts +1 -0
  21. package/esm/src/version.d.ts +1 -1
  22. package/package.json +1 -1
  23. package/src/cli/cli-commands/agents-server/startAgentsServer.ts +17 -1
  24. package/src/other/templates/getTemplatesPipelineCollection.ts +724 -878
  25. package/src/version.ts +2 -2
  26. package/src/versions.txt +1 -0
  27. package/umd/index.umd.js +23 -4
  28. package/umd/index.umd.js.map +1 -1
  29. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +2 -1
  30. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.test.d.ts +1 -0
  31. 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.112.0-111';
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-110`).
23
+ * It follows semantic versioning (e.g., `0.112.0-111`).
24
24
  *
25
25
  * @generated
26
26
  */
package/src/versions.txt CHANGED
@@ -1145,3 +1145,4 @@
1145
1145
  0.112.0-109
1146
1146
  0.112.0-110
1147
1147
  0.112.0-111
1148
+ 0.112.0-112
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-111';
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
@@ -34204,7 +34204,11 @@
34204
34204
  const projectPath = toPosixPath(options.projectPath);
34205
34205
  const loginMethodConfig = spaceTrim(`
34206
34206
  ${options.allowCredits ? 'CODEX_LOGIN_METHOD_ARGUMENTS=()' : 'CODEX_LOGIN_METHOD_ARGUMENTS=(-c forced_login_method=chatgpt)'}
34207
- if [ "\${PTBK_OPENAI_CODEX_USE_API_KEY:-0}" = "1" ] && [ -n "\${OPENAI_API_KEY:-}" ]; then
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
34208
34212
  CODEX_LOGIN_METHOD_ARGUMENTS=(-c forced_login_method=api)
34209
34213
  fi
34210
34214
  `);
@@ -34222,7 +34226,7 @@
34222
34226
  '',
34223
34227
  loginMethodConfig,
34224
34228
  '',
34225
- 'if [ "${PTBK_OPENAI_CODEX_USE_API_KEY:-0}" != "1" ] || [ -z "${OPENAI_API_KEY:-}" ]; then',
34229
+ 'if [ "${CODEX_USE_API_KEY:-0}" != "1" ] || [ -z "${OPENAI_API_KEY:-}" ]; then',
34226
34230
  'unset OPENAI_API_KEY',
34227
34231
  'unset OPENAI_BASE_URL',
34228
34232
  'fi',
@@ -37276,6 +37280,12 @@
37276
37280
  * @private internal constant of `ptbk agents-server`
37277
37281
  */
37278
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';
37279
37289
  /**
37280
37290
  * Entropy size for the local-only token shared by the CLI pump and the Next app.
37281
37291
  *
@@ -37401,11 +37411,20 @@
37401
37411
  });
37402
37412
  }
37403
37413
  /**
37404
- * Loads launch-directory `.env` values without overriding explicit process environment.
37414
+ * Loads Agents Server runtime environment from the installed `.env` file when explicitly configured and falls back
37415
+ * to the launch-directory `.env`.
37405
37416
  *
37406
37417
  * @private internal utility of `ptbk agents-server`
37407
37418
  */
37408
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
+ }
37409
37428
  dotenv__namespace.config({ path: path.join(launchWorkingDirectory, AGENTS_SERVER_PROJECT_ENV_FILE_NAME) });
37410
37429
  }
37411
37430
  /**