@promptbook/cli 0.112.0-88 → 0.112.0-90

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 (27) hide show
  1. package/apps/agents-server/next.config.ts +58 -3
  2. package/apps/agents-server/src/database/ensureAutomaticDatabaseMigrations.ts +8 -1
  3. package/apps/agents-server/src/database/runDatabaseMigrations.ts +31 -1
  4. package/apps/agents-server/src/database/sqlite/$provideLocalSqliteSupabase.ts +2 -2
  5. package/apps/agents-server/src/middleware/createMiddlewareRequestContext.ts +1 -1
  6. package/apps/agents-server/src/tools/$provideServer.ts +27 -0
  7. package/apps/agents-server/src/utils/serverRegistry.ts +117 -3
  8. package/esm/apps/agents-server/src/utils/serverRegistry.d.ts +6 -0
  9. package/esm/index.es.js +348 -17
  10. package/esm/index.es.js.map +1 -1
  11. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +31 -0
  12. package/esm/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +6 -0
  13. package/esm/src/version.d.ts +1 -1
  14. package/package.json +5 -3
  15. package/src/cli/cli-commands/agents-server/buildAgentsServer.ts +330 -8
  16. package/src/cli/cli-commands/agents-server/run.ts +2 -1
  17. package/src/cli/cli-commands/agents-server/startAgentsServer.ts +40 -16
  18. package/src/other/templates/getTemplatesPipelineCollection.ts +691 -794
  19. package/src/version.ts +2 -2
  20. package/src/versions.txt +2 -0
  21. package/umd/apps/agents-server/src/utils/serverRegistry.d.ts +6 -0
  22. package/umd/index.umd.js +346 -15
  23. package/umd/index.umd.js.map +1 -1
  24. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer.d.ts +31 -0
  25. package/umd/src/cli/cli-commands/agents-server/startAgentsServer.d.ts +6 -0
  26. package/umd/src/version.d.ts +1 -1
  27. package/src/wizard/test/sub/subsub/subsubsub/.promptbook/executions-cache/8/c/report-whoami-6e340b9cffb37a98.json +0 -104
@@ -1,4 +1,17 @@
1
1
  /// <reference types="node" />
2
+ /**
3
+ * Environment variable passed to the bundled Next app so webpack can resolve dependencies
4
+ * installed beside `ptbk` even when the app sources are materialized into a project cache.
5
+ *
6
+ * @private internal constant of `ptbk agents-server`
7
+ */
8
+ export declare const PTBK_AGENTS_SERVER_NODE_MODULES_PATH_ENV = "PTBK_AGENTS_SERVER_NODE_MODULES_PATH";
9
+ /**
10
+ * Environment variable used only by the CLI-owned production build.
11
+ *
12
+ * @private internal constant of `ptbk agents-server`
13
+ */
14
+ export declare const PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION_ENV = "PTBK_AGENTS_SERVER_IGNORE_NEXT_VALIDATION";
2
15
  /**
3
16
  * Inputs controlling one cached Agents Server production build.
4
17
  *
@@ -18,6 +31,7 @@ type EnsureAgentsServerBuildOptions = {
18
31
  */
19
32
  export type AgentsServerBuildArtifacts = {
20
33
  readonly appPath: string;
34
+ readonly nodeModulesPath: string;
21
35
  readonly nextCliPath: string;
22
36
  };
23
37
  /**
@@ -53,4 +67,21 @@ export declare function writeAgentsServerBuildCache(options: AgentsServerBuildCa
53
67
  * @private internal utility of `ptbk agents-server`
54
68
  */
55
69
  export declare function resolveAgentsServerAppPath(): Promise<string>;
70
+ /**
71
+ * Adds dependency-resolution environment required by the materialized Agents Server runtime.
72
+ *
73
+ * @private internal utility of `ptbk agents-server`
74
+ */
75
+ export declare function createAgentsServerRuntimeEnvironment(environment: NodeJS.ProcessEnv, nodeModulesPath: string, options?: {
76
+ readonly isNextValidationIgnored?: boolean;
77
+ }): NodeJS.ProcessEnv;
78
+ /**
79
+ * Uses the source checkout app directly, but copies npm-packaged app sources out of `node_modules`.
80
+ *
81
+ * @private internal utility of `ptbk agents-server`
82
+ */
83
+ export declare function resolveAgentsServerBuildAppPath(options: {
84
+ readonly nodeModulesPath: string;
85
+ readonly sourceAppPath: string;
86
+ }): Promise<string>;
56
87
  export {};
