@promptbook/remote-client 0.84.0-21 → 0.84.0-9
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/README.md +5 -21
- package/esm/index.es.js +9 -62
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/cli.index.d.ts +0 -4
- package/esm/typings/src/_packages/core.index.d.ts +2 -12
- package/esm/typings/src/_packages/types.index.d.ts +0 -2
- package/esm/typings/src/_packages/utils.index.d.ts +0 -2
- package/esm/typings/src/_packages/wizzard.index.d.ts +0 -4
- package/esm/typings/src/cli/cli-commands/about.d.ts +1 -3
- package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -3
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +1 -3
- package/esm/typings/src/cli/cli-commands/make.d.ts +1 -3
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -3
- package/esm/typings/src/cli/cli-commands/run.d.ts +1 -3
- package/esm/typings/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -3
- package/esm/typings/src/config.d.ts +1 -27
- package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
- package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -3
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -3
- package/esm/typings/src/pipeline/prompt-notation.d.ts +5 -18
- package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +1 -1
- package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +2 -5
- package/esm/typings/src/wizzard/wizzard.d.ts +1 -7
- package/package.json +16 -9
- package/umd/index.umd.js +9 -62
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/_packages/deepseek.index.d.ts +0 -8
- package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +0 -13
- package/esm/typings/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +0 -9
- package/esm/typings/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -14
- package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +0 -14
- package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +0 -15
- package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.test.d.ts +0 -1
- package/esm/typings/src/utils/editable/utils/isFlatPipeline.test.d.ts +0 -1
- package/esm/typings/src/utils/files/mimeTypeToExtension.d.ts +0 -10
- package/esm/typings/src/utils/files/mimeTypeToExtension.test.d.ts +0 -1
|
@@ -4,8 +4,6 @@ import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic
|
|
|
4
4
|
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
|
|
5
5
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
6
6
|
import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor';
|
|
7
|
-
import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
|
|
8
|
-
import { _DeepseekRegistration } from '../llm-providers/deepseek/register-constructor';
|
|
9
7
|
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
10
8
|
import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
|
|
11
9
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
@@ -32,8 +30,6 @@ export { _AnthropicClaudeMetadataRegistration };
|
|
|
32
30
|
export { _AnthropicClaudeRegistration };
|
|
33
31
|
export { _AzureOpenAiMetadataRegistration };
|
|
34
32
|
export { _AzureOpenAiRegistration };
|
|
35
|
-
export { _DeepseekMetadataRegistration };
|
|
36
|
-
export { _DeepseekRegistration };
|
|
37
33
|
export { _GoogleMetadataRegistration };
|
|
38
34
|
export { _GoogleRegistration };
|
|
39
35
|
export { _OpenAiMetadataRegistration };
|
|
@@ -12,9 +12,6 @@ import { LOGO_LIGHT_SRC } from '../config';
|
|
|
12
12
|
import { LOGO_DARK_SRC } from '../config';
|
|
13
13
|
import { DEFAULT_BOOK_TITLE } from '../config';
|
|
14
14
|
import { DEFAULT_TASK_TITLE } from '../config';
|
|
15
|
-
import { DEFAULT_PROMPT_TASK_TITLE } from '../config';
|
|
16
|
-
import { DEFAULT_BOOK_OUTPUT_PARAMETER_NAME } from '../config';
|
|
17
|
-
import { DEFAULT_MAX_FILE_SIZE } from '../config';
|
|
18
15
|
import { MAX_FILENAME_LENGTH } from '../config';
|
|
19
16
|
import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
|
|
20
17
|
import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
|
|
@@ -22,8 +19,7 @@ import { DEFAULT_MAX_EXECUTION_ATTEMPTS } from '../config';
|
|
|
22
19
|
import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH } from '../config';
|
|
23
20
|
import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL } from '../config';
|
|
24
21
|
import { DEFAULT_BOOKS_DIRNAME } from '../config';
|
|
25
|
-
import {
|
|
26
|
-
import { DEFAULT_EXECUTION_CACHE_DIRNAME } from '../config';
|
|
22
|
+
import { DEFAULT_EXECUTIONS_CACHE_DIRNAME } from '../config';
|
|
27
23
|
import { DEFAULT_SCRAPE_CACHE_DIRNAME } from '../config';
|
|
28
24
|
import { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME } from '../config';
|
|
29
25
|
import { DEFAULT_REMOTE_URL } from '../config';
|
|
@@ -92,7 +88,6 @@ import { countTotalUsage } from '../llm-providers/_common/utils/count-total-usag
|
|
|
92
88
|
import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
|
|
93
89
|
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
|
|
94
90
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
95
|
-
import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
|
|
96
91
|
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
97
92
|
import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
|
|
98
93
|
import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
|
|
@@ -143,9 +138,6 @@ export { LOGO_LIGHT_SRC };
|
|
|
143
138
|
export { LOGO_DARK_SRC };
|
|
144
139
|
export { DEFAULT_BOOK_TITLE };
|
|
145
140
|
export { DEFAULT_TASK_TITLE };
|
|
146
|
-
export { DEFAULT_PROMPT_TASK_TITLE };
|
|
147
|
-
export { DEFAULT_BOOK_OUTPUT_PARAMETER_NAME };
|
|
148
|
-
export { DEFAULT_MAX_FILE_SIZE };
|
|
149
141
|
export { MAX_FILENAME_LENGTH };
|
|
150
142
|
export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
|
|
151
143
|
export { DEFAULT_MAX_PARALLEL_COUNT };
|
|
@@ -153,8 +145,7 @@ export { DEFAULT_MAX_EXECUTION_ATTEMPTS };
|
|
|
153
145
|
export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH };
|
|
154
146
|
export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL };
|
|
155
147
|
export { DEFAULT_BOOKS_DIRNAME };
|
|
156
|
-
export {
|
|
157
|
-
export { DEFAULT_EXECUTION_CACHE_DIRNAME };
|
|
148
|
+
export { DEFAULT_EXECUTIONS_CACHE_DIRNAME };
|
|
158
149
|
export { DEFAULT_SCRAPE_CACHE_DIRNAME };
|
|
159
150
|
export { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME };
|
|
160
151
|
export { DEFAULT_REMOTE_URL };
|
|
@@ -223,7 +214,6 @@ export { countTotalUsage };
|
|
|
223
214
|
export { limitTotalUsage };
|
|
224
215
|
export { _AnthropicClaudeMetadataRegistration };
|
|
225
216
|
export { _AzureOpenAiMetadataRegistration };
|
|
226
|
-
export { _DeepseekMetadataRegistration };
|
|
227
217
|
export { _GoogleMetadataRegistration };
|
|
228
218
|
export { joinLlmExecutionTools };
|
|
229
219
|
export { MultipleLlmExecutionTools };
|
|
@@ -70,7 +70,6 @@ import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anth
|
|
|
70
70
|
import type { AnthropicClaudeExecutionToolsDirectOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
71
71
|
import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
72
72
|
import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions';
|
|
73
|
-
import type { DeepseekExecutionToolsOptions } from '../llm-providers/deepseek/DeepseekExecutionToolsOptions';
|
|
74
73
|
import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
|
|
75
74
|
import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
|
|
76
75
|
import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
|
|
@@ -345,7 +344,6 @@ export type { AnthropicClaudeExecutionToolsOptions };
|
|
|
345
344
|
export type { AnthropicClaudeExecutionToolsDirectOptions };
|
|
346
345
|
export type { AnthropicClaudeExecutionToolsProxiedOptions };
|
|
347
346
|
export type { AzureOpenAiExecutionToolsOptions };
|
|
348
|
-
export type { DeepseekExecutionToolsOptions };
|
|
349
347
|
export type { GoogleExecutionToolsOptions };
|
|
350
348
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
351
349
|
export type { OpenAiExecutionToolsOptions };
|
|
@@ -8,7 +8,6 @@ import { serializeError } from '../errors/utils/serializeError';
|
|
|
8
8
|
import { forEachAsync } from '../execution/utils/forEachAsync';
|
|
9
9
|
import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
|
|
10
10
|
import { prompt } from '../pipeline/prompt-notation';
|
|
11
|
-
import { promptTemplate } from '../pipeline/prompt-notation';
|
|
12
11
|
import { $getCurrentDate } from '../utils/$getCurrentDate';
|
|
13
12
|
import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
|
|
14
13
|
import { $isRunningInJest } from '../utils/environment/$isRunningInJest';
|
|
@@ -90,7 +89,6 @@ export { serializeError };
|
|
|
90
89
|
export { forEachAsync };
|
|
91
90
|
export { isValidJsonString };
|
|
92
91
|
export { prompt };
|
|
93
|
-
export { promptTemplate };
|
|
94
92
|
export { $getCurrentDate };
|
|
95
93
|
export { $isRunningInBrowser };
|
|
96
94
|
export { $isRunningInJest };
|
|
@@ -3,8 +3,6 @@ import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic
|
|
|
3
3
|
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
|
|
4
4
|
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
5
5
|
import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor';
|
|
6
|
-
import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
|
|
7
|
-
import { _DeepseekRegistration } from '../llm-providers/deepseek/register-constructor';
|
|
8
6
|
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
9
7
|
import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
|
|
10
8
|
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
@@ -31,8 +29,6 @@ export { _AnthropicClaudeMetadataRegistration };
|
|
|
31
29
|
export { _AnthropicClaudeRegistration };
|
|
32
30
|
export { _AzureOpenAiMetadataRegistration };
|
|
33
31
|
export { _AzureOpenAiRegistration };
|
|
34
|
-
export { _DeepseekMetadataRegistration };
|
|
35
|
-
export { _DeepseekRegistration };
|
|
36
32
|
export { _GoogleMetadataRegistration };
|
|
37
33
|
export { _GoogleRegistration };
|
|
38
34
|
export { _OpenAiMetadataRegistration };
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes `about` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializeAboutCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* TODO: [🗽] Unite branding and make single place for it
|
|
12
10
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes testing `hello` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializeHelloCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* TODO: [🧠][🐣] Make here some easter egg with generated hello greeting via LLM models
|
|
12
10
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes `list-models` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializeListModelsCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12
10
|
* Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes `make` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializeMakeCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* TODO: [🥃][main] !!3 Allow `ptbk make` without configuring any llm tools
|
|
12
10
|
* TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes `prettify` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializePrettifyCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* TODO: [😶] Unite floder listing
|
|
12
10
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes `run` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializeRunCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* TODO: !!5 Catch and wrap all errors from CLI
|
|
12
10
|
* TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PipelineExecutor } from '../../execution/PipelineExecutor';
|
|
2
1
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineExecutor } from '../../execution/PipelineExecutor';
|
|
3
3
|
/**
|
|
4
4
|
* Options for running the interactive chatbot
|
|
5
5
|
*/
|
|
@@ -2,11 +2,9 @@ import type { Command as Program } from 'commander';
|
|
|
2
2
|
/**
|
|
3
3
|
* Initializes `test` command for Promptbook CLI utilities
|
|
4
4
|
*
|
|
5
|
-
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
|
|
6
|
-
*
|
|
7
5
|
* @private internal function of `promptbookCli`
|
|
8
6
|
*/
|
|
9
|
-
export declare function
|
|
7
|
+
export declare function initializeTestCommand(program: Program): void;
|
|
10
8
|
/**
|
|
11
9
|
* TODO: [😶] Unite floder listing
|
|
12
10
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -65,24 +65,6 @@ export declare const DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
|
|
|
65
65
|
* @public exported from `@promptbook/core`
|
|
66
66
|
*/
|
|
67
67
|
export declare const DEFAULT_TASK_TITLE = "Task";
|
|
68
|
-
/**
|
|
69
|
-
* When the title of the prompt task is not provided, the default title is used
|
|
70
|
-
*
|
|
71
|
-
* @public exported from `@promptbook/core`
|
|
72
|
-
*/
|
|
73
|
-
export declare const DEFAULT_PROMPT_TASK_TITLE = "Prompt";
|
|
74
|
-
/**
|
|
75
|
-
* When the pipeline is flat and no name of return parameter is provided, this name is used
|
|
76
|
-
*
|
|
77
|
-
* @public exported from `@promptbook/core`
|
|
78
|
-
*/
|
|
79
|
-
export declare const DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = "result";
|
|
80
|
-
/**
|
|
81
|
-
* Maximum file size limit
|
|
82
|
-
*
|
|
83
|
-
* @public exported from `@promptbook/core`
|
|
84
|
-
*/
|
|
85
|
-
export declare const DEFAULT_MAX_FILE_SIZE: number;
|
|
86
68
|
/**
|
|
87
69
|
* Warning message for the generated sections and files files
|
|
88
70
|
*
|
|
@@ -184,14 +166,6 @@ export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
|
|
|
184
166
|
* @public exported from `@promptbook/core`
|
|
185
167
|
*/
|
|
186
168
|
export declare const DEFAULT_BOOKS_DIRNAME = "./books";
|
|
187
|
-
/**
|
|
188
|
-
* Where to store the temporary downloads
|
|
189
|
-
*
|
|
190
|
-
* Note: When the folder does not exist, it is created recursively
|
|
191
|
-
*
|
|
192
|
-
* @public exported from `@promptbook/core`
|
|
193
|
-
*/
|
|
194
|
-
export declare const DEFAULT_DOWNLOAD_CACHE_DIRNAME = "./.promptbook/download-cache";
|
|
195
169
|
/**
|
|
196
170
|
* Where to store the cache of executions for promptbook CLI
|
|
197
171
|
*
|
|
@@ -199,7 +173,7 @@ export declare const DEFAULT_DOWNLOAD_CACHE_DIRNAME = "./.promptbook/download-ca
|
|
|
199
173
|
*
|
|
200
174
|
* @public exported from `@promptbook/core`
|
|
201
175
|
*/
|
|
202
|
-
export declare const
|
|
176
|
+
export declare const DEFAULT_EXECUTIONS_CACHE_DIRNAME = "./.promptbook/executions-cache";
|
|
203
177
|
/**
|
|
204
178
|
* Where to store the scrape cache
|
|
205
179
|
*
|
|
@@ -17,5 +17,5 @@ import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOpt
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function compilePipelineOnRemoteServer<TCustomOptions = undefined>(pipelineString: PipelineString, options: RemoteClientOptions<TCustomOptions>): Promise<PipelineJson>;
|
|
19
19
|
/**
|
|
20
|
-
* TODO:
|
|
20
|
+
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
|
|
21
21
|
*/
|
|
@@ -3,7 +3,7 @@ import type fs from 'fs/promises';
|
|
|
3
3
|
/**
|
|
4
4
|
* Container for all the tools needed to manipulate with filesystem
|
|
5
5
|
*/
|
|
6
|
-
export type FilesystemTools = Pick<typeof fs, 'access' | 'constants' | 'readFile' | 'writeFile' | 'stat' | 'readdir'
|
|
6
|
+
export type FilesystemTools = Pick<typeof fs, 'access' | 'constants' | 'readFile' | 'writeFile' | 'stat' | 'readdir'>;
|
|
7
7
|
/**
|
|
8
8
|
* TODO: Implement destroyable pattern to free resources
|
|
9
9
|
*/
|
|
@@ -2,13 +2,11 @@ import type { PipelineExecutorResult } from './PipelineExecutorResult';
|
|
|
2
2
|
/**
|
|
3
3
|
* Asserts that the execution of a Promptbook is successful
|
|
4
4
|
*
|
|
5
|
-
* Note: If there are only warnings, the execution is still successful but the warnings are logged in the console
|
|
6
|
-
*
|
|
7
5
|
* @param executionResult - The partial result of the Promptbook execution
|
|
8
6
|
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
9
7
|
* @public exported from `@promptbook/core`
|
|
10
8
|
*/
|
|
11
|
-
export declare function assertsExecutionSuccessful(executionResult: Pick<PipelineExecutorResult, 'isSuccessful' | 'errors'
|
|
9
|
+
export declare function assertsExecutionSuccessful(executionResult: Pick<PipelineExecutorResult, 'isSuccessful' | 'errors'>): void;
|
|
12
10
|
/**
|
|
13
11
|
* TODO: [🐚] This function should be removed OR changed OR be completely rewritten
|
|
14
12
|
* TODO: [🧠] Can this return type be better typed than void
|
|
@@ -2,10 +2,9 @@ import type { PipelineString } from './PipelineString';
|
|
|
2
2
|
/**
|
|
3
3
|
* Tag function for notating a pipeline with a book\`...\ notation as template literal
|
|
4
4
|
*
|
|
5
|
-
* Note: There are
|
|
5
|
+
* Note: There are 2 similar functions:
|
|
6
6
|
* 1) `prompt` for notating single prompt exported from `@promptbook/utils`
|
|
7
|
-
*
|
|
8
|
-
* 3) `book` for notating and validating entire books exported from `@promptbook/utils`
|
|
7
|
+
* 1) `book` for notating and validating entire books exported from `@promptbook/utils`
|
|
9
8
|
*
|
|
10
9
|
* @param strings @@@
|
|
11
10
|
* @param values @@@
|
|
@@ -2,29 +2,16 @@ import type { string_prompt } from '../types/typeAliases';
|
|
|
2
2
|
/**
|
|
3
3
|
* Tag function for notating a prompt as template literal
|
|
4
4
|
*
|
|
5
|
-
* Note: There are
|
|
5
|
+
* Note: There are 2 similar functions:
|
|
6
6
|
* 1) `prompt` for notating single prompt exported from `@promptbook/utils`
|
|
7
|
-
*
|
|
8
|
-
* 3) `book` for notating and validating entire books exported from `@promptbook/utils`
|
|
7
|
+
* 1) `book` for notating and validating entire books exported from `@promptbook/utils`
|
|
9
8
|
*
|
|
10
|
-
* @param strings
|
|
11
|
-
* @param values
|
|
12
|
-
* @returns the
|
|
9
|
+
* @param strings @@@
|
|
10
|
+
* @param values @@@
|
|
11
|
+
* @returns the pipeline string
|
|
13
12
|
* @public exported from `@promptbook/utils`
|
|
14
13
|
*/
|
|
15
14
|
export declare function prompt(strings: TemplateStringsArray, ...values: Array<string>): string_prompt;
|
|
16
|
-
/**
|
|
17
|
-
* Tag function for notating a prompt as template literal
|
|
18
|
-
*
|
|
19
|
-
* Note: There are 3 similar functions:
|
|
20
|
-
* 1) `prompt` for notating single prompt exported from `@promptbook/utils`
|
|
21
|
-
* 2) `promptTemplate` alias for `prompt`
|
|
22
|
-
* 3) `book` for notating and validating entire books exported from `@promptbook/utils`
|
|
23
|
-
*
|
|
24
|
-
* @alias prompt
|
|
25
|
-
* @public exported from `@promptbook/utils`
|
|
26
|
-
*/
|
|
27
|
-
export declare const promptTemplate: typeof prompt;
|
|
28
15
|
/**
|
|
29
16
|
* TODO: [🧠][🈴] Where is the best location for this file
|
|
30
17
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -13,5 +13,5 @@ import type { RemoteClientOptions } from '../remote-server/types/RemoteClientOpt
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function preparePipelineOnRemoteServer<TCustomOptions = undefined>(pipeline: PipelineJson, options: RemoteClientOptions<TCustomOptions>): Promise<PipelineJson>;
|
|
15
15
|
/**
|
|
16
|
-
* TODO:
|
|
16
|
+
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
|
|
17
17
|
*/
|
package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { ApplicationRemoteServerClientOptions } from '../../types/RemoteSer
|
|
|
9
9
|
*/
|
|
10
10
|
export type PromptbookServer_Identification<TCustomOptions> = PromptbookServer_ApplicationIdentification<TCustomOptions> | PromptbookServer_AnonymousIdentification;
|
|
11
11
|
/**
|
|
12
|
-
* Application mode is
|
|
12
|
+
* Application mode is @@@!!!
|
|
13
13
|
*
|
|
14
14
|
* @public exported from `@promptbook/remote-server`
|
|
15
15
|
* @public exported from `@promptbook/remote-client`
|
|
@@ -21,10 +21,7 @@ export type PromptbookServer_ApplicationIdentification<TCustomOptions> = Applica
|
|
|
21
21
|
readonly isAnonymous: false;
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Anonymous mode is
|
|
25
|
-
*
|
|
26
|
-
* Note: This is useful in situations when the LLM provider does not allow to call the API requests from the client side
|
|
27
|
-
* It is kind of a proxy mode
|
|
24
|
+
* Anonymous mode is @@@!!!
|
|
28
25
|
*
|
|
29
26
|
* @public exported from `@promptbook/remote-server`
|
|
30
27
|
* @public exported from `@promptbook/remote-client`
|
|
@@ -6,7 +6,6 @@ import type { PipelineString } from '../pipeline/PipelineString';
|
|
|
6
6
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
7
7
|
import type { InputParameters } from '../types/typeAliases';
|
|
8
8
|
import type { string_filename } from '../types/typeAliases';
|
|
9
|
-
import type { string_parameter_value } from '../types/typeAliases';
|
|
10
9
|
import type { string_pipeline_url } from '../types/typeAliases';
|
|
11
10
|
/**
|
|
12
11
|
* Wizzard for simple usage of the Promptbook
|
|
@@ -28,12 +27,7 @@ declare class Wizzard {
|
|
|
28
27
|
*
|
|
29
28
|
* Note: This works simmilar to the `ptbk run` command
|
|
30
29
|
*/
|
|
31
|
-
execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<
|
|
32
|
-
/**
|
|
33
|
-
* Simple result of the execution
|
|
34
|
-
*/
|
|
35
|
-
result: string_parameter_value;
|
|
36
|
-
} & PipelineExecutorResult>;
|
|
30
|
+
execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
|
|
37
31
|
private executionTools;
|
|
38
32
|
/**
|
|
39
33
|
* Provides the tools automatically for the Node.js environment
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/remote-client",
|
|
3
|
-
"version": "0.84.0-
|
|
3
|
+
"version": "0.84.0-9",
|
|
4
4
|
"description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
|
|
5
|
+
"--note-0": " <- [🐊]",
|
|
5
6
|
"private": false,
|
|
6
7
|
"sideEffects": false,
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
10
|
"url": "https://github.com/webgptorg/promptbook"
|
|
10
11
|
},
|
|
11
|
-
"author": "Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)",
|
|
12
12
|
"contributors": [
|
|
13
|
-
"Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)"
|
|
14
|
-
"Jiří Jahn <jiri@ptbk.io> (https://www.ptbk.io/)"
|
|
13
|
+
"Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)"
|
|
15
14
|
],
|
|
15
|
+
"--todo-0": "TODO: [❇️] Make better list of keywords",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"ai",
|
|
18
18
|
"llm",
|
|
@@ -25,9 +25,6 @@
|
|
|
25
25
|
"natural-language-processing",
|
|
26
26
|
"nlp",
|
|
27
27
|
"openai",
|
|
28
|
-
"o3",
|
|
29
|
-
"o3-mini",
|
|
30
|
-
"deepseek",
|
|
31
28
|
"gpt-3",
|
|
32
29
|
"gpt-4",
|
|
33
30
|
"gpt-4o",
|
|
@@ -38,16 +35,26 @@
|
|
|
38
35
|
"anthropic",
|
|
39
36
|
"LLMOps"
|
|
40
37
|
],
|
|
41
|
-
"license": "
|
|
38
|
+
"license": "CC-BY-4.0",
|
|
42
39
|
"bugs": {
|
|
43
40
|
"url": "https://github.com/webgptorg/promptbook/issues"
|
|
44
41
|
},
|
|
45
42
|
"homepage": "https://www.npmjs.com/package/@promptbook/core",
|
|
43
|
+
"funding": [
|
|
44
|
+
{
|
|
45
|
+
"type": "individual",
|
|
46
|
+
"url": "https://buymeacoffee.com/hejny"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"type": "github",
|
|
50
|
+
"url": "https://github.com/webgptorg/promptbook/blob/main/README.md#%EF%B8%8F-contributing"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
46
53
|
"main": "./umd/index.umd.js",
|
|
47
54
|
"module": "./esm/index.es.js",
|
|
48
55
|
"typings": "./esm/typings/src/_packages/remote-client.index.d.ts",
|
|
49
56
|
"peerDependencies": {
|
|
50
|
-
"@promptbook/core": "0.84.0-
|
|
57
|
+
"@promptbook/core": "0.84.0-9"
|
|
51
58
|
},
|
|
52
59
|
"dependencies": {
|
|
53
60
|
"crypto-js": "4.2.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.84.0-
|
|
26
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.84.0-8';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -434,12 +434,6 @@
|
|
|
434
434
|
* @public exported from `@promptbook/core`
|
|
435
435
|
*/
|
|
436
436
|
var DEFAULT_TASK_TITLE = "Task";
|
|
437
|
-
/**
|
|
438
|
-
* When the pipeline is flat and no name of return parameter is provided, this name is used
|
|
439
|
-
*
|
|
440
|
-
* @public exported from `@promptbook/core`
|
|
441
|
-
*/
|
|
442
|
-
var DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = 'result';
|
|
443
437
|
/**
|
|
444
438
|
* Timeout for the connections in milliseconds
|
|
445
439
|
*
|
|
@@ -655,7 +649,7 @@
|
|
|
655
649
|
});
|
|
656
650
|
}
|
|
657
651
|
/**
|
|
658
|
-
* TODO:
|
|
652
|
+
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
|
|
659
653
|
*/
|
|
660
654
|
|
|
661
655
|
/**
|
|
@@ -4458,10 +4452,7 @@
|
|
|
4458
4452
|
description: 'Chatbot response',
|
|
4459
4453
|
isInput: false,
|
|
4460
4454
|
isOutput: true,
|
|
4461
|
-
exampleValues: [
|
|
4462
|
-
'Hello, how can I help you?',
|
|
4463
|
-
// <- TODO: [🧠] Make this dynamic, async, prepare-phase HLAs
|
|
4464
|
-
],
|
|
4455
|
+
exampleValues: ['Hello, I am a Pavol`s virtual avatar. How can I help you?'],
|
|
4465
4456
|
});
|
|
4466
4457
|
// TODO: Use spaceTrim in multiline strings
|
|
4467
4458
|
$pipelineJson.tasks.push({
|
|
@@ -4521,21 +4512,6 @@
|
|
|
4521
4512
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4522
4513
|
*/
|
|
4523
4514
|
|
|
4524
|
-
/**
|
|
4525
|
-
* Checks if value is valid email
|
|
4526
|
-
*
|
|
4527
|
-
* @public exported from `@promptbook/utils`
|
|
4528
|
-
*/
|
|
4529
|
-
function isValidEmail(email) {
|
|
4530
|
-
if (typeof email !== 'string') {
|
|
4531
|
-
return false;
|
|
4532
|
-
}
|
|
4533
|
-
if (email.split('\n').length > 1) {
|
|
4534
|
-
return false;
|
|
4535
|
-
}
|
|
4536
|
-
return /^.+@.+\..+$/.test(email);
|
|
4537
|
-
}
|
|
4538
|
-
|
|
4539
4515
|
/**
|
|
4540
4516
|
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
4541
4517
|
* It does not check if the string is fully logically correct, but if it is a string that can be a pipeline string or the string looks completely different.
|
|
@@ -4549,15 +4525,6 @@
|
|
|
4549
4525
|
if (isValidJsonString(pipelineString)) {
|
|
4550
4526
|
throw new ParseError('Expected a book, but got a JSON string');
|
|
4551
4527
|
}
|
|
4552
|
-
else if (isValidUrl(pipelineString)) {
|
|
4553
|
-
throw new ParseError("Expected a book, but got just the URL \"".concat(pipelineString, "\""));
|
|
4554
|
-
}
|
|
4555
|
-
else if (isValidFilePath(pipelineString)) {
|
|
4556
|
-
throw new ParseError("Expected a book, but got just the file path \"".concat(pipelineString, "\""));
|
|
4557
|
-
}
|
|
4558
|
-
else if (isValidEmail(pipelineString)) {
|
|
4559
|
-
throw new ParseError("Expected a book, but got just the email \"".concat(pipelineString, "\""));
|
|
4560
|
-
}
|
|
4561
4528
|
// <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
|
|
4562
4529
|
return pipelineString;
|
|
4563
4530
|
}
|
|
@@ -4593,15 +4560,12 @@
|
|
|
4593
4560
|
pipelineString = removeMarkdownComments(pipelineString);
|
|
4594
4561
|
pipelineString = spaceTrim__default["default"](pipelineString);
|
|
4595
4562
|
var isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
var isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
|
|
4599
|
-
var isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
|
|
4600
|
-
// TODO: [🧉] Also (double)check
|
|
4563
|
+
var isLastLineReturnStatement = pipelineString.split('\n').pop().split('`').join('').startsWith('->');
|
|
4564
|
+
// TODO: Also (double)check
|
|
4601
4565
|
// > const usedCommands
|
|
4602
4566
|
// > const isBlocksUsed
|
|
4603
4567
|
// > const returnStatementCount
|
|
4604
|
-
var isFlat = !isMarkdownBeginningWithHeadline &&
|
|
4568
|
+
var isFlat = !isMarkdownBeginningWithHeadline && isLastLineReturnStatement;
|
|
4605
4569
|
return isFlat;
|
|
4606
4570
|
}
|
|
4607
4571
|
|
|
@@ -4615,26 +4579,9 @@
|
|
|
4615
4579
|
return pipelineString;
|
|
4616
4580
|
}
|
|
4617
4581
|
var pipelineStringLines = pipelineString.split('\n');
|
|
4618
|
-
var
|
|
4619
|
-
var returnStatement;
|
|
4620
|
-
if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
|
|
4621
|
-
// Note: Last line is return statement
|
|
4622
|
-
returnStatement = potentialReturnStatement;
|
|
4623
|
-
}
|
|
4624
|
-
else {
|
|
4625
|
-
// Note: Last line is not a return statement
|
|
4626
|
-
returnStatement = "-> {".concat(DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, "}");
|
|
4627
|
-
pipelineStringLines.push(potentialReturnStatement);
|
|
4628
|
-
}
|
|
4582
|
+
var returnStatement = pipelineStringLines.pop();
|
|
4629
4583
|
var prompt = spaceTrim__default["default"](pipelineStringLines.join('\n'));
|
|
4630
|
-
|
|
4631
|
-
if (prompt.split('\n').length <= 1) {
|
|
4632
|
-
quotedPrompt = "> ".concat(prompt);
|
|
4633
|
-
}
|
|
4634
|
-
else {
|
|
4635
|
-
quotedPrompt = spaceTrim__default["default"](function (block) { return "\n ```\n ".concat(block(prompt.split('`').join('\\`')), "\n ```\n "); });
|
|
4636
|
-
}
|
|
4637
|
-
pipelineString = validatePipelineString(spaceTrim__default["default"](function (block) { return "\n # ".concat(DEFAULT_BOOK_TITLE, "\n\n ## Prompt\n\n ").concat(block(quotedPrompt), "\n\n ").concat(returnStatement, "\n "); }));
|
|
4584
|
+
pipelineString = validatePipelineString(spaceTrim__default["default"](function (block) { return "\n # ".concat(DEFAULT_BOOK_TITLE, "\n\n ## Prompt\n\n ```\n ").concat(block(prompt), "\n ```\n\n ").concat(returnStatement, "\n "); }));
|
|
4638
4585
|
// <- TODO: Maybe use book` notation
|
|
4639
4586
|
return pipelineString;
|
|
4640
4587
|
}
|
|
@@ -5640,7 +5587,7 @@
|
|
|
5640
5587
|
});
|
|
5641
5588
|
}
|
|
5642
5589
|
/**
|
|
5643
|
-
* TODO:
|
|
5590
|
+
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
|
|
5644
5591
|
*/
|
|
5645
5592
|
|
|
5646
5593
|
/**
|