@promptbook/openai 0.60.0 → 0.61.0-0

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 (350) hide show
  1. package/README.md +23 -21
  2. package/esm/index.es.js +38 -20
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/promptbook-collection/index.d.ts +61 -4
  5. package/esm/typings/src/_packages/core.index.d.ts +8 -8
  6. package/esm/typings/src/_packages/markdown-utils.d.ts +17 -0
  7. package/esm/typings/src/_packages/types.index.d.ts +11 -6
  8. package/esm/typings/src/_packages/utils.index.d.ts +23 -19
  9. package/esm/typings/src/cli/cli-commands/hello.d.ts +7 -0
  10. package/esm/typings/src/cli/cli-commands/make.d.ts +7 -0
  11. package/esm/typings/src/cli/cli-commands/prettify.d.ts +7 -0
  12. package/esm/typings/src/collection/collectionToJson.d.ts +3 -0
  13. package/esm/typings/src/collection/collectionToJson.test.d.ts +6 -0
  14. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +2 -1
  15. package/esm/typings/src/commands/BLOCK/BlockCommand.d.ts +11 -0
  16. package/esm/typings/src/commands/BLOCK/BlockTypes.d.ts +13 -0
  17. package/esm/typings/src/commands/BLOCK/blockCommandParser.d.ts +9 -0
  18. package/esm/typings/src/commands/EXPECT/ExpectAmountCommand.d.ts +14 -0
  19. package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +9 -0
  20. package/esm/typings/src/commands/EXPECT/ExpectFormatCommand.d.ts +7 -0
  21. package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +9 -0
  22. package/esm/typings/src/commands/JOKER/JokerCommand.d.ts +11 -0
  23. package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +9 -0
  24. package/esm/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +12 -0
  25. package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +9 -0
  26. package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +13 -0
  27. package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +9 -0
  28. package/esm/typings/src/commands/PARAMETER/ParameterCommand.d.ts +15 -0
  29. package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +9 -0
  30. package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +11 -0
  31. package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +9 -0
  32. package/esm/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +11 -0
  33. package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +9 -0
  34. package/esm/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +11 -0
  35. package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +9 -0
  36. package/esm/typings/src/commands/URL/UrlCommand.d.ts +10 -0
  37. package/esm/typings/src/commands/URL/urlCommandParser.d.ts +9 -0
  38. package/esm/typings/src/commands/X_ACTION/ActionCommand.d.ts +9 -0
  39. package/esm/typings/src/commands/X_ACTION/actionCommand.test.d.ts +1 -0
  40. package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +9 -0
  41. package/esm/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +9 -0
  42. package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +1 -0
  43. package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +9 -0
  44. package/esm/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +10 -0
  45. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +1 -0
  46. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +12 -0
  47. package/esm/typings/src/commands/_common/parseCommand.d.ts +12 -0
  48. package/esm/typings/src/commands/_common/parseCommand.test.d.ts +1 -0
  49. package/esm/typings/src/commands/_common/types/Command.d.ts +6 -0
  50. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -0
  51. package/esm/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +9 -0
  52. package/esm/typings/src/commands/index.d.ts +4 -0
  53. package/esm/typings/src/config.d.ts +4 -0
  54. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +2 -0
  55. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -3
  56. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -2
  57. package/esm/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
  58. package/esm/typings/src/conversion/utils/extractVariables.d.ts +1 -1
  59. package/esm/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +3 -0
  60. package/esm/typings/src/errors/NotYetImplementedError.d.ts +7 -0
  61. package/esm/typings/src/errors/{SyntaxError.d.ts → ParsingError.d.ts} +2 -2
  62. package/{umd/typings/src/errors/ExecutionError.d.ts → esm/typings/src/errors/PipelineExecutionError.d.ts} +2 -2
  63. package/esm/typings/src/errors/_ExpectError.d.ts +2 -2
  64. package/esm/typings/src/execution/ExecutionTools.d.ts +4 -3
  65. package/esm/typings/src/execution/LlmExecutionTools.d.ts +24 -5
  66. package/esm/typings/src/execution/PromptResult.d.ts +2 -2
  67. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
  68. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
  69. package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  70. package/esm/typings/src/execution/utils/replaceParameters.d.ts +1 -1
  71. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +5 -0
  72. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
  73. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -0
  74. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -0
  75. package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +5 -0
  76. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
  77. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +10 -0
  78. package/esm/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
  79. package/esm/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
  80. package/esm/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
  81. package/esm/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
  82. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +14 -1
  83. package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +16 -0
  84. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +6 -1
  85. package/esm/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
  86. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
  87. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +13 -3
  88. package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
  89. package/esm/typings/src/personas/personaToModelRequirements.d.ts +6 -0
  90. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
  91. package/esm/typings/src/types/Arrayable.d.ts +10 -0
  92. package/esm/typings/src/types/PipelineJson/Expectations.d.ts +28 -0
  93. package/esm/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +16 -0
  94. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +8 -2
  95. package/esm/typings/src/types/PipelineJson/PromptDialogJson.d.ts +7 -0
  96. package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +6 -142
  97. package/esm/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +77 -0
  98. package/esm/typings/src/types/PipelineJson/ScriptJson.d.ts +14 -0
  99. package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +7 -0
  100. package/esm/typings/src/types/Prompt.d.ts +3 -3
  101. package/esm/typings/src/types/TaskProgress.d.ts +2 -2
  102. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -3
  103. package/esm/typings/src/types/typeAliases.d.ts +50 -6
  104. package/esm/typings/src/utils/arrayableToArray.d.ts +11 -0
  105. package/esm/typings/src/utils/arrayableToArray.test.d.ts +1 -0
  106. package/esm/typings/src/utils/emojis.d.ts +1 -0
  107. package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
  108. package/esm/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
  109. package/esm/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
  110. package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
  111. package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
  112. package/esm/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
  113. package/esm/typings/src/utils/expectation-counters/index.d.ts +2 -2
  114. package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +14 -0
  115. package/esm/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
  116. package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +30 -0
  117. package/esm/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
  118. package/esm/typings/src/utils/markdown/prettifyMarkdown.d.ts +1 -0
  119. package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +12 -0
  120. package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
  121. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +8 -1
  122. package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +8 -1
  123. package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +13 -1
  124. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +8 -1
  125. package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +8 -1
  126. package/esm/typings/src/{conversion/utils → utils}/parseNumber.d.ts +1 -1
  127. package/esm/typings/src/utils/parseNumber.test.d.ts +1 -0
  128. package/esm/typings/src/utils/sets/difference.d.ts +2 -0
  129. package/esm/typings/src/utils/sets/intersection.d.ts +2 -0
  130. package/esm/typings/src/utils/sets/union.d.ts +2 -0
  131. package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +5 -0
  132. package/esm/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
  133. package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +7 -0
  134. package/esm/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
  135. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -0
  136. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
  137. package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +12 -0
  138. package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
  139. package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +9 -0
  140. package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
  141. package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +9 -0
  142. package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
  143. package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +12 -0
  144. package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
  145. package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +12 -0
  146. package/esm/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
  147. package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +3 -0
  148. package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +5 -0
  149. package/esm/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
  150. package/esm/typings/src/version.d.ts +3 -2
  151. package/package.json +2 -2
  152. package/umd/index.umd.js +38 -20
  153. package/umd/index.umd.js.map +1 -1
  154. package/umd/typings/promptbook-collection/index.d.ts +61 -4
  155. package/umd/typings/src/_packages/core.index.d.ts +8 -8
  156. package/umd/typings/src/_packages/markdown-utils.d.ts +17 -0
  157. package/umd/typings/src/_packages/types.index.d.ts +11 -6
  158. package/umd/typings/src/_packages/utils.index.d.ts +23 -19
  159. package/umd/typings/src/cli/cli-commands/hello.d.ts +7 -0
  160. package/umd/typings/src/cli/cli-commands/make.d.ts +7 -0
  161. package/umd/typings/src/cli/cli-commands/prettify.d.ts +7 -0
  162. package/umd/typings/src/collection/collectionToJson.d.ts +3 -0
  163. package/umd/typings/src/collection/collectionToJson.test.d.ts +6 -0
  164. package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +2 -1
  165. package/umd/typings/src/commands/BLOCK/BlockCommand.d.ts +11 -0
  166. package/umd/typings/src/commands/BLOCK/BlockTypes.d.ts +13 -0
  167. package/umd/typings/src/commands/BLOCK/blockCommand.test.d.ts +1 -0
  168. package/umd/typings/src/commands/BLOCK/blockCommandParser.d.ts +9 -0
  169. package/umd/typings/src/commands/EXPECT/ExpectAmountCommand.d.ts +14 -0
  170. package/umd/typings/src/commands/EXPECT/ExpectCommand.d.ts +9 -0
  171. package/umd/typings/src/commands/EXPECT/ExpectFormatCommand.d.ts +7 -0
  172. package/umd/typings/src/commands/EXPECT/expectCommand.test.d.ts +1 -0
  173. package/umd/typings/src/commands/EXPECT/expectCommandParser.d.ts +9 -0
  174. package/umd/typings/src/commands/JOKER/JokerCommand.d.ts +11 -0
  175. package/umd/typings/src/commands/JOKER/jokerCommand.test.d.ts +1 -0
  176. package/umd/typings/src/commands/JOKER/jokerCommandParser.d.ts +9 -0
  177. package/umd/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +12 -0
  178. package/umd/typings/src/commands/KNOWLEDGE/knowledgeCommand.test.d.ts +1 -0
  179. package/umd/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +9 -0
  180. package/umd/typings/src/commands/MODEL/ModelCommand.d.ts +13 -0
  181. package/umd/typings/src/commands/MODEL/modelCommand.test.d.ts +1 -0
  182. package/umd/typings/src/commands/MODEL/modelCommandParser.d.ts +9 -0
  183. package/umd/typings/src/commands/PARAMETER/ParameterCommand.d.ts +15 -0
  184. package/umd/typings/src/commands/PARAMETER/parameterCommand.test.d.ts +1 -0
  185. package/umd/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +9 -0
  186. package/umd/typings/src/commands/PERSONA/PersonaCommand.d.ts +11 -0
  187. package/umd/typings/src/commands/PERSONA/personaCommand.test.d.ts +1 -0
  188. package/umd/typings/src/commands/PERSONA/personaCommandParser.d.ts +9 -0
  189. package/umd/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +11 -0
  190. package/umd/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts +1 -0
  191. package/umd/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +9 -0
  192. package/umd/typings/src/commands/PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts +11 -0
  193. package/umd/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts +1 -0
  194. package/umd/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +9 -0
  195. package/umd/typings/src/commands/URL/UrlCommand.d.ts +10 -0
  196. package/umd/typings/src/commands/URL/urlCommand.test.d.ts +1 -0
  197. package/umd/typings/src/commands/URL/urlCommandParser.d.ts +9 -0
  198. package/umd/typings/src/commands/X_ACTION/ActionCommand.d.ts +9 -0
  199. package/umd/typings/src/commands/X_ACTION/actionCommand.test.d.ts +1 -0
  200. package/umd/typings/src/commands/X_ACTION/actionCommandParser.d.ts +9 -0
  201. package/umd/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +9 -0
  202. package/umd/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +1 -0
  203. package/umd/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +9 -0
  204. package/umd/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +10 -0
  205. package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +1 -0
  206. package/umd/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +12 -0
  207. package/umd/typings/src/commands/_common/parseCommand.d.ts +12 -0
  208. package/umd/typings/src/commands/_common/parseCommand.test.d.ts +1 -0
  209. package/umd/typings/src/commands/_common/types/Command.d.ts +6 -0
  210. package/umd/typings/src/commands/_common/types/CommandParser.d.ts +36 -0
  211. package/umd/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +9 -0
  212. package/umd/typings/src/commands/index.d.ts +4 -0
  213. package/umd/typings/src/config.d.ts +4 -0
  214. package/umd/typings/src/conversion/pipelineJsonToString.d.ts +2 -0
  215. package/umd/typings/src/conversion/pipelineStringToJson.d.ts +2 -3
  216. package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -2
  217. package/umd/typings/src/conversion/utils/extractParametersFromPromptTemplate.d.ts +2 -2
  218. package/umd/typings/src/conversion/utils/extractVariables.d.ts +1 -1
  219. package/umd/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +3 -0
  220. package/umd/typings/src/errors/NotYetImplementedError.d.ts +7 -0
  221. package/umd/typings/src/errors/{SyntaxError.d.ts → ParsingError.d.ts} +2 -2
  222. package/{esm/typings/src/errors/ExecutionError.d.ts → umd/typings/src/errors/PipelineExecutionError.d.ts} +2 -2
  223. package/umd/typings/src/errors/_ExpectError.d.ts +2 -2
  224. package/umd/typings/src/execution/ExecutionTools.d.ts +4 -3
  225. package/umd/typings/src/execution/LlmExecutionTools.d.ts +24 -5
  226. package/umd/typings/src/execution/PromptResult.d.ts +2 -2
  227. package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -1
  228. package/umd/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -1
  229. package/umd/typings/src/execution/utils/checkExpectations.d.ts +1 -1
  230. package/umd/typings/src/execution/utils/replaceParameters.d.ts +1 -1
  231. package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +5 -0
  232. package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +5 -5
  233. package/umd/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -0
  234. package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -0
  235. package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +5 -0
  236. package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +5 -0
  237. package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +10 -0
  238. package/umd/typings/src/llm-providers/mocked/fakeTextToExpectations.d.ts +1 -1
  239. package/umd/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
  240. package/umd/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
  241. package/umd/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
  242. package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +14 -1
  243. package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +16 -0
  244. package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +6 -1
  245. package/umd/typings/src/llm-providers/openai/computeOpenaiUsage.d.ts +1 -1
  246. package/umd/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
  247. package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +13 -3
  248. package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
  249. package/umd/typings/src/personas/personaToModelRequirements.d.ts +6 -0
  250. package/umd/typings/src/scripting/javascript/utils/preserve.d.ts +2 -1
  251. package/umd/typings/src/types/Arrayable.d.ts +10 -0
  252. package/umd/typings/src/types/PipelineJson/Expectations.d.ts +28 -0
  253. package/umd/typings/src/types/PipelineJson/LlmTemplateJson.d.ts +16 -0
  254. package/umd/typings/src/types/PipelineJson/PipelineJson.d.ts +8 -2
  255. package/umd/typings/src/types/PipelineJson/PromptDialogJson.d.ts +7 -0
  256. package/umd/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +6 -142
  257. package/umd/typings/src/types/PipelineJson/PromptTemplateJsonCommon.d.ts +77 -0
  258. package/umd/typings/src/types/PipelineJson/ScriptJson.d.ts +14 -0
  259. package/umd/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +7 -0
  260. package/umd/typings/src/types/Prompt.d.ts +3 -3
  261. package/umd/typings/src/types/TaskProgress.d.ts +2 -2
  262. package/umd/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -3
  263. package/umd/typings/src/types/typeAliases.d.ts +50 -6
  264. package/umd/typings/src/utils/arrayableToArray.d.ts +11 -0
  265. package/umd/typings/src/utils/arrayableToArray.test.d.ts +1 -0
  266. package/umd/typings/src/utils/emojis.d.ts +1 -0
  267. package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
  268. package/umd/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
  269. package/umd/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
  270. package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
  271. package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
  272. package/umd/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
  273. package/umd/typings/src/utils/expectation-counters/index.d.ts +2 -2
  274. package/umd/typings/src/utils/markdown/flattenMarkdown.d.ts +14 -0
  275. package/umd/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
  276. package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +30 -0
  277. package/umd/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
  278. package/umd/typings/src/utils/markdown/prettifyMarkdown.d.ts +1 -0
  279. package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +12 -0
  280. package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
  281. package/umd/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +8 -1
  282. package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +8 -1
  283. package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +13 -1
  284. package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +8 -1
  285. package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +8 -1
  286. package/umd/typings/src/{conversion/utils → utils}/parseNumber.d.ts +1 -1
  287. package/umd/typings/src/utils/parseNumber.test.d.ts +1 -0
  288. package/umd/typings/src/utils/sets/difference.d.ts +2 -0
  289. package/umd/typings/src/utils/sets/intersection.d.ts +2 -0
  290. package/umd/typings/src/utils/sets/union.d.ts +2 -0
  291. package/umd/typings/src/utils/validators/email/isValidEmail.d.ts +5 -0
  292. package/umd/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
  293. package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +7 -0
  294. package/umd/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
  295. package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +2 -0
  296. package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
  297. package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +12 -0
  298. package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
  299. package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +9 -0
  300. package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
  301. package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +9 -0
  302. package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
  303. package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +12 -0
  304. package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
  305. package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +12 -0
  306. package/umd/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
  307. package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +3 -0
  308. package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +5 -0
  309. package/umd/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
  310. package/umd/typings/src/version.d.ts +3 -2
  311. package/esm/typings/src/cli/actions/hello.d.ts +0 -7
  312. package/esm/typings/src/cli/actions/make.d.ts +0 -7
  313. package/esm/typings/src/cli/actions/prettify.d.ts +0 -7
  314. package/esm/typings/src/conversion/utils/parseCommand.d.ts +0 -11
  315. package/esm/typings/src/conversion/utils/parseCommand.test.d.ts +0 -4
  316. package/esm/typings/src/errors/TemplateError.d.ts +0 -9
  317. package/esm/typings/src/llm-providers/mocked/mocked-chat.test.d.ts +0 -4
  318. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionToolsOptions.d.ts +0 -24
  319. package/esm/typings/src/types/Command.d.ts +0 -101
  320. package/esm/typings/src/types/ExecutionTypes.d.ts +0 -13
  321. package/esm/typings/src/utils/markdown-json/MarkdownStructure.d.ts +0 -25
  322. package/esm/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +0 -7
  323. package/esm/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +0 -13
  324. package/umd/typings/src/cli/actions/hello.d.ts +0 -7
  325. package/umd/typings/src/cli/actions/make.d.ts +0 -7
  326. package/umd/typings/src/cli/actions/prettify.d.ts +0 -7
  327. package/umd/typings/src/conversion/utils/parseCommand.d.ts +0 -11
  328. package/umd/typings/src/conversion/utils/parseCommand.test.d.ts +0 -4
  329. package/umd/typings/src/errors/TemplateError.d.ts +0 -9
  330. package/umd/typings/src/llm-providers/mocked/mocked-chat.test.d.ts +0 -4
  331. package/umd/typings/src/llm-providers/multiple/MultipleLlmExecutionToolsOptions.d.ts +0 -24
  332. package/umd/typings/src/types/Command.d.ts +0 -101
  333. package/umd/typings/src/types/ExecutionTypes.d.ts +0 -13
  334. package/umd/typings/src/utils/markdown-json/MarkdownStructure.d.ts +0 -25
  335. package/umd/typings/src/utils/markdown-json/countMarkdownStructureDeepness.d.ts +0 -7
  336. package/umd/typings/src/utils/markdown-json/markdownToMarkdownStructure.d.ts +0 -13
  337. /package/esm/typings/src/{conversion/utils/parseNumber.test.d.ts → commands/BLOCK/blockCommand.test.d.ts} +0 -0
  338. /package/esm/typings/src/{llm-providers/mocked/fakeTextToExpectations.test.d.ts → commands/EXPECT/expectCommand.test.d.ts} +0 -0
  339. /package/esm/typings/src/{llm-providers/mocked/faked-completion.test.d.ts → commands/JOKER/jokerCommand.test.d.ts} +0 -0
  340. /package/esm/typings/src/{utils/markdown-json/countMarkdownStructureDeepness.test.d.ts → commands/KNOWLEDGE/knowledgeCommand.test.d.ts} +0 -0
  341. /package/esm/typings/src/{utils/markdown-json/markdownToMarkdownStructure.test.d.ts → commands/MODEL/modelCommand.test.d.ts} +0 -0
  342. /package/{umd/typings/src/conversion/utils/parseNumber.test.d.ts → esm/typings/src/commands/PARAMETER/parameterCommand.test.d.ts} +0 -0
  343. /package/{umd/typings/src/llm-providers/mocked/fakeTextToExpectations.test.d.ts → esm/typings/src/commands/PERSONA/personaCommand.test.d.ts} +0 -0
  344. /package/{umd/typings/src/llm-providers/mocked/faked-completion.test.d.ts → esm/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts} +0 -0
  345. /package/{umd/typings/src/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts → esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts} +0 -0
  346. /package/{umd/typings/src/utils/markdown-json/markdownToMarkdownStructure.test.d.ts → esm/typings/src/commands/URL/urlCommand.test.d.ts} +0 -0
  347. /package/esm/typings/src/llm-providers/mocked/{joker.test.d.ts → test/joker.test.d.ts} +0 -0
  348. /package/esm/typings/src/llm-providers/mocked/{mocked-completion.test.d.ts → test/mocked-completion.test.d.ts} +0 -0
  349. /package/umd/typings/src/llm-providers/mocked/{joker.test.d.ts → test/joker.test.d.ts} +0 -0
  350. /package/umd/typings/src/llm-providers/mocked/{mocked-completion.test.d.ts → test/mocked-completion.test.d.ts} +0 -0
