@promptbook/markdown-utils 0.84.0-9 → 0.84.0

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 (43) hide show
  1. package/README.md +21 -9
  2. package/esm/index.es.js +271 -164
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/cli.index.d.ts +4 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +12 -2
  6. package/esm/typings/src/_packages/deepseek.index.d.ts +8 -0
  7. package/esm/typings/src/_packages/types.index.d.ts +2 -0
  8. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  9. package/esm/typings/src/_packages/wizzard.index.d.ts +4 -0
  10. package/esm/typings/src/cli/cli-commands/about.d.ts +4 -1
  11. package/esm/typings/src/cli/cli-commands/hello.d.ts +3 -1
  12. package/esm/typings/src/cli/cli-commands/list-models.d.ts +3 -1
  13. package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +13 -0
  14. package/esm/typings/src/cli/cli-commands/make.d.ts +3 -1
  15. package/esm/typings/src/cli/cli-commands/prettify.d.ts +3 -1
  16. package/esm/typings/src/cli/cli-commands/run.d.ts +3 -1
  17. package/esm/typings/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
  18. package/esm/typings/src/cli/cli-commands/test-command.d.ts +3 -1
  19. package/esm/typings/src/config.d.ts +27 -1
  20. package/esm/typings/src/conversion/compilePipelineOnRemoteServer.d.ts +1 -1
  21. package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
  22. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +3 -1
  23. package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +9 -0
  24. package/esm/typings/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +9 -0
  25. package/esm/typings/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +14 -0
  26. package/esm/typings/src/llm-providers/deepseek/register-configuration.d.ts +14 -0
  27. package/esm/typings/src/llm-providers/deepseek/register-constructor.d.ts +15 -0
  28. package/esm/typings/src/pipeline/book-notation.d.ts +3 -2
  29. package/esm/typings/src/pipeline/prompt-notation.d.ts +18 -5
  30. package/esm/typings/src/prepare/preparePipelineOnRemoteServer.d.ts +1 -1
  31. package/esm/typings/src/remote-server/socket-types/_subtypes/PromptbookServer_Identification.d.ts +5 -2
  32. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.test.d.ts +1 -0
  33. package/esm/typings/src/utils/editable/utils/isFlatPipeline.test.d.ts +1 -0
  34. package/esm/typings/src/utils/environment/$isRunningInBrowser.d.ts +3 -0
  35. package/esm/typings/src/utils/environment/$isRunningInJest.d.ts +3 -0
  36. package/esm/typings/src/utils/environment/$isRunningInNode.d.ts +3 -0
  37. package/esm/typings/src/utils/environment/$isRunningInWebWorker.d.ts +3 -0
  38. package/esm/typings/src/utils/files/mimeTypeToExtension.d.ts +10 -0
  39. package/esm/typings/src/utils/files/mimeTypeToExtension.test.d.ts +1 -0
  40. package/esm/typings/src/wizzard/wizzard.d.ts +7 -1
  41. package/package.json +7 -14
  42. package/umd/index.umd.js +272 -165
  43. package/umd/index.umd.js.map +1 -1
@@ -4,6 +4,8 @@ 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';
7
9
  import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
8
10
  import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
9
11
  import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
@@ -30,6 +32,8 @@ export { _AnthropicClaudeMetadataRegistration };
30
32
  export { _AnthropicClaudeRegistration };
31
33
  export { _AzureOpenAiMetadataRegistration };
32
34
  export { _AzureOpenAiRegistration };
35
+ export { _DeepseekMetadataRegistration };
36
+ export { _DeepseekRegistration };
33
37
  export { _GoogleMetadataRegistration };
34
38
  export { _GoogleRegistration };
35
39
  export { _OpenAiMetadataRegistration };
@@ -12,6 +12,9 @@ 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';
15
18
  import { MAX_FILENAME_LENGTH } from '../config';
16
19
  import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
17
20
  import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
@@ -19,7 +22,8 @@ import { DEFAULT_MAX_EXECUTION_ATTEMPTS } from '../config';
19
22
  import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH } from '../config';
20
23
  import { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL } from '../config';
21
24
  import { DEFAULT_BOOKS_DIRNAME } from '../config';
22
- import { DEFAULT_EXECUTIONS_CACHE_DIRNAME } from '../config';
25
+ import { DEFAULT_DOWNLOAD_CACHE_DIRNAME } from '../config';
26
+ import { DEFAULT_EXECUTION_CACHE_DIRNAME } from '../config';
23
27
  import { DEFAULT_SCRAPE_CACHE_DIRNAME } from '../config';
