@promptbook/editable 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 +6 -56
- 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 +6 -56
- 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
|
@@ -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/editable",
|
|
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/editable.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
|
|
@@ -194,12 +194,6 @@
|
|
|
194
194
|
* @public exported from `@promptbook/core`
|
|
195
195
|
*/
|
|
196
196
|
var DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
|
|
197
|
-
/**
|
|
198
|
-
* When the pipeline is flat and no name of return parameter is provided, this name is used
|
|
199
|
-
*
|
|
200
|
-
* @public exported from `@promptbook/core`
|
|
201
|
-
*/
|
|
202
|
-
var DEFAULT_BOOK_OUTPUT_PARAMETER_NAME = 'result';
|
|
203
197
|
// <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
|
|
204
198
|
/**
|
|
205
199
|
* The maximum number of iterations for a loops
|
|
@@ -3880,21 +3874,6 @@
|
|
|
3880
3874
|
return null;
|
|
3881
3875
|
}
|
|
3882
3876
|
|
|
3883
|
-
/**
|
|
3884
|
-
* Checks if value is valid email
|
|
3885
|
-
*
|
|
3886
|
-
* @public exported from `@promptbook/utils`
|
|
3887
|
-
*/
|
|
3888
|
-
function isValidEmail(email) {
|
|
3889
|
-
if (typeof email !== 'string') {
|
|
3890
|
-
return false;
|
|
3891
|
-
}
|
|
3892
|
-
if (email.split('\n').length > 1) {
|
|
3893
|
-
return false;
|
|
3894
|
-
}
|
|
3895
|
-
return /^.+@.+\..+$/.test(email);
|
|
3896
|
-
}
|
|
3897
|
-
|
|
3898
3877
|
/**
|
|
3899
3878
|
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
3900
3879
|
* 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.
|
|
@@ -3908,15 +3887,6 @@
|
|
|
3908
3887
|
if (isValidJsonString(pipelineString)) {
|
|
3909
3888
|
throw new ParseError('Expected a book, but got a JSON string');
|
|
3910
3889
|
}
|
|
3911
|
-
else if (isValidUrl(pipelineString)) {
|
|
3912
|
-
throw new ParseError("Expected a book, but got just the URL \"".concat(pipelineString, "\""));
|
|
3913
|
-
}
|
|
3914
|
-
else if (isValidFilePath(pipelineString)) {
|
|
3915
|
-
throw new ParseError("Expected a book, but got just the file path \"".concat(pipelineString, "\""));
|
|
3916
|
-
}
|
|
3917
|
-
else if (isValidEmail(pipelineString)) {
|
|
3918
|
-
throw new ParseError("Expected a book, but got just the email \"".concat(pipelineString, "\""));
|
|
3919
|
-
}
|
|
3920
3890
|
// <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
|
|
3921
3891
|
return pipelineString;
|
|
3922
3892
|
}
|
|
@@ -3944,15 +3914,12 @@
|
|
|
3944
3914
|
pipelineString = removeMarkdownComments(pipelineString);
|
|
3945
3915
|
pipelineString = spaceTrim__default["default"](pipelineString);
|
|
3946
3916
|
var isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
var isQuoteBlocksUsed = /^>\s+/m.test(pipelineString);
|
|
3950
|
-
var isBlocksUsed = isBacktickBlockUsed || isQuoteBlocksUsed;
|
|
3951
|
-
// TODO: [🧉] Also (double)check
|
|
3917
|
+
var isLastLineReturnStatement = pipelineString.split('\n').pop().split('`').join('').startsWith('->');
|
|
3918
|
+
// TODO: Also (double)check
|
|
3952
3919
|
// > const usedCommands
|
|
3953
3920
|
// > const isBlocksUsed
|
|
3954
3921
|
// > const returnStatementCount
|
|
3955
|
-
var isFlat = !isMarkdownBeginningWithHeadline &&
|
|
3922
|
+
var isFlat = !isMarkdownBeginningWithHeadline && isLastLineReturnStatement;
|
|
3956
3923
|
return isFlat;
|
|
3957
3924
|
}
|
|
3958
3925
|
|
|
@@ -3966,26 +3933,9 @@
|
|
|
3966
3933
|
return pipelineString;
|
|
3967
3934
|
}
|
|
3968
3935
|
var pipelineStringLines = pipelineString.split('\n');
|
|
3969
|
-
var
|
|
3970
|
-
var returnStatement;
|
|
3971
|
-
if (/(-|=)>\s*\{.*\}/.test(potentialReturnStatement)) {
|
|
3972
|
-
// Note: Last line is return statement
|
|
3973
|
-
returnStatement = potentialReturnStatement;
|
|
3974
|
-
}
|
|
3975
|
-
else {
|
|
3976
|
-
// Note: Last line is not a return statement
|
|
3977
|
-
returnStatement = "-> {".concat(DEFAULT_BOOK_OUTPUT_PARAMETER_NAME, "}");
|
|
3978
|
-
pipelineStringLines.push(potentialReturnStatement);
|
|
3979
|
-
}
|
|
3936
|
+
var returnStatement = pipelineStringLines.pop();
|
|
3980
3937
|
var prompt = spaceTrim__default["default"](pipelineStringLines.join('\n'));
|
|
3981
|
-
|
|
3982
|
-
if (prompt.split('\n').length <= 1) {
|
|
3983
|
-
quotedPrompt = "> ".concat(prompt);
|
|
3984
|
-
}
|
|
3985
|
-
else {
|
|
3986
|
-
quotedPrompt = spaceTrim__default["default"](function (block) { return "\n ```\n ".concat(block(prompt.split('`').join('\\`')), "\n ```\n "); });
|
|
3987
|
-
}
|
|
3988
|
-
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 "); }));
|
|
3938
|
+
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 "); }));
|
|
3989
3939
|
// <- TODO: Maybe use book` notation
|
|
3990
3940
|
return pipelineString;
|
|
3991
3941
|
}
|