@@ -1,4 +1,5 @@
1
1
  import type { PipelineCollection } from '../collection/PipelineCollection';
2
+ import type { BlockType } from '../commands/BLOCK/BlockTypes';
2
3
  import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
3
4
  import { EmbeddingVector } from '../execution/EmbeddingVector';
4
5
  import type { ExecutionTools } from '../execution/ExecutionTools';
@@ -7,27 +8,31 @@ import type { PipelineExecutor } from '../execution/PipelineExecutor';
7
8
  import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptEmbeddingResult, PromptResult, PromptResultUsage, PromptResultUsageCounts, UncertainNumber } from '../execution/PromptResult';
8
9
  import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
9
10
  import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
10
- import type { ExecutionType } from '../types/ExecutionTypes';
11
11
  import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
12
12
  import type { Parameters } from '../types/Parameters';
13
+ import type { ExpectationAmount, ExpectationUnit, Expectations } from '../types/PipelineJson/Expectations';
14
+ import { EXPECTATION_UNITS } from '../types/PipelineJson/Expectations';
13
15
  import { KnowledgeJson } from '../types/PipelineJson/KnowledgeJson';
16
+ import type { LlmTemplateJson } from '../types/PipelineJson/LlmTemplateJson';
14
17
  import { MaterialKnowledgePieceJson } from '../types/PipelineJson/MaterialKnowledgePieceJson';