24
28
  import { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME } from '../config';
25
29
  import { DEFAULT_REMOTE_URL } from '../config';
@@ -88,6 +92,7 @@ import { countTotalUsage } from '../llm-providers/_common/utils/count-total-usag
88
92
  import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
89
93
  import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
90
94
  import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
95
+ import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
91
96
  import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
92
97
  import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
93
98
  import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlmExecutionTools';
@@ -138,6 +143,9 @@ export { LOGO_LIGHT_SRC };
138
143
  export { LOGO_DARK_SRC };
139
144
  export { DEFAULT_BOOK_TITLE };
140
145
  export { DEFAULT_TASK_TITLE };
146
+ export { DEFAULT_PROMPT_TASK_TITLE };
147
+ export { DEFAULT_BOOK_OUTPUT_PARAMETER_NAME };
148
+ export { DEFAULT_MAX_FILE_SIZE };
141
149
  export { MAX_FILENAME_LENGTH };
142
150
  export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
143
151
  export { DEFAULT_MAX_PARALLEL_COUNT };
@@ -145,7 +153,8 @@ export { DEFAULT_MAX_EXECUTION_ATTEMPTS };
145
153
  export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH };
146
154
  export { DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL };
147
155
  export { DEFAULT_BOOKS_DIRNAME };
148
- export { DEFAULT_EXECUTIONS_CACHE_DIRNAME };
156
+ export { DEFAULT_DOWNLOAD_CACHE_DIRNAME };
157
+ export { DEFAULT_EXECUTION_CACHE_DIRNAME };
149
158
  export { DEFAULT_SCRAPE_CACHE_DIRNAME };
150
159
  export { DEFAULT_PIPELINE_COLLECTION_BASE_FILENAME };
151
160
  export { DEFAULT_REMOTE_URL };
@@ -214,6 +223,7 @@ export { countTotalUsage };
214
223
  export { limitTotalUsage };
215
224
  export { _AnthropicClaudeMetadataRegistration };
216
225
  export { _AzureOpenAiMetadataRegistration };
226
+ export { _DeepseekMetadataRegistration };
217
227
  export { _GoogleMetadataRegistration };
218
228
  export { joinLlmExecutionTools };
219
229
  export { MultipleLlmExecutionTools };
@@ -0,0 +1,8 @@
1
+ import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
+ import { createDeepseekExecutionTools } from '../llm-providers/deepseek/createDeepseekExecutionTools';
3
+ import type { DeepseekExecutionToolsOptions } from '../llm-providers/deepseek/DeepseekExecutionToolsOptions';
4
+ import { _DeepseekRegistration } from '../llm-providers/deepseek/register-constructor';
5
+ export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
6
+ export { createDeepseekExecutionTools };
7
+ export type { DeepseekExecutionToolsOptions };
8
+ export { _DeepseekRegistration };
@@ -70,6 +70,7 @@ 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';
73
74
  import type { GoogleExecutionToolsOptions } from '../llm-providers/google/GoogleExecutionToolsOptions';
74
75
  import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
75
76
  import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
@@ -344,6 +345,7 @@ export type { AnthropicClaudeExecutionToolsOptions };
344
345
  export type { AnthropicClaudeExecutionToolsDirectOptions };
345
346
  export type { AnthropicClaudeExecutionToolsProxiedOptions };
346
347
  export type { AzureOpenAiExecutionToolsOptions };
348
+ export type { DeepseekExecutionToolsOptions };
347
349
  export type { GoogleExecutionToolsOptions };
348
350
  export type { OpenAiAssistantExecutionToolsOptions };
349
351
  export type { OpenAiExecutionToolsOptions };
@@ -8,6 +8,7 @@ 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';
11
12
  import { $getCurrentDate } from '../utils/$getCurrentDate';
12
13
  import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
13
14
  import { $isRunningInJest } from '../utils/environment/$isRunningInJest';
@@ -89,6 +90,7 @@ export { serializeError };
89
90
  export { forEachAsync };
90
91
  export { isValidJsonString };
91
92
  export { prompt };
93
+ export { promptTemplate };
92
94
  export { $getCurrentDate };
93
95
  export { $isRunningInBrowser };
94
96
  export { $isRunningInJest };
@@ -3,6 +3,8 @@ 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';
6
8
  import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
7
9
  import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
8
10
  import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
@@ -29,6 +31,8 @@ export { _AnthropicClaudeMetadataRegistration };
29
31
  export { _AnthropicClaudeRegistration };
30
32
  export { _AzureOpenAiMetadataRegistration };
