@promptbook/remote-server 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 +4 -3
  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 +2 -2
  55. package/umd/index.umd.js +4 -3
  56. package/umd/index.umd.js.map +1 -1
  57. /package/esm/typings/src/storage/{memory → local-storage}/utils/makePromptbookStorageFromWebStorage.d.ts +0 -0
@@ -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
+ };
@@ -0,0 +1,22 @@
1
+ import type { string_parameter_name } from '../../types/typeAliases';
2
+ /**
3
+ * @@@
4
+ */
5
+ export type PipelineInterface = {
6
+ /**
7
+ * @@@
8
+ *
9
+ * Note: Sorted alphabetically
10
+ */
11
+ readonly inputParameterNames: ReadonlyArray<string_parameter_name>;
12
+ /**
13
+ * @@@
14
+ *
15
+ * Note: Sorted alphabetically
16
+ */
17
+ readonly outputParameterNames: ReadonlyArray<string_parameter_name>;
18
+ };
19
+ /**
20
+ * TODO: !!!!!! Change inputParameterNames to inputParameters<InputParameter>
21
+ * TODO: [🧠] Better name than `PipelineInterface` to avoid confusion with typescript `interface`
22
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const GENERIC_PIPELINE_INTERFACE: {
7
+ readonly inputParameterNames: readonly [];
8
+ readonly outputParameterNames: readonly [];
9
+ };
@@ -0,0 +1,11 @@
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
+ import type { PipelineInterface } from './PipelineInterface';
3
+ /**
4
+ * @@@
5
+ *
6
+ * @public exported from `@promptbook/core`
7
+ */
8
+ export declare function getPipelineInterface(pipeline: PipelineJson): PipelineInterface;
9
+ /**
10
+ * TODO: !!!!!! Write unit test
11
+ */
@@ -0,0 +1,25 @@
1
+ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
2
+ import type { PipelineInterface } from './PipelineInterface';
3
+ /**
4
+ * @@@
5
+ */
6
+ export type IsPipelineImplementingInterfaceOptions = {
7
+ /**
8
+ * @@@
9
+ */
10
+ pipeline: PipelineJson;
11
+ /**
12
+ * @@@
13
+ */
14
+ pipelineInterface: PipelineInterface;
15
+ };
16
+ /**
17
+ * @@@
18
+ *
19
+ * @public exported from `@promptbook/core`
20
+ */
21
+ export declare function isPipelineImplementingInterface(options: IsPipelineImplementingInterfaceOptions): boolean;
22
+ /**
23
+ * TODO: !!!!!! Test real implementing NOT equality
24
+ * TODO: !!!!!! Write unit test
25
+ */
@@ -0,0 +1,11 @@
1
+ import type { PipelineInterface } from './PipelineInterface';
2
+ /**
3
+ * @@@
4
+ *
5
+ * @public exported from `@promptbook/core`
6
+ */
7
+ export declare function isPipelineInterfacesEqual(pipelineInterface1: PipelineInterface, pipelineInterface2: PipelineInterface): boolean;
8
+ /**
9
+ * TODO: [🧠] !!! Return more states than true/false - 'IDENTICAL' |'IDENTICAL_UNPREPARED' | 'IDENTICAL_INTERFACE' | 'DIFFERENT'
10
+ * TODO: !!! Write unit test
11
+ */
@@ -0,0 +1,33 @@
1
+ import type { PromptbookStorage } from '../_common/PromptbookStorage';
2
+ /**
3
+ * Behaves like a storage but forgets everything you put in it
4
+ *
5
+ * @public exported from `@promptbook/core`
6
+ */
7
+ export declare class BlackholeStorage<TItem> implements PromptbookStorage<TItem> {
8
+ /**
9
+ * Returns the number of key/value pairs currently present in the list associated with the object.
10
+ */
11
+ get length(): number;
12
+ /**
13
+ * Empties the list associated with the object of all key/value pairs, if there are any.
14
+ */
15
+ clear(): void;
16
+ /**
17
+ * Returns the current value associated with the given key, or null if the given key does not exist in the list associated with the object.
18
+ * @param key
19
+ */
20
+ getItem(key: string): null;
21
+ /**
22
+ * Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
23
+ */
24
+ key(index: number): null;
25
+ /**
26
+ * Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
27
+ */
28
+ setItem(key: string, value: TItem): void;
29
+ /**
30
+ * Removes the key/value pair with the given key from the list associated with the object, if a key/value pair with the given key exists.
31
+ */
32
+ removeItem(key: string): void;
33
+ }
@@ -1,6 +1,6 @@
1
1
  import type { PromptbookStorage } from '../_common/PromptbookStorage';
