@promptbook/openai 0.61.0-2 → 0.61.0-21

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 (360) hide show
  1. package/README.md +2 -2
  2. package/esm/index.es.js +181 -18
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/promptbook-collection/index.d.ts +200 -30
  5. package/esm/typings/src/_packages/core.index.d.ts +7 -2
  6. package/esm/typings/src/_packages/execute-javascript.index.d.ts +1 -1
  7. package/esm/typings/src/_packages/node.index.d.ts +2 -1
  8. package/esm/typings/src/_packages/types.index.d.ts +11 -7
  9. package/esm/typings/src/_packages/utils.index.d.ts +8 -6
  10. package/esm/typings/src/cli/cli-commands/hello.d.ts +3 -0
  11. package/esm/typings/src/cli/cli-commands/make.d.ts +3 -0
  12. package/esm/typings/src/cli/cli-commands/prettify.d.ts +3 -0
  13. package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
  14. package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
  15. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +10 -10
  16. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +8 -7
  17. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
  18. package/esm/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +2 -3
  19. package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +2 -2
  20. package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
  21. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  22. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +42 -14
  23. package/esm/typings/src/config.d.ts +38 -1
  24. package/esm/typings/src/config.test.d.ts +4 -0
  25. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
  26. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
  27. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
  28. package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
  29. package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
  30. package/esm/typings/src/conversion/utils/renameParameter.d.ts +3 -3
  31. package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +13 -0
  32. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +12 -3
  33. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +10 -1
  34. package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
  35. package/esm/typings/src/errors/LimitReachedError.d.ts +7 -0
  36. package/esm/typings/src/errors/VersionMismatchError.d.ts +8 -0
  37. package/esm/typings/src/execution/CommonExecutionToolsOptions.d.ts +1 -0
  38. package/esm/typings/src/execution/LlmExecutionTools.d.ts +10 -8
  39. package/esm/typings/src/execution/PipelineExecutor.d.ts +10 -8
  40. package/esm/typings/src/execution/PromptResult.d.ts +28 -58
  41. package/esm/typings/src/execution/PromptResultUsage.d.ts +26 -0
  42. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +5 -4
  43. package/esm/typings/src/execution/UncertainNumber.d.ts +18 -0
  44. package/esm/typings/src/execution/UserInterfaceTools.d.ts +5 -5
  45. package/esm/typings/src/execution/createPipelineExecutor.d.ts +20 -3
  46. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
  47. package/esm/typings/src/execution/utils/addUsage.d.ts +58 -2
  48. package/esm/typings/src/execution/utils/computeUsageCounts.d.ts +1 -1
  49. package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  50. package/esm/typings/src/execution/utils/uncertainNumber.d.ts +1 -1
  51. package/esm/typings/src/execution/utils/usageToWorktime.d.ts +2 -2
  52. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
  53. package/esm/typings/src/formats/csv/ListFormatDefinition.d.ts +2 -1
  54. package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +2 -1
  55. package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +2 -1
  56. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -0
  57. package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
  58. package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -0
  59. package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +27 -0
  60. package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
  61. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +9 -23
  62. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
  63. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +8 -14
  64. package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +30 -0
  65. package/esm/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +10 -0
  66. package/esm/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +11 -0
  67. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
  68. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
  69. package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +16 -0
  70. package/esm/typings/src/llm-providers/_common/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
  71. package/esm/typings/src/llm-providers/_common/utils/count-total-cost/countTotalCost.d.ts +14 -0
  72. package/esm/typings/src/llm-providers/_common/utils/count-total-cost/limitTotalCost.d.ts +32 -0
  73. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -2
  74. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  75. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +3 -3
  76. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
  77. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -4
  78. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
  79. package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
  80. package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +3 -0
  81. package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +1 -1
  82. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -5
  83. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +7 -7
  84. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +12 -8
  85. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +7 -6
  86. package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
  87. package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
  88. package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
  89. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
  90. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
  91. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +9 -7
  92. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
  93. package/esm/typings/src/personas/preparePersona.d.ts +15 -0
  94. package/esm/typings/src/prepare/PrepareOptions.d.ts +22 -0
  95. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +10 -0
  96. package/esm/typings/src/prepare/preparePipeline.d.ts +18 -0
  97. package/esm/typings/src/prepare/unpreparePipeline.d.ts +9 -0
  98. package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
  99. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  100. package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +2 -1
  101. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +25 -0
  102. package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
  103. package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +30 -0
  104. package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +13 -0
  105. package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
  106. package/esm/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
  107. package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +9 -0
  108. package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +9 -0
  109. package/esm/typings/src/storage/memory/MemoryStorage.d.ts +34 -0
  110. package/esm/typings/src/storage/utils/PrefixStorage.d.ts +26 -0
  111. package/esm/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
  112. package/esm/typings/src/types/ModelRequirements.d.ts +71 -11
  113. package/esm/typings/src/types/ModelVariant.d.ts +14 -0
  114. package/esm/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
  115. package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
  116. package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
  117. package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +9 -1
  118. package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +38 -0
  119. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +29 -4
  120. package/esm/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
  121. package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +5 -0
  122. package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +5 -1
  123. package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +13 -4
  124. package/esm/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
  125. package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
  126. package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
  127. package/esm/typings/src/types/PipelineString.d.ts +1 -1
  128. package/esm/typings/src/types/Prompt.d.ts +54 -10
  129. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
  130. package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
  131. package/esm/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
  132. package/esm/typings/src/types/typeAliases.d.ts +114 -15
  133. package/esm/typings/src/utils/FromtoItems.d.ts +3 -3
  134. package/esm/typings/src/utils/currentDate.d.ts +7 -0
  135. package/esm/typings/src/utils/deepClone.d.ts +9 -0
  136. package/esm/typings/src/utils/deepFreeze.d.ts +22 -0
  137. package/esm/typings/src/utils/emojis.d.ts +2 -2
  138. package/esm/typings/src/utils/extractParameters.d.ts +2 -2
  139. package/esm/typings/src/utils/formatNumber.d.ts +1 -1
  140. package/esm/typings/src/utils/isRunningInWhatever.d.ts +3 -0
  141. package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +3 -3
  142. package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +7 -10
  143. package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
  144. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
  145. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
  146. package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  147. package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
  148. package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -1
  149. package/esm/typings/src/utils/organization/TODO_USE.d.ts +12 -0
  150. package/esm/typings/src/utils/organization/TODO_any.d.ts +6 -0
  151. package/esm/typings/src/utils/organization/TODO_object.d.ts +6 -0
  152. package/esm/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
  153. package/esm/typings/src/utils/organization/___.d.ts +6 -0
  154. package/esm/typings/src/utils/{just.d.ts → organization/just.d.ts} +5 -1
  155. package/esm/typings/src/utils/organization/keepUnused.d.ts +16 -0
  156. package/esm/typings/src/utils/organization/really_any.d.ts +6 -0
  157. package/esm/typings/src/utils/organization/really_unknown.d.ts +6 -0
  158. package/esm/typings/src/utils/random/randomSeed.d.ts +7 -0
  159. package/{umd/typings/src/execution → esm/typings/src}/utils/replaceParameters.d.ts +2 -4
  160. package/esm/typings/src/utils/replaceParameters.test.d.ts +1 -0
  161. package/esm/typings/src/utils/sets/difference.d.ts +3 -0
  162. package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +2 -1
  163. package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -1
  164. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -1
  165. package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  166. package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -1
  167. package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -1
  168. package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +2 -1
  169. package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -1
  170. package/package.json +2 -2
  171. package/umd/index.umd.js +181 -18
  172. package/umd/index.umd.js.map +1 -1
  173. package/umd/typings/promptbook-collection/index.d.ts +200 -30
  174. package/umd/typings/src/_packages/core.index.d.ts +7 -2
  175. package/umd/typings/src/_packages/execute-javascript.index.d.ts +1 -1
  176. package/umd/typings/src/_packages/node.index.d.ts +2 -1
  177. package/umd/typings/src/_packages/types.index.d.ts +11 -7
  178. package/umd/typings/src/_packages/utils.index.d.ts +8 -6
  179. package/umd/typings/src/cli/cli-commands/hello.d.ts +3 -0
  180. package/umd/typings/src/cli/cli-commands/make.d.ts +3 -0
  181. package/umd/typings/src/cli/cli-commands/prettify.d.ts +3 -0
  182. package/umd/typings/src/cli/promptbookCli.d.ts +1 -0
  183. package/umd/typings/src/collection/PipelineCollection.d.ts +1 -1
  184. package/umd/typings/src/collection/SimplePipelineCollection.d.ts +10 -10
  185. package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +8 -7
  186. package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +2 -2
  187. package/umd/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +2 -3
  188. package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +2 -2
  189. package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +4 -2
  190. package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  191. package/umd/typings/src/commands/_common/types/CommandParser.d.ts +42 -14
  192. package/umd/typings/src/config.d.ts +38 -1
  193. package/umd/typings/src/config.test.d.ts +4 -0
  194. package/umd/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
  195. package/umd/typings/src/conversion/pipelineStringToJson.d.ts +9 -5
  196. package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +5 -3
  197. package/umd/typings/src/conversion/prettify/PrettifyOptions.d.ts +2 -2
  198. package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
  199. package/umd/typings/src/conversion/utils/renameParameter.d.ts +3 -3
  200. package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +13 -0
  201. package/umd/typings/src/conversion/utils/stringifyPipelineJson.test.d.ts +1 -0
  202. package/umd/typings/src/conversion/validation/_importPipeline.d.ts +12 -3
  203. package/umd/typings/src/conversion/validation/validatePipeline.d.ts +10 -1
  204. package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +7 -0
  205. package/umd/typings/src/errors/LimitReachedError.d.ts +7 -0
  206. package/umd/typings/src/errors/VersionMismatchError.d.ts +8 -0
  207. package/umd/typings/src/execution/CommonExecutionToolsOptions.d.ts +1 -0
  208. package/umd/typings/src/execution/LlmExecutionTools.d.ts +10 -8
  209. package/umd/typings/src/execution/PipelineExecutor.d.ts +10 -8
  210. package/umd/typings/src/execution/PromptResult.d.ts +28 -58
  211. package/umd/typings/src/execution/PromptResultUsage.d.ts +26 -0
  212. package/umd/typings/src/execution/ScriptExecutionTools.d.ts +5 -4
  213. package/umd/typings/src/execution/UncertainNumber.d.ts +18 -0
  214. package/umd/typings/src/execution/UserInterfaceTools.d.ts +5 -5
  215. package/umd/typings/src/execution/createPipelineExecutor.d.ts +20 -3
  216. package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +2 -2
  217. package/umd/typings/src/execution/utils/addUsage.d.ts +58 -2
  218. package/umd/typings/src/execution/utils/computeUsageCounts.d.ts +1 -1
  219. package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  220. package/umd/typings/src/execution/utils/uncertainNumber.d.ts +1 -1
  221. package/umd/typings/src/execution/utils/usageToWorktime.d.ts +2 -2
  222. package/umd/typings/src/formats/_common/FormatDefinition.d.ts +1 -1
  223. package/umd/typings/src/formats/csv/ListFormatDefinition.d.ts +2 -1
  224. package/umd/typings/src/formats/json/JsonFormatDefinition.d.ts +2 -1
  225. package/umd/typings/src/formats/list/ListFormatDefinition.d.ts +2 -1
  226. package/umd/typings/src/formats/xml/XmlFormatDefinition.d.ts +1 -0
  227. package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +1 -1
  228. package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -0
  229. package/umd/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +27 -0
  230. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +18 -0
  231. package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts +1 -0
  232. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +9 -23
  233. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts +3 -0
  234. package/umd/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +8 -14
  235. package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +30 -0
  236. package/umd/typings/src/llm-providers/_common/getLlmToolsForCli.d.ts +10 -0
  237. package/umd/typings/src/llm-providers/_common/getLlmToolsForTestingAndScriptsAndPlayground.d.ts +11 -0
  238. package/umd/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +29 -0
  239. package/umd/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +10 -0
  240. package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +16 -0
  241. package/umd/typings/src/llm-providers/_common/utils/count-total-cost/LlmExecutionToolsWithTotalCost.d.ts +11 -0
  242. package/umd/typings/src/llm-providers/_common/utils/count-total-cost/countTotalCost.d.ts +14 -0
  243. package/umd/typings/src/llm-providers/_common/utils/count-total-cost/limitTotalCost.d.ts +32 -0
  244. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +3 -2
  245. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +1 -1
  246. package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +3 -3
  247. package/umd/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -0
  248. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -4
  249. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +5 -5
  250. package/umd/typings/src/llm-providers/azure-openai/playground/playground.d.ts +3 -0
  251. package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +3 -0
  252. package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +1 -1
  253. package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -5
  254. package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +7 -7
  255. package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +12 -8
  256. package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +7 -6
  257. package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +1 -1
  258. package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
  259. package/umd/typings/src/llm-providers/openai/computeUsage.d.ts +2 -2
  260. package/umd/typings/src/llm-providers/openai/openai-models.d.ts +3 -2
  261. package/umd/typings/src/llm-providers/openai/playground/playground.d.ts +3 -0
  262. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +9 -7
  263. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +1 -1
  264. package/umd/typings/src/personas/preparePersona.d.ts +15 -0
  265. package/umd/typings/src/personas/preparePersona.test.d.ts +1 -0
  266. package/umd/typings/src/prepare/PrepareOptions.d.ts +22 -0
  267. package/umd/typings/src/prepare/isPipelinePrepared.d.ts +10 -0
  268. package/umd/typings/src/prepare/isPipelinePrepared.test.d.ts +1 -0
  269. package/umd/typings/src/prepare/preparePipeline.d.ts +18 -0
  270. package/umd/typings/src/prepare/unpreparePipeline.d.ts +9 -0
  271. package/umd/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +1 -1
  272. package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  273. package/umd/typings/src/scripting/javascript/utils/unknownToString.d.ts +2 -1
  274. package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +25 -0
  275. package/umd/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
  276. package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +30 -0
  277. package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +13 -0
  278. package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.d.ts +7 -0
  279. package/umd/typings/src/storage/files-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
  280. package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +9 -0
  281. package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +9 -0
  282. package/umd/typings/src/storage/memory/MemoryStorage.d.ts +34 -0
  283. package/umd/typings/src/storage/utils/PrefixStorage.d.ts +26 -0
  284. package/umd/typings/src/storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
  285. package/umd/typings/src/types/ModelRequirements.d.ts +71 -11
  286. package/umd/typings/src/types/ModelVariant.d.ts +14 -0
  287. package/umd/typings/src/types/PipelineJson/Expectations.d.ts +6 -2
  288. package/umd/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +67 -0
  289. package/umd/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +24 -0
  290. package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +9 -1
  291. package/umd/typings/src/types/PipelineJson/PersonaJson.d.ts +38 -0
  292. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +29 -4
  293. package/umd/typings/src/types/PipelineJson/PreparationJson.d.ts +21 -0
  294. package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +5 -0
  295. package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +5 -1
  296. package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +13 -4
  297. package/umd/typings/src/types/PipelineJson/PromptTemplateParameterJson.d.ts +11 -2
  298. package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +2 -0
  299. package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +2 -0
  300. package/umd/typings/src/types/PipelineString.d.ts +1 -1
  301. package/umd/typings/src/types/Prompt.d.ts +54 -10
  302. package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +4 -4
  303. package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +3 -3
  304. package/umd/typings/src/types/execution-report/countWorkingDuration.d.ts +1 -1
  305. package/umd/typings/src/types/typeAliases.d.ts +114 -15
  306. package/umd/typings/src/utils/FromtoItems.d.ts +3 -3
  307. package/umd/typings/src/utils/currentDate.d.ts +7 -0
  308. package/umd/typings/src/utils/deepClone.d.ts +9 -0
  309. package/umd/typings/src/utils/deepFreeze.d.ts +22 -0
  310. package/umd/typings/src/utils/emojis.d.ts +2 -2
  311. package/umd/typings/src/utils/extractParameters.d.ts +2 -2
  312. package/umd/typings/src/utils/formatNumber.d.ts +1 -1
  313. package/umd/typings/src/utils/isRunningInWhatever.d.ts +3 -0
  314. package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +3 -3
  315. package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +7 -10
  316. package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +1 -1
  317. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
  318. package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +9 -2
  319. package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  320. package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +3 -3
  321. package/umd/typings/src/utils/normalization/parseKeywords.d.ts +2 -1
  322. package/umd/typings/src/utils/organization/TODO_USE.d.ts +12 -0
  323. package/umd/typings/src/utils/organization/TODO_any.d.ts +6 -0
  324. package/umd/typings/src/utils/organization/TODO_object.d.ts +6 -0
  325. package/umd/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
  326. package/umd/typings/src/utils/organization/___.d.ts +6 -0
  327. package/umd/typings/src/utils/{just.d.ts → organization/just.d.ts} +5 -1
  328. package/umd/typings/src/utils/organization/keepUnused.d.ts +16 -0
  329. package/umd/typings/src/utils/organization/really_any.d.ts +6 -0
  330. package/umd/typings/src/utils/organization/really_unknown.d.ts +6 -0
  331. package/umd/typings/src/utils/random/randomSeed.d.ts +7 -0
  332. package/{esm/typings/src/execution → umd/typings/src}/utils/replaceParameters.d.ts +2 -4
  333. package/umd/typings/src/utils/replaceParameters.test.d.ts +1 -0
  334. package/umd/typings/src/utils/sets/difference.d.ts +3 -0
  335. package/umd/typings/src/utils/validators/email/isValidEmail.d.ts +2 -1
  336. package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -1
  337. package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -1
  338. package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  339. package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -1
  340. package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -1
  341. package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +2 -1
  342. package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -1
  343. package/esm/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
  344. package/esm/typings/src/personas/personaToModelRequirements.d.ts +0 -6
  345. package/esm/typings/src/types/Parameters.d.ts +0 -14
  346. package/esm/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
  347. package/esm/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
  348. package/umd/typings/src/collection/constructors/justTestFsImport.d.ts +0 -7
  349. package/umd/typings/src/personas/personaToModelRequirements.d.ts +0 -6
  350. package/umd/typings/src/types/Parameters.d.ts +0 -14
  351. package/umd/typings/src/types/PipelineJson/KnowledgeJson.d.ts +0 -6
  352. package/umd/typings/src/types/PipelineJson/MaterialKnowledgePieceJson.d.ts +0 -28
  353. /package/esm/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
  354. /package/esm/typings/src/{execution/addPromptResultUsage.test.d.ts → conversion/utils/stringifyPipelineJson.test.d.ts} +0 -0
  355. /package/esm/typings/src/{execution/utils/replaceParameters.test.d.ts → knowledge/prepare-knowledge/_common/prepareKnowledgePieces.test.d.ts} +0 -0
  356. /package/{umd/typings/src/execution/addPromptResultUsage.test.d.ts → esm/typings/src/personas/preparePersona.test.d.ts} +0 -0
  357. /package/esm/typings/src/{utils/postprocessing → postprocessing/utils}/extractBlock.d.ts +0 -0
  358. /package/{umd/typings/src/execution/utils/replaceParameters.test.d.ts → esm/typings/src/prepare/isPipelinePrepared.test.d.ts} +0 -0
  359. /package/umd/typings/src/_packages/{markdown-utils.d.ts → markdown-utils.index.d.ts} +0 -0
  360. /package/umd/typings/src/{utils/postprocessing → postprocessing/utils}/extractBlock.d.ts +0 -0