31
33
  export { _AzureOpenAiRegistration };
34
+ export { _DeepseekMetadataRegistration };
35
+ export { _DeepseekRegistration };
32
36
  export { _GoogleMetadataRegistration };
33
37
  export { _GoogleRegistration };
34
38
  export { _OpenAiMetadataRegistration };
@@ -2,10 +2,13 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializeAboutCommand(program: Program): void;
9
+ export declare function $initializeAboutCommand(program: Program): void;
8
10
  /**
11
+ * TODO: !!! Test this in `deno`
9
12
  * TODO: [🗽] Unite branding and make single place for it
10
13
  * Note: [💞] Ignore a discrepancy between file name and entity name
11
14
  * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
@@ -2,9 +2,11 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializeHelloCommand(program: Program): void;
9
+ export declare function $initializeHelloCommand(program: Program): void;
8
10
  /**
9
11
  * TODO: [🧠][🐣] Make here some easter egg with generated hello greeting via LLM models
10
12
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2,9 +2,11 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializeListModelsCommand(program: Program): void;
9
+ export declare function $initializeListModelsCommand(program: Program): void;
8
10
  /**
9
11
  * Note: [💞] Ignore a discrepancy between file name and entity name
10
12
  * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
@@ -0,0 +1,13 @@
1
+ import type { Command as Program } from 'commander';
2
+ /**
3
+ * Initializes `list-scrapers` command for Promptbook CLI utilities
4
+ *
5
+ * Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI
6
+ *
7
+ * @private internal function of `promptbookCli`
8
+ */
9
+ export declare function $initializeListScrapersCommand(program: Program): void;
10
+ /**
11
+ * Note: [💞] Ignore a discrepancy between file name and entity name
12
+ * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
13
+ */
@@ -2,9 +2,11 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializeMakeCommand(program: Program): void;
9
+ export declare function $initializeMakeCommand(program: Program): void;
8
10
  /**
9
11
  * TODO: [🥃][main] !!3 Allow `ptbk make` without configuring any llm tools
10
12
  * TODO: [0] DRY Javascript and typescript - Maybe make ONLY typescript and for javascript just remove types
@@ -2,9 +2,11 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializePrettifyCommand(program: Program): void;
9
+ export declare function $initializePrettifyCommand(program: Program): void;
8
10
  /**
9
11
  * TODO: [😶] Unite floder listing
10
12
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2,9 +2,11 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializeRunCommand(program: Program): void;
9
+ export declare function $initializeRunCommand(program: Program): void;
8
10
  /**
9
11
  * TODO: !!5 Catch and wrap all errors from CLI
10
12
  * TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
@@ -1,5 +1,5 @@
1
- import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
2
1
  import type { PipelineExecutor } from '../../execution/PipelineExecutor';
2
+ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
3
3
  /**
4
4
  * Options for running the interactive chatbot
5
5
  */
@@ -2,9 +2,11 @@ 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
+ *
5
7
  * @private internal function of `promptbookCli`
6
8
  */
7
- export declare function initializeTestCommand(program: Program): void;
9
+ export declare function $initializeTestCommand(program: Program): void;
8
10
  /**
9
11
  * TODO: [😶] Unite floder listing
10
12
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -65,6 +65,24 @@ 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;
68
86
  /**
69
87
  * Warning message for the generated sections and files files
70
88
  *
@@ -166,6 +184,14 @@ export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
166
184
  * @public exported from `@promptbook/core`
167
185
  */
168
186
  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";
169
195
  /**
170
196
  * Where to store the cache of executions for promptbook CLI
171
197
  *
@@ -173,7 +199,7 @@ export declare const DEFAULT_BOOKS_DIRNAME = "./books";
173
199
  *
174
200
  * @public exported from `@promptbook/core`
175
201
  */
176
- export declare const DEFAULT_EXECUTIONS_CACHE_DIRNAME = "./.promptbook/executions-cache";
202
+ export declare const DEFAULT_EXECUTION_CACHE_DIRNAME = "./.promptbook/execution-cache";
177
203
  /**
178
204
  * Where to store the scrape cache
179
205
  *
@@ -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: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
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' | 'mkdir'>;
7
7
  /**
8
8
  * TODO: Implement destroyable pattern to free resources
9
9
  */
@@ -2,11 +2,13 @@ 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
+ *
5
7
  * @param executionResult - The partial result of the Promptbook execution
6
8
  * @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
7
9
  * @public exported from `@promptbook/core`
8
10
  */
