@promptbook/markdown-utils 0.80.0-1 → 0.81.0-11
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 +3 -0
- package/esm/index.es.js +149 -40
- package/esm/index.es.js.map +1 -1
- package/esm/typings/books/index.d.ts +15 -0
- package/esm/typings/src/_packages/core.index.d.ts +2 -6
- package/esm/typings/src/_packages/editable.index.d.ts +10 -0
- package/esm/typings/src/_packages/templates.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +6 -0
- package/esm/typings/src/_packages/utils.index.d.ts +10 -2
- package/esm/typings/src/_packages/wizzard.index.d.ts +44 -0
- package/esm/typings/src/config.d.ts +26 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +7 -0
- package/esm/typings/src/execution/PipelineExecutor.d.ts +2 -2
- package/esm/typings/src/execution/PromptbookFetch.d.ts +5 -0
- package/esm/typings/src/execution/PromptbookFetch.test-type.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +2 -2
- package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +2 -1
- package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +2 -1
- package/esm/typings/src/high-level-abstractions/index.d.ts +10 -0
- package/esm/typings/src/llm-providers/_common/register/{$provideLlmToolsForCli.d.ts → $provideLlmToolsForWizzardOrCli.d.ts} +2 -2
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +1 -0
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +2 -0
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +1 -0
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -0
- package/esm/typings/src/llm-providers/google/register-configuration.d.ts +1 -0
- package/esm/typings/src/llm-providers/google/register-constructor.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -0
- package/esm/typings/src/other/templates/getBookTemplate.d.ts +21 -0
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +10 -0
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +10 -0
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/utils/scraperFetch.d.ts +7 -0
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -0
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -0
- package/esm/typings/src/types/typeAliases.d.ts +8 -0
- package/esm/typings/src/utils/editable/types/PipelineEditableSerialized.d.ts +27 -0
- package/esm/typings/src/{conversion → utils/editable}/utils/removePipelineCommand.d.ts +3 -3
- package/esm/typings/src/{conversion → utils/editable}/utils/renamePipelineParameter.d.ts +3 -3
- package/esm/typings/src/{conversion → utils/editable}/utils/stringifyPipelineJson.d.ts +2 -2
- package/esm/typings/src/utils/parameters/numberToString.d.ts +7 -0
- package/esm/typings/src/utils/parameters/{replaceParameters.d.ts → templateParameters.d.ts} +6 -2
- package/esm/typings/src/utils/parameters/valueToString.d.ts +17 -0
- package/esm/typings/src/utils/parameters/valueToString.test.d.ts +1 -0
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +4 -0
- package/esm/typings/src/version.d.ts +7 -0
- package/esm/typings/src/wizzard/wizzard.d.ts +51 -0
- package/package.json +1 -1
- package/umd/index.umd.js +149 -40
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/utils/formatNumber.d.ts +0 -6
- /package/esm/typings/src/{conversion → utils/editable}/utils/removePipelineCommand.test.d.ts +0 -0
- /package/esm/typings/src/{conversion → utils/editable}/utils/renamePipelineParameter.test.d.ts +0 -0
- /package/esm/typings/src/{conversion → utils/editable}/utils/stringifyPipelineJson.test.d.ts +0 -0
- /package/esm/typings/src/utils/{formatNumber.test.d.ts → parameters/numberToString.test.d.ts} +0 -0
- /package/esm/typings/src/utils/parameters/{replaceParameters.test.d.ts → templateParameters.test.d.ts} +0 -0
|
@@ -20,6 +20,11 @@ declare const _default: ({
|
|
|
20
20
|
preparations: never[];
|
|
21
21
|
knowledgeSources: never[];
|
|
22
22
|
knowledgePieces: never[];
|
|
23
|
+
sources: {
|
|
24
|
+
type: string;
|
|
25
|
+
path: null;
|
|
26
|
+
content: string;
|
|
27
|
+
}[];
|
|
23
28
|
sourceFile: string;
|
|
24
29
|
} | {
|
|
25
30
|
title: string;
|
|
@@ -49,6 +54,11 @@ declare const _default: ({
|
|
|
49
54
|
preparations: never[];
|
|
50
55
|
knowledgeSources: never[];
|
|
51
56
|
knowledgePieces: never[];
|
|
57
|
+
sources: {
|
|
58
|
+
type: string;
|
|
59
|
+
path: null;
|
|
60
|
+
content: string;
|
|
61
|
+
}[];
|
|
52
62
|
sourceFile: string;
|
|
53
63
|
} | {
|
|
54
64
|
title: string;
|
|
@@ -73,6 +83,11 @@ declare const _default: ({
|
|
|
73
83
|
preparations: never[];
|
|
74
84
|
knowledgeSources: never[];
|
|
75
85
|
knowledgePieces: never[];
|
|
86
|
+
sources: {
|
|
87
|
+
type: string;
|
|
88
|
+
path: null;
|
|
89
|
+
content: string;
|
|
90
|
+
}[];
|
|
76
91
|
sourceFile: string;
|
|
77
92
|
})[];
|
|
78
93
|
export default _default;
|
|
@@ -27,6 +27,7 @@ import { DEFAULT_CSV_SETTINGS } from '../config';
|
|
|
27
27
|
import { DEFAULT_IS_VERBOSE } from '../config';
|
|
28
28
|
import { SET_IS_VERBOSE } from '../config';
|
|
29
29
|
import { DEFAULT_IS_AUTO_INSTALLED } from '../config';
|
|
30
|
+
import { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME } from '../config';
|
|
30
31
|
import { ORDER_OF_PIPELINE_JSON } from '../constants';
|
|
31
32
|
import { RESERVED_PARAMETER_NAMES } from '../constants';
|
|
32
33
|
import { compilePipeline } from '../conversion/compilePipeline';
|
|
@@ -34,9 +35,6 @@ import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
|
|
|
34
35
|
import { precompilePipeline } from '../conversion/precompilePipeline';
|
|
35
36
|
import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
|
|
36
37
|
import { extractParameterNamesFromTask } from '../conversion/utils/extractParameterNamesFromTask';
|
|
37
|
-
import { removePipelineCommand } from '../conversion/utils/removePipelineCommand';
|
|
38
|
-
import { renamePipelineParameter } from '../conversion/utils/renamePipelineParameter';
|
|
39
|
-
import { stringifyPipelineJson } from '../conversion/utils/stringifyPipelineJson';
|
|
40
38
|
import { validatePipeline } from '../conversion/validation/validatePipeline';
|
|
41
39
|
import { CallbackInterfaceTools } from '../dialogs/callback/CallbackInterfaceTools';
|
|
42
40
|
import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
|
|
@@ -148,6 +146,7 @@ export { DEFAULT_CSV_SETTINGS };
|
|
|
148
146
|
export { DEFAULT_IS_VERBOSE };
|
|
149
147
|
export { SET_IS_VERBOSE };
|
|
150
148
|
export { DEFAULT_IS_AUTO_INSTALLED };
|
|
149
|
+
export { DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME };
|
|
151
150
|
export { ORDER_OF_PIPELINE_JSON };
|
|
152
151
|
export { RESERVED_PARAMETER_NAMES };
|
|
153
152
|
export { compilePipeline };
|
|
@@ -155,9 +154,6 @@ export { pipelineJsonToString };
|
|
|
155
154
|
export { precompilePipeline };
|
|
156
155
|
export { prettifyPipelineString };
|
|
157
156
|
export { extractParameterNamesFromTask };
|
|
158
|
-
export { removePipelineCommand };
|
|
159
|
-
export { renamePipelineParameter };
|
|
160
|
-
export { stringifyPipelineJson };
|
|
161
157
|
export { validatePipeline };
|
|
162
158
|
export { CallbackInterfaceTools };
|
|
163
159
|
export type { CallbackInterfaceToolsOptions };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import type { PipelineEditableSerialized } from '../utils/editable/types/PipelineEditableSerialized';
|
|
3
|
+
import { removePipelineCommand } from '../utils/editable/utils/removePipelineCommand';
|
|
4
|
+
import { renamePipelineParameter } from '../utils/editable/utils/renamePipelineParameter';
|
|
5
|
+
import { stringifyPipelineJson } from '../utils/editable/utils/stringifyPipelineJson';
|
|
6
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
7
|
+
export type { PipelineEditableSerialized };
|
|
8
|
+
export { removePipelineCommand };
|
|
9
|
+
export { renamePipelineParameter };
|
|
10
|
+
export { stringifyPipelineJson };
|
|
@@ -30,6 +30,7 @@ import type { LlmExecutionTools } from '../execution/LlmExecutionTools';
|
|
|
30
30
|
import type { LlmExecutionToolsConstructor } from '../execution/LlmExecutionToolsConstructor';
|
|
31
31
|
import type { PipelineExecutor } from '../execution/PipelineExecutor';
|
|
32
32
|
import type { PipelineExecutorResult } from '../execution/PipelineExecutorResult';
|
|
33
|
+
import type { PromptbookFetch } from '../execution/PromptbookFetch';
|
|
33
34
|
import type { PromptResult } from '../execution/PromptResult';
|
|
34
35
|
import type { CompletionPromptResult } from '../execution/PromptResult';
|
|
35
36
|
import type { ChatPromptResult } from '../execution/PromptResult';
|
|
@@ -142,6 +143,7 @@ import type { string_name } from '../types/typeAliases';
|
|
|
142
143
|
import type { string_parameter_name } from '../types/typeAliases';
|
|
143
144
|
import type { string_parameter_value } from '../types/typeAliases';
|
|
144
145
|
import type { Parameters } from '../types/typeAliases';
|
|
146
|
+
import type { InputParameters } from '../types/typeAliases';
|
|
145
147
|
import type { string_reserved_parameter_name } from '../types/typeAliases';
|
|
146
148
|
import type { ReservedParameters } from '../types/typeAliases';
|
|
147
149
|
import type { string_title } from '../types/typeAliases';
|
|
@@ -241,6 +243,7 @@ import type { number_gigabytes } from '../types/typeAliases';
|
|
|
241
243
|
import type { number_terabytes } from '../types/typeAliases';
|
|
242
244
|
import type { Registered } from '../utils/$Register';
|
|
243
245
|
import type { Registration } from '../utils/$Register';
|
|
246
|
+
import type { PipelineEditableSerialized } from '../utils/editable/types/PipelineEditableSerialized';
|
|
244
247
|
import type { ExecCommandOptions } from '../utils/execCommand/ExecCommandOptions';
|
|
245
248
|
import type { ExecCommandOptionsAdvanced } from '../utils/execCommand/ExecCommandOptions';
|
|
246
249
|
import type { FromtoItems } from '../utils/FromtoItems';
|
|
@@ -292,6 +295,7 @@ export type { LlmExecutionTools };
|
|
|
292
295
|
export type { LlmExecutionToolsConstructor };
|
|
293
296
|
export type { PipelineExecutor };
|
|
294
297
|
export type { PipelineExecutorResult };
|
|
298
|
+
export type { PromptbookFetch };
|
|
295
299
|
export type { PromptResult };
|
|
296
300
|
export type { CompletionPromptResult };
|
|
297
301
|
export type { ChatPromptResult };
|
|
@@ -404,6 +408,7 @@ export type { string_name };
|
|
|
404
408
|
export type { string_parameter_name };
|
|
405
409
|
export type { string_parameter_value };
|
|
406
410
|
export type { Parameters };
|
|
411
|
+
export type { InputParameters };
|
|
407
412
|
export type { string_reserved_parameter_name };
|
|
408
413
|
export type { ReservedParameters };
|
|
409
414
|
export type { string_title };
|
|
@@ -503,6 +508,7 @@ export type { number_gigabytes };
|
|
|
503
508
|
export type { number_terabytes };
|
|
504
509
|
export type { Registered };
|
|
505
510
|
export type { Registration };
|
|
511
|
+
export type { PipelineEditableSerialized };
|
|
506
512
|
export type { ExecCommandOptions };
|
|
507
513
|
export type { ExecCommandOptionsAdvanced };
|
|
508
514
|
export type { FromtoItems };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { VALUE_STRINGS } from '../config';
|
|
3
|
+
import { SMALL_NUMBER } from '../config';
|
|
2
4
|
import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
|
|
3
5
|
import { extractVariablesFromScript } from '../conversion/utils/extractVariablesFromScript';
|
|
4
6
|
import { deserializeError } from '../errors/utils/deserializeError';
|
|
@@ -46,7 +48,9 @@ import { searchKeywords } from '../utils/normalization/searchKeywords';
|
|
|
46
48
|
import { titleToName } from '../utils/normalization/titleToName';
|
|
47
49
|
import { spaceTrim } from '../utils/organization/spaceTrim';
|
|
48
50
|
import { extractParameterNames } from '../utils/parameters/extractParameterNames';
|
|
49
|
-
import {
|
|
51
|
+
import { numberToString } from '../utils/parameters/numberToString';
|
|
52
|
+
import { templateParameters } from '../utils/parameters/templateParameters';
|
|
53
|
+
import { valueToString } from '../utils/parameters/valueToString';
|
|
50
54
|
import { parseNumber } from '../utils/parseNumber';
|
|
51
55
|
import { $randomSeed } from '../utils/random/$randomSeed';
|
|
52
56
|
import { removeEmojis } from '../utils/removeEmojis';
|
|
@@ -74,6 +78,8 @@ import { isValidPipelineUrl } from '../utils/validators/url/isValidPipelineUrl';
|
|
|
74
78
|
import { isValidUrl } from '../utils/validators/url/isValidUrl';
|
|
75
79
|
import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
|
|
76
80
|
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
81
|
+
export { VALUE_STRINGS };
|
|
82
|
+
export { SMALL_NUMBER };
|
|
77
83
|
export { renderPromptbookMermaid };
|
|
78
84
|
export { extractVariablesFromScript };
|
|
79
85
|
export { deserializeError };
|
|
@@ -121,7 +127,9 @@ export { searchKeywords };
|
|
|
121
127
|
export { titleToName };
|
|
122
128
|
export { spaceTrim };
|
|
123
129
|
export { extractParameterNames };
|
|
124
|
-
export {
|
|
130
|
+
export { numberToString };
|
|
131
|
+
export { templateParameters };
|
|
132
|
+
export { valueToString };
|
|
125
133
|
export { parseNumber };
|
|
126
134
|
export { $randomSeed };
|
|
127
135
|
export { removeEmojis };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
|
|
2
|
+
import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
|
|
3
|
+
import { _AnthropicClaudeRegistration } from '../llm-providers/anthropic-claude/register-constructor';
|
|
4
|
+
import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
|
|
5
|
+
import { _AzureOpenAiRegistration } from '../llm-providers/azure-openai/register-constructor';
|
|
6
|
+
import { _GoogleMetadataRegistration } from '../llm-providers/google/register-configuration';
|
|
7
|
+
import { _GoogleRegistration } from '../llm-providers/google/register-constructor';
|
|
8
|
+
import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
9
|
+
import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
|
|
10
|
+
import { _OpenAiRegistration } from '../llm-providers/openai/register-constructor';
|
|
11
|
+
import { _OpenAiAssistantRegistration } from '../llm-providers/openai/register-constructor';
|
|
12
|
+
import { _LegacyDocumentScraperRegistration } from '../scrapers/document-legacy/register-constructor';
|
|
13
|
+
import { _LegacyDocumentScraperMetadataRegistration } from '../scrapers/document-legacy/register-metadata';
|
|
14
|
+
import { _DocumentScraperRegistration } from '../scrapers/document/register-constructor';
|
|
15
|
+
import { _DocumentScraperMetadataRegistration } from '../scrapers/document/register-metadata';
|
|
16
|
+
import { _MarkdownScraperRegistration } from '../scrapers/markdown/register-constructor';
|
|
17
|
+
import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
|
|
18
|
+
import { _PdfScraperRegistration } from '../scrapers/pdf/register-constructor';
|
|
19
|
+
import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
|
|
20
|
+
import { _WebsiteScraperRegistration } from '../scrapers/website/register-constructor';
|
|
21
|
+
import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
|
|
22
|
+
import { wizzard } from '../wizzard/wizzard';
|
|
23
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
|
|
24
|
+
export { _AnthropicClaudeMetadataRegistration };
|
|
25
|
+
export { _AnthropicClaudeRegistration };
|
|
26
|
+
export { _AzureOpenAiMetadataRegistration };
|
|
27
|
+
export { _AzureOpenAiRegistration };
|
|
28
|
+
export { _GoogleMetadataRegistration };
|
|
29
|
+
export { _GoogleRegistration };
|
|
30
|
+
export { _OpenAiMetadataRegistration };
|
|
31
|
+
export { _OpenAiAssistantMetadataRegistration };
|
|
32
|
+
export { _OpenAiRegistration };
|
|
33
|
+
export { _OpenAiAssistantRegistration };
|
|
34
|
+
export { _LegacyDocumentScraperRegistration };
|
|
35
|
+
export { _LegacyDocumentScraperMetadataRegistration };
|
|
36
|
+
export { _DocumentScraperRegistration };
|
|
37
|
+
export { _DocumentScraperMetadataRegistration };
|
|
38
|
+
export { _MarkdownScraperRegistration };
|
|
39
|
+
export { _MarkdownScraperMetadataRegistration };
|
|
40
|
+
export { _PdfScraperRegistration };
|
|
41
|
+
export { _PdfScraperMetadataRegistration };
|
|
42
|
+
export { _WebsiteScraperRegistration };
|
|
43
|
+
export { _WebsiteScraperMetadataRegistration };
|
|
44
|
+
export { wizzard };
|
|
@@ -77,6 +77,26 @@ export declare const LOOP_LIMIT = 1000;
|
|
|
77
77
|
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
78
78
|
*/
|
|
79
79
|
export declare const CHARACTER_LOOP_LIMIT = 100000;
|
|
80
|
+
/**
|
|
81
|
+
* Strings to represent various values in the context of parameter values
|
|
82
|
+
*
|
|
83
|
+
* @public exported from `@promptbook/utils`
|
|
84
|
+
*/
|
|
85
|
+
export declare const VALUE_STRINGS: {
|
|
86
|
+
readonly empty: "(nothing; empty string)";
|
|
87
|
+
readonly null: "(no value; null)";
|
|
88
|
+
readonly undefined: "(unknown value; undefined)";
|
|
89
|
+
readonly nan: "(not a number; NaN)";
|
|
90
|
+
readonly infinity: "(infinity; ∞)";
|
|
91
|
+
readonly negativeInfinity: "(negative infinity; -∞)";
|
|
92
|
+
readonly unserializable: "(unserializable value)";
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Small number limit
|
|
96
|
+
*
|
|
97
|
+
* @public exported from `@promptbook/utils`
|
|
98
|
+
*/
|
|
99
|
+
export declare const SMALL_NUMBER = 0.001;
|
|
80
100
|
/**
|
|
81
101
|
* Timeout for the connections in milliseconds
|
|
82
102
|
*
|
|
@@ -209,6 +229,12 @@ export declare function SET_IS_VERBOSE(isVerbose: boolean): void;
|
|
|
209
229
|
* @public exported from `@promptbook/core`
|
|
210
230
|
*/
|
|
211
231
|
export declare const DEFAULT_IS_AUTO_INSTALLED = false;
|
|
232
|
+
/**
|
|
233
|
+
* Function name for generated function via `ptbk make` to get the pipeline collection
|
|
234
|
+
*
|
|
235
|
+
* @public exported from `@promptbook/core`
|
|
236
|
+
*/
|
|
237
|
+
export declare const DEFAULT_GET_PIPELINE_COLLECTION_FUNCTION_NAME = "getPipelineCollection";
|
|
212
238
|
/**
|
|
213
239
|
* @@@
|
|
214
240
|
*
|
|
@@ -3,6 +3,7 @@ import type { Arrayable } from '../types/Arrayable';
|
|
|
3
3
|
import type { Executables } from './Executables';
|
|
4
4
|
import type { FilesystemTools } from './FilesystemTools';
|
|
5
5
|
import type { LlmExecutionTools } from './LlmExecutionTools';
|
|
6
|
+
import type { PromptbookFetch } from './PromptbookFetch';
|
|
6
7
|
import type { ScriptExecutionTools } from './ScriptExecutionTools';
|
|
7
8
|
import type { UserInterfaceTools } from './UserInterfaceTools';
|
|
8
9
|
/**
|
|
@@ -27,6 +28,12 @@ export type ExecutionTools = {
|
|
|
27
28
|
* @default undefined - If not provided, no filesystem operations will be possible
|
|
28
29
|
*/
|
|
29
30
|
readonly fs?: FilesystemTools;
|
|
31
|
+
/**
|
|
32
|
+
* Fetch function for fetching resources
|
|
33
|
+
*
|
|
34
|
+
* @default `fetch` - If not provided, the built-in `fetch' function is used with a lightweight error handling wrapper.
|
|
35
|
+
*/
|
|
36
|
+
readonly fetch?: PromptbookFetch;
|
|
30
37
|
/**
|
|
31
38
|
* Scrapers for extracting knowledge from external sources
|
|
32
39
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Promisable } from 'type-fest';
|
|
2
2
|
import type { TaskProgress } from '../types/TaskProgress';
|
|
3
|
-
import type {
|
|
3
|
+
import type { InputParameters } from '../types/typeAliases';
|
|
4
4
|
import type { PipelineExecutorResult } from './PipelineExecutorResult';
|
|
5
5
|
/**
|
|
6
6
|
* Executor is a simple async function that takes INPUT PARAMETERs and returns result parameters _(along with all intermediate parameters and INPUT PARAMETERs = it extends input object)_.
|
|
@@ -11,7 +11,7 @@ import type { PipelineExecutorResult } from './PipelineExecutorResult';
|
|
|
11
11
|
* @see https://github.com/webgptorg/promptbook#executor
|
|
12
12
|
*/
|
|
13
13
|
export type PipelineExecutor = {
|
|
14
|
-
(inputParameters:
|
|
14
|
+
(inputParameters: InputParameters, onProgress?: (taskProgress: TaskProgress) => Promisable<void>): Promise<PipelineExecutorResult>;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* TODO: [🐚] Change onProgress to object that represents the running execution, can be subscribed via RxJS to and also awaited
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Promisable, ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
3
|
import type { TaskProgress } from '../../types/TaskProgress';
|
|
4
|
-
import type {
|
|
4
|
+
import type { InputParameters } from '../../types/typeAliases';
|
|
5
5
|
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
6
6
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ type ExecutePipelineOptions = Required<CreatePipelineExecutorOptions> & {
|
|
|
13
13
|
/**
|
|
14
14
|
* @@@
|
|
15
15
|
*/
|
|
16
|
-
readonly inputParameters: Readonly<
|
|
16
|
+
readonly inputParameters: Readonly<InputParameters>;
|
|
17
17
|
/**
|
|
18
18
|
* @@@
|
|
19
19
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { PromptbookFetch } from '../../execution/PromptbookFetch';
|
|
1
2
|
import type { string_name } from '../../types/typeAliases';
|
|
2
3
|
/**
|
|
3
4
|
* @private still in development
|
|
4
5
|
*/
|
|
5
|
-
export declare function isDomainNameFree(name: string_name): Promise<boolean>;
|
|
6
|
+
export declare function isDomainNameFree(name: string_name, fetch: PromptbookFetch): Promise<boolean>;
|
|
6
7
|
/**
|
|
7
8
|
* TODO: [🍓][🧠] Test and implement `isDomainNameFree`
|
|
8
9
|
* TODO: Export via some (and probably new) NPM package
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { PromptbookFetch } from '../../execution/PromptbookFetch';
|
|
1
2
|
import type { string_name } from '../../types/typeAliases';
|
|
2
3
|
/**
|
|
3
4
|
* @private still in development
|
|
4
5
|
*/
|
|
5
|
-
export declare function isGithubNameFree(name: string_name): Promise<boolean>;
|
|
6
|
+
export declare function isGithubNameFree(name: string_name, fetch: PromptbookFetch): Promise<boolean>;
|
|
6
7
|
/**
|
|
7
8
|
* TODO: [🍓][🧠] Test and implement `isGithubNameFree`
|
|
8
9
|
* TODO: Export via some (and probably new) NPM package
|
|
@@ -18,6 +18,11 @@ export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
|
|
|
18
18
|
readonly knowledgePieces: import("../_packages/types.index").KnowledgePiecePreparedJson[];
|
|
19
19
|
readonly personas: (import("../_packages/types.index").PersonaJson | import("../_packages/types.index").PersonaPreparedJson)[];
|
|
20
20
|
readonly preparations: import("../_packages/types.index").PreparationJson[];
|
|
21
|
+
readonly sources: readonly {
|
|
22
|
+
type: "BOOK";
|
|
23
|
+
path: string | null;
|
|
24
|
+
content: import("../pipeline/PipelineString").PipelineString;
|
|
25
|
+
}[];
|
|
21
26
|
readonly formfactorName?: "CHATBOT" | "GENERATOR" | "GENERIC" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
|
|
22
27
|
}>): void;
|
|
23
28
|
}, {
|
|
@@ -35,6 +40,11 @@ export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
|
|
|
35
40
|
readonly knowledgePieces: import("../_packages/types.index").KnowledgePiecePreparedJson[];
|
|
36
41
|
readonly personas: (import("../_packages/types.index").PersonaJson | import("../_packages/types.index").PersonaPreparedJson)[];
|
|
37
42
|
readonly preparations: import("../_packages/types.index").PreparationJson[];
|
|
43
|
+
readonly sources: readonly {
|
|
44
|
+
type: "BOOK";
|
|
45
|
+
path: string | null;
|
|
46
|
+
content: import("../pipeline/PipelineString").PipelineString;
|
|
47
|
+
}[];
|
|
38
48
|
readonly formfactorName?: "CHATBOT" | "GENERATOR" | "GENERIC" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
|
|
39
49
|
}>): void;
|
|
40
50
|
}];
|
|
@@ -5,9 +5,9 @@ import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage
|
|
|
5
5
|
*
|
|
6
6
|
* @private within the repository - for CLI utils
|
|
7
7
|
*/
|
|
8
|
-
export declare function $
|
|
8
|
+
export declare function $provideLlmToolsForWizzardOrCli(options?: Pick<CacheLlmToolsOptions, 'isCacheReloaded'>): LlmExecutionToolsWithTotalUsage;
|
|
9
9
|
/**
|
|
10
|
-
* Note: [
|
|
10
|
+
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
11
11
|
* TODO: [👷♂️] @@@ Manual about construction of llmTools
|
|
12
12
|
* TODO: [🥃] Allow `ptbk make` without llm tools
|
|
13
13
|
* TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/core`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _AnthropicClaudeMetadataRegistration: Registration;
|
|
@@ -5,7 +5,9 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/anthropic-claude`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
10
|
+
*
|
|
9
11
|
*/
|
|
10
12
|
export declare const _AnthropicClaudeRegistration: Registration;
|
|
11
13
|
/**
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/core`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _AzureOpenAiMetadataRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/azure-openai`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _AzureOpenAiRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/core`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _GoogleMetadataRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/google`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _GoogleRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/core`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _OpenAiMetadataRegistration: Registration;
|
|
@@ -14,6 +15,7 @@ export declare const _OpenAiMetadataRegistration: Registration;
|
|
|
14
15
|
* Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
|
|
15
16
|
*
|
|
16
17
|
* @public exported from `@promptbook/core`
|
|
18
|
+
* @public exported from `@promptbook/wizzard`
|
|
17
19
|
* @public exported from `@promptbook/cli`
|
|
18
20
|
*/
|
|
19
21
|
export declare const _OpenAiAssistantMetadataRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
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
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/openai`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _OpenAiRegistration: Registration;
|
|
@@ -14,6 +15,7 @@ export declare const _OpenAiRegistration: Registration;
|
|
|
14
15
|
* Note: [🏐] Configurations registrations are done in @@@ BUT constructor @@@
|
|
15
16
|
*
|
|
16
17
|
* @public exported from `@promptbook/openai`
|
|
18
|
+
* @public exported from `@promptbook/wizzard`
|
|
17
19
|
* @public exported from `@promptbook/cli`
|
|
18
20
|
*/
|
|
19
21
|
export declare const _OpenAiAssistantRegistration: Registration;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PipelineCollection } from '../../collection/PipelineCollection';
|
|
2
|
+
import type { string_formfactor_name } from '../../formfactors/_common/string_formfactor_name';
|
|
3
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
4
|
+
/**
|
|
5
|
+
* @@@
|
|
6
|
+
*
|
|
7
|
+
* @singleton
|
|
8
|
+
* @private internal cache of `getBookTemplate`
|
|
9
|
+
*/
|
|
10
|
+
export declare let templatesPipelineCollection: PipelineCollection | null;
|
|
11
|
+
/**
|
|
12
|
+
* Get template for new book
|
|
13
|
+
*
|
|
14
|
+
* @public exported from `@promptbook/templates`
|
|
15
|
+
*/
|
|
16
|
+
export declare function getBookTemplate(formfactorName: string_formfactor_name): PipelineJson;
|
|
17
|
+
/**
|
|
18
|
+
* TODO: !!!!!! Test
|
|
19
|
+
* TODO: [🧠] Which is the best place for this function
|
|
20
|
+
* TODO: !!!!!! `book string template notation
|
|
21
|
+
*/
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PipelineCollection } from '../../collection/PipelineCollection';
|
|
2
|
+
/**
|
|
3
|
+
* Get pipeline collection for Untitled Promptbook project
|
|
4
|
+
*
|
|
5
|
+
* ⚠️ WARNING: This code has been generated by `@promptbook/cli` so that any manual changes will be overwritten
|
|
6
|
+
*
|
|
7
|
+
* @generated
|
|
8
|
+
* @returns {PipelineCollection} Library of promptbooks for Untitled Promptbook project
|
|
9
|
+
*/
|
|
10
|
+
export declare function getTemplatesPipelineCollection(): PipelineCollection;
|
|
@@ -3,7 +3,9 @@ import type { ModelRequirements } from '../../types/ModelRequirements';
|
|
|
3
3
|
import type { string_filename } from '../../types/typeAliases';
|
|
4
4
|
import type { string_markdown_text } from '../../types/typeAliases';
|
|
5
5
|
import type { string_pipeline_url } from '../../types/typeAliases';
|
|
6
|
+
import type { string_relative_filename } from '../../types/typeAliases';
|
|
6
7
|
import type { string_semantic_version } from '../../types/typeAliases';
|
|
8
|
+
import type { PipelineString } from '../PipelineString';
|
|
7
9
|
import type { KnowledgePiecePreparedJson } from './KnowledgePieceJson';
|
|
8
10
|
import type { KnowledgeSourceJson } from './KnowledgeSourceJson';
|
|
9
11
|
import type { KnowledgeSourcePreparedJson } from './KnowledgeSourceJson';
|
|
@@ -91,6 +93,14 @@ export type PipelineJson = {
|
|
|
91
93
|
* @see https://github.com/webgptorg/promptbook/discussions/78
|
|
92
94
|
*/
|
|
93
95
|
readonly preparations: Array<PreparationJson>;
|
|
96
|
+
/**
|
|
97
|
+
* Backup of the original book source
|
|
98
|
+
*/
|
|
99
|
+
readonly sources: ReadonlyArray<{
|
|
100
|
+
type: 'BOOK';
|
|
101
|
+
path: string_relative_filename | null;
|
|
102
|
+
content: PipelineString;
|
|
103
|
+
}>;
|
|
94
104
|
};
|
|
95
105
|
/**
|
|
96
106
|
* TODO: [🛳] Default PERSONA for the pipeline `defaultPersonaName` (same as `defaultModelRequirements`)
|
|
@@ -8,4 +8,4 @@ import type { ScraperSourceHandler } from '../Scraper';
|
|
|
8
8
|
*
|
|
9
9
|
* @public exported from `@promptbook/core`
|
|
10
10
|
*/
|
|
11
|
-
export declare function makeKnowledgeSourceHandler(knowledgeSource: SetOptional<KnowledgeSourceJson, 'name'>, tools: Pick<ExecutionTools, 'fs'>, options?: Pick<PrepareAndScrapeOptions, 'rootDirname' | 'isVerbose'>): Promise<ScraperSourceHandler>;
|
|
11
|
+
export declare function makeKnowledgeSourceHandler(knowledgeSource: SetOptional<KnowledgeSourceJson, 'name'>, tools: Pick<ExecutionTools, 'fs' | 'fetch'>, options?: Pick<PrepareAndScrapeOptions, 'rootDirname' | 'isVerbose'>): Promise<ScraperSourceHandler>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PromptbookFetch } from '../../../execution/PromptbookFetch';
|
|
2
|
+
/**
|
|
3
|
+
* The built-in `fetch' function with a lightweight error handling wrapper as default fetch function used in Promptbook scrapers
|
|
4
|
+
*
|
|
5
|
+
* @private as default `fetch` function used in Promptbook scrapers
|
|
6
|
+
*/
|
|
7
|
+
export declare const scraperFetch: PromptbookFetch;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
5
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/documents`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _DocumentScraperRegistration: Registration;
|
|
@@ -19,6 +19,7 @@ export declare const documentScraperMetadata: import("type-fest/source/readonly-
|
|
|
19
19
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
20
20
|
*
|
|
21
21
|
* @public exported from `@promptbook/core`
|
|
22
|
+
* @public exported from `@promptbook/wizzard`
|
|
22
23
|
* @public exported from `@promptbook/cli`
|
|
23
24
|
*/
|
|
24
25
|
export declare const _DocumentScraperMetadataRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
5
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/legacy-documents`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _LegacyDocumentScraperRegistration: Registration;
|
|
@@ -19,6 +19,7 @@ export declare const legacyDocumentScraperMetadata: import("type-fest/source/rea
|
|
|
19
19
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
20
20
|
*
|
|
21
21
|
* @public exported from `@promptbook/core`
|
|
22
|
+
* @public exported from `@promptbook/wizzard`
|
|
22
23
|
* @public exported from `@promptbook/cli`
|
|
23
24
|
*/
|
|
24
25
|
export declare const _LegacyDocumentScraperMetadataRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
5
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/markdown-utils`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _MarkdownScraperRegistration: Registration;
|
|
@@ -19,6 +19,7 @@ export declare const markdownScraperMetadata: import("type-fest/source/readonly-
|
|
|
19
19
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
20
20
|
*
|
|
21
21
|
* @public exported from `@promptbook/core`
|
|
22
|
+
* @public exported from `@promptbook/wizzard`
|
|
22
23
|
* @public exported from `@promptbook/cli`
|
|
23
24
|
*/
|
|
24
25
|
export declare const _MarkdownScraperMetadataRegistration: Registration;
|
|
@@ -5,6 +5,7 @@ import type { Registration } from '../../utils/$Register';
|
|
|
5
5
|
* Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
|
|
6
6
|
*
|
|
7
7
|
* @public exported from `@promptbook/pdf`
|
|
8
|
+
* @public exported from `@promptbook/wizzard`
|
|
8
9
|
* @public exported from `@promptbook/cli`
|
|
9
10
|
*/
|
|
10
11
|
export declare const _PdfScraperRegistration: Registration;
|