15
18
  import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
16
- import type { ExpectationAmount, ExpectationUnit, Expectations, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
17
- import { EXPECTATION_UNITS } from '../types/PipelineJson/PromptTemplateJson';
19
+ import type { PromptDialogJson } from '../types/PipelineJson/PromptDialogJson';
20
+ import type { PromptTemplateJson } from '../types/PipelineJson/PromptTemplateJson';
18
21
  import type { PromptTemplateParameterJson } from '../types/PipelineJson/PromptTemplateParameterJson';
22
+ import type { ScriptJson } from '../types/PipelineJson/ScriptJson';
23
+ import type { SimpleTemplateJson } from '../types/PipelineJson/SimpleTemplateJson';
19
24
  import type { PipelineString } from '../types/PipelineString';
20
25
  import type { Prompt } from '../types/Prompt';
21
26
  import type { ScriptLanguage } from '../types/ScriptLanguage';
22
27
  import type { TaskProgress } from '../types/TaskProgress';
23
28
  import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
24
29
  import type { string_char_emoji } from '../types/typeAliasEmoji';
25
- import type { client_id, string_char, string_chat_prompt, string_completion_prompt, string_data_url, string_domain, string_email, 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_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_version } from '../types/typeAliases';
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';
26
31
  import type { FromtoItems } from '../utils/FromtoItems';
27
- import { PROMPTBOOK_VERSION } from '../version';
32
+ import { PROMPTBOOK_VERSION, string_promptbook_version } from '../version';
28
33
  export { PROMPTBOOK_VERSION };
29
34
  export { EXPECTATION_UNITS };
30
- export type { AvailableModel, CommonExecutionToolsOptions, EmbeddingVector, ExecutionReportJson, ExecutionTools, ExecutionType, 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_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_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_version, };
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, };
31
36
  /**
32
37
  * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
33
38
  */
