@promptbook/markdown-utils 0.74.0-8 → 0.75.0-1

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 (57) hide show
  1. package/README.md +2 -11
  2. package/esm/index.es.js +102 -55
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/promptbook-collection/index.d.ts +3 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +25 -1
  6. package/esm/typings/src/_packages/types.index.d.ts +10 -0
  7. package/esm/typings/src/_packages/utils.index.d.ts +4 -0
  8. package/esm/typings/src/cli/cli-commands/run.d.ts +1 -1
  9. package/esm/typings/src/cli/main.d.ts +4 -1
  10. package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
  11. package/esm/typings/src/cli/test/ptbk.d.ts +1 -1
  12. package/esm/typings/src/collection/collectionToJson.test.d.ts +1 -1
  13. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -1
  14. package/esm/typings/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -1
  15. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -2
  16. package/esm/typings/src/commands/FORMFACTOR/FormfactorCommand.d.ts +11 -0
  17. package/esm/typings/src/commands/FORMFACTOR/formfactorCommand.test.d.ts +1 -0
  18. package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +11 -0
  19. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  20. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +2 -0
  21. package/esm/typings/src/commands/index.d.ts +1 -1
  22. package/esm/typings/src/config.d.ts +7 -0
  23. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +3 -3
  24. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -2
  25. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +2 -2
  26. package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +1 -1
  27. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +7 -7
  28. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
  29. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +1 -1
  30. package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +14 -0
  31. package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +34 -0
  32. package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +5 -0
  33. package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +5 -0
  34. package/esm/typings/src/formfactors/chat/ChatFormfactorDefinition.d.ts +15 -0
  35. package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +14 -0
  36. package/esm/typings/src/formfactors/index.d.ts +39 -0
  37. package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +14 -0
  38. package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +14 -0
  39. package/esm/typings/src/pipeline/pipeline-interface/PipelineInterface.d.ts +22 -0
  40. package/esm/typings/src/pipeline/pipeline-interface/constants.d.ts +9 -0
  41. package/esm/typings/src/pipeline/pipeline-interface/getPipelineInterface.d.ts +11 -0
  42. package/esm/typings/src/pipeline/pipeline-interface/isPipelineImplementingInterface.d.ts +25 -0
  43. package/esm/typings/src/pipeline/pipeline-interface/isPipelineInterfacesEqual.d.ts +11 -0
  44. package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
  45. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +1 -1
  46. package/esm/typings/src/storage/{memory/utils → utils}/PrefixStorage.d.ts +1 -1
  47. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +11 -4
  48. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +1 -1
  49. package/esm/typings/src/types/Prompt.d.ts +1 -1
  50. package/esm/typings/src/types/typeAliases.d.ts +2 -2
  51. package/esm/typings/src/utils/expectation-counters/constants.d.ts +15 -0
  52. package/esm/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
  53. package/esm/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
  54. package/package.json +1 -1
  55. package/umd/index.umd.js +102 -55
  56. package/umd/index.umd.js.map +1 -1
  57. /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