@@ -21,3 +21,9 @@ export type StartAgentsServerOptions = {
21
21
  * @private internal utility of `ptbk agents-server`
22
22
  */
23
23
  export declare function startAgentsServer(options: StartAgentsServerOptions): Promise<void>;
24
+ /**
25
+ * Loads launch-directory `.env` values without overriding explicit process environment.
26
+ *
27
+ * @private internal utility of `ptbk agents-server`
28
+ */
29
+ export declare function loadAgentsServerProjectEnvironment(launchWorkingDirectory: string): void;
@@ -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-82`).
18
+ * It follows semantic versioning (e.g., `0.112.0-89`).
19
19
  *
20
20
  * @generated
21
21
  */
@@ -1,104 +0,0 @@
1
- {
2
- "date": "2025-01-08T15:53:13.523Z",
3
- "promptbookVersion": "0.81.0-14",
4
- "prompt": {
5
- "title": "Report whoami",
6
- "pipelineUrl": "https://promptbook.studio/test.ptbk.md#report-whoami",
7
- "parameters": {},
8
- "content": "src/wizard/test/sub/subsub/subsubsub/books/test.ptbk.md",
9
- "modelRequirements": {
10
- "modelVariant": "CHAT"
11
- },
12
- "expectations": {}
13
- },
14
- "promptResult": {
15
- "content": "I apologize, but I don't actually have access to any document at the file path you mentioned (src/wizard/test/sub/subsub/subsubsub/books/test.ptbk.md). I'm an AI assistant without access to external files or documents unless they are specifically provided to me in the conversation. If you have a specific question about the contents of that file or if you'd like to share some information from it, I'd be happy to try to help based on what you provide. Otherwise, I can only respond in general terms about file structures or markdown files.",
16
- "modelName": "claude-3-5-sonnet-20240620",
17
- "timing": {
18
- "start": "2025-01-08T15:53:10.709Z",
19
- "complete": "2025-01-08T15:53:13.521Z"
20
- },
21
- "usage": {
22
- "price": {
23
- "value": 0.00204
24
- },
25
- "input": {
26
- "tokensCount": {
27
- "value": 35
28
- },
29
- "charactersCount": {
30
- "value": 56
31
- },
32
- "wordsCount": {
33
- "value": 10
34
- },
35
- "sentencesCount": {
36
- "value": 3
37
- },
38
- "linesCount": {
39
- "value": 1
40
- },
41
- "paragraphsCount": {
42
- "value": 1
43
- },
44
- "pagesCount": {
45
- "value": 1
46
- }
47
- },
48
- "output": {
49
- "tokensCount": {
50
- "value": 129
51
- },
52
- "charactersCount": {
53
- "value": 542
54
- },
55
- "wordsCount": {
56
- "value": 100
57
- },
58
- "sentencesCount": {
59
- "value": 6
60
- },
61
- "linesCount": {
62
- "value": 9
63
- },
64
- "paragraphsCount": {
65
- "value": 1
66
- },
67
- "pagesCount": {
68
- "value": 1
69
- }
70
- }
71
- },
72
- "rawPromptContent": "src/wizard/test/sub/subsub/subsubsub/books/test.ptbk.md",
73
- "rawRequest": {
74
- "model": "claude-3-5-sonnet-20240620",
75
- "max_tokens": 4096,
76
- "messages": [
77
- {
78
- "role": "user",
79
- "content": "src/wizard/test/sub/subsub/subsubsub/books/test.ptbk.md"
80
- }
81
- ]
82
- },
83
- "rawResponse": {
84
- "id": "msg_019zpNj2Zx1D7xB15e8taXN7",
85
- "type": "message",
86
- "role": "assistant",
87
- "model": "claude-3-5-sonnet-20240620",
88
- "content": [
89
- {
90
- "type": "text",
91
- "text": "I apologize, but I don't actually have access to any document at the file path you mentioned (src/wizard/test/sub/subsub/subsubsub/books/test.ptbk.md). I'm an AI assistant without access to external files or documents unless they are specifically provided to me in the conversation. If you have a specific question about the contents of that file or if you'd like to share some information from it, I'd be happy to try to help based on what you provide. Otherwise, I can only respond in general terms about file structures or markdown files."
92
- }
93
- ],
94
- "stop_reason": "end_turn",
95
- "stop_sequence": null,
96
- "usage": {
97
- "input_tokens": 35,
98
- "cache_creation_input_tokens": 0,
99
- "cache_read_input_tokens": 0,
100
- "output_tokens": 129
101
- }
102
- }
103
- }
104
- }