@@ -2,7 +2,6 @@ import { spaceTrim } from 'spacetrim';
2
2
  import { renderPromptbookMermaid } from '../conversion/prettify/renderPipelineMermaidOptions';
3
3
  import { extractParametersFromPromptTemplate } from '../conversion/utils/extractParametersFromPromptTemplate';
4
4
  import { extractVariables } from '../conversion/utils/extractVariables';
5
- import { parseNumber } from '../conversion/utils/parseNumber';
6
5
  import { renameParameter } from '../conversion/utils/renameParameter';
7
6
  import { titleToName } from '../conversion/utils/titleToName';
8
7
  import { forEachAsync } from '../execution/utils/forEachAsync';
@@ -16,11 +15,6 @@ import { countSentences, splitIntoSentences } from '../utils/expectation-counter
16
15
  import { countWords } from '../utils/expectation-counters/countWords';
17
16
  import { CountUtils } from '../utils/expectation-counters/index';
18
17
  import { extractParameters } from '../utils/extractParameters';
19
- import { extractAllBlocksFromMarkdown } from '../utils/markdown/extractAllBlocksFromMarkdown';
20
- import { extractAllListItemsFromMarkdown } from '../utils/markdown/extractAllListItemsFromMarkdown';
21
- import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFromMarkdown';
22
- import { removeContentComments } from '../utils/markdown/removeContentComments';
23
- import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
24
18
  import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
