@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
@@ -29,7 +29,8 @@ export type StartAgentsServerOptions = {
29
29
  */
30
30
  export declare function startAgentsServer(options: StartAgentsServerOptions): Promise<void>;
31
31
  /**
32
- * Loads launch-directory `.env` values without overriding explicit process environment.
32
+ * Loads Agents Server runtime environment from the installed `.env` file when explicitly configured and falls back
33
+ * to the launch-directory `.env`.
33
34
  *
34
35
  * @private internal utility of `ptbk agents-server`
35
36
  */
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.112.0-110`).
18
+ * It follows semantic versioning (e.g., `0.112.0-111`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.112.0-111",
3
+ "version": "0.112.0-112",
4
4
  "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -107,6 +107,13 @@ const PTBK_AGENTS_SERVER_SQLITE_PATH_ENV = 'PTBK_AGENTS_SERVER_SQLITE_PATH';
107
107
  */
108
108
  const PTBK_HOSTNAME_ENV = 'PTBK_HOSTNAME';
109
109
 
110
+ /**
111
+ * Explicit installed `.env` file passed by standalone VPS pm2/runtime launchers.
112
+ *
113
+ * @private internal constant of `ptbk agents-server`
114
+ */
115
+ const PTBK_AGENTS_SERVER_ENV_FILE_ENV = 'PTBK_AGENTS_SERVER_ENV_FILE';
116
+
110
117
  /**
111
118
  * Entropy size for the local-only token shared by the CLI pump and the Next app.
112
119
  *
@@ -355,11 +362,20 @@ async function prepareAgentsServerDevelopmentRuntime(
355
362
  }
356
363
 
357
364
  /**
358
- * Loads launch-directory `.env` values without overriding explicit process environment.
365
+ * Loads Agents Server runtime environment from the installed `.env` file when explicitly configured and falls back
366
+ * to the launch-directory `.env`.
359
367
  *
360
368
  * @private internal utility of `ptbk agents-server`
361
369
  */
362
370
  export function loadAgentsServerProjectEnvironment(launchWorkingDirectory: string): void {
371
+ const explicitEnvFilePath = process.env[PTBK_AGENTS_SERVER_ENV_FILE_ENV]?.trim();
372
+ if (explicitEnvFilePath) {
373
+ const explicitLoadResult = dotenv.config({ path: explicitEnvFilePath, override: true });
374
+ if (!explicitLoadResult.error) {
375
+ return;
376
+ }
377
+ }
378
+
363
379
  dotenv.config({ path: join(launchWorkingDirectory, AGENTS_SERVER_PROJECT_ENV_FILE_NAME) });
364
380
  }
365
381