@promptbook/vercel 0.92.0-3 → 0.92.0-30

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 (171) hide show
  1. package/esm/index.es.js +20 -10
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +22 -6
  5. package/esm/typings/src/_packages/deepseek.index.d.ts +2 -0
  6. package/esm/typings/src/_packages/google.index.d.ts +2 -0
  7. package/esm/typings/src/_packages/types.index.d.ts +4 -2
  8. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  9. package/esm/typings/src/cli/common/$provideLlmToolsForCli.d.ts +1 -1
  10. package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
  11. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
  12. package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
  13. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
  14. package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
  15. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  16. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
  17. package/esm/typings/src/config.d.ts +41 -11
  18. package/esm/typings/src/constants.d.ts +43 -2
  19. package/esm/typings/src/conversion/archive/loadArchive.d.ts +2 -2
  20. package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
  21. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
  22. package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
  23. package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
  24. package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
  25. package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
  26. package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
  27. package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
  28. package/esm/typings/src/execution/CommonToolsOptions.d.ts +5 -1
  29. package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
  30. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
  31. package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
  32. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +12 -9
  33. package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +11 -8
  34. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
  35. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +20 -14
  36. package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
  37. package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
  38. package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
  39. package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
  40. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +21 -5
  41. package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +19 -5
  42. package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
  43. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
  44. package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  45. package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
  46. package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
  47. package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
  48. package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
  49. package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
  50. package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
  51. package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
  52. package/esm/typings/src/formats/index.d.ts +2 -2
  53. package/esm/typings/src/formats/json/{JsonFormatDefinition.d.ts → JsonFormatParser.d.ts} +6 -6
  54. package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
  55. package/esm/typings/src/formats/json/utils/jsonParse.d.ts +8 -0
  56. package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
  57. package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
  58. package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
  59. package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
  60. package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
  61. package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
  62. package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
  63. package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
  64. package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
  65. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
  66. package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
  67. package/esm/typings/src/formfactors/index.d.ts +33 -8
  68. package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
  69. package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
  70. package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
  71. package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
  72. package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
  73. package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
  74. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
  75. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
  76. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +17 -4
  77. package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
  78. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +27 -5
  79. package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
  80. package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +12 -3
  81. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
  82. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +5 -3
  83. package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
  84. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
  85. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  86. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +4 -0
  87. package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +23 -0
  88. package/esm/typings/src/llm-providers/google/google-models.d.ts +23 -0
  89. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
  90. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  91. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
  92. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
  93. package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
  94. package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
  95. package/esm/typings/src/personas/preparePersona.d.ts +1 -1
  96. package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
  97. package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
  98. package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
  99. package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
  100. package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
  101. package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +9 -6
  102. package/esm/typings/src/pipeline/PipelineJson/PersonaJson.d.ts +4 -2
  103. package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
  104. package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
  105. package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
  106. package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +1 -1
  107. package/esm/typings/src/prepare/prepareTasks.d.ts +7 -4
  108. package/esm/typings/src/remote-server/openapi-types.d.ts +348 -6
  109. package/esm/typings/src/remote-server/openapi.d.ts +398 -4
  110. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
  111. package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
  112. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
  113. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
  114. package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
  115. package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
  116. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
  117. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
  118. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
  119. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
  120. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
  121. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
  122. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
  123. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
  124. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
  125. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
  126. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
  127. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
  128. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
  129. package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
  130. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
  131. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
  132. package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
  133. package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
  134. package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
  135. package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
  136. package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +10 -0
  137. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +7 -0
  138. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
  139. package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
  140. package/esm/typings/src/types/ModelVariant.d.ts +5 -5
  141. package/esm/typings/src/types/typeAliases.d.ts +17 -13
  142. package/esm/typings/src/utils/$Register.d.ts +8 -7
  143. package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
  144. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
  145. package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
  146. package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
  147. package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
  148. package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
  149. package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
  150. package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
  151. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
  152. package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
  153. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
  154. package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
  155. package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
  156. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
  157. package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
  158. package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
  159. package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
  160. package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
  161. package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
  162. package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
  163. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
  164. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
  165. package/esm/typings/src/version.d.ts +2 -1
  166. package/package.json +2 -2
  167. package/umd/index.umd.js +20 -10
  168. package/umd/index.umd.js.map +1 -1
  169. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
  170. package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
  171. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