25
19
  import type { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
26
20
  import { capitalize } from '../utils/normalization/capitalize';
@@ -28,16 +22,17 @@ import { decapitalize } from '../utils/normalization/decapitalize';
28
22
  import { isValidKeyword } from '../utils/normalization/isValidKeyword';
29
23
  import { nameToUriPart } from '../utils/normalization/nameToUriPart';
30
24
  import { nameToUriParts } from '../utils/normalization/nameToUriParts';
31
- import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
32
- import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
33
- import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
34
- import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
35
- import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
25
+ import { normalizeToKebabCase, string_kebab_case } from '../utils/normalization/normalize-to-kebab-case';
26
+ import { normalizeTo_PascalCase, string_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
27
+ import { normalizeTo_SCREAMING_CASE, string_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
28
+ import { normalizeTo_camelCase, string_camelCase } from '../utils/normalization/normalizeTo_camelCase';
29
+ import { normalizeTo_snake_case, string_snake_case } from '../utils/normalization/normalizeTo_snake_case';
36
30
  import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
37
31
  import { parseKeywords } from '../utils/normalization/parseKeywords';
38
32
  import { parseKeywordsFromString } from '../utils/normalization/parseKeywordsFromString';
39
33
  import { removeDiacritics } from '../utils/normalization/removeDiacritics';
40
34
  import { searchKeywords } from '../utils/normalization/searchKeywords';
35
+ import { parseNumber } from '../utils/parseNumber';
41
36
  import { extractBlock } from '../utils/postprocessing/extractBlock';
42
37
  import { removeEmojis } from '../utils/removeEmojis';
43
38
  import { removeQuotes } from '../utils/removeQuotes';
@@ -47,13 +42,21 @@ import { union } from '../utils/sets/union';
47
42
  import { trimCodeBlock } from '../utils/trimCodeBlock';
48
43
  import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
49
44
  import { unwrapResult } from '../utils/unwrapResult';
45
+ import { isValidFilePath } from '../utils/validators/filePath/isValidFilePath';
46
+ import { isValidJavascriptName } from '../utils/validators/javascriptName/isValidJavascriptName';
47
+ import { isValidPromptbookVersion } from '../utils/validators/semanticVersion/isValidPromptbookVersion';
48
+ import { isValidSemanticVersion } from '../utils/validators/semanticVersion/isValidSemanticVersion';
49
+ import { isHostnameOnPrivateNetwork } from '../utils/validators/url/isHostnameOnPrivateNetwork';
50
+ import { isUrlOnPrivateNetwork } from '../utils/validators/url/isUrlOnPrivateNetwork';
51
+ import { isValidPipelineUrl } from '../utils/validators/url/isValidPipelineUrl';
52
+ import { isValidUrl } from '../utils/validators/url/isValidUrl';
53
+ import { isValidUuid } from '../utils/validators/uuid/isValidUuid';
50
54
  import { PROMPTBOOK_VERSION } from '../version';
51
- export { PROMPTBOOK_VERSION, forEachAsync };
52
- export { extractAllBlocksFromMarkdown, // <- [🌻]
53
- extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
54
- extractOneBlockFromMarkdown, extractParameters, extractVariables, isValidJsonString, parseNumber, // <- [🌻]
55
- removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
56
- export { CountUtils, countCharacters, countLines, countPages, countParagraphs, countSentences, countWords };
55
+ 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, };
59
+ export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
57
60
  export { splitIntoSentences };
58
61
  export declare const normalizeTo: {
59
62
  camelCase: typeof normalizeTo_camelCase;
@@ -62,10 +65,11 @@ export declare const normalizeTo: {
62
65
  snake_case: typeof normalizeTo_snake_case;
63
66
  'kebab-case': typeof normalizeToKebabCase;
64
67
  };
65
- export { DIACRITIC_VARIANTS_LETTERS, IKeywords, capitalize, decapitalize, isValidKeyword, nameToUriPart, nameToUriParts, normalizeToKebabCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_camelCase, normalizeTo_snake_case, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, titleToName, };
68
+ export { capitalize, decapitalize, DIACRITIC_VARIANTS_LETTERS, IKeywords, isValidKeyword, nameToUriPart, nameToUriParts, normalizeTo_camelCase, normalizeTo_PascalCase, normalizeTo_SCREAMING_CASE, normalizeTo_snake_case, normalizeToKebabCase, normalizeWhitespaces, parseKeywords, parseKeywordsFromString, removeDiacritics, searchKeywords, string_keyword, titleToName, };
69
+ export type { string_camelCase, string_kebab_case, string_PascalCase, string_SCREAMING_CASE, string_snake_case };
66
70
  export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
67
71
  export { difference, intersection, union };
68
72
  /**
69
- * TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
73
+ * TODO: [🧠] Maybe create some indipendent package like `@promptbook/markdown-utils`
70
74
  * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
71
75
  */
@@ -0,0 +1,7 @@
1
+ import type { Command as Program } from 'commander';
2
+ /**
3
+ * Initializes testing `hello` command for Promptbook CLI utilities
4
+ *
5
+ * @private part of `promptbookCli`
6
+ */
7
+ export declare function initializeHelloCommand(program: Program): void;
@@ -0,0 +1,7 @@
1
+ import type { Command as Program } from 'commander';
2
+ /**
3
+ * Initializes `make` command for Promptbook CLI utilities
4
+ *
5
+ * @private part of `promptbookCli`
6
+ */
7
+ export declare function initializeMakeCommand(program: Program): void;
@@ -0,0 +1,7 @@
1
+ import type { Command as Program } from 'commander';
2
+ /**
3
+ * Initializes `prettify` command for Promptbook CLI utilities
4
+ *
5
+ * @private part of `promptbookCli`
6
+ */
7
+ export declare function initializePrettifyCommand(program: Program): void;
@@ -6,3 +6,6 @@ import type { PipelineCollection } from './PipelineCollection';
6
6
  * Note: Functions `collectionToJson` and `createCollectionFromJson` are complementary
7
7
  */
8
8
  export declare function collectionToJson(collection: PipelineCollection): Promise<Array<PipelineJson>>;
9
+ /**
10
+ * TODO: [🧠] Maybe clear `sourceFile` or clear when exposing through API or remote server
11
+ */
@@ -1 +1,7 @@
1
1
  export {};
2
+ /**
3
+ * Note: [🐠] For example here URL https://example.com/pipeline.ptbk.md is not valid
4
+ * because it is on private network BUT its very hard to debug because
5
+ * there is no error message and false return (the error) happen deep in:
6
+ * `isValidPipelineUrl` -> `isValidPipelineUrl` -> `isUrlOnPrivateNetwork`
7
+ */
@@ -1,9 +1,10 @@
1
+ import type { PipelineStringToJsonOptions } from '../../conversion/pipelineStringToJson';
1
2
  import type { string_folder_path } from '../../types/typeAliases';
2
3
  import type { PipelineCollection } from '../PipelineCollection';
3
4
  /**
4
5
  * Options for `createCollectionFromDirectory` function
5
6
  */
6
- type CreatePipelineCollectionFromDirectoryOptions = {
7
+ type CreatePipelineCollectionFromDirectoryOptions = PipelineStringToJsonOptions & {
7
8
  /**
8
9
  * If true, the directory is searched recursively for promptbooks
9
10
  *
@@ -0,0 +1,11 @@
1
+ import type { BlockType } from './BlockTypes';
2
+ /**
3
+ * Parsed BLOCK command
4
+ *
5
+ * @see ./blockCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type BlockCommand = {
9
+ readonly type: 'BLOCK';
10
+ readonly blockType: BlockType;
11
+ };
@@ -0,0 +1,13 @@
1
+ import type { TupleToUnion } from 'type-fest';
2
+ /**
3
+ * Block type describes the way how the block is blockd
4
+ *
5
+ * @see https://github.com/webgptorg/promptbook#block-type
6
+ */
7
+ export type BlockType = TupleToUnion<typeof BlockTypes>;
8
+ /**
9
+ * Block type describes the way how the block is blockd
10
+ *
11
+ * @see https://github.com/webgptorg/promptbook#block-type
12
+ */
13
+ export declare const BlockTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT", "PROMPT_DIALOG", "SAMPLE", "KNOWLEDGE", "INSTRUMENT", "ACTION"];
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { BlockCommand } from './BlockCommand';
3
+ /**
4
+ * Parses the block command
5
+ *
6
+ * @see ./BLOCK-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const blockCommandParser: CommandParser<BlockCommand>;
@@ -0,0 +1,14 @@
1
+ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
2
+ import type { ExpectationUnit } from '../../types/PipelineJson/Expectations';
3
+ /**
4
+ * Expect amount command describes the desired output of the prompt template (after post-processing)
5
+ * It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs,...
6
+ *
7
+ * Note: LLMs work with tokens, not characters, but in Promptbooks we want to use some human-recognisable and cross-model interoperable units.
8
+ */
9
+ export type ExpectAmountCommand = {
10
+ readonly type: 'EXPECT_AMOUNT';
11
+ readonly sign: 'EXACTLY' | 'MINIMUM' | 'MAXIMUM';
12
+ readonly unit: ExpectationUnit;
13
+ readonly amount: ExpectationAmount;
14
+ };
@@ -0,0 +1,9 @@
1
+ import type { ExpectAmountCommand } from "./ExpectAmountCommand";
2
+ import type { ExpectFormatCommand } from "./ExpectFormatCommand";
3
+ /**
4
+ * Parsed EXPECT command
5
+ *
6
+ * @see ./expectCommandParser.ts for more details
7
+ * @private within the commands folder
8
+ */
9
+ export type ExpectCommand = ExpectAmountCommand | ExpectFormatCommand;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Represents a command that expects a specific format.
3
+ */
4
+ export type ExpectFormatCommand = {
5
+ readonly type: 'EXPECT_FORMAT';
6
+ readonly format: 'JSON';
7
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { ExpectCommand } from './ExpectCommand';
3
+ /**
4
+ * Parses the expect command
5
+ *
6
+ * @see ./EXPECT-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const expectCommandParser: CommandParser<ExpectCommand>;
@@ -0,0 +1,11 @@
1
+ import type { string_name } from '../../types/typeAliases';
2
+ /**
3
+ * Parsed JOKER command
4
+ *
5
+ * @see ./jokerCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type JokerCommand = {
9
+ readonly type: 'JOKER';
10
+ readonly parameterName: string_name;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { JokerCommand } from './JokerCommand';
3
+ /**
4
+ * Parses the joker command
5
+ *
6
+ * @see ./JOKER-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const jokerCommandParser: CommandParser<JokerCommand>;
@@ -0,0 +1,12 @@
1
+ import type { string_file_relative_path } from '../../types/typeAliases';
2
+ import type { string_url } from '../../types/typeAliases';
3
+ /**
4
+ * Parsed KNOWLEDGE command
5
+ *
6
+ * @see ./knowledgeCommandParser.ts for more details
7
+ * @private within the commands folder
8
+ */
9
+ export type KnowledgeCommand = {
10
+ readonly type: 'KNOWLEDGE';
11
+ readonly source: string_url | string_file_relative_path;
12
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { KnowledgeCommand } from './KnowledgeCommand';
3
+ /**
4
+ * Parses the knowledge command
5
+ *
6
+ * @see ./KNOWLEDGE-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const knowledgeCommandParser: CommandParser<KnowledgeCommand>;
@@ -0,0 +1,13 @@
1
+ import type { ModelRequirements } from '../../types/ModelRequirements';
2
+ import type { TODO } from '../../types/typeAliases';
3
+ /**
4
+ * Parsed MODEL command
5
+ *
6
+ * @see ./modelCommandParser.ts for more details
7
+ * @private within the commands folder
8
+ */
9
+ export type ModelCommand = {
10
+ readonly type: 'MODEL';
11
+ readonly key: keyof ModelRequirements;
12
+ readonly value: TODO;
13
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { ModelCommand } from './ModelCommand';
3
+ /**
4
+ * Parses the model command
5
+ *
6
+ * @see ./MODEL-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const modelCommandParser: CommandParser<ModelCommand>;
@@ -0,0 +1,15 @@
1
+ import type { string_markdown_text } from '../../types/typeAliases';
2
+ import type { string_name } from '../../types/typeAliases';
3
+ /**
4
+ * Parsed PARAMETER command
5
+ *
6
+ * @see ./parameterCommandParser.ts for more details
7
+ * @private within the commands folder
8
+ */
9
+ export type ParameterCommand = {
10
+ readonly type: 'PARAMETER';
11
+ readonly isInput: boolean;
12
+ readonly isOutput: boolean;
13
+ readonly parameterName: string_name;
14
+ readonly parameterDescription: string_markdown_text | null;
15
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { ParameterCommand } from './ParameterCommand';
3
+ /**
4
+ * Parses the parameter command
5
+ *
6
+ * @see ./PARAMETER-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const parameterCommandParser: CommandParser<ParameterCommand>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Parsed PERSONA command
3
+ *
4
+ * @see ./personaCommandParser.ts for more details
5
+ * @private within the commands folder
6
+ */
7
+ export type PersonaCommand = {
8
+ readonly type: 'PERSONA';
9
+ personaName: string;
10
+ personaDescription: string | null;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { PersonaCommand } from './PersonaCommand';
3
+ /**
4
+ * Parses the persona command
5
+ *
6
+ * @see ./PERSONA-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const personaCommandParser: CommandParser<PersonaCommand>;
@@ -0,0 +1,11 @@
1
+ import type { string_name } from '../../types/typeAliases';
2
+ /**
3
+ * Parsed POSTPROCESS command
4
+ *
5
+ * @see ./postprocessCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type PostprocessCommand = {
9
+ readonly type: 'POSTPROCESS';
10
+ readonly functionName: string_name;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { PostprocessCommand } from './PostprocessCommand';
3
+ /**
4
+ * Parses the postprocess command
5
+ *
6
+ * @see ./POSTPROCESS-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const postprocessCommandParser: CommandParser<PostprocessCommand>;
@@ -0,0 +1,11 @@
1
+ import type { string_semantic_version } from '../../types/typeAliases';
2
+ /**
3
+ * Parsed PROMPTBOOK_VERSION command
4
+ *
5
+ * @see ./promptbookVersionCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type PromptbookVersionCommand = {
9
+ readonly type: 'PROMPTBOOK_VERSION';
10
+ readonly promptbookVersion: string_semantic_version;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { PromptbookVersionCommand } from './PromptbookVersionCommand';
3
+ /**
4
+ * Parses the PROMPTBOOK_VERSION command
5
+ *
6
+ * @see ./PROMPTBOOK_VERSION-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const promptbookVersionCommandParser: CommandParser<PromptbookVersionCommand>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Parsed URL command
3
+ *
4
+ * @see ./urlCommandParser.ts for more details
5
+ * @private within the commands folder
6
+ */
7
+ export type UrlCommand = {
8
+ readonly type: 'URL';
9
+ readonly pipelineUrl: URL;
10
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { UrlCommand } from './UrlCommand';
3
+ /**
4
+ * Parses the url command
5
+ *
6
+ * @see ./URL-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const urlCommandParser: CommandParser<UrlCommand>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Parsed ACTION command
3
+ *
4
+ * @see ./actionCommandParser.ts for more details
5
+ * @private within the commands folder
6
+ */
7
+ export type ActionCommand = {
8
+ readonly type: 'ACTION';
9
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { ActionCommand } from './ActionCommand';
3
+ /**
4
+ * Parses the action command
5
+ *
6
+ * @see ./ACTION-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const actionCommandParser: CommandParser<ActionCommand>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Parsed INSTRUMENT command
3
+ *
4
+ * @see ./instrumentCommandParser.ts for more details
5
+ * @private within the commands folder
6
+ */
7
+ export type InstrumentCommand = {
8
+ readonly type: 'INSTRUMENT';
9
+ };
@@ -0,0 +1,9 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { InstrumentCommand } from './InstrumentCommand';
3
+ /**
4
+ * Parses the instrument command
5
+ *
6
+ * @see ./INSTRUMENT-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const instrumentCommandParser: CommandParser<InstrumentCommand>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Parsed BOILERPLATE command
3
+ *
4
+ * @see ./boilerplateCommandParser.ts for more details
5
+ * @private within the commands folder
6
+ */
7
+ export type BoilerplateCommand = {
8
+ readonly type: 'BOILERPLATE';
9
+ readonly value: string;
10
+ };
@@ -0,0 +1,12 @@
1
+ import type { CommandParser } from '../_common/types/CommandParser';
2
+ import type { BoilerplateCommand } from './BoilerplateCommand';
3
+ /**
4
+ * Parses the boilerplate command
5
+ *
6
+ * @see ./BOILERPLATE-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const boilerplateCommandParser: CommandParser<BoilerplateCommand>;
10
+ /**
11
+ * TODO: [💐] Implement BOILERPLATE command into `pipelineStringToJsonSync` function
12
+ */
@@ -0,0 +1,12 @@
1
+ import type { string_markdown_text } from '../../types/typeAliases';
2
+ import type { Command } from './types/Command';
3
+ import type { CommandUsagePlace } from './types/CommandUsagePlaces';
4
+ /**
5
+ * Parses one line of ul/ol to command
6
+ *
7
+ * @returns parsed command object
8
+ * @throws {ParsingError} if the command is invalid
9
+ *
10
+ * @private within the pipelineStringToJson
11
+ */
12
+ export declare function parseCommand(raw: string_markdown_text, usagePlace: CommandUsagePlace): Command;
@@ -0,0 +1,6 @@
1
+ import { COMMANDS } from '../../index';
2
+ /**
3
+ * Command is one piece of the prompt template which adds some logic to the prompt template or the whole pipeline.
4
+ * It is parsed from the markdown from ul/ol items - one command per one item.
5
+ */
6
+ export type Command = ReturnType<typeof COMMANDS[number]['parse']>;
@@ -0,0 +1,36 @@
1
+ import type { string_markdown_text } from '../../../types/typeAliases';
2
+ import type { string_name } from '../../../types/typeAliases';
3
+ import type { string_SCREAMING_CASE } from '../../../utils/normalization/normalizeTo_SCREAMING_CASE';
4
+ import type { CommandUsagePlace } from './CommandUsagePlaces';
5
+ export type CommandParser<TCommand extends {
6
+ type: string_name & string_SCREAMING_CASE;
7
+ }> = {
8
+ name: string_name & string_SCREAMING_CASE;
9
+ aliasNames?: Array<string_name & string_SCREAMING_CASE>;
10
+ deprecatedNames?: Array<string_name & string_SCREAMING_CASE>;
11
+ usagePlaces: Array<CommandUsagePlace>;
12
+ description: string_markdown_text;
13
+ discussionUrl: `https://github.com/webgptorg/promptbook/discussions/${number | '@@'}`;
14
+ examples: Array<string_markdown_text>;
15
+ /**
16
+ * @throws {ParsingError} if the parsing fails
17
+ */
18
+ parse(input: CommandParserInput): TCommand;
19
+ };
20
+ export type CommandParserInput = {
21
+ usagePlace: CommandUsagePlace;
22
+ raw: string_markdown_text;
23
+ rawArgs: string_markdown_text;
24
+ normalized: string_name & string_SCREAMING_CASE;
25
+ args: Array<string_name & string_SCREAMING_CASE>;
26
+ };
27
+ /**
28
+ * TODO: !!!! Annotate
29
+ * TODO: [🧠] Maybe put flag if it is for whole `.ptbk.md` file of just one section
30
+ * TODO: [🍧] CommandParser should have applyToPipelineJson method
31
+ * which will apply parsed command to the pipeline JSON
32
+ * it will be called from `pipelineStringToJsonSync`
33
+ * and replace hardcoded switch statement and [💐]
34
+ * and throw ParsingError
35
+ *
36
+ */