9
- export declare function assertsExecutionSuccessful(executionResult: Pick<PipelineExecutorResult, 'isSuccessful' | 'errors'>): void;
11
+ export declare function assertsExecutionSuccessful(executionResult: Pick<PipelineExecutorResult, 'isSuccessful' | 'errors' | 'warnings'>): void;
10
12
  /**
11
13
  * TODO: [🐚] This function should be removed OR changed OR be completely rewritten
12
14
  * TODO: [🧠] Can this return type be better typed than void
@@ -1,4 +1,13 @@
1
+ import type { string_filename } from '../../../types/typeAliases';
1
2
  import type { string_markdown } from '../../../types/typeAliases';
3
+ /**
4
+ * Pass the `.env` file which was used to configure LLM tools
5
+ *
6
+ * Note: `$` is used to indicate that this variable is making side effect
7
+ *
8
+ * @private internal log of `$provideLlmToolsConfigurationFromEnv` and `$registeredLlmToolsMessage`
9
+ */
10
+ export declare function $setUsedEnvFilename(filepath: string_filename): void;
2
11
  /**
3
12
  * Creates a message with all registered LLM tools
4
13
  *
@@ -0,0 +1,9 @@
1
+ import type { createDeepSeek } from '@ai-sdk/deepseek';
2
+ import type { VercelExecutionToolsOptions } from '../vercel/VercelExecutionToolsOptions';
3
+ /**
4
+ * Options for `DeepseekExecutionTools`
5
+ *
6
+ * This combines options for Promptbook, Deepseek and Vercel together
7
+ * @public exported from `@promptbook/deepseek`
8
+ */
9
+ export type DeepseekExecutionToolsOptions = Omit<VercelExecutionToolsOptions, 'title' | 'description' | 'vercelProvider' | 'availableModels'> & Parameters<typeof createDeepSeek>[0];
@@ -0,0 +1,14 @@
1
+ import type { LlmExecutionTools } from '../../execution/LlmExecutionTools';
2
+ import type { DeepseekExecutionToolsOptions } from './DeepseekExecutionToolsOptions';
3
+ /**
4
+ * Execution Tools for calling Deepseek API.
5
+ *
6
+ * @public exported from `@promptbook/deepseek`
7
+ */
8
+ export declare const createDeepseekExecutionTools: ((options: DeepseekExecutionToolsOptions) => LlmExecutionTools) & {
9
+ packageName: string;
10
+ className: string;
11
+ };
12
+ /**
13
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
14
+ */
@@ -0,0 +1,14 @@
1
+ import type { Registration } from '../../utils/$Register';
2
+ /**
3
+ * Registration of LLM provider metadata
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
+ *
7
+ * @public exported from `@promptbook/core`
8
+ * @public exported from `@promptbook/wizzard`
9
+ * @public exported from `@promptbook/cli`
10
+ */
11
+ export declare const _DeepseekMetadataRegistration: Registration;
12
+ /**
13
+ * Note: [💞] Ignore a discrepancy between file name and entity name
14
+ */
@@ -0,0 +1,15 @@
1
+ import type { Registration } from '../../utils/$Register';
2
+ /**
3
+ * Registration of LLM provider
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available LLM tools
6
+ *
7
+ * @public exported from `@promptbook/deepseek`
8
+ * @public exported from `@promptbook/wizzard`
9
+ * @public exported from `@promptbook/cli`
10
+ */
11
+ export declare const _DeepseekRegistration: Registration;
12
+ /**
13
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
14
+ * Note: [💞] Ignore a discrepancy between file name and entity name
15
+ */
@@ -2,9 +2,10 @@ 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 2 similar functions:
5
+ * Note: There are 3 similar functions:
6
6
  * 1) `prompt` for notating single prompt exported from `@promptbook/utils`
7
- * 1) `book` for notating and validating entire books exported from `@promptbook/utils`
7
+ * 2) `promptTemplate` alias for `prompt`
8
+ * 3) `book` for notating and validating entire books exported from `@promptbook/utils`
8
9
  *
9
10
  * @param strings @@@
10
11
  * @param values @@@
@@ -2,16 +2,29 @@ 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 2 similar functions:
5
+ * Note: There are 3 similar functions:
6
6
  * 1) `prompt` for notating single prompt exported from `@promptbook/utils`
7
- * 1) `book` for notating and validating entire books exported from `@promptbook/utils`
7
+ * 2) `promptTemplate` alias for `prompt`
8
+ * 3) `book` for notating and validating entire books exported from `@promptbook/utils`
8
9
  *
9
- * @param strings @@@
10
- * @param values @@@
11
- * @returns the pipeline string
10
+ * @param strings
11
+ * @param values
12
+ * @returns the prompt string
12
13
  * @public exported from `@promptbook/utils`