@@ -1,6 +1,7 @@
1
1
  declare const _default: ({
2
2
  title: string;
3
3
  pipelineUrl: string;
4
+ formfactorName: string;
4
5
  parameters: {
5
6
  name: string;
6
7
  description: string;
@@ -23,6 +24,7 @@ declare const _default: ({
23
24
  } | {
24
25
  title: string;
25
26
  pipelineUrl: string;
27
+ formfactorName: string;
26
28
  parameters: {
27
29
  name: string;
28
30
  description: string;
@@ -51,6 +53,7 @@ declare const _default: ({
51
53
  } | {
52
54
  title: string;
53
55
  pipelineUrl: string;
56
+ formfactorName: string;
54
57
  parameters: {
55
58
  name: string;
56
59
  description: string;
@@ -7,6 +7,7 @@ import { createSubcollection } from '../collection/constructors/createSubcollect
7
7
  import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
8
8
  import { TemplateTypes } from '../commands/TEMPLATE/TemplateTypes';
9
9
  import { CLAIM } from '../config';
10
+ import { DEFAULT_TITLE } from '../config';
10
11
  import { MAX_FILENAME_LENGTH } from '../config';
11
12
  import { DEFAULT_INTERMEDIATE_FILES_STRATEGY } from '../config';
12
13
  import { DEFAULT_MAX_PARALLEL_COUNT } from '../config';
@@ -58,6 +59,12 @@ import { CsvFormatDefinition } from '../formats/csv/CsvFormatDefinition';
58
59
  import { CsvFormatError } from '../formats/csv/CsvFormatError';
59
60
  import { MANDATORY_CSV_SETTINGS } from '../formats/csv/CsvSettings';
60
61
  import { TextFormatDefinition } from '../formats/text/TextFormatDefinition';
62
+ import { BoilerplateFormfactorDefinition } from '../formfactors/_boilerplate/BoilerplateFormfactorDefinition';
63
+ import { ChatFormfactorDefinition } from '../formfactors/chat/ChatFormfactorDefinition';
64
+ import { GenericFormfactorDefinition } from '../formfactors/generic/GenericFormfactorDefinition';
65
+ import { FORMFACTOR_DEFINITIONS } from '../formfactors/index';
66
+ import { SheetsFormfactorDefinition } from '../formfactors/sheets/SheetsFormfactorDefinition';
67
+ import { TranslatorFormfactorDefinition } from '../formfactors/translator/TranslatorFormfactorDefinition';
61
68
  import { $llmToolsMetadataRegister } from '../llm-providers/_common/register/$llmToolsMetadataRegister';
62
69
  import { $llmToolsRegister } from '../llm-providers/_common/register/$llmToolsRegister';
63
70
  import { createLlmToolsFromConfiguration } from '../llm-providers/_common/register/createLlmToolsFromConfiguration';
@@ -71,6 +78,10 @@ import { MultipleLlmExecutionTools } from '../llm-providers/multiple/MultipleLlm
71
78
  import { _OpenAiMetadataRegistration } from '../llm-providers/openai/register-configuration';
72
79
  import { _OpenAiAssistantMetadataRegistration } from '../llm-providers/openai/register-configuration';
73
80
  import { preparePersona } from '../personas/preparePersona';
81
+ import { GENERIC_PIPELINE_INTERFACE } from '../pipeline/pipeline-interface/constants';
82
+ import { getPipelineInterface } from '../pipeline/pipeline-interface/getPipelineInterface';
83
+ import { isPipelineImplementingInterface } from '../pipeline/pipeline-interface/isPipelineImplementingInterface';
84
+ import { isPipelineInterfacesEqual } from '../pipeline/pipeline-interface/isPipelineInterfacesEqual';
74
85
  import { isPipelinePrepared } from '../prepare/isPipelinePrepared';
75
86
  import { preparePipeline } from '../prepare/preparePipeline';
76
87
  import { prepareTemplates } from '../prepare/prepareTemplates';
@@ -84,8 +95,9 @@ import { _DocumentScraperMetadataRegistration } from '../scrapers/document/regis
84
95
  import { _MarkdownScraperMetadataRegistration } from '../scrapers/markdown/register-metadata';
85
96
  import { _PdfScraperMetadataRegistration } from '../scrapers/pdf/register-metadata';
86
97
  import { _WebsiteScraperMetadataRegistration } from '../scrapers/website/register-metadata';
98
+ import { BlackholeStorage } from '../storage/blackhole/BlackholeStorage';
87
99
  import { MemoryStorage } from '../storage/memory/MemoryStorage';
88
- import { PrefixStorage } from '../storage/memory/utils/PrefixStorage';
100
+ import { PrefixStorage } from '../storage/utils/PrefixStorage';
89
101
  import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
90
102
  import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
91
103
  import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
@@ -100,6 +112,7 @@ export { createSubcollection };
100
112
  export type { TemplateType };
101
113
  export { TemplateTypes };
102
114
  export { CLAIM };
115
+ export { DEFAULT_TITLE };
103
116
  export { MAX_FILENAME_LENGTH };
104
117
  export { DEFAULT_INTERMEDIATE_FILES_STRATEGY };
105
118
  export { DEFAULT_MAX_PARALLEL_COUNT };
@@ -151,6 +164,12 @@ export { CsvFormatDefinition };
151
164
  export { CsvFormatError };
152
165
  export { MANDATORY_CSV_SETTINGS };
153
166
  export { TextFormatDefinition };
167
+ export { BoilerplateFormfactorDefinition };
168
+ export { ChatFormfactorDefinition };
169
+ export { GenericFormfactorDefinition };
170
+ export { FORMFACTOR_DEFINITIONS };
171
+ export { SheetsFormfactorDefinition };
172
+ export { TranslatorFormfactorDefinition };
154
173
  export { $llmToolsMetadataRegister };
155
174
  export { $llmToolsRegister };
156
175
  export { createLlmToolsFromConfiguration };
@@ -164,6 +183,10 @@ export { MultipleLlmExecutionTools };
164
183
  export { _OpenAiMetadataRegistration };
165
184
  export { _OpenAiAssistantMetadataRegistration };
166
185
  export { preparePersona };
186
+ export { GENERIC_PIPELINE_INTERFACE };
187
+ export { getPipelineInterface };
188
+ export { isPipelineImplementingInterface };
189
+ export { isPipelineInterfacesEqual };
167
190
  export { isPipelinePrepared };
168
191
  export { preparePipeline };
169
192
  export { prepareTemplates };
@@ -177,6 +200,7 @@ export { _DocumentScraperMetadataRegistration };
177
200
  export { _MarkdownScraperMetadataRegistration };
178
201
  export { _PdfScraperMetadataRegistration };
179
202
  export { _WebsiteScraperMetadataRegistration };
203
+ export { BlackholeStorage };
180
204
  export { MemoryStorage };
181
205
  export { PrefixStorage };
182
206
  export { executionReportJsonToString };
@@ -39,6 +39,9 @@ import type { UserInterfaceTools } from '../execution/UserInterfaceTools';
39
39
  import type { UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
40
40
  import type { FormatSubvalueDefinition } from '../formats/_common/FormatSubvalueDefinition';
41
41
  import type { CsvSettings } from '../formats/csv/CsvSettings';
42
+ import type { AbstractFormfactorDefinition } from '../formfactors/_common/AbstractFormfactorDefinition';
43
+ import type { FormfactorDefinition } from '../formfactors/_common/FormfactorDefinition';
44
+ import type { string_formfactor_name } from '../formfactors/_common/string_formfactor_name';
42
45
  import type { LlmToolsConfiguration } from '../llm-providers/_common/register/LlmToolsConfiguration';
43
46
  import type { LlmToolsMetadata } from '../llm-providers/_common/register/LlmToolsMetadata';
44
47
  import type { LlmToolsOptions } from '../llm-providers/_common/register/LlmToolsOptions';
@@ -67,6 +70,8 @@ import type { RemoteServerOptions } from '../llm-providers/remote/interfaces/Rem
67
70
  import type { AnonymousRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
68
71
  import type { CollectionRemoteServerOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
69
72
  import type { CollectionRemoteServerClientOptions } from '../llm-providers/remote/interfaces/RemoteServerOptions';
73
+ import type { IsPipelineImplementingInterfaceOptions } from '../pipeline/pipeline-interface/isPipelineImplementingInterface';
74
+ import type { PipelineInterface } from '../pipeline/pipeline-interface/PipelineInterface';
70
75
  import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
71
76
  import type { Converter } from '../scrapers/_common/Converter';
72
77
  import type { ScraperAndConverterMetadata } from '../scrapers/_common/register/ScraperAndConverterMetadata';
@@ -283,6 +288,9 @@ export type { UserInterfaceTools };
283
288
  export type { UserInterfaceToolsPromptDialogOptions };
284
289
  export type { FormatSubvalueDefinition };
285
290
  export type { CsvSettings };
291
+ export type { AbstractFormfactorDefinition };
292
+ export type { FormfactorDefinition };
293
+ export type { string_formfactor_name };
286
294
  export type { LlmToolsConfiguration };
287
295
  export type { LlmToolsMetadata };
288
296
  export type { LlmToolsOptions };
@@ -311,6 +319,8 @@ export type { RemoteServerOptions };
311
319
  export type { AnonymousRemoteServerOptions };
312
320
  export type { CollectionRemoteServerOptions };
313
321
  export type { CollectionRemoteServerClientOptions };
322
+ export type { IsPipelineImplementingInterfaceOptions };
323
+ export type { PipelineInterface };
314
324
  export type { PrepareAndScrapeOptions };
315
325
  export type { Converter };
316
326
  export type { ScraperAndConverterMetadata };
@@ -12,6 +12,8 @@ import { $currentDate } from '../utils/$currentDate';
12
12
  import { $isRunningInBrowser } from '../utils/environment/$isRunningInBrowser';
13
13
  import { $isRunningInNode } from '../utils/environment/$isRunningInNode';
14
14
  import { $isRunningInWebWorker } from '../utils/environment/$isRunningInWebWorker';
15
+ import { CHARACTERS_PER_STANDARD_LINE } from '../utils/expectation-counters/constants';
16
+ import { LINES_PER_STANDARD_PAGE } from '../utils/expectation-counters/constants';
15
17
  import { countCharacters } from '../utils/expectation-counters/countCharacters';
16
18
  import { countLines } from '../utils/expectation-counters/countLines';
17
19
  import { countPages } from '../utils/expectation-counters/countPages';
@@ -83,6 +85,8 @@ export { $currentDate };
83
85
  export { $isRunningInBrowser };
84
86
  export { $isRunningInNode };
85
87
  export { $isRunningInWebWorker };
88
+ export { CHARACTERS_PER_STANDARD_LINE };
89
+ export { LINES_PER_STANDARD_PAGE };
86
90
  export { countCharacters };
87
91
  export { countLines };
88
92
  export { countPages };
@@ -6,7 +6,7 @@ import type { Command as Program } from 'commander';
6
6
  */
7
7
  export declare function initializeRunCommand(program: Program): void;
8
8
  /**
9
- * TODO: !!!!!! Catch and wrap all errors from CLI
9
+ * TODO: !!!!! Catch and wrap all errors from CLI
10
10
  * TODO: [🧠] Pass `maxExecutionAttempts`, `csvSettings`
11
11
  * TODO: [🥃][main] !!! Allow `ptbk run` without configuring any llm tools
12
12
  * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
@@ -1,11 +1,14 @@
1
1
  import { promptbookCli } from './promptbookCli';
2
+ /**
3
+ * Note: [🔺] Purpose of this file is to export CLI for production environment
4
+ */
2
5
  /**
3
6
  * Hidden utilities which should not be used by external consumers.
4
7
  *
5
8
  * @public exported from `@promptbook/cli`
6
9
  */
7
10
  export declare const _CLI: {
8
- _initialize: typeof promptbookCli;
11
+ _initialize_promptbookCli: typeof promptbookCli;
9
12
  };
10
13
  /**
11
14
  * Note: [🟡] Code in this file should never be published outside of `@promptbook/cli`
@@ -5,7 +5,7 @@
5
5
  */
6
6
  export declare function promptbookCli(): Promise<void>;
7
7
  /**
8
- * TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.ptbk.md` -> `ptbk ./foo.ptbk.md`
8
+ * TODO: [🧠] Maybe `run` command the default, instead of `ptbk run ./foo.book.md` -> `ptbk ./foo.book.md`
9
9
  * TODO: [🥠] Do not export, its just for CLI script
10
10
  * TODO: [🕌] When more functionalities, rename
11
11
  * Note: 11:11
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ts-node
2
2
  /**
3
- * Note: Purpose of this file !!!!!!! vs other place
3
+ * Note: [🔺] Purpose of this file is to test the CLI in development environment
4
4
  */
5
5
  import '../../_packages/cli.index.ts';
@@ -1,6 +1,6 @@
1
1
  export {};
2
2
  /**
3
- * Note: [🐠] For example here URL https://example.com/pipeline.ptbk.md is not valid
3
+ * Note: [🐠] For example here URL https://example.com/pipeline.book.md is not valid
4
4
  * because it is on private network BUT its very hard to debug because
5
5
  * there is no error message and false return (the error) happen deep in:
6
6
  * `isValidPipelineUrl` -> `isValidPipelineUrl` -> `isUrlOnPrivateNetwork`
@@ -5,7 +5,7 @@ import type { PipelineCollection } from '../PipelineCollection';
5
5
  /**
6
6
  * Options for `createCollectionFromDirectory` function
7
7
  *
8
- * Note: `rootDirname` is not needed because it is the folder in which `.ptbk.md` file is located
8
+ * Note: `rootDirname` is not needed because it is the folder in which `.book.md` file is located
9
9
  * This is not same as `path` which is the first argument of `createCollectionFromDirectory` - it can be a subfolder
10
10
  */
11
11
  type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & {
@@ -7,5 +7,5 @@ import type { string_semantic_version } from '../../types/typeAliases';
7
7
  */
8
8
  export type BookVersionCommand = {
9
9
  readonly type: 'BOOK_VERSION';
10
- readonly promptbookVersion: string_semantic_version;
10
+ readonly bookVersion: string_semantic_version;
11
11
  };
@@ -3,12 +3,12 @@ import type { ForeachCommand } from './ForeachCommand';
3
3
  /**
4
4
  * Parses the foreach command
5
5
  *
6
- * Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.ptbk.md` file
6
+ * Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book.md` file
7
7
  *
8
8
  * @see `documentationUrl` for more details
9
9
  * @private within the commands folder
10
10
  */
11
11
  export declare const foreachCommandParser: PipelineTemplateCommandParser<ForeachCommand>;
12
12
  /**
13
- * TODO: [🍭] Make .ptbk.md file with examples of the FOREACH with wrong parsing and logic
13
+ * TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
14
14
  */
@@ -0,0 +1,11 @@
1
+ import type { string_formfactor_name } from '../../formfactors/_common/string_formfactor_name';
2
+ /**
3
+ * Parsed FORMFACTOR command
4
+ *
5
+ * @see ./formfactorCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type FormfactorCommand = {
9
+ readonly type: 'FORMFACTOR';
10
+ readonly formfactorName: string_formfactor_name;
11
+ };
@@ -0,0 +1,11 @@
1
+ import type { PipelineHeadCommandParser } from '../_common/types/CommandParser';
2
+ import type { FormfactorCommand } from './FormfactorCommand';
3
+ /**
4
+ * Parses the formfactor command
5
+ *
6
+ * Note: @@@ This command is used as formfactor for new commands - it should NOT be used in any `.book.md` file
7
+ *
8
+ * @see `documentationUrl` for more details
9
+ * @private within the commands folder
10
+ */
11
+ export declare const formfactorCommandParser: PipelineHeadCommandParser<FormfactorCommand>;
@@ -3,7 +3,7 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
3
3
  /**
4
4
  * Parses the boilerplate command
5
5
  *
6
- * Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.ptbk.md` file
6
+ * Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book.md` file
7
7
  *
8
8
  * @see `documentationUrl` for more details
9
9
  * @private within the commands folder
@@ -99,6 +99,8 @@ export type PipelineHeadCommandParser<TCommand extends CommandBase> = CommonComm
99
99
  };
100
100
  /**
101
101
  * @@@
102
+ *
103
+ * TODO: !!!!!! Rename to PipelineTaskCommandParser, applyToTaskJson, TaskJson, isUsedInPipelineTask,...
102
104
  */
103
105
  export type PipelineTemplateCommandParser<TCommand extends CommandBase> = CommonCommandParser<TCommand> & {
104
106
  /**
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * @private internal index of `parseCommand`
5
5
  */
6
- export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./TEMPLATE/TemplateCommand").TemplateCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./BOOK_VERSION/BookVersionCommand").BookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
6
+ export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./TEMPLATE/TemplateCommand").TemplateCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./BOOK_VERSION/BookVersionCommand").BookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./FORMFACTOR/FormfactorCommand").FormfactorCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
@@ -14,6 +14,12 @@ export declare const GENERATOR_WARNING = "\u26A0\uFE0F WARNING: This code has be
14
14
  * @public exported from `@promptbook/core`
15
15
  */
16
16
  export declare const CLAIM = "Build responsible, controlled and transparent applications on top of LLM models!";
17
+ /**
18
+ * When the title is not provided, the default title is used
19
+ *
20
+ * @public exported from `@promptbook/core`
21
+ */
22
+ export declare const DEFAULT_TITLE = "Untitled";
17
23
  /**
18
24
  * Warning message for the generated sections and files files
19
25
  *
@@ -186,5 +192,6 @@ export declare const IS_PIPELINE_LOGIC_VALIDATED: boolean;
186
192
  */
187
193
  export declare const IS_COST_PREVENTED: boolean;
188
194
  /**
195
+ * TODO: Extract `constants.ts` from `config.ts`
189
196
  * TODO: [🧠][🧜‍♂️] Maybe join remoteUrl and path into single value
190
197
  */
@@ -3,8 +3,8 @@ import type { PipelineString } from '../types/PipelineString';
3
3
  /**
4
4
  * Converts promptbook in JSON format to string format
5
5
  *
6
- * @param pipelineJson Promptbook in JSON format (.ptbk.json)
7
- * @returns Promptbook in string format (.ptbk.md)
6
+ * @param pipelineJson Promptbook in JSON format (.book.json)
7
+ * @returns Promptbook in string format (.book.md)
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
10
  export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
@@ -13,5 +13,5 @@ export declare function pipelineJsonToString(pipelineJson: PipelineJson): Pipeli
13
13
  * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
14
14
  * TODO: [🏛] Maybe make some markdown builder
15
15
  * TODO: [🏛] Escape all
16
- * TODO: [🧠] Should be in generated .ptbk.md file GENERATOR_WARNING
16
+ * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
17
17
  */
@@ -13,10 +13,10 @@ import type { PipelineString } from '../types/PipelineString';
13
13
  * Note: This function does not validate logic of the pipeline only the parsing
14
14
  * Note: This function acts as compilation process
15
15
  *
16
- * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
16
+ * @param pipelineString {Promptbook} in string markdown format (.book.md)
17
17
  * @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
18
18
  * @param options - Options and tools for the compilation
19
- * @returns {Promptbook} compiled in JSON format (.ptbk.json)
19
+ * @returns {Promptbook} compiled in JSON format (.book.json)
20
20
  * @throws {ParseError} if the promptbook string is not valid
21
21
  * @public exported from `@promptbook/core`
22
22
  */
@@ -11,8 +11,8 @@ import type { PipelineString } from '../types/PipelineString';
11
11
  * Note: This function does not validate logic of the pipeline only the parsing
12
12
  * Note: This function acts as compilation process
13
13
  *
14
- * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
15
- * @returns {Promptbook} compiled in JSON format (.ptbk.json)
14
+ * @param pipelineString {Promptbook} in string markdown format (.book.md)
15
+ * @returns {Promptbook} compiled in JSON format (.book.json)
16
16
  * @throws {ParseError} if the promptbook string is not valid
17
17
  * @public exported from `@promptbook/core`
18
18
  */
@@ -9,7 +9,7 @@ import type { string_json } from '../../types/typeAliases';
9
9
  */
10
10
  export declare function stringifyPipelineJson<TType>(pipeline: TType): string_json<TType>;
11
11
  /**
12
- * TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.ptbk.md
12
+ * TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book.md
13
13
  * TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
14
14
  * TODO: [🧠] Maybe more elegant solution than replacing via regex
15
15
  * TODO: [🍙] Make some standard order of json properties
@@ -2,7 +2,7 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
2
  import type { PipelineString } from '../../types/PipelineString';
3
3
  import type { string_json } from '../../types/typeAliases';
4
4
  /**
5
- * Import the pipeline.ptbk.md or pipeline.ptbk.json file
5
+ * Import the pipeline.book.md or pipeline.book.json file
6
6
  *
7
7
  * Note: Using here custom import to work in jest tests
8
8
  * Note: Using sync version is 💩 in the production code, but it's ok here in tests
@@ -10,20 +10,20 @@ import type { string_json } from '../../types/typeAliases';
10
10
  * @param path - The path to the file relative to examples/pipelines directory
11
11
  * @private internal function of tests
12
12
  */
13
- export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.md`): PipelineString;
14
- export declare function importPipelineWithoutPreparation(path: `${string}.ptbk.json`): PipelineJson;
13
+ export declare function importPipelineWithoutPreparation(path: `${string}.book.md`): PipelineString;
14
+ export declare function importPipelineWithoutPreparation(path: `${string}.book.json`): PipelineJson;
15
15
  /**
16
- * Import the pipeline.ptbk.json file as parsed JSON
16
+ * Import the pipeline.book.json file as parsed JSON
17
17
  *
18
18
  * @private internal function of tests
19
19
  */
20
- export declare function importPipelineJson(path: `${string}.ptbk.json`): PipelineJson;
20
+ export declare function importPipelineJson(path: `${string}.book.json`): PipelineJson;
21
21
  /**
22
- * Import the pipeline.ptbk.json file as string
22
+ * Import the pipeline.book.json file as string
23
23
  *
24
24
  * @private internal function of tests
25
25
  */
26
- export declare function importPipelineJsonAsString(path: `${string}.ptbk.json`): string_json<PipelineJson>;
26
+ export declare function importPipelineJsonAsString(path: `${string}.book.json`): string_json<PipelineJson>;
27
27
  /**
28
28
  * Note: [⚫] Code in this file should never be published in any package
29
29
  */
@@ -13,7 +13,7 @@ import type { FormatSubvalueDefinition } from './FormatSubvalueDefinition';
13
13
  */
14
14
  export type FormatDefinition<TValue extends TPartialValue, TPartialValue extends string, TSettings extends empty_object, TSchema extends empty_object> = {
15
15
  /**
16
- * The name of the format used in .ptbk.md files
16
+ * The name of the format used in .book.md files
17
17
  *
18
18
  * @example "JSON"
19
19
  */
@@ -9,7 +9,7 @@ import type { empty_object } from '../../utils/organization/empty_object';
9
9
  */
10
10
  export type FormatSubvalueDefinition<TValue extends string, TSettings extends empty_object> = {
11
11
  /**
12
- * The name of the format used in .ptbk.md files
12
+ * The name of the format used in .book.md files
13
13
  *
14
14
  * @example "CELL"
15
15
  */
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Boilerplate is form of app that @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const BoilerplateFormfactorDefinition: {
7
+ readonly name: "BOILERPLATE";
8
+ readonly description: "@@@";
9
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
+ readonly pipelineInterface: {
11
+ readonly inputParameterNames: readonly [];
12
+ readonly outputParameterNames: readonly [];
13
+ };
14
+ };
@@ -0,0 +1,34 @@
1
+ import type { PipelineInterface } from '../../pipeline/pipeline-interface/PipelineInterface';
2
+ import type { string_markdown_text } from '../../types/typeAliases';
3
+ import type { string_name } from '../../types/typeAliases';
4
+ import type { string_promptbook_documentation_url } from '../../types/typeAliases';
5
+ import type { string_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
6
+ /**
7
+ * @@@
8
+ */
9
+ export type AbstractFormfactorDefinition = {
10
+ /**
11
+ * @@@
12
+ */
13
+ readonly name: string_name & string_SCREAMING_CASE;
14
+ /**
15
+ * @@@
16
+ */
17
+ readonly aliasNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
18
+ /**
19
+ * @@@
20
+ */
21
+ readonly deprecatedNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
22
+ /**
23
+ * @@@
24
+ */
25
+ readonly description: string_markdown_text;
26
+ /**
27
+ * @@@
28
+ */
29
+ readonly documentationUrl: string_promptbook_documentation_url;
30
+ /**
31
+ * @@@
32
+ */
33
+ readonly pipelineInterface: PipelineInterface;
34
+ };
@@ -0,0 +1,5 @@
1
+ import { FORMFACTOR_DEFINITIONS } from '../index';
2
+ /**
3
+ * @@@
4
+ */
5
+ export type FormfactorDefinition = typeof FORMFACTOR_DEFINITIONS[number];
@@ -0,0 +1,5 @@
1
+ import type { FormfactorDefinition } from './FormfactorDefinition';
2
+ /**
3
+ * @@@
4
+ */
5
+ export type string_formfactor_name = FormfactorDefinition['name'];
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const ChatFormfactorDefinition: {
7
+ readonly name: "CHATBOT";
8
+ readonly aliasNames: readonly ["CHAT"];
9
+ readonly description: "@@@";
10
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
11
+ readonly pipelineInterface: {
12
+ readonly inputParameterNames: readonly ["previousTitle", "previousConversationSummary", "userMessage"];
13
+ readonly outputParameterNames: readonly ["title", "conversationSummary", "chatbotResponse"];
14
+ };
15
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const GenericFormfactorDefinition: {
7
+ readonly name: "GENERIC";
8
+ readonly description: "@@@";
9
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
+ readonly pipelineInterface: {
11
+ readonly inputParameterNames: readonly [];
12
+ readonly outputParameterNames: readonly [];
13
+ };
14
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * All available formfactor definitions
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const FORMFACTOR_DEFINITIONS: readonly [{
7
+ readonly name: "GENERIC";
8
+ readonly description: "@@@";
9
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
+ readonly pipelineInterface: {
11
+ readonly inputParameterNames: readonly [];
12
+ readonly outputParameterNames: readonly [];
13
+ };
14
+ }, {
15
+ readonly name: "CHATBOT";
16
+ readonly aliasNames: readonly ["CHAT"];
17
+ readonly description: "@@@";
18
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
19
+ readonly pipelineInterface: {
20
+ readonly inputParameterNames: readonly ["previousTitle", "previousConversationSummary", "userMessage"];
21
+ readonly outputParameterNames: readonly ["title", "conversationSummary", "chatbotResponse"];
22
+ };
23
+ }, {
24
+ readonly name: "TRANSLATOR";
25
+ readonly description: "@@@";
26
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
27
+ readonly pipelineInterface: {
28
+ readonly inputParameterNames: readonly ["inputMessage"];
29
+ readonly outputParameterNames: readonly ["outputMessage"];
30
+ };
31
+ }, {
32
+ readonly name: "SHEETS";
33
+ readonly description: "@@@";
34
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
35
+ readonly pipelineInterface: {
36
+ readonly inputParameterNames: readonly ["inputSheet"];
37
+ readonly outputParameterNames: readonly ["outputSheet"];
38
+ };
39
+ }];
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Sheets is form of app that @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const SheetsFormfactorDefinition: {
7
+ readonly name: "SHEETS";
8
+ readonly description: "@@@";
9
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
+ readonly pipelineInterface: {
11
+ readonly inputParameterNames: readonly ["inputSheet"];
12
+ readonly outputParameterNames: readonly ["outputSheet"];
13
+ };
14
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Translator is form of app that @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const TranslatorFormfactorDefinition: {
7
+ readonly name: "TRANSLATOR";
8
+ readonly description: "@@@";
9
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
+ readonly pipelineInterface: {
11
+ readonly inputParameterNames: readonly ["inputMessage"];
12
+ readonly outputParameterNames: readonly ["outputMessage"];
13
+ };
14
+ };