@promptbook/remote-client 0.84.0-20 → 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 -11
- package/esm/index.es.js +8 -58
- 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/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 +8 -58
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/_packages/deepseek.index.d.ts +0 -8
- 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 };
|
|
@@ -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
|
/**
|
|
@@ -4518,21 +4512,6 @@
|
|
|
4518
4512
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4519
4513
|
*/
|
|
4520
4514
|
|
|
4521
|
-
/**
|
|
4522
|
-
* Checks if value is valid email
|
|
4523
|
-
*
|
|
4524
|
-
* @public exported from `@promptbook/utils`
|
|
4525
|
-
*/
|
|
4526
|
-
function isValidEmail(email) {
|
|
4527
|
-
if (typeof email !== 'string') {
|
|
4528
|
-
return false;
|
|
4529
|
-
}
|
|
4530
|
-
if (email.split('\n').length > 1) {
|
|
4531
|
-
return false;
|
|
4532
|
-
}
|
|
4533
|
-
return /^.+@.+\..+$/.test(email);
|
|
4534
|
-
}
|
|
4535
|
-
|
|
4536
4515
|
/**
|
|
4537
4516
|
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
4538
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.
|
|
@@ -4546,15 +4525,6 @@
|
|
|
4546
4525
|
if (isValidJsonString(pipelineString)) {
|
|
4547
4526
|
throw new ParseError('Expected a book, but got a JSON string');
|
|
4548
4527
|
}
|
|
4549
|
-
else if (isValidUrl(pipelineString)) {
|
|
4550
|
-
throw new ParseError("Expected a book, but got just the URL \"".concat(pipelineString, "\""));
|
|
4551
|
-
}
|
|
4552
|
-
else if (isValidFilePath(pipelineString)) {
|
|
4553
|
-
throw new ParseError("Expected a book, but got just the file path \"".concat(pipelineString, "\""));
|
|
4554
|
-
}
|
|
4555
|
-
else if (isValidEmail(pipelineString)) {
|
|
4556
|
-
throw new ParseError("Expected a book, but got just the email \"".concat(pipelineString, "\""));
|
|
4557
|
-
}
|
|
4558
4528
|
// <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
|
|
4559
4529
|
return pipelineString;
|
|
4560
4530
|
}
|
|
@@ -4590,15 +4560,12 @@
|
|
|
4590
4560
|
pipelineString = removeMarkdownComments(pipelineString);
|
|
4591
4561
|
pipelineString = spaceTrim__default["default"](pipelineString);
|
|
4592
4562
|
var isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
var isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
|
|
4596
|
-
var isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
|
|
4597
|
-
// TODO: [🧉] Also (double)check
|
|
4563
|
+
var isLastLineReturnStatement = pipelineString.split('\n').pop().split('`').join('').startsWith('->');
|
|
4564
|
+
// TODO: Also (double)check
|
|
4598
4565
|
// > const usedCommands
|
|
4599
4566
|
// > const isBlocksUsed
|
|
4600
4567
|
// > const returnStatementCount
|
|
4601
|
-
var isFlat = !isMarkdownBeginningWithHeadline &&
|
|
4568
|
+
var isFlat = !isMarkdownBeginningWithHeadline && isLastLineReturnStatement;
|
|
4602
4569
|
return isFlat;
|
|
4603
4570
|
}
|
|
4604
4571
|
|
|
@@ -4612,26 +4579,9 @@
|
|
|
4612
4579
|
return pipelineString;
|
|
4613
4580
|
}
|
|
4614
4581
|
var pipelineStringLines = pipelineString.split('\n');
|
|
4615
|
-
var
|
|
4616
|
-
var returnStatement;
|
|
4617
|
-
if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
|
|
4618
|
-
// Note: Last line is return statement
|
|
4619
|
-
returnStatement = potentialReturnStatement;
|
|
4620
|
-
}
|
|
4621
|
-
else {
|
|
4622
|
-
// Note: Last line is not a return statement
|
|
4623
|
-
returnStatement = "-> {".concat(DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, "}");
|
|
4624
|
-
pipelineStringLines.push(potentialReturnStatement);
|
|
4625
|
-
}
|
|
4582
|
+
var returnStatement = pipelineStringLines.pop();
|
|
4626
4583
|
var prompt = spaceTrim__default["default"](pipelineStringLines.join('\n'));
|
|
4627
|
-
|
|
4628
|
-
if (prompt.split('\n').length <= 1) {
|
|
4629
|
-
quotedPrompt = "> ".concat(prompt);
|
|
4630
|
-
}
|
|
4631
|
-
else {
|
|
4632
|
-
quotedPrompt = spaceTrim__default["default"](function (block) { return "\n ```\n ".concat(block(prompt.split('`').join('\\`')), "\n ```\n "); });
|
|
4633
|
-
}
|
|
4634
|
-
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 "); }));
|
|
4635
4585
|
// <- TODO: Maybe use book` notation
|
|
4636
4586
|
return pipelineString;
|
|
4637
4587
|
}
|
|
@@ -5637,7 +5587,7 @@
|
|
|
5637
5587
|
});
|
|
5638
5588
|
}
|
|
5639
5589
|
/**
|
|
5640
|
-
* TODO:
|
|
5590
|
+
* TODO: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
|
|
5641
5591
|
*/
|
|
5642
5592
|
|
|
5643
5593
|
/**
|