@@ -0,0 +1,19 @@
1
+ import type { TODO_any } from '../../utils/organization/TODO_any';
2
+ import type { FormatParser } from '../_common/FormatParser';
3
+ /**
4
+ * Definition for XML format
5
+ *
6
+ * @private still in development [🏢]
7
+ */
8
+ export declare const XmlFormatParser: FormatParser<string, string, TODO_any, TODO_any>;
9
+ /**
10
+ * TODO: [🧠] Maybe propper instance of object
11
+ * TODO: [0] Make string_serialized_xml
12
+ * TODO: [1] Make type for XML Settings and Schema
13
+ * TODO: [🧠] What to use for validating XMLs - XSD,...
14
+ * TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
15
+ * TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
16
+ * TODO: [🍓] In `XmlFormatParser` implement `heal
17
+ * TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
18
+ * TODO: [🏢] Allow to expect something inside XML and other formats
19
+ */
@@ -2,7 +2,7 @@
2
2
  * Function to check if a string is valid XML
3
3
  *
4
4
  * @param value
5
- * @returns True if the string is a valid XML string, false otherwise
5
+ * @returns `true` if the string is a valid XML string, false otherwise
6
6
  *
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Boilerplate is form of app that @@@
2
+ * Boilerplate is form of app that serves as a template structure for creating other formfactors
3
+ * and should not be used directly in production.
3
4
  *
4
5
  * @public exported from `@promptbook/core`
5
6
  */
6
7
  export declare const BoilerplateFormfactorDefinition: {
7
8
  readonly name: "BOILERPLATE";
8
- readonly description: "@@@";
9
+ readonly description: "A template structure for creating new formfactors, providing the base architecture and interfaces that should be implemented.";
9
10
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
11
  readonly pipelineInterface: {
11
12
  readonly inputParameters: readonly [];
@@ -4,34 +4,43 @@ import type { string_name } from '../../types/typeAliases';
4
4
  import type { string_promptbook_documentation_url } from '../../types/typeAliases';
5
5
  import type { string_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
6
6
  /**
7
- * @@@
7
+ * AbstractFormfactorDefinition provides the base structure for all form factor implementations
8
+ * in the Promptbook system. It defines common properties and interfaces that must be
9
+ * implemented by specific form factors.
8
10
  *
9
11
  * Note: [🚉] This is fully serializable as JSON
10
12
  * @see https://github.com/webgptorg/promptbook/discussions/172
11
13
  */
12
14
  export type AbstractFormfactorDefinition = {
13
15
  /**
14
- * @@@
16
+ * Unique identifier for the form factor in SCREAMING_CASE format
17
+ * Used for programmatic identification and reference
15
18
  */
16
19
  readonly name: string_name & string_SCREAMING_CASE;
17
20
  /**
18
- * @@@
21
+ * Alternative names that can be used to reference this form factor
22
+ * Also in SCREAMING_CASE format for consistency
19
23
  */
20
24
  readonly aliasNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
21
25
  /**
22
- * @@@
26
+ * Previous names that were used for this form factor but are now deprecated
27
+ * These are maintained for backward compatibility purposes
23
28
  */
24
29
  readonly deprecatedNames?: ReadonlyArray<string_name & string_SCREAMING_CASE>;
25
30
  /**
26
- * @@@
31
+ * Human-readable description of the form factor in markdown format
32
+ * Explains the purpose, functionality, and use cases of this form factor
27
33
  */
28
34
  readonly description: string_markdown_text;
29
35
  /**
30
- * @@@
36
+ * URL pointing to detailed documentation for this form factor
37
+ * Provides additional resources and guidance for implementation and usage
31
38
  */
32
39
  readonly documentationUrl: string_promptbook_documentation_url;
33
40
  /**
34
- * @@@
41
+ * Defines the interface structure for this form factor's pipeline
42
+ * Specifies how inputs and outputs are handled, processed, and formatted
43
+ * Required for properly configuring and executing the form factor's functionality
35
44
  */
36
45
  readonly pipelineInterface: PipelineInterface;
37
46
  };
@@ -1,6 +1,8 @@
1
1
  import { FORMFACTOR_DEFINITIONS } from '../index';
2
2
  /**
3
- * @@@
3
+ * FormfactorDefinition is a type that defines the structure and capabilities of a specific
4
+ * application form factor in the Promptbook system. It encapsulates all properties needed
5
+ * to represent how a particular interface handles inputs, outputs, and behaviors.
4
6
  *
5
7
  * Note: [🚉] This is fully serializable as JSON
6
8
  * @see https://github.com/webgptorg/promptbook/discussions/172
@@ -1,5 +1,6 @@
1
1
  import type { FormfactorDefinition } from './FormfactorDefinition';
2
2
  /**
3
- * @@@
3
+ * A type alias representing the name of a formfactor, used for type checking and validation
4
+ * in the formfactor registry and selection processes
4
5
  */
5
6
  export type string_formfactor_name = FormfactorDefinition['name'];
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @@@
2
+ * Chatbot form factor definition for conversational interfaces that interact with users in a chat-like manner.
3
3
  *
4
4
  * @public exported from `@promptbook/core`
5
5
  */
6
6
  export declare const ChatbotFormfactorDefinition: {
7
7
  readonly name: "CHATBOT";
8
8
  readonly aliasNames: readonly ["CHAT"];
9
- readonly description: "@@@";
9
+ readonly description: "A chatbot form factor for conversational user interfaces.";
10
10
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/174";
11
11
  readonly pipelineInterface: {
12
12
  readonly inputParameters: readonly [{
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Completion is formfactor that emulates completion models
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare const CompletionFormfactorDefinition: {
7
+ readonly name: "COMPLETION";
8
+ readonly description: "Completion is formfactor that emulates completion models";
9
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
10
+ readonly pipelineInterface: {
11
+ readonly inputParameters: readonly [{
12
+ readonly name: "inputText";
13
+ readonly description: "Input text to be completed";
14
+ readonly isInput: true;
15
+ readonly isOutput: false;
16
+ }, {
17
+ readonly name: "instructions";
18
+ readonly description: "Additional instructions for the model, for example the required length, empty by default";
19
+ readonly isInput: true;
20
+ readonly isOutput: false;
21
+ }];
22
+ readonly outputParameters: readonly [{
23
+ readonly name: "followingText";
24
+ readonly description: "Text that follows the input text";
25
+ readonly isInput: false;
26
+ readonly isOutput: true;
27
+ }];
28
+ };
29
+ };
@@ -1,5 +1,6 @@
1
1
  /**
2
- * Generator is form of app that @@@
2
+ * Generator form factor represents an application that generates content or data based on user input or predefined rules.
3
+ * This form factor is used for apps that produce outputs, such as text, images, or other media, based on provided input.
3
4
  *
4
5
  * @public exported from `@promptbook/core`
5
6
  */
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @@@
2
+ * A generic pipeline
3
3
  *
4
4
  * @public exported from `@promptbook/core`
5
5
  */
6
6
  export declare const GenericFormfactorDefinition: {
7
7
  readonly name: "GENERIC";
8
- readonly description: "@@@";
8
+ readonly description: "A generic pipeline";
9
9
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/173";
10
10
  readonly pipelineInterface: {
11
11
  readonly inputParameters: readonly [];
@@ -5,7 +5,7 @@
5
5
  */
6
6
  export declare const FORMFACTOR_DEFINITIONS: readonly [{
7
7
  readonly name: "GENERIC";
8
- readonly description: "@@@";
8
+ readonly description: "A generic pipeline";
9
9
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/173";
10
10
  readonly pipelineInterface: {
11
11
  readonly inputParameters: readonly [];
@@ -14,7 +14,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
14
14
  }, {
15
15
  readonly name: "CHATBOT";
16
16
  readonly aliasNames: readonly ["CHAT"];
17
- readonly description: "@@@";
17
+ readonly description: "A chatbot form factor for conversational user interfaces.";
18
18
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/174";
19
19
  readonly pipelineInterface: {
20
20
  readonly inputParameters: readonly [{
@@ -36,9 +36,6 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
36
36
  readonly outputParameters: readonly [{
37
37
  readonly name: "title";
38
38
  readonly description: "Title of the conversation";
39
- /**
40
- * Note: [💞] Ignore a discrepancy between file name and entity name
41
- */
42
39
  readonly isInput: false;
43
40
  readonly isOutput: true;
44
41
  }, {
@@ -55,7 +52,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
55
52
  };
56
53
  }, {
57
54
  readonly name: "TRANSLATOR";
58
- readonly description: "@@@";
55
+ readonly description: "A text transformation system that converts input content into different forms,\n including language translations, paraphrasing, style conversions, and tone adjustments.\n This form factor takes one input and produces one transformed output.";
59
56
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/175";
60
57
  readonly pipelineInterface: {
61
58
  readonly inputParameters: readonly [{
@@ -74,7 +71,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
74
71
  }, {
75
72
  readonly name: "SHEETS";
76
73
  readonly aliasNames: readonly ["SHEETS", "SHEET"];
77
- readonly description: "@@@";
74
+ readonly description: "A formfactor for processing spreadsheet-like data in CSV format, enabling AI transformations on tabular data";
78
75
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/176";
79
76
  readonly pipelineInterface: {
80
77
  readonly inputParameters: readonly [{
@@ -92,7 +89,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
92
89
  };
93
90
  }, {
94
91
  readonly name: "EXPERIMENTAL_MATCHER";
95
- readonly description: "@@@";
92
+ readonly description: "An evaluation system that determines whether content meets specific criteria or patterns.\n Used for content validation, quality assessment, and intelligent filtering tasks. Currently in experimental phase.";
96
93
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/177";
97
94
  readonly pipelineInterface: {
98
95
  readonly inputParameters: readonly [{
@@ -132,6 +129,11 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
132
129
  readonly isInput: true;
133
130
  readonly isOutput: false;
134
131
  }];
132
+ /**
133
+ * All available formfactor definitions
134
+ *
135
+ * @public exported from `@promptbook/core`
136
+ */
135
137
  readonly outputParameters: readonly [{
136
138
  readonly name: "prompt";
137
139
  readonly description: "Prompt to be used for image generation";
@@ -139,6 +141,29 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
139
141
  readonly isOutput: true;
140
142
  }];
141
143
  };
144
+ }, {
145
+ readonly name: "COMPLETION";
146
+ readonly description: "Completion is formfactor that emulates completion models";
147
+ readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
148
+ readonly pipelineInterface: {
149
+ readonly inputParameters: readonly [{
150
+ readonly name: "inputText";
151
+ readonly description: "Input text to be completed";
152
+ readonly isInput: true;
153
+ readonly isOutput: false;
154
+ }, {
155
+ readonly name: "instructions";
156
+ readonly description: "Additional instructions for the model, for example the required length, empty by default";
157
+ readonly isInput: true;
158
+ readonly isOutput: false;
159
+ }];
160
+ readonly outputParameters: readonly [{
161
+ readonly name: "followingText";
162
+ readonly description: "Text that follows the input text";
163
+ readonly isInput: false;
164
+ readonly isOutput: true;
165
+ }];
166
+ };
142
167
  }];
143
168
  /**
144
169
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1,11 +1,13 @@
1
1
  /**
2
- * Matcher is form of app that @@@
2
+ * Matcher is form of app that evaluates (spreadsheet) content against defined criteria or patterns,
3
+ * determining if it matches or meets specific requirements. Used for classification,
4
+ * validation, filtering, and quality assessment of inputs.
3
5
  *
4
6
  * @public exported from `@promptbook/core`
5
7
  */
6
8
  export declare const MatcherFormfactorDefinition: {
7
9
  readonly name: "EXPERIMENTAL_MATCHER";
8
- readonly description: "@@@";
10
+ readonly description: "An evaluation system that determines whether content meets specific criteria or patterns.\n Used for content validation, quality assessment, and intelligent filtering tasks. Currently in experimental phase.";
9
11
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/177";
10
12
  readonly pipelineInterface: {
11
13
  readonly inputParameters: readonly [{
@@ -1,12 +1,13 @@
1
1
  /**
2
- * Sheets is form of app that @@@
2
+ * Sheets is form of app that processes tabular data in CSV format, allowing transformation
3
+ * and analysis of structured data through AI-powered operations
3
4
  *
4
5
  * @public exported from `@promptbook/core`
5
6
  */
6
7
  export declare const SheetsFormfactorDefinition: {
7
8
  readonly name: "SHEETS";
8
9
  readonly aliasNames: readonly ["SHEETS", "SHEET"];
9
- readonly description: "@@@";
10
+ readonly description: "A formfactor for processing spreadsheet-like data in CSV format, enabling AI transformations on tabular data";
10
11
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/176";
11
12
  readonly pipelineInterface: {
12
13
  readonly inputParameters: readonly [{
@@ -1,11 +1,12 @@
1
1
  /**
2
- * Translator is form of app that @@@
2
+ * Translator is form of app that transforms input text from one form to another,
3
+ * such as language translation, style conversion, tone modification, or other text transformations.
3
4
  *
4
5
  * @public exported from `@promptbook/core`
5
6
  */
6
7
  export declare const TranslatorFormfactorDefinition: {
7
8
  readonly name: "TRANSLATOR";
8
- readonly description: "@@@";
9
+ readonly description: "A text transformation system that converts input content into different forms,\n including language translations, paraphrasing, style conversions, and tone adjustments.\n This form factor takes one input and produces one transformed output.";
9
10
  readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/175";
10
11
  readonly pipelineInterface: {
11
12
  readonly inputParameters: readonly [{
@@ -23,7 +23,7 @@ export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
23
23
  path: string | null;
24
24
  content: import("../pipeline/PipelineString").PipelineString;
25
25
  }[];
26
- readonly formfactorName?: "CHATBOT" | "GENERATOR" | "GENERIC" | "IMAGE_GENERATOR" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
26
+ readonly formfactorName?: "CHATBOT" | "COMPLETION" | "GENERATOR" | "GENERIC" | "IMAGE_GENERATOR" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
27
27
  }>): void;
28
28
  }, {
29
29
  type: "SYNC";
@@ -45,7 +45,7 @@ export declare const HIGH_LEVEL_ABSTRACTIONS: readonly [{
45
45
  path: string | null;
46
46
  content: import("../pipeline/PipelineString").PipelineString;
47
47
  }[];
48
- readonly formfactorName?: "CHATBOT" | "GENERATOR" | "GENERIC" | "IMAGE_GENERATOR" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
48
+ readonly formfactorName?: "CHATBOT" | "COMPLETION" | "GENERATOR" | "GENERIC" | "IMAGE_GENERATOR" | "EXPERIMENTAL_MATCHER" | "SHEETS" | "TRANSLATOR" | undefined;
49
49
  }>): void;
50
50
  }];
51
51
  /**
@@ -1,13 +1,13 @@
1
1
  import { $Register } from '../../../utils/$Register';
2
2
  import type { LlmToolsMetadata } from './LlmToolsMetadata';
3
3
  /**
4
- * @@@
4
+ * Register for LLM tools metadata.
5
5
  *
6
6
  * Note: `$` is used to indicate that this interacts with the global scope
7
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
7
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
10
  export declare const $llmToolsMetadataRegister: $Register<LlmToolsMetadata>;
11
11
  /**
12
12
  * TODO: [®] DRY Register logic
13
- */
13
+ */
@@ -1,13 +1,13 @@
1
1
  import type { LlmExecutionToolsConstructor } from '../../../execution/LlmExecutionToolsConstructor';
2
2
  import { $Register } from '../../../utils/$Register';
3
3
  /**
4
- * @@@
4
+ * Register for LLM tools.
5
5
  *
6
6
  * Note: `$` is used to indicate that this interacts with the global scope
7
- * @singleton Only one instance of each register is created per build, but thare can be more @@@
7
+ * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
8
8
  * @public exported from `@promptbook/core`
9
9
  */
10
10
  export declare const $llmToolsRegister: $Register<LlmExecutionToolsConstructor>;
11
11
  /**
12
12
  * TODO: [®] DRY Register logic
13
- */
13
+ */
@@ -1,8 +1,7 @@
1
1
  import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
2
2
  /**
3
- * @@@
3
+ * Provides LLM tools configuration by reading environment variables.
4
4
  *
5
- * @@@ .env
6
5
  * Note: `$` is used to indicate that this function is not a pure function - it uses filesystem to access `.env` file
7
6
  *
8
7
  * It looks for environment variables:
@@ -10,10 +9,11 @@ import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
10
9
  * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
11
10
  * - ...
12
11
  *
13
- * @returns @@@
12
+ * @see Environment variables documentation or .env file for required variables.
13
+ * @returns A promise that resolves to the LLM tools configuration, or null if configuration is incomplete or missing.
14
14
  * @public exported from `@promptbook/node`
15
15
  */
16
16
  export declare function $provideLlmToolsConfigurationFromEnv(): Promise<LlmToolsConfiguration>;
17
17
  /**
18
18
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
19
- */
19
+ */
@@ -3,7 +3,8 @@ import type { LlmExecutionToolsWithTotalUsage } from '../utils/count-total-usage
3
3
  import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFromConfiguration';
4
4
  type GetLlmToolsForTestingAndScriptsAndPlaygroundOptions = CreateLlmToolsFromConfigurationOptions & {
5
5
  /**
6
- * @@@
6
+ * Flag indicating whether the cache should be reloaded or reused
7
+ * When set to true, the existing cache will not be used but thinks will be still saved to the cache
7
8
  *
8
9
  * @default false
9
10
  */
@@ -22,5 +23,5 @@ export {};
22
23
  * Note: [⚪] This should never be in any released package
23
24
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
24
25
  * TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
25
- * TODO: [®] DRY Register logic
26
- */
26
+ * TODO: [®] DRY Register logi
27
+ */
@@ -1,11 +1,14 @@
1
1
  import { MultipleLlmExecutionTools } from '../../multiple/MultipleLlmExecutionTools';
2
2
  import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFromConfiguration';
3
3
  /**
4
- * @@@
4
+ * Automatically configures LLM tools from environment variables in Node.js
5
+ *
6
+ * This utility function detects available LLM providers based on environment variables
7
+ * and creates properly configured LLM execution tools for each detected provider.
5
8
  *
6
9
  * Note: This function is not cached, every call creates new instance of `MultipleLlmExecutionTools`
7
10
  *
8
- * @@@ .env
11
+ * Supports environment variables from .env files when dotenv is configured
9
12
  * Note: `$` is used to indicate that this function is not a pure function - it uses filesystem to access `.env` file
10
13
  *
11
14
  * It looks for environment variables:
@@ -13,12 +16,22 @@ import type { CreateLlmToolsFromConfigurationOptions } from './createLlmToolsFro
13
16
  * - `process.env.ANTHROPIC_CLAUDE_API_KEY`
14
17
  * - ...
15
18
  *
16
- * @returns @@@
19
+ * @param options Configuration options for the LLM tools
20
+ * @returns A unified interface containing all detected and configured LLM tools
17
21
  * @public exported from `@promptbook/node`
18
22
  */
19
23
  export declare function $provideLlmToolsFromEnv(options?: CreateLlmToolsFromConfigurationOptions): Promise<MultipleLlmExecutionTools>;
20
24
  /**
21
- * TODO: @@@ write `$provideLlmToolsFromEnv` vs `$provideLlmToolsConfigurationFromEnv` vs `createLlmToolsFromConfiguration`
25
+ * TODO: The architecture for LLM tools configuration consists of three key functions:
26
+ * 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
27
+ * 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
28
+ * 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
29
+ *
30
+ * This layered approach allows flexibility in how tools are configured:
31
+ * - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
32
+ * - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
33
+ * - Use createLlmToolsFromConfiguration for explicit control over tool configurations
34
+ *
22
35
  * TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
23
36
  * TODO: [🧠] Is there some meaningfull way how to test this util
24
37
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
@@ -2,17 +2,24 @@ import type { string_title } from '../../../types/typeAliases';
2
2
  import type { Registered } from '../../../utils/$Register';
3
3
  import type { LlmToolsOptions } from './LlmToolsOptions';
4
4
  /**
5
- * @@@
5
+ * Configuration definition for LLM execution tools, containing provider-specific settings
6
+ * that can be passed during runtime to instantiate and configure LLM tools properly.
6
7
  *
7
- * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
8
+ * The Promptbook LLM tools architecture involves several related types:
9
+ * - `LlmToolsMetadata`: Contains static metadata about the tool, such as name, version, and capabilities
10
+ * - `LlmToolsConfiguration`: Runtime configuration from environment variables or settings
11
+ * - `LlmToolsOptions`: Provider-specific options for instantiating tools
12
+ * - `Registered`: The record of a registered tool in the global registry
8
13
  */
9
14
  export type LlmToolsConfiguration = ReadonlyArray<Registered & {
10
15
  /**
11
- * @@@
16
+ * Human-readable name for this specific provider configuration
17
+ * Used in UI components and logs for identifying this particular configuration
12
18
  */
13
19
  readonly title: string_title;
14
20
  /**
15
- * @@@
21
+ * Provider-specific configuration options used for instantiating and configuring LLM tools
22
+ * Contains values like API keys, model preferences, endpoint URLs, and other settings
16
23
  */
17
24
  readonly options: LlmToolsOptions;
18
25
  }>;
@@ -1,18 +1,34 @@
1
+ import { MODEL_ORDERS } from '../../../constants';
2
+ import { MODEL_TRUST_LEVELS } from '../../../constants';
1
3
  import type { string_name } from '../../../types/typeAliases';
2
4
  import type { string_title } from '../../../types/typeAliases';
3
5
  import type { Registered } from '../../../utils/$Register';
4
6
  import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
5
7
  import type { LlmToolsConfiguration } from './LlmToolsConfiguration';
6
8
  /**
7
- * @@@
9
+ * Metadata definition for LLM execution tools that provides information about a provider's capabilities,
10
+ * configuration options, and relationships within the registry system.
8
11
  *
9
- * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
12
+ * The Promptbook LLM tools architecture involves several related types:
13
+ * - `LlmToolsMetadata`: Contains static metadata about the tool, such as name, version, and capabilities
14
+ * - `LlmToolsConfiguration`: Runtime configuration from environment variables or settings
15
+ * - `LlmToolsOptions`: Provider-specific options for instantiating tools
16
+ * - `Registered`: The record of a registered tool in the global registry
10
17
  */
11
18
  export type LlmToolsMetadata = Registered & {
12
19
  /**
13
- * @@@
20
+ * Human-readable display name for the LLM provider
21
+ * Used in UI components and documentation references
14
22
  */
15
23
  readonly title: string_title;
24
+ /**
25
+ * How is the model is trusted?
26
+ */
27
+ readonly trustLevel: keyof typeof MODEL_TRUST_LEVELS;
28
+ /**
29
+ * How is the model provider important and should be sorted in the list of available providers?
30
+ */
31
+ readonly order: typeof MODEL_ORDERS[keyof typeof MODEL_ORDERS] | number;
16
32
  /**
17
33
  * List of environment variables that can be used to configure the provider
18
34
  *
@@ -21,11 +37,17 @@ export type LlmToolsMetadata = Registered & {
21
37
  */
22
38
  readonly envVariables: ReadonlyArray<string_name & string_SCREAMING_CASE> | null;
23
39
  /**
24
- * @@@
40
+ * Provides a default configuration template for this LLM provider
41
+ * Used to generate example configurations or as fallback when no specific configuration is provided
42
+ * @returns A standardized configuration object for this LLM provider
25
43
  */
26
44
  getBoilerplateConfiguration(): LlmToolsConfiguration[number];
27
45
  /**
28
- * @@@
46
+ * Creates a provider-specific configuration object from environment variables
47
+ * Used to automatically configure LLM tools based on available environment settings
48
+ *
49
+ * @param env Dictionary of environment variables (key-value pairs)
50
+ * @returns Configuration object for this LLM provider if required variables are present, or null if configuration is not possible
29
51
  */
30
52
  createConfigurationFromEnv(env: Record<string_name, string>): LlmToolsConfiguration[number] | null;
31
53
  };
@@ -1,8 +1,15 @@
1
1
  import type { TODO_object } from '../../../utils/organization/TODO_object';
2
2
  /**
3
- * @@@
3
+ * Options for configuring LLM (Large Language Model) tools.
4
4
  *
5
- * @@@ `LlmToolsMetadata` vs `LlmToolsConfiguration` vs `LlmToolsOptions` (vs `Registered`)
5
+ * This type is used to pass provider-specific options to LLM execution tools.
6
+ *
7
+ *
8
+ * The Promptbook LLM tools architecture involves several related types:
9
+ * - `LlmToolsMetadata`: Contains static metadata about the tool, such as name, version, and capabilities
10
+ * - `LlmToolsConfiguration`: Runtime configuration from environment variables or settings
11
+ * - `LlmToolsOptions`: Provider-specific options for instantiating tools
12
+ * - `Registered`: The record of a registered tool in the global registry
6
13
  */
7
14
  export type LlmToolsOptions = TODO_object;
8
15
  /**
@@ -21,18 +21,27 @@ export type CreateLlmToolsFromConfigurationOptions = {
21
21
  readonly userId?: string_user_id;
22
22
  };
23
23
  /**
24
- * @@@
24
+ * Creates LLM execution tools from provided configuration objects
25
+ *
26
+ * Instantiates and configures LLM tool instances for each configuration entry,
27
+ * combining them into a unified interface via MultipleLlmExecutionTools.
25
28
  *
26
29
  * Note: This function is not cached, every call creates new instance of `MultipleLlmExecutionTools`
27
30
  *
28
- * @returns @@@
31
+ * @param configuration Array of LLM tool configurations to instantiate
32
+ * @param options Additional options for configuring the LLM tools
33
+ * @returns A unified interface combining all successfully instantiated LLM tools
29
34
  * @public exported from `@promptbook/core`
30
35
  */
31
36
  export declare function createLlmToolsFromConfiguration(configuration: LlmToolsConfiguration, options?: CreateLlmToolsFromConfigurationOptions): MultipleLlmExecutionTools;
32
37
  /**
33
38
  * TODO: [🎌] Together with `createLlmToolsFromConfiguration` + 'EXECUTION_TOOLS_CLASSES' gets to `@promptbook/core` ALL model providers, make this more efficient
34
39
  * TODO: [🧠][🎌] Dynamically install required providers
35
- * TODO: @@@ write discussion about this - wizzard
40
+ * TODO: We should implement an interactive configuration wizard that would:
41
+ * 1. Detect which LLM providers are available in the environment
42
+ * 2. Guide users through required configuration settings for each provider
43
+ * 3. Allow testing connections before completing setup
44
+ * 4. Generate appropriate configuration code for application integration
36
45
  * TODO: [🧠][🍛] Which name is better `createLlmToolsFromConfig` or `createLlmToolsFromConfiguration`?
37
46
  * TODO: [🧠] Is there some meaningfull way how to test this util
38
47
  * TODO: This should be maybe not under `_common` but under `utils`