13
14
  */
14
15
  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;
15
28
  /**
16
29
  * TODO: [🧠][🈴] Where is the best location for this file
17
30
  * 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: !!!! Do not return Promise<PipelineJson> But PreparePipelineTask
16
+ * TODO: [🐚] Do not return Promise<PipelineJson> But PreparePipelineTask
17
17
  */
@@ -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 situation when you run known and well-defined books with your own api keys
13
13
  *
14
14
  * @public exported from `@promptbook/remote-server`
15
15
  * @public exported from `@promptbook/remote-client`
@@ -21,7 +21,10 @@ export type PromptbookServer_ApplicationIdentification<TCustomOptions> = Applica
21
21
  readonly isAnonymous: false;
22
22
  };
23
23
  /**
24
- * Anonymous mode is @@@!!!
24
+ * Anonymous mode is when you run arbitrary user books without api keys from user
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
25
28
  *
26
29
  * @public exported from `@promptbook/remote-server`
27
30
  * @public exported from `@promptbook/remote-client`
@@ -6,3 +6,6 @@
6
6
  * @public exported from `@promptbook/utils`
7
7
  */
8
8
  export declare const $isRunningInBrowser: Function;
9
+ /**
10
+ * TODO: [☑]
11
+ */
@@ -6,3 +6,6 @@
6
6
  * @public exported from `@promptbook/utils`
7
7
  */
8
8
  export declare const $isRunningInJest: Function;
9
+ /**
10
+ * TODO: [☑]
11
+ */
@@ -6,3 +6,6 @@
6
6
  * @public exported from `@promptbook/utils`
7
7
  */
8
8
  export declare const $isRunningInNode: Function;
9
+ /**
10
+ * TODO: [☑]
11
+ */
@@ -6,3 +6,6 @@
6
6
  * @public exported from `@promptbook/utils`
7
7
  */
8
8
  export declare const $isRunningInWebWorker: Function;
9
+ /**
10
+ * TODO: [☑]
11
+ */
@@ -0,0 +1,10 @@
1
+ import type { string_file_extension } from '../../types/typeAliases';
2
+ import type { string_mime_type } from '../../types/typeAliases';
3
+ /**
4
+ * Convert mime type to file extension
5
+ *
6
+ * Note: If the mime type is invalid, `null` is returned
7
+ *
8
+ * @private within the repository
9
+ */
10
+ export declare function mimeTypeToExtension(value: string_mime_type): string_file_extension | null;
@@ -6,6 +6,7 @@ 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';
9
10
  import type { string_pipeline_url } from '../types/typeAliases';
10
11
  /**
11
12
  * Wizzard for simple usage of the Promptbook
@@ -27,7 +28,12 @@ declare class Wizzard {
27
28
  *
28
29
  * Note: This works simmilar to the `ptbk run` command
29
30
  */
30
- execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
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>;
31
37
  private executionTools;
32
38
  /**
33
39
  * Provides the tools automatically for the Node.js environment
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@promptbook/markdown-utils",
3
- "version": "0.84.0-9",
3
+ "version": "0.84.0",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
- "--note-0": " <- [🐊]",
6
5
  "private": false,
7
6
  "sideEffects": false,
8
7
  "repository": {
9
8
  "type": "git",
10
9
  "url": "https://github.com/webgptorg/promptbook"
11
10
  },
11
+ "author": "Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)",
12
12
  "contributors": [
13
- "Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)"
13
+ "Pavol Hejný <pavol@ptbk.io> (https://www.pavolhejny.com/)",
14
+ "Jiří Jahn <jiri@ptbk.io> (https://www.ptbk.io/)"
14
15
  ],
15
- "--todo-0": "TODO: [❇️] Make better list of keywords",
16
16
  "keywords": [
17
17
  "ai",
18
18
  "llm",
@@ -25,6 +25,9 @@
25
25
  "natural-language-processing",
26
26
  "nlp",
27
27
  "openai",
28
+ "o3",
29
+ "o3-mini",
30
+ "deepseek",
28
31
  "gpt-3",
29
32
  "gpt-4",
30
33
  "gpt-4o",
@@ -40,16 +43,6 @@
40
43
  "url": "https://github.com/webgptorg/promptbook/issues"
41
44
  },
42
45
  "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
- ],
53
46
  "main": "./umd/index.umd.js",
54
47
  "module": "./esm/index.es.js",
55
48
  "typings": "./esm/typings/src/_packages/markdown-utils.index.d.ts",