2
2
  /**
3
- * Stores
3
+ * Stores data in memory (HEAP)
4
4
  *
5
5
  * @public exported from `@promptbook/core`
6
6
  */
@@ -1,5 +1,5 @@
1
1
  import type { Promisable } from 'type-fest';
2
- import type { PromptbookStorage } from '../../_common/PromptbookStorage';
2
+ import type { PromptbookStorage } from '../_common/PromptbookStorage';
3
3
  /**
4
4
  * This class behaves like LocalStorage but separates keys by prefix
5
5
  *
@@ -1,3 +1,4 @@
1
+ import type { string_formfactor_name } from '../../formfactors/_common/string_formfactor_name';
1
2
  import type { ModelRequirements } from '../ModelRequirements';
2
3
  import type { string_filename } from '../typeAliases';
3
4
  import type { string_markdown_text } from '../typeAliases';
@@ -26,12 +27,12 @@ export type PipelineJson = {
26
27
  * Note: It must be unique across all pipeline collections
27
28
  * Note: It must use HTTPs URL
28
29
  * Tip: You can do versioning in the URL
29
- * For example: https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md@1.0.0
30
+ * For example: https://promptbook.studio/webgpt/write-website-content-cs.book.md@1.0.0
30
31
  * Warning: Do not hash part of the URL, hash part is used for identification of the template in the pipeline
31
32
  */
32
33
  readonly pipelineUrl?: string_pipeline_url;
33
34
  /**
34
- * Internal helper for tracking the source `.ptbk.md` file of the pipeline
35
+ * Internal helper for tracking the source `.book.md` file of the pipeline
35
36
  */
36
37
  readonly sourceFile?: string_filename;
37
38
  /**
@@ -40,14 +41,20 @@ export type PipelineJson = {
40
41
  */
41
42
  readonly title: string_markdown_text;
42
43
  /**
43
- * Version of the .ptbk.json file
44
+ * Version of the Book language
45
+ *
46
+ * @see https://github.com/webgptorg/book
44
47
  */
45
- readonly promptbookVersion?: string_semantic_version;
48
+ readonly bookVersion?: string_semantic_version;
46
49
  /**
47
50
  * Description of the promptbook
48
51
  * It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
49
52
  */
50
53
  readonly description?: string_markdown_text;
54
+ /**
55
+ * Name of the formfactor that the pipeline is shaped for
56
+ */
57
+ readonly formfactorName: string_formfactor_name;
51
58
  /**
52
59
  * Set of variables that are used across the pipeline
53
60
  */
@@ -18,5 +18,5 @@ export type PreparationJson = {
18
18
  /**
19
19
  * TODO: [🍙] Make some standard order of json properties
20
20
  * TODO: Maybe put here used `modelName`
21
- * TODO: [🍥] When using `date` it changes all examples .ptbk.json files each time so until some more elegant solution omit the time from prepared pipeline
21
+ * TODO: [🍥] When using `date` it changes all examples .book.json files each time so until some more elegant solution omit the time from prepared pipeline
22
22
  */
@@ -95,7 +95,7 @@ export type CommonPrompt = {
95
95
  /**
96
96
  * Unique identifier of the pipeline with specific template name as hash
97
97
  *
98
- * @example https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md#keywords
98
+ * @example https://promptbook.studio/webgpt/write-website-content-cs.book.md#keywords
99
99
  */
100
100
  readonly pipelineUrl?: string_pipeline_url_with_hashtemplate;
101
101
  /**
@@ -298,13 +298,13 @@ export type string_base_url = string;
298
298
  /**
299
299
  * Semantic helper
300
300
  *
301
- * For example `"https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md"`
301
+ * For example `"https://promptbook.studio/webgpt/write-website-content-cs.book.md"`
302
302
  */
303
303
  export type string_pipeline_url = string;
304
304
  /**
305
305
  * Semantic helper
306
306
  *
307
- * For example `"https://promptbook.studio/webgpt/write-website-content-cs.ptbk.md#keywords"`
307
+ * For example `"https://promptbook.studio/webgpt/write-website-content-cs.book.md#keywords"`
308
308
  */
309
309
  export type string_pipeline_url_with_hashtemplate = string;
310
310
  /**
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Number of characters per standard line with 11pt Arial font size.
3
+ *
4
+ * @public exported from `@promptbook/utils`
5
+ */
6
+ export declare const CHARACTERS_PER_STANDARD_LINE = 63;
7
+ /**
8
+ * Number of lines per standard A4 page with 11pt Arial font size and standard margins and spacing.
9
+ *
10
+ * @public exported from `@promptbook/utils`
11
+ */
12
+ export declare const LINES_PER_STANDARD_PAGE = 44;
13
+ /**
14
+ * TODO: [🧠] Should be this `constants.ts` or `config.ts`?
15
+ */
@@ -2,6 +2,8 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
2
2
  /**
3
3
  * Counts number of lines in the text
4
4
  *
5
+ * Note: This does not check only for the presence of newlines, but also for the length of the standard line.
6
+ *
5
7
  * @public exported from `@promptbook/utils`
6
8
  */
7
9
  export declare function countLines(text: string): ExpectationAmount;
@@ -2,6 +2,8 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
2
2
  /**
3
3
  * Counts number of pages in the text
4
4
  *
5
+ * Note: This does not check only for the count of newlines, but also for the length of the standard line and length of the standard page.
6
+ *
5
7
  * @public exported from `@promptbook/utils`
6
8
  */
7
9
  export declare function countPages(text: string): ExpectationAmount;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.74.0-8",
3
+ "version": "0.75.0-1",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -53,7 +53,7 @@
53
53
  "module": "./esm/index.es.js",
54
54
  "typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
55
55
  "peerDependencies": {
56
- "@promptbook/core": "0.74.0-8"
56
+ "@promptbook/core": "0.75.0-1"
57
57
  },
58
58
  "dependencies": {
59
59
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * @see https://github.com/webgptorg/promptbook
24
24
  */
25
- var PROMPTBOOK_ENGINE_VERSION = '0.74.0-7';
25
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.0-0';
26
26
  /**
27
27
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
28
28
  */
@@ -394,6 +394,7 @@
394
394
  */
395
395
  var DEFAULT_IS_VERBOSE = false;
396
396
  /**
397
+ * TODO: Extract `constants.ts` from `config.ts`
397
398
  * TODO: [🧠][🧜‍♂️] Maybe join remoteUrl and path into single value
398
399
  */
399
400
 
@@ -816,8 +817,8 @@
816
817
  else if (errors.length > 1) {
817
818
  throw new PipelineExecutionError(
818
819
  // TODO: Tell which execution tools failed like
819
- // 1) OpenAI throw PipelineExecutionError: Parameter {knowledge} is not defined
820
- // 2) AnthropicClaude throw PipelineExecutionError: Parameter {knowledge} is not defined
820
+ // 1) OpenAI throw PipelineExecutionError: Parameter `{knowledge}` is not defined
821
+ // 2) AnthropicClaude throw PipelineExecutionError: Parameter `{knowledge}` is not defined
821
822
  // 3) ...
822
823
  spaceTrim__default["default"](function (block) { return "\n All execution tools failed:\n\n ".concat(block(errors
823
824
  .map(function (error, i) { return "".concat(i + 1, ") **").concat(error.name || 'Error', ":** ").concat(error.message); })