@@ -9,30 +9,74 @@ declare const _default: ({
9
9
  isOutput: boolean;
10
10
  }[];
11
11
  promptTemplates: {
12
+ blockType: string;
12
13
  name: string;
13
14
  title: string;
14
- dependentParameterNames: string[];
15
- blockType: string;
16
15
  modelRequirements: {
17
16
  modelVariant: string;
18
17
  modelName: string;
19
18
  };
20
19
  content: string;
20
+ dependentParameterNames: string[];
21
21
  resultingParameterName: string;
22
22
  }[];
23
- knowledge: {
24
- name: string;
25
- title: string;
26
- content: string;
27
- keywords: string[];
28
- index: {
29
- modelName: string;
30
- position: number[];
31
- }[];
32
- sources: {
33
- title: string;
34
- href: string;
35
- }[];
23
+ knowledgeSources: never[];
24
+ knowledgePieces: never[];
25
+ personas: never[];
26
+ preparations: {
27
+ id: number;
28
+ promptbookVersion: string;
29
+ modelUsage: {
30
+ price: {
31
+ value: number;
32
+ };
33
+ input: {
34
+ tokensCount: {
35
+ value: number;
36
+ };
37
+ charactersCount: {
38
+ value: number;
39
+ };
40
+ wordsCount: {
41
+ value: number;
42
+ };
43
+ sentencesCount: {
44
+ value: number;
45
+ };
46
+ linesCount: {
47
+ value: number;
48
+ };
49
+ paragraphsCount: {
50
+ value: number;
51
+ };
52
+ pagesCount: {
53
+ value: number;
54
+ };
55
+ };
56
+ output: {
57
+ tokensCount: {
58
+ value: number;
59
+ };
60
+ charactersCount: {
61
+ value: number;
62
+ };
63
+ wordsCount: {
64
+ value: number;
65
+ };
66
+ sentencesCount: {
67
+ value: number;
68
+ };
69
+ linesCount: {
70
+ value: number;
71
+ };
72
+ paragraphsCount: {
73
+ value: number;
74
+ };
75
+ pagesCount: {
76
+ value: number;
77
+ };
78
+ };
79
+ };
36
80
  }[];
37
81
  sourceFile: string;
38
82
  } | {
@@ -46,36 +90,162 @@ declare const _default: ({
46
90
  isOutput: boolean;
47
91
  }[];
48
92
  promptTemplates: {
93
+ blockType: string;
49
94
  name: string;
50
95
  title: string;
51
- dependentParameterNames: string[];
52
- blockType: string;
96
+ modelRequirements: {
97
+ modelVariant: string;
98
+ modelName: string;
99
+ };
100
+ content: string;
53
101
  expectations: {
54
102
  words: {
55
103
  min: number;
56
104
  max: number;
57
105
  };
58
106
  };
107
+ dependentParameterNames: string[];
108
+ resultingParameterName: string;
109
+ }[];
110
+ knowledgeSources: never[];
111
+ knowledgePieces: never[];
112
+ personas: never[];
113
+ preparations: {
114
+ id: number;
115
+ promptbookVersion: string;
116
+ modelUsage: {
117
+ price: {
118
+ value: number;
119
+ };
120
+ input: {
121
+ tokensCount: {
122
+ value: number;
123
+ };
124
+ charactersCount: {
125
+ value: number;
126
+ };
127
+ wordsCount: {
128
+ value: number;
129
+ };
130
+ sentencesCount: {
131
+ value: number;
132
+ };
133
+ linesCount: {
134
+ value: number;
135
+ };
136
+ paragraphsCount: {
137
+ value: number;
138
+ };
139
+ pagesCount: {
140
+ value: number;
141
+ };
142
+ };
143
+ output: {
144
+ tokensCount: {
145
+ value: number;
146
+ };
147
+ charactersCount: {
148
+ value: number;
149
+ };
150
+ wordsCount: {
151
+ value: number;
152
+ };
153
+ sentencesCount: {
154
+ value: number;
155
+ };
156
+ linesCount: {
157
+ value: number;
158
+ };
159
+ paragraphsCount: {
160
+ value: number;
161
+ };
162
+ pagesCount: {
163
+ value: number;
164
+ };
165
+ };
166
+ };
167
+ }[];
168
+ sourceFile: string;
169
+ } | {
170
+ title: string;
171
+ pipelineUrl: string;
172
+ promptbookVersion: string;
173
+ parameters: {
174
+ name: string;
175
+ description: string;
176
+ isInput: boolean;
177
+ isOutput: boolean;
178
+ }[];
179
+ promptTemplates: {
180
+ blockType: string;
181
+ name: string;
182
+ title: string;
59
183
  modelRequirements: {
60
184
  modelVariant: string;
61
185
  modelName: string;
62
186
  };
63
187
  content: string;
188
+ expectFormat: string;
189
+ dependentParameterNames: string[];
64
190
  resultingParameterName: string;
65
191
  }[];
66
- knowledge: {
67
- name: string;
68
- title: string;
69
- content: string;
70
- keywords: string[];
71
- index: {
72
- modelName: string;
73
- position: number[];
74
- }[];
75
- sources: {
76
- title: string;
77
- href: string;
78
- }[];
192
+ knowledgeSources: never[];
193
+ knowledgePieces: never[];
194
+ personas: never[];
195
+ preparations: {
196
+ id: number;
197
+ promptbookVersion: string;
198
+ modelUsage: {
199
+ price: {
200
+ value: number;
201
+ };
202
+ input: {
203
+ tokensCount: {
204
+ value: number;
205
+ };
206
+ charactersCount: {
207
+ value: number;
208
+ };
209
+ wordsCount: {
210
+ value: number;
211
+ };
212
+ sentencesCount: {
213
+ value: number;
214
+ };
215
+ linesCount: {
216
+ value: number;
217
+ };
218
+ paragraphsCount: {
219
+ value: number;
220
+ };
221
+ pagesCount: {
222
+ value: number;
223
+ };
224
+ };
225
+ output: {
226
+ tokensCount: {
227
+ value: number;
228
+ };
229
+ charactersCount: {
230
+ value: number;
231
+ };
232
+ wordsCount: {
233
+ value: number;
234
+ };
235
+ sentencesCount: {
236
+ value: number;
237
+ };
238
+ linesCount: {
239
+ value: number;
240
+ };
241
+ paragraphsCount: {
242
+ value: number;
243
+ };
244
+ pagesCount: {
245
+ value: number;
246
+ };
247
+ };
248
+ };
79
249
  }[];
80
250
  sourceFile: string;
81
251
  })[];
@@ -9,6 +9,7 @@ import { pipelineJsonToString } from '../conversion/pipelineJsonToString';
9
9
  import { pipelineStringToJson } from '../conversion/pipelineStringToJson';
10
10
  import { pipelineStringToJsonSync } from '../conversion/pipelineStringToJsonSync';
11
11
  import { prettifyPipelineString } from '../conversion/prettify/prettifyPipelineString';
12
+ import { stringifyPipelineJson } from '../conversion/utils/stringifyPipelineJson';
12
13
  import { validatePipeline } from '../conversion/validation/validatePipeline';
13
14
  import { CollectionError } from '../errors/CollectionError';
14
15
  import { NotFoundError } from '../errors/NotFoundError';
@@ -17,6 +18,7 @@ import { PipelineExecutionError } from '../errors/PipelineExecutionError';
17
18
  import { PipelineLogicError } from '../errors/PipelineLogicError';
18
19
  import { ReferenceError } from '../errors/ReferenceError';
19
20
  import { UnexpectedError } from '../errors/UnexpectedError';
21
+ import { VersionMismatchError } from '../errors/VersionMismatchError';
20
22
  import { ExpectError } from '../errors/_ExpectError';
21
23
  import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
22
24
  import { createPipelineExecutor } from '../execution/createPipelineExecutor';
@@ -29,6 +31,8 @@ import type { CallbackInterfaceToolsOptions } from '../knowledge/dialogs/callbac
29
31
  import { SimplePromptInterfaceTools } from '../knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools';
30
32
  import { prepareKnowledgeFromMarkdown } from '../knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown';
31
33
  import { joinLlmExecutionTools } from '../llm-providers/multiple/joinLlmExecutionTools';
34
+ import { preparePipeline } from '../prepare/preparePipeline';
35
+ import { unpreparePipeline } from '../prepare/unpreparePipeline';
32
36
  import type { ExecutionReportStringOptions } from '../types/execution-report/ExecutionReportStringOptions';
33
37
  import { ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
34
38
  import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
@@ -38,7 +42,8 @@ export { BlockTypes, RESERVED_PARAMETER_NAMES };
38
42
  export { addUsage, assertsExecutionSuccessful, checkExpectations, embeddingVectorToString, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, isPassingExpectations, prepareKnowledgeFromMarkdown, prettifyPipelineString, usageToWorktime, };
39
43
  export { collectionToJson, createCollectionFromJson, createCollectionFromPromise, createCollectionFromUrl, createSubcollection, };
40
44
  export { SimplePromptInterfaceTools };
41
- export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, validatePipeline };
45
+ export { pipelineJsonToString, pipelineStringToJson, pipelineStringToJsonSync, stringifyPipelineJson, validatePipeline, };
46
+ export { preparePipeline, unpreparePipeline };
42
47
  export { createPipelineExecutor, joinLlmExecutionTools };
43
48
  export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
44
- export { CollectionError, ExpectError, NotFoundError, ParsingError, PipelineExecutionError, PipelineLogicError, ReferenceError, UnexpectedError, };
49
+ export { CollectionError, ExpectError, NotFoundError, ParsingError, PipelineExecutionError, PipelineLogicError, ReferenceError, UnexpectedError, VersionMismatchError, };
@@ -1,4 +1,5 @@
1
1
  import spaceTrim from 'spacetrim';
2
+ import { extractBlock } from '../postprocessing/utils/extractBlock';
2
3
  import { JavascriptEvalExecutionTools } from '../scripting/javascript/JavascriptEvalExecutionTools';
3
4
  import { JavascriptExecutionTools } from '../scripting/javascript/JavascriptExecutionTools';
4
5
  import { prettifyMarkdown } from '../utils/markdown/prettifyMarkdown';
@@ -13,7 +14,6 @@ import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelC
13
14
  import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
14
15
  import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
15
16
  import { removeDiacritics } from '../utils/normalization/removeDiacritics';
16
- import { extractBlock } from '../utils/postprocessing/extractBlock';
17
17
  import { removeEmojis } from '../utils/removeEmojis';
18
18
  import { removeQuotes } from '../utils/removeQuotes';
19
19
  import { trimCodeBlock } from '../utils/trimCodeBlock';
@@ -1,4 +1,5 @@
1
1
  import { createCollectionFromDirectory } from '../collection/constructors/createCollectionFromDirectory';
2
+ import { createLlmToolsFromEnv } from '../llm-providers/_common/createLlmToolsFromEnv';
2
3
  import { PROMPTBOOK_VERSION } from '../version';
3
4
  export { PROMPTBOOK_VERSION };
4
- export { createCollectionFromDirectory };
5
+ export { createCollectionFromDirectory, createLlmToolsFromEnv };
@@ -5,17 +5,21 @@ import { EmbeddingVector } from '../execution/EmbeddingVector';
5
5
  import type { ExecutionTools } from '../execution/ExecutionTools';
6
6
  import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
7
7
  import type { PipelineExecutor } from '../execution/PipelineExecutor';
8
- import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
8
+ import type { ChatPromptResult, CommonPromptResult, CompletionPromptResult, EmbeddingPromptResult, PromptResult } from '../execution/PromptResult';
9
+ import type { PromptResultUsage, PromptResultUsageCounts } from '../execution/PromptResultUsage';
9
10
  import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
11
+ import type { UncertainNumber } from '../execution/UncertainNumber';
10
12
  import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
11
- import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
12
- import type { Parameters } from '../types/Parameters';
13
+ import type { ModelRequirements } from '../types/ModelRequirements';
14
+ import type { ModelVariant } from '../types/ModelVariant';
13
15
  import type { ExpectationAmount, ExpectationUnit, Expectations } from '../types/PipelineJson/Expectations';
14
16
  import { EXPECTATION_UNITS } from '../types/PipelineJson/Expectations';
15
- import { KnowledgeJson } from '../types/PipelineJson/KnowledgeJson';
17
+ import { KnowledgePiecePreparedJson } from '../types/PipelineJson/KnowledgePieceJson';
18
+ import { KnowledgeSourceJson, KnowledgeSourcePreparedJson } from '../types/PipelineJson/KnowledgeSourceJson';
16
19
  import type { LlmTemplateJson } from '../types/PipelineJson/LlmTemplateJson';
17
- import { MaterialKnowledgePieceJson } from '../types/PipelineJson/MaterialKnowledgePieceJson';
20
+ import { PersonaJson, PersonaPreparedJson } from '../types/PipelineJson/PersonaJson';
18
21
  import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
22
+ import { PreparationJson } from '../types/PipelineJson/PreparationJson';
19
23
  import type { PromptDialogJson } from '../types/PipelineJson/PromptDialogJson';
20
24
  import type { PromptTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
21
25
  import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
@@ -27,12 +31,12 @@ import type { ScriptLanguage } from '../types/ScriptLanguage';
27
31
  import type { TaskProgress } from '../types/TaskProgress';
28
32
  import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
29
33
  import type { string_char_emoji } from '../types/typeAliasEmoji';
30
- import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_script, string_semantic_version, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid } from '../types/typeAliases';
34
+ import type { Parameters, ReservedParameters, client_id, number_model_temperature, number_seed, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_parameter_name, string_parameter_value, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_documentation_url, string_reserved_parameter_name, string_script, string_semantic_version, string_sha256, string_system_message, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid } from '../types/typeAliases';
31
35
  import type { FromtoItems } from '../utils/FromtoItems';
32
36
  import { PROMPTBOOK_VERSION, string_promptbook_version } from '../version';
33
37
  export { PROMPTBOOK_VERSION };
34
38
  export { EXPECTATION_UNITS };
35
- export type { AvailableModel, BlockType, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgeJson, LlmExecutionTools, LlmTemplateJson, MaterialKnowledgePieceJson, ModelRequirements, ModelVariant, Parameters, PipelineCollection, PipelineExecutor, PipelineJson, PipelineString, Prompt, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_version, string_script, string_sha256, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid, string_semantic_version as string_version, };
39
+ export type { AvailableModel, BlockType, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExpectationAmount, ExpectationUnit, Expectations, FromtoItems, KnowledgePiecePreparedJson, KnowledgeSourceJson, KnowledgeSourcePreparedJson, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, PersonaJson, PersonaPreparedJson, PipelineCollection, PipelineExecutor, PipelineJson, PipelineString, PreparationJson, Prompt, ChatPromptResult as PromptChatResult, CommonPromptResult as PromptCommonResult, CompletionPromptResult as PromptCompletionResult, PromptDialogJson, EmbeddingPromptResult as PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, PromptTemplateJson, PromptTemplateParameterJson, ReservedParameters, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, TaskProgress, UncertainNumber, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, client_id, number_model_temperature, number_seed, string_char, string_char_emoji, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, string_emails, string_file_absolute_path, string_file_extension, string_file_path, string_file_relative_path, string_filename, string_folder_absolute_path, string_folder_path, string_folder_relative_path, string_host, string_hostname, string_href, string_html, string_javascript, string_javascript_name, string_license, string_markdown, string_markdown_text, string_mime_type, string_mime_type_with_wildcard, string_model_name, string_name, string_parameter_name, string_parameter_value, string_person_fullname, string_pipeline_url, string_pipeline_url_with_hashtemplate, string_prompt, string_promptbook_documentation_url, string_promptbook_version, string_reserved_parameter_name, string_script, string_semantic_version, string_sha256, string_system_message, string_tdl, string_template, string_text_prompt, string_title, string_token, string_translate_language, string_uri, string_uri_part, string_url, string_url_image, string_uuid, };
36
40
  /**
37
41
  * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
38
42
  */
@@ -5,8 +5,9 @@ import { extractVariables } from '../conversion/utils/extractVariables';
5
5
  import { renameParameter } from '../conversion/utils/renameParameter';
6
6
  import { titleToName } from '../conversion/utils/titleToName';
7
7
  import { forEachAsync } from '../execution/utils/forEachAsync';
8
- import { replaceParameters } from '../execution/utils/replaceParameters';
9
8
  import { isValidJsonString } from '../formats/json/utils/isValidJsonString';
9
+ import { extractBlock } from '../postprocessing/utils/extractBlock';
10
+ import { $currentDate } from '../utils/currentDate';
10
11
  import { countCharacters } from '../utils/expectation-counters/countCharacters';
11
12
  import { countLines } from '../utils/expectation-counters/countLines';
12
13
  import { countPages } from '../utils/expectation-counters/countPages';
@@ -33,9 +34,10 @@ import { parseKeywordsFromString } from '../utils/normalization/parseKeywordsFro
33
34
  import { removeDiacritics } from '../utils/normalization/removeDiacritics';
34
35
  import { searchKeywords } from '../utils/normalization/searchKeywords';
35
36
  import { parseNumber } from '../utils/parseNumber';
36
- import { extractBlock } from '../utils/postprocessing/extractBlock';
37
+ import { $randomSeed } from '../utils/random/randomSeed';
37
38
  import { removeEmojis } from '../utils/removeEmojis';
38
39
  import { removeQuotes } from '../utils/removeQuotes';
40
+ import { replaceParameters } from '../utils/replaceParameters';
39
41
  import { difference } from '../utils/sets/difference';
40
42
  import { intersection } from '../utils/sets/intersection';
41
43
  import { union } from '../utils/sets/union';
@@ -53,9 +55,10 @@ import { isValidUrl } from '../utils/validators/url/isValidUrl';
53
55
  import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
54
56
  import { PROMPTBOOK_VERSION } from '../version';
55
57
  export { forEachAsync, PROMPTBOOK_VERSION };
56
- export { extractBlock, // <- [🌻] + maybe export through `@promptbook/markdown-utils`
57
- extractParameters, extractVariables, isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl as isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
58
- removeEmojis, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
58
+ export { extractParameters, extractVariables, replaceParameters, spaceTrim };
59
+ export { $currentDate, $randomSeed, extractBlock, // <- [🌻] + maybe export through `@promptbook/markdown-utils`
60
+ isHostnameOnPrivateNetwork, isUrlOnPrivateNetwork, isValidFilePath, isValidJavascriptName, isValidJsonString, isValidPipelineUrl, isValidPromptbookVersion, isValidSemanticVersion, isValidUrl, isValidUuid, parseNumber, // <- [🌻]
61
+ removeEmojis, removeQuotes, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
59
62
  export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
60
63
  export { splitIntoSentences };
61
64
  export declare const normalizeTo: {
@@ -70,6 +73,5 @@ export type { string_camelCase, string_kebab_case, string_PascalCase, string_SCR
70
73
  export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
71
74
  export { difference, intersection, union };
72
75
  /**
73
- * TODO: [🧠] Maybe create some indipendent package like `@promptbook/markdown-utils`
74
76
  * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
75
77
  */
@@ -5,3 +5,6 @@ import type { Command as Program } from 'commander';
5
5
  * @private part of `promptbookCli`
6
6
  */
7
7
  export declare function initializeHelloCommand(program: Program): void;
8
+ /**
9
+ * Note: [🟡] This code should never be published outside of `@promptbook/cli`
10
+ */
@@ -5,3 +5,6 @@ import type { Command as Program } from 'commander';
5
5
  * @private part of `promptbookCli`
6
6
  */
7
7
  export declare function initializeMakeCommand(program: Program): void;
8
+ /**
9
+ * Note: [🟡] This code should never be published outside of `@promptbook/cli`
10
+ */
@@ -5,3 +5,6 @@ import type { Command as Program } from 'commander';
5
5
  * @private part of `promptbookCli`
6
6
  */
7
7
  export declare function initializePrettifyCommand(program: Program): void;
8
+ /**
9
+ * Note: [🟡] This code should never be published outside of `@promptbook/cli`
10
+ */
@@ -6,4 +6,5 @@ export declare function promptbookCli(): Promise<void>;
6
6
  * TODO: [🥠] Do not export to utils directly, its just for CLI script
7
7
  * TODO: [🕌] When more functionalities, rename
8
8
  * Note: 11:11
9
+ * Note: [🟡] This code should never be published outside of `@promptbook/cli`
9
10
  */
@@ -5,7 +5,7 @@ import type { string_pipeline_url } from '../types/typeAliases';
5
5
  /**
6
6
  * Collection that groups together pipelines, knowledge, personas, tools and actions
7
7
  *
8
- * @see !!! https://github.com/webgptorg/pipeline#pipeline-collection
8
+ * @see @@@ https://github.com/webgptorg/pipeline#pipeline-collection
9
9
  */
10
10
  export type PipelineCollection = {
11
11
  /**
@@ -3,36 +3,36 @@ import type { Prompt } from '../types/Prompt';
3
3
  import type { string_pipeline_url } from '../types/typeAliases';
4
4
  import type { PipelineCollection } from './PipelineCollection';
5
5
  /**
6
- * Library of promptbooks that groups together promptbooks for an application.
7
- * This implementation is a very thin wrapper around the Array / Map of promptbooks.
6
+ * Library of pipelines that groups together pipelines for an application.
7
+ * This implementation is a very thin wrapper around the Array / Map of pipelines.
8
8
  *
9
9
  * @private use `createCollectionFromJson` instead
10
- * @see https://github.com/webgptorg/promptbook#promptbook-collection
10
+ * @see https://github.com/webgptorg/pipeline#pipeline-collection
11
11
  */
12
12
  export declare class SimplePipelineCollection implements PipelineCollection {
13
13
  private collection;
14
14
  /**
15
- * Constructs a pipeline collection from promptbooks
15
+ * Constructs a pipeline collection from pipelines
16
16
  *
17
- * @param promptbooks !!!
17
+ * @param pipelines @@@
18
18
  *
19
19
  * @private Use instead `createCollectionFromJson`
20
- * Note: During the construction logic of all promptbooks are validated
20
+ * Note: During the construction logic of all pipelines are validated
21
21
  * Note: It is not recommended to use this constructor directly, use `createCollectionFromJson` *(or other variant)* instead
22
22
  */
23
- constructor(...promptbooks: Array<PipelineJson>);
23
+ constructor(...pipelines: Array<PipelineJson>);
24
24
  /**
25
- * Gets all promptbooks in the collection
25
+ * Gets all pipelines in the collection
26
26
  */
27
27
  listPipelines(): Array<string_pipeline_url>;
28
28
  /**
29
- * Gets promptbook by its URL
29
+ * Gets pipeline by its URL
30
30
  *
31
31
  * Note: This is not a direct fetching from the URL, but a lookup in the collection
32
32
  */
33
33
  getPipelineByUrl(url: string_pipeline_url): PipelineJson;
34
34
  /**
35
- * Checks whether given prompt was defined in any promptbook in the collection
35
+ * Checks whether given prompt was defined in any pipeline in the collection
36
36
  */
37
37
  isResponsibleForPrompt(prompt: Prompt): boolean;
38
38
  }
@@ -6,7 +6,7 @@ import type { PipelineCollection } from '../PipelineCollection';
6
6
  */
7
7
  type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions & {
8
8
  /**
9
- * If true, the directory is searched recursively for promptbooks
9
+ * If true, the directory is searched recursively for pipelines
10
10
  *
11
11
  * @default true
12
12
  */
@@ -24,24 +24,25 @@ type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions
24
24
  */
25
25
  isLazyLoaded?: boolean;
26
26
  /**
27
- * If true, whole collection creation crashes on error in any promptbook
28
- * If true and isLazyLoaded is true, the error is thrown on first access to the promptbook
27
+ * If true, whole collection creation crashes on error in any pipeline
28
+ * If true and isLazyLoaded is true, the error is thrown on first access to the pipeline
29
29
  *
30
30
  * @default true
31
31
  */
32
- isCrashOnError?: boolean;
32
+ isCrashedOnError?: boolean;
33
33
  };
34
34
  /**
35
- * Constructs Promptbook from given directory
35
+ * Constructs Pipeline from given directory
36
36
  *
37
37
  * Note: Works only in Node.js environment because it reads the file system
38
38
  *
39
- * @param path - path to the directory with promptbooks
39
+ * @param path - path to the directory with pipelines
40
40
  * @param options - Misc options for the collection
41
41
  * @returns PipelineCollection
42
42
  */
43
43
  export declare function createCollectionFromDirectory(path: string_folder_path, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
44
44
  export {};
45
45
  /**
46
- * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json promptbooks
46
+ * TODO: !!!! [🧠] Library precompilation and do not mix markdown and json pipelines
47
+ * Note: [🟢] This code should never be published outside of `@pipeline/node`
47
48
  */
@@ -9,13 +9,13 @@ type CreatePipelineCollectionFromUrlyOptions = {
9
9
  *
10
10
  * @default false
11
11
  */
12
- isVerbose?: boolean;
12
+ readonly isVerbose?: boolean;
13
13
  /**
14
14
  * If true, directory will be scanned only when needed not during the construction
15
15
  *
16
16
  * @default false
17
17
  */
18
- isLazyLoaded?: boolean;
18
+ readonly isLazyLoaded?: boolean;
19
19
  };
20
20
  /**
21
21
  * Constructs Promptbook from remote Promptbase URL
@@ -1,5 +1,4 @@
1
- import type { string_file_relative_path } from '../../types/typeAliases';
2
- import type { string_url } from '../../types/typeAliases';
1
+ import type { string_knowledge_source } from '../../types/typeAliases';
3
2
  /**
4
3
  * Parsed KNOWLEDGE command
5
4
  *
@@ -8,5 +7,5 @@ import type { string_url } from '../../types/typeAliases';
8
7
  */
9
8
  export type KnowledgeCommand = {
10
9
  readonly type: 'KNOWLEDGE';
11
- readonly source: string_url | string_file_relative_path;
10
+ readonly source: string_knowledge_source;
12
11
  };
@@ -1,5 +1,5 @@
1
1
  import type { ModelRequirements } from '../../types/ModelRequirements';
2
- import type { TODO } from '../../types/typeAliases';
2
+ import type { TODO_any } from '../../utils/organization/TODO_any';
3
3
  /**
4
4
  * Parsed MODEL command
5
5
  *
@@ -9,5 +9,5 @@ import type { TODO } from '../../types/typeAliases';
9
9
  export type ModelCommand = {
10
10
  readonly type: 'MODEL';
11
11
  readonly key: keyof ModelRequirements;
12
- readonly value: TODO;
12
+ readonly value: TODO_any;
13
13
  };
@@ -1,3 +1,5 @@
1
+ import type { string_name } from '../../types/typeAliases';
2
+ import type { string_persona_description } from '../../types/typeAliases';
1
3
  /**
2
4
  * Parsed PERSONA command
3
5
  *
@@ -6,6 +8,6 @@
6
8
  */
7
9
  export type PersonaCommand = {
8
10
  readonly type: 'PERSONA';
9
- personaName: string;
10
- personaDescription: string | null;
11
+ readonly personaName: string_name;
12
+ readonly personaDescription: string_persona_description | null;
11
13
  };
@@ -9,4 +9,5 @@ import type { BoilerplateCommand } from './BoilerplateCommand';
9
9
  export declare const boilerplateCommandParser: CommandParser<BoilerplateCommand>;
10
10
  /**
11
11
  * TODO: [💐] Implement BOILERPLATE command into `pipelineStringToJsonSync` function
12
+ * Note: [⚪] This should never be in any released package
12
13
  */