@promptbook/anthropic-claude 0.52.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (484) hide show
  1. package/README.md +708 -0
  2. package/esm/index.es.js +2 -0
  3. package/esm/index.es.js.map +1 -0
  4. package/esm/typings/_packages/cli.index.d.ts +8 -0
  5. package/esm/typings/_packages/core.index.d.ts +19 -0
  6. package/esm/typings/_packages/execute-javascript.index.d.ts +46 -0
  7. package/esm/typings/_packages/langtail.index.d.ts +3 -0
  8. package/esm/typings/_packages/mock.index.d.ts +6 -0
  9. package/esm/typings/_packages/openai.index.d.ts +4 -0
  10. package/esm/typings/_packages/remote-client.index.d.ts +4 -0
  11. package/esm/typings/_packages/remote-server.index.d.ts +3 -0
  12. package/esm/typings/_packages/types.index.d.ts +28 -0
  13. package/esm/typings/_packages/utils.index.d.ts +73 -0
  14. package/esm/typings/_packages/wizzard.index.d.ts +5 -0
  15. package/esm/typings/config.d.ts +8 -0
  16. package/esm/typings/conversion/prettify/PrettifyOptions.d.ts +13 -0
  17. package/esm/typings/conversion/prettify/prettifyPromptbookString.d.ts +10 -0
  18. package/esm/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -0
  19. package/esm/typings/conversion/prettify/renderPromptbookMermaid.d.ts +24 -0
  20. package/esm/typings/conversion/promptbookJsonToString.d.ts +12 -0
  21. package/esm/typings/conversion/promptbookStringToJson.d.ts +15 -0
  22. package/esm/typings/conversion/promptbookStringToJson.test.d.ts +1 -0
  23. package/esm/typings/conversion/utils/extractParametersFromPromptTemplate.d.ts +13 -0
  24. package/esm/typings/conversion/utils/extractParametersFromPromptTemplate.test.d.ts +1 -0
  25. package/esm/typings/conversion/utils/extractVariables.d.ts +12 -0
  26. package/esm/typings/conversion/utils/extractVariables.test.d.ts +1 -0
  27. package/esm/typings/conversion/utils/parseCommand.d.ts +11 -0
  28. package/esm/typings/conversion/utils/parseCommand.test.d.ts +4 -0
  29. package/esm/typings/conversion/utils/parseNumber.d.ts +15 -0
  30. package/esm/typings/conversion/utils/parseNumber.test.d.ts +1 -0
  31. package/esm/typings/conversion/utils/renameParameter.d.ts +25 -0
  32. package/esm/typings/conversion/utils/renameParameter.test.d.ts +1 -0
  33. package/esm/typings/conversion/utils/titleToName.d.ts +4 -0
  34. package/esm/typings/conversion/utils/titleToName.test.d.ts +1 -0
  35. package/esm/typings/conversion/validation/_importPromptbook.d.ts +13 -0
  36. package/esm/typings/conversion/validation/promptbookStringToJson-syntaxErrors.test.d.ts +1 -0
  37. package/esm/typings/conversion/validation/validatePromptbookJson-logicErrors.test.d.ts +1 -0
  38. package/esm/typings/conversion/validation/validatePromptbookJson.d.ts +27 -0
  39. package/esm/typings/conversion/validation/validatePromptbookJson.test.d.ts +1 -0
  40. package/esm/typings/errors/PromptbookExecutionError.d.ts +7 -0
  41. package/esm/typings/errors/PromptbookLogicError.d.ts +7 -0
  42. package/esm/typings/errors/PromptbookNotFoundError.d.ts +7 -0
  43. package/esm/typings/errors/PromptbookReferenceError.d.ts +7 -0
  44. package/esm/typings/errors/PromptbookSyntaxError.d.ts +7 -0
  45. package/esm/typings/errors/TemplateError.d.ts +9 -0
  46. package/esm/typings/errors/UnexpectedError.d.ts +7 -0
  47. package/esm/typings/errors/_ExpectError.d.ts +10 -0
  48. package/esm/typings/execution/CommonExecutionToolsOptions.d.ts +9 -0
  49. package/esm/typings/execution/ExecutionTools.d.ts +30 -0
  50. package/esm/typings/execution/LlmExecutionTools.d.ts +48 -0
  51. package/esm/typings/execution/PromptResult.d.ts +74 -0
  52. package/esm/typings/execution/PromptbookExecutor.d.ts +37 -0
  53. package/esm/typings/execution/ScriptExecutionTools.d.ts +37 -0
  54. package/esm/typings/execution/UserInterfaceTools.d.ts +45 -0
  55. package/esm/typings/execution/assertsExecutionSuccessful.d.ts +11 -0
  56. package/esm/typings/execution/createPromptbookExecutor.d.ts +42 -0
  57. package/esm/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +10 -0
  58. package/esm/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
  59. package/esm/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts +26 -0
  60. package/esm/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts +23 -0
  61. package/esm/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts +15 -0
  62. package/esm/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.test.d.ts +1 -0
  63. package/esm/typings/execution/plugins/llm-execution-tools/mocked/faked-completion.test.d.ts +1 -0
  64. package/esm/typings/execution/plugins/llm-execution-tools/mocked/joker.test.d.ts +4 -0
  65. package/esm/typings/execution/plugins/llm-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
  66. package/esm/typings/execution/plugins/llm-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
  67. package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +45 -0
  68. package/esm/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -0
  69. package/esm/typings/execution/plugins/llm-execution-tools/openai/computeOpenaiUsage.d.ts +8 -0
  70. package/esm/typings/execution/plugins/llm-execution-tools/openai/computeUsage.d.ts +13 -0
  71. package/esm/typings/execution/plugins/llm-execution-tools/openai/computeUsage.test.d.ts +1 -0
  72. package/esm/typings/execution/plugins/llm-execution-tools/openai/models.d.ts +25 -0
  73. package/esm/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +40 -0
  74. package/esm/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions.d.ts +23 -0
  75. package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
  76. package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
  77. package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
  78. package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
  79. package/esm/typings/execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -0
  80. package/esm/typings/execution/plugins/llm-execution-tools/remote/startRemoteServer.d.ts +17 -0
  81. package/esm/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -0
  82. package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
  83. package/esm/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -0
  84. package/esm/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
  85. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
  86. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
  87. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -0
  88. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
  89. package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
  90. package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/unknownToString.d.ts +7 -0
  91. package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -0
  92. package/esm/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -0
  93. package/esm/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
  94. package/esm/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
  95. package/esm/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -0
  96. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -0
  97. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
  98. package/esm/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -0
  99. package/esm/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
  100. package/esm/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
  101. package/esm/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
  102. package/esm/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
  103. package/esm/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
  104. package/esm/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
  105. package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
  106. package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
  107. package/esm/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
  108. package/esm/typings/execution/utils/checkExpectations.d.ts +25 -0
  109. package/esm/typings/execution/utils/checkExpectations.test.d.ts +1 -0
  110. package/esm/typings/execution/utils/replaceParameters.d.ts +13 -0
  111. package/esm/typings/execution/utils/replaceParameters.test.d.ts +1 -0
  112. package/esm/typings/library/PromptbookLibrary.d.ts +25 -0
  113. package/esm/typings/library/SimplePromptbookLibrary.d.ts +36 -0
  114. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +14 -0
  115. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +26 -0
  116. package/esm/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +15 -0
  117. package/esm/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +13 -0
  118. package/esm/typings/library/constructors/createPromptbookSublibrary.d.ts +15 -0
  119. package/esm/typings/types/Command.d.ts +98 -0
  120. package/esm/typings/types/ExecutionTypes.d.ts +13 -0
  121. package/esm/typings/types/ModelRequirements.d.ts +43 -0
  122. package/esm/typings/types/Parameters.d.ts +14 -0
  123. package/esm/typings/types/Prompt.d.ts +54 -0
  124. package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +137 -0
  125. package/esm/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -0
  126. package/esm/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -0
  127. package/esm/typings/types/PromptbookString.d.ts +12 -0
  128. package/esm/typings/types/ScriptLanguage.d.ts +9 -0
  129. package/esm/typings/types/TaskProgress.d.ts +42 -0
  130. package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +56 -0
  131. package/esm/typings/types/execution-report/ExecutionReportString.d.ts +16 -0
  132. package/esm/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
  133. package/esm/typings/types/execution-report/config.d.ts +8 -0
  134. package/esm/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
  135. package/esm/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
  136. package/esm/typings/types/execution-report/executionReportJsonToString.d.ts +11 -0
  137. package/esm/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -0
  138. package/esm/typings/types/typeAliasEmoji.d.ts +9 -0
  139. package/esm/typings/types/typeAliases.d.ts +432 -0
  140. package/esm/typings/utils/FromtoItems.d.ts +19 -0
  141. package/esm/typings/utils/emojis.d.ts +22 -0
  142. package/esm/typings/utils/expectation-counters/countCharacters.d.ts +5 -0
  143. package/esm/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -0
  144. package/esm/typings/utils/expectation-counters/countLines.d.ts +5 -0
  145. package/esm/typings/utils/expectation-counters/countLines.test.d.ts +1 -0
  146. package/esm/typings/utils/expectation-counters/countPages.d.ts +5 -0
  147. package/esm/typings/utils/expectation-counters/countPages.test.d.ts +1 -0
  148. package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +5 -0
  149. package/esm/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
  150. package/esm/typings/utils/expectation-counters/countSentences.d.ts +9 -0
  151. package/esm/typings/utils/expectation-counters/countSentences.test.d.ts +1 -0
  152. package/esm/typings/utils/expectation-counters/countWords.d.ts +5 -0
  153. package/esm/typings/utils/expectation-counters/countWords.test.d.ts +1 -0
  154. package/esm/typings/utils/expectation-counters/index.d.ts +5 -0
  155. package/esm/typings/utils/extractParameters.d.ts +8 -0
  156. package/esm/typings/utils/extractParameters.test.d.ts +1 -0
  157. package/esm/typings/utils/formatNumber.d.ts +6 -0
  158. package/esm/typings/utils/formatNumber.test.d.ts +1 -0
  159. package/esm/typings/utils/getCurrentIsoDate.d.ts +7 -0
  160. package/esm/typings/utils/isRunningInWhatever.d.ts +12 -0
  161. package/esm/typings/utils/isValidJsonString.d.ts +4 -0
  162. package/esm/typings/utils/isValidJsonString.test.d.ts +1 -0
  163. package/esm/typings/utils/just.d.ts +10 -0
  164. package/esm/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -0
  165. package/esm/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
  166. package/esm/typings/utils/markdown/createMarkdownChart.d.ts +41 -0
  167. package/esm/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
  168. package/esm/typings/utils/markdown/createMarkdownTable.d.ts +7 -0
  169. package/esm/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
  170. package/esm/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
  171. package/esm/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
  172. package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
  173. package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
  174. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -0
  175. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
  176. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
  177. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
  178. package/esm/typings/utils/markdown/prettifyMarkdown.d.ts +8 -0
  179. package/esm/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
  180. package/esm/typings/utils/markdown/removeContentComments.d.ts +8 -0
  181. package/esm/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
  182. package/esm/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
  183. package/esm/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
  184. package/esm/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
  185. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
  186. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
  187. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
  188. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
  189. package/esm/typings/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
  190. package/esm/typings/utils/normalization/IKeywords.d.ts +18 -0
  191. package/esm/typings/utils/normalization/capitalize.d.ts +5 -0
  192. package/esm/typings/utils/normalization/capitalize.test.d.ts +1 -0
  193. package/esm/typings/utils/normalization/decapitalize.d.ts +5 -0
  194. package/esm/typings/utils/normalization/decapitalize.test.d.ts +1 -0
  195. package/esm/typings/utils/normalization/isValidKeyword.d.ts +8 -0
  196. package/esm/typings/utils/normalization/isValidKeyword.test.d.ts +1 -0
  197. package/esm/typings/utils/normalization/nameToUriPart.d.ts +1 -0
  198. package/esm/typings/utils/normalization/nameToUriPart.test.d.ts +1 -0
  199. package/esm/typings/utils/normalization/nameToUriParts.d.ts +1 -0
  200. package/esm/typings/utils/normalization/nameToUriParts.test.d.ts +1 -0
  201. package/esm/typings/utils/normalization/normalize-to-kebab-case.d.ts +1 -0
  202. package/esm/typings/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
  203. package/esm/typings/utils/normalization/normalizeTo_PascalCase.d.ts +1 -0
  204. package/esm/typings/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
  205. package/esm/typings/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +4 -0
  206. package/esm/typings/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
  207. package/esm/typings/utils/normalization/normalizeTo_camelCase.d.ts +4 -0
  208. package/esm/typings/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
  209. package/esm/typings/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  210. package/esm/typings/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
  211. package/esm/typings/utils/normalization/normalizeWhitespaces.d.ts +4 -0
  212. package/esm/typings/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
  213. package/esm/typings/utils/normalization/parseKeywords.d.ts +14 -0
  214. package/esm/typings/utils/normalization/parseKeywords.test.d.ts +1 -0
  215. package/esm/typings/utils/normalization/parseKeywordsFromString.d.ts +8 -0
  216. package/esm/typings/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
  217. package/esm/typings/utils/normalization/removeDiacritics.d.ts +4 -0
  218. package/esm/typings/utils/normalization/removeDiacritics.test.d.ts +1 -0
  219. package/esm/typings/utils/normalization/searchKeywords.d.ts +5 -0
  220. package/esm/typings/utils/normalization/searchKeywords.test.d.ts +1 -0
  221. package/esm/typings/utils/postprocessing/extractBlock.d.ts +12 -0
  222. package/esm/typings/utils/removeEmojis.d.ts +7 -0
  223. package/esm/typings/utils/removeEmojis.test.d.ts +1 -0
  224. package/esm/typings/utils/removeQuotes.d.ts +13 -0
  225. package/esm/typings/utils/removeQuotes.test.d.ts +1 -0
  226. package/esm/typings/utils/sets/difference.d.ts +4 -0
  227. package/esm/typings/utils/sets/difference.test.d.ts +1 -0
  228. package/esm/typings/utils/sets/intersection.d.ts +4 -0
  229. package/esm/typings/utils/sets/intersection.test.d.ts +1 -0
  230. package/esm/typings/utils/sets/union.d.ts +4 -0
  231. package/esm/typings/utils/sets/union.test.d.ts +1 -0
  232. package/esm/typings/utils/trimCodeBlock.d.ts +8 -0
  233. package/esm/typings/utils/trimCodeBlock.test.d.ts +1 -0
  234. package/esm/typings/utils/trimEndOfCodeBlock.d.ts +7 -0
  235. package/esm/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -0
  236. package/esm/typings/utils/unwrapResult.d.ts +36 -0
  237. package/esm/typings/utils/unwrapResult.test.d.ts +1 -0
  238. package/esm/typings/utils/validators/url/isValidUrl.d.ts +7 -0
  239. package/esm/typings/utils/validators/url/isValidUrl.test.d.ts +1 -0
  240. package/esm/typings/version.d.ts +5 -0
  241. package/esm/typings/wizzard/Wizzard.d.ts +4 -0
  242. package/esm/typings/wizzard/sample.d.ts +6 -0
  243. package/package.json +53 -0
  244. package/umd/index.umd.js +9 -0
  245. package/umd/index.umd.js.map +1 -0
  246. package/umd/typings/_packages/cli.index.d.ts +8 -0
  247. package/umd/typings/_packages/core.index.d.ts +19 -0
  248. package/umd/typings/_packages/execute-javascript.index.d.ts +46 -0
  249. package/umd/typings/_packages/langtail.index.d.ts +3 -0
  250. package/umd/typings/_packages/mock.index.d.ts +6 -0
  251. package/umd/typings/_packages/openai.index.d.ts +4 -0
  252. package/umd/typings/_packages/remote-client.index.d.ts +4 -0
  253. package/umd/typings/_packages/remote-server.index.d.ts +3 -0
  254. package/umd/typings/_packages/types.index.d.ts +28 -0
  255. package/umd/typings/_packages/utils.index.d.ts +73 -0
  256. package/umd/typings/_packages/wizzard.index.d.ts +5 -0
  257. package/umd/typings/config.d.ts +8 -0
  258. package/umd/typings/conversion/prettify/PrettifyOptions.d.ts +13 -0
  259. package/umd/typings/conversion/prettify/prettifyPromptbookString.d.ts +10 -0
  260. package/umd/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -0
  261. package/umd/typings/conversion/prettify/renderPromptbookMermaid.d.ts +24 -0
  262. package/umd/typings/conversion/promptbookJsonToString.d.ts +12 -0
  263. package/umd/typings/conversion/promptbookStringToJson.d.ts +15 -0
  264. package/umd/typings/conversion/promptbookStringToJson.test.d.ts +1 -0
  265. package/umd/typings/conversion/utils/extractParametersFromPromptTemplate.d.ts +13 -0
  266. package/umd/typings/conversion/utils/extractParametersFromPromptTemplate.test.d.ts +1 -0
  267. package/umd/typings/conversion/utils/extractVariables.d.ts +12 -0
  268. package/umd/typings/conversion/utils/extractVariables.test.d.ts +1 -0
  269. package/umd/typings/conversion/utils/parseCommand.d.ts +11 -0
  270. package/umd/typings/conversion/utils/parseCommand.test.d.ts +4 -0
  271. package/umd/typings/conversion/utils/parseNumber.d.ts +15 -0
  272. package/umd/typings/conversion/utils/parseNumber.test.d.ts +1 -0
  273. package/umd/typings/conversion/utils/renameParameter.d.ts +25 -0
  274. package/umd/typings/conversion/utils/renameParameter.test.d.ts +1 -0
  275. package/umd/typings/conversion/utils/titleToName.d.ts +4 -0
  276. package/umd/typings/conversion/utils/titleToName.test.d.ts +1 -0
  277. package/umd/typings/conversion/validation/_importPromptbook.d.ts +13 -0
  278. package/umd/typings/conversion/validation/promptbookStringToJson-syntaxErrors.test.d.ts +1 -0
  279. package/umd/typings/conversion/validation/validatePromptbookJson-logicErrors.test.d.ts +1 -0
  280. package/umd/typings/conversion/validation/validatePromptbookJson.d.ts +27 -0
  281. package/umd/typings/conversion/validation/validatePromptbookJson.test.d.ts +1 -0
  282. package/umd/typings/errors/PromptbookExecutionError.d.ts +7 -0
  283. package/umd/typings/errors/PromptbookLogicError.d.ts +7 -0
  284. package/umd/typings/errors/PromptbookNotFoundError.d.ts +7 -0
  285. package/umd/typings/errors/PromptbookReferenceError.d.ts +7 -0
  286. package/umd/typings/errors/PromptbookSyntaxError.d.ts +7 -0
  287. package/umd/typings/errors/TemplateError.d.ts +9 -0
  288. package/umd/typings/errors/UnexpectedError.d.ts +7 -0
  289. package/umd/typings/errors/_ExpectError.d.ts +10 -0
  290. package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +9 -0
  291. package/umd/typings/execution/ExecutionTools.d.ts +30 -0
  292. package/umd/typings/execution/LlmExecutionTools.d.ts +48 -0
  293. package/umd/typings/execution/PromptResult.d.ts +74 -0
  294. package/umd/typings/execution/PromptbookExecutor.d.ts +37 -0
  295. package/umd/typings/execution/ScriptExecutionTools.d.ts +37 -0
  296. package/umd/typings/execution/UserInterfaceTools.d.ts +45 -0
  297. package/umd/typings/execution/assertsExecutionSuccessful.d.ts +11 -0
  298. package/umd/typings/execution/createPromptbookExecutor.d.ts +42 -0
  299. package/umd/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools.d.ts +10 -0
  300. package/umd/typings/execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions.d.ts +11 -0
  301. package/umd/typings/execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools.d.ts +26 -0
  302. package/umd/typings/execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools.d.ts +23 -0
  303. package/umd/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.d.ts +15 -0
  304. package/umd/typings/execution/plugins/llm-execution-tools/mocked/fakeTextToExpectations.test.d.ts +1 -0
  305. package/umd/typings/execution/plugins/llm-execution-tools/mocked/faked-completion.test.d.ts +1 -0
  306. package/umd/typings/execution/plugins/llm-execution-tools/mocked/joker.test.d.ts +4 -0
  307. package/umd/typings/execution/plugins/llm-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
  308. package/umd/typings/execution/plugins/llm-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
  309. package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools.d.ts +45 -0
  310. package/umd/typings/execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -0
  311. package/umd/typings/execution/plugins/llm-execution-tools/openai/computeOpenaiUsage.d.ts +8 -0
  312. package/umd/typings/execution/plugins/llm-execution-tools/openai/computeUsage.d.ts +13 -0
  313. package/umd/typings/execution/plugins/llm-execution-tools/openai/computeUsage.test.d.ts +1 -0
  314. package/umd/typings/execution/plugins/llm-execution-tools/openai/models.d.ts +25 -0
  315. package/umd/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools.d.ts +40 -0
  316. package/umd/typings/execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions.d.ts +23 -0
  317. package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
  318. package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
  319. package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
  320. package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
  321. package/umd/typings/execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -0
  322. package/umd/typings/execution/plugins/llm-execution-tools/remote/startRemoteServer.d.ts +17 -0
  323. package/umd/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -0
  324. package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
  325. package/umd/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -0
  326. package/umd/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
  327. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
  328. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
  329. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -0
  330. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
  331. package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
  332. package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/unknownToString.d.ts +7 -0
  333. package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -0
  334. package/umd/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -0
  335. package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
  336. package/umd/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
  337. package/umd/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -0
  338. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -0
  339. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
  340. package/umd/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -0
  341. package/umd/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
  342. package/umd/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
  343. package/umd/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
  344. package/umd/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
  345. package/umd/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
  346. package/umd/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
  347. package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +7 -0
  348. package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
  349. package/umd/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
  350. package/umd/typings/execution/utils/checkExpectations.d.ts +25 -0
  351. package/umd/typings/execution/utils/checkExpectations.test.d.ts +1 -0
  352. package/umd/typings/execution/utils/replaceParameters.d.ts +13 -0
  353. package/umd/typings/execution/utils/replaceParameters.test.d.ts +1 -0
  354. package/umd/typings/library/PromptbookLibrary.d.ts +25 -0
  355. package/umd/typings/library/SimplePromptbookLibrary.d.ts +36 -0
  356. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +14 -0
  357. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +26 -0
  358. package/umd/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +15 -0
  359. package/umd/typings/library/constructors/createPromptbookLibraryFromUrl.d.ts +13 -0
  360. package/umd/typings/library/constructors/createPromptbookSublibrary.d.ts +15 -0
  361. package/umd/typings/types/Command.d.ts +98 -0
  362. package/umd/typings/types/ExecutionTypes.d.ts +13 -0
  363. package/umd/typings/types/ModelRequirements.d.ts +43 -0
  364. package/umd/typings/types/Parameters.d.ts +14 -0
  365. package/umd/typings/types/Prompt.d.ts +54 -0
  366. package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +137 -0
  367. package/umd/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -0
  368. package/umd/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -0
  369. package/umd/typings/types/PromptbookString.d.ts +12 -0
  370. package/umd/typings/types/ScriptLanguage.d.ts +9 -0
  371. package/umd/typings/types/TaskProgress.d.ts +42 -0
  372. package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +56 -0
  373. package/umd/typings/types/execution-report/ExecutionReportString.d.ts +16 -0
  374. package/umd/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
  375. package/umd/typings/types/execution-report/config.d.ts +8 -0
  376. package/umd/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
  377. package/umd/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
  378. package/umd/typings/types/execution-report/executionReportJsonToString.d.ts +11 -0
  379. package/umd/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -0
  380. package/umd/typings/types/typeAliasEmoji.d.ts +9 -0
  381. package/umd/typings/types/typeAliases.d.ts +432 -0
  382. package/umd/typings/utils/FromtoItems.d.ts +19 -0
  383. package/umd/typings/utils/emojis.d.ts +22 -0
  384. package/umd/typings/utils/expectation-counters/countCharacters.d.ts +5 -0
  385. package/umd/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -0
  386. package/umd/typings/utils/expectation-counters/countLines.d.ts +5 -0
  387. package/umd/typings/utils/expectation-counters/countLines.test.d.ts +1 -0
  388. package/umd/typings/utils/expectation-counters/countPages.d.ts +5 -0
  389. package/umd/typings/utils/expectation-counters/countPages.test.d.ts +1 -0
  390. package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +5 -0
  391. package/umd/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
  392. package/umd/typings/utils/expectation-counters/countSentences.d.ts +9 -0
  393. package/umd/typings/utils/expectation-counters/countSentences.test.d.ts +1 -0
  394. package/umd/typings/utils/expectation-counters/countWords.d.ts +5 -0
  395. package/umd/typings/utils/expectation-counters/countWords.test.d.ts +1 -0
  396. package/umd/typings/utils/expectation-counters/index.d.ts +5 -0
  397. package/umd/typings/utils/extractParameters.d.ts +8 -0
  398. package/umd/typings/utils/extractParameters.test.d.ts +1 -0
  399. package/umd/typings/utils/formatNumber.d.ts +6 -0
  400. package/umd/typings/utils/formatNumber.test.d.ts +1 -0
  401. package/umd/typings/utils/getCurrentIsoDate.d.ts +7 -0
  402. package/umd/typings/utils/isRunningInWhatever.d.ts +12 -0
  403. package/umd/typings/utils/isValidJsonString.d.ts +4 -0
  404. package/umd/typings/utils/isValidJsonString.test.d.ts +1 -0
  405. package/umd/typings/utils/just.d.ts +10 -0
  406. package/umd/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -0
  407. package/umd/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
  408. package/umd/typings/utils/markdown/createMarkdownChart.d.ts +41 -0
  409. package/umd/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
  410. package/umd/typings/utils/markdown/createMarkdownTable.d.ts +7 -0
  411. package/umd/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
  412. package/umd/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
  413. package/umd/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
  414. package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
  415. package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
  416. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -0
  417. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
  418. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
  419. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
  420. package/umd/typings/utils/markdown/prettifyMarkdown.d.ts +8 -0
  421. package/umd/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
  422. package/umd/typings/utils/markdown/removeContentComments.d.ts +8 -0
  423. package/umd/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
  424. package/umd/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
  425. package/umd/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
  426. package/umd/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
  427. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
  428. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
  429. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
  430. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
  431. package/umd/typings/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +10 -0
  432. package/umd/typings/utils/normalization/IKeywords.d.ts +18 -0
  433. package/umd/typings/utils/normalization/capitalize.d.ts +5 -0
  434. package/umd/typings/utils/normalization/capitalize.test.d.ts +1 -0
  435. package/umd/typings/utils/normalization/decapitalize.d.ts +5 -0
  436. package/umd/typings/utils/normalization/decapitalize.test.d.ts +1 -0
  437. package/umd/typings/utils/normalization/isValidKeyword.d.ts +8 -0
  438. package/umd/typings/utils/normalization/isValidKeyword.test.d.ts +1 -0
  439. package/umd/typings/utils/normalization/nameToUriPart.d.ts +1 -0
  440. package/umd/typings/utils/normalization/nameToUriPart.test.d.ts +1 -0
  441. package/umd/typings/utils/normalization/nameToUriParts.d.ts +1 -0
  442. package/umd/typings/utils/normalization/nameToUriParts.test.d.ts +1 -0
  443. package/umd/typings/utils/normalization/normalize-to-kebab-case.d.ts +1 -0
  444. package/umd/typings/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
  445. package/umd/typings/utils/normalization/normalizeTo_PascalCase.d.ts +1 -0
  446. package/umd/typings/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
  447. package/umd/typings/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +4 -0
  448. package/umd/typings/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
  449. package/umd/typings/utils/normalization/normalizeTo_camelCase.d.ts +4 -0
  450. package/umd/typings/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
  451. package/umd/typings/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  452. package/umd/typings/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
  453. package/umd/typings/utils/normalization/normalizeWhitespaces.d.ts +4 -0
  454. package/umd/typings/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
  455. package/umd/typings/utils/normalization/parseKeywords.d.ts +14 -0
  456. package/umd/typings/utils/normalization/parseKeywords.test.d.ts +1 -0
  457. package/umd/typings/utils/normalization/parseKeywordsFromString.d.ts +8 -0
  458. package/umd/typings/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
  459. package/umd/typings/utils/normalization/removeDiacritics.d.ts +4 -0
  460. package/umd/typings/utils/normalization/removeDiacritics.test.d.ts +1 -0
  461. package/umd/typings/utils/normalization/searchKeywords.d.ts +5 -0
  462. package/umd/typings/utils/normalization/searchKeywords.test.d.ts +1 -0
  463. package/umd/typings/utils/postprocessing/extractBlock.d.ts +12 -0
  464. package/umd/typings/utils/removeEmojis.d.ts +7 -0
  465. package/umd/typings/utils/removeEmojis.test.d.ts +1 -0
  466. package/umd/typings/utils/removeQuotes.d.ts +13 -0
  467. package/umd/typings/utils/removeQuotes.test.d.ts +1 -0
  468. package/umd/typings/utils/sets/difference.d.ts +4 -0
  469. package/umd/typings/utils/sets/difference.test.d.ts +1 -0
  470. package/umd/typings/utils/sets/intersection.d.ts +4 -0
  471. package/umd/typings/utils/sets/intersection.test.d.ts +1 -0
  472. package/umd/typings/utils/sets/union.d.ts +4 -0
  473. package/umd/typings/utils/sets/union.test.d.ts +1 -0
  474. package/umd/typings/utils/trimCodeBlock.d.ts +8 -0
  475. package/umd/typings/utils/trimCodeBlock.test.d.ts +1 -0
  476. package/umd/typings/utils/trimEndOfCodeBlock.d.ts +7 -0
  477. package/umd/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -0
  478. package/umd/typings/utils/unwrapResult.d.ts +36 -0
  479. package/umd/typings/utils/unwrapResult.test.d.ts +1 -0
  480. package/umd/typings/utils/validators/url/isValidUrl.d.ts +7 -0
  481. package/umd/typings/utils/validators/url/isValidUrl.test.d.ts +1 -0
  482. package/umd/typings/version.d.ts +5 -0
  483. package/umd/typings/wizzard/Wizzard.d.ts +4 -0
  484. package/umd/typings/wizzard/sample.d.ts +6 -0
@@ -0,0 +1,2 @@
1
+
2
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { prettifyPromptbookStringCli } from '../conversion/prettify/prettifyPromptbookStringCli';
2
+ /**
3
+ * Hidden utilities which should not be used by external consumers.
4
+ */
5
+ declare const __: {
6
+ prettifyPromptbookStringCli: typeof prettifyPromptbookStringCli;
7
+ };
8
+ export { __ };
@@ -0,0 +1,19 @@
1
+ import { promptbookStringToJson } from '../conversion/promptbookStringToJson';
2
+ import { promptbookJsonToString } from '../conversion/promptbookJsonToString';
3
+ import { validatePromptbookJson } from '../conversion/validation/validatePromptbookJson';
4
+ import { createPromptbookExecutor } from '../execution/createPromptbookExecutor';
5
+ import { CallbackInterfaceTools } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools';
6
+ import { CallbackInterfaceToolsOptions } from '../execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions';
7
+ import { SimplePromptInterfaceTools } from '../execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools';
8
+ import { SimplePromptbookLibrary } from '../library/SimplePromptbookLibrary';
9
+ import { createPromptbookLibraryFromPromise } from '../library/constructors/createPromptbookLibraryFromPromise';
10
+ import { createPromptbookLibraryFromSources } from '../library/constructors/createPromptbookLibraryFromSources';
11
+ import { createPromptbookSublibrary } from '../library/constructors/createPromptbookSublibrary';
12
+ import { ExecutionTypes } from '../types/ExecutionTypes';
13
+ import { PROMPTBOOK_VERSION } from '../version';
14
+ export { ExecutionTypes, PROMPTBOOK_VERSION };
15
+ export { createPromptbookLibraryFromPromise, createPromptbookLibraryFromSources, createPromptbookSublibrary, SimplePromptbookLibrary, };
16
+ export { SimplePromptInterfaceTools };
17
+ export { promptbookStringToJson, promptbookJsonToString, validatePromptbookJson };
18
+ export { createPromptbookExecutor };
19
+ export { CallbackInterfaceTools, CallbackInterfaceToolsOptions };
@@ -0,0 +1,46 @@
1
+ import spaceTrim from 'spacetrim';
2
+ import { JavascriptEvalExecutionTools } from '../execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools';
3
+ import { JavascriptExecutionTools } from '../execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools';
4
+ import { prettifyMarkdown } from '../utils/markdown/prettifyMarkdown';
5
+ import { capitalize } from '../utils/normalization/capitalize';
6
+ import { decapitalize } from '../utils/normalization/decapitalize';
7
+ import { nameToUriPart } from '../utils/normalization/nameToUriPart';
8
+ import { nameToUriParts } from '../utils/normalization/nameToUriParts';
9
+ import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
10
+ import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
11
+ import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
12
+ import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
13
+ import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
14
+ import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
15
+ import { removeDiacritics } from '../utils/normalization/removeDiacritics';
16
+ import { extractBlock } from '../utils/postprocessing/extractBlock';
17
+ import { removeEmojis } from '../utils/removeEmojis';
18
+ import { removeQuotes } from '../utils/removeQuotes';
19
+ import { trimCodeBlock } from '../utils/trimCodeBlock';
20
+ import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
21
+ import { unwrapResult } from '../utils/unwrapResult';
22
+ declare const POSTPROCESSING_FUNCTIONS: {
23
+ spaceTrim: typeof spaceTrim;
24
+ removeQuotes: typeof removeQuotes;
25
+ unwrapResult: typeof unwrapResult;
26
+ trimEndOfCodeBlock: typeof trimEndOfCodeBlock;
27
+ trimCodeBlock: typeof trimCodeBlock;
28
+ trim: (str: string) => string;
29
+ reverse: (str: string) => string;
30
+ removeEmojis: typeof removeEmojis;
31
+ prettifyMarkdown: typeof prettifyMarkdown;
32
+ capitalize: typeof capitalize;
33
+ decapitalize: typeof decapitalize;
34
+ nameToUriPart: typeof nameToUriPart;
35
+ nameToUriParts: typeof nameToUriParts;
36
+ removeDiacritics: typeof removeDiacritics;
37
+ normalizeWhitespaces: typeof normalizeWhitespaces;
38
+ normalizeToKebabCase: typeof normalizeToKebabCase;
39
+ normalizeTo_camelCase: typeof normalizeTo_camelCase;
40
+ normalizeTo_snake_case: typeof normalizeTo_snake_case;
41
+ normalizeTo_PascalCase: typeof normalizeTo_PascalCase;
42
+ parseKeywords: (input: string) => string;
43
+ normalizeTo_SCREAMING_CASE: typeof normalizeTo_SCREAMING_CASE;
44
+ extractBlock: typeof extractBlock;
45
+ };
46
+ export { JavascriptEvalExecutionTools, JavascriptExecutionTools, POSTPROCESSING_FUNCTIONS };
@@ -0,0 +1,3 @@
1
+ import { LangtailExecutionTools } from '../execution/plugins/llm-execution-tools/langtail/LangtailExecutionTools';
2
+ import { LangtailExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/langtail/LangtailExecutionToolsOptions';
3
+ export { LangtailExecutionTools, LangtailExecutionToolsOptions };
@@ -0,0 +1,6 @@
1
+ import { MockedEchoLlmExecutionTools } from '../execution/plugins/llm-execution-tools/mocked/MockedEchoLlmExecutionTools';
2
+ import { MockedFackedLlmExecutionTools } from '../execution/plugins/llm-execution-tools/mocked/MockedFackedLlmExecutionTools';
3
+ export { MockedEchoLlmExecutionTools, MockedFackedLlmExecutionTools };
4
+ /**
5
+ * TODO: [🚏] FakeLLM
6
+ */
@@ -0,0 +1,4 @@
1
+ import { OPENAI_MODELS } from '../execution/plugins/llm-execution-tools/openai/models';
2
+ import { OpenAiExecutionTools } from '../execution/plugins/llm-execution-tools/openai/OpenAiExecutionTools';
3
+ import { OpenAiExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/openai/OpenAiExecutionToolsOptions';
4
+ export { OPENAI_MODELS, OpenAiExecutionTools, OpenAiExecutionToolsOptions };
@@ -0,0 +1,4 @@
1
+ import { RemoteServerOptions } from '../execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions';
2
+ import { RemoteLlmExecutionTools } from '../execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionTools';
3
+ import { RemoteLlmExecutionToolsOptions } from '../execution/plugins/llm-execution-tools/remote/RemoteLlmExecutionToolsOptions';
4
+ export { RemoteLlmExecutionTools, RemoteLlmExecutionToolsOptions, RemoteServerOptions };
@@ -0,0 +1,3 @@
1
+ import { RemoteServerOptions } from '../execution/plugins/llm-execution-tools/remote/interfaces/RemoteServerOptions';
2
+ import { startRemoteServer } from '../execution/plugins/llm-execution-tools/remote/startRemoteServer';
3
+ export { RemoteServerOptions, startRemoteServer };
@@ -0,0 +1,28 @@
1
+ import type { CommonExecutionToolsOptions } from '../execution/CommonExecutionToolsOptions';
2
+ import type { ExecutionTools } from '../execution/ExecutionTools';
3
+ import type { AvailableModel, LlmExecutionTools } from '../execution/LlmExecutionTools';
4
+ import type { PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptResult } from '../execution/PromptResult';
5
+ import type { PromptbookExecutor } from '../execution/PromptbookExecutor';
6
+ import type { ScriptExecutionTools, ScriptExecutionToolsExecuteOptions } from '../execution/ScriptExecutionTools';
7
+ import type { UserInterfaceTools, UserInterfaceToolsPromptDialogOptions } from '../execution/UserInterfaceTools';
8
+ import { PromptbookLibrary } from '../library/PromptbookLibrary';
9
+ import type { ExecutionType } from '../types/ExecutionTypes';
10
+ import type { ModelRequirements, ModelVariant } from '../types/ModelRequirements';
11
+ import type { Parameters } from '../types/Parameters';
12
+ import type { Prompt } from '../types/Prompt';
13
+ import type { ExpectationAmount, Expectations, ExpectationUnit, LlmTemplateJson, PromptDialogJson, PromptTemplateJson, ScriptJson, SimpleTemplateJson } from '../types/PromptbookJson/PromptTemplateJson';
14
+ import { EXPECTATION_UNITS } from '../types/PromptbookJson/PromptTemplateJson';
15
+ import type { PromptTemplateParameterJson } from '../types/PromptbookJson/PromptTemplateParameterJson';
16
+ import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
17
+ import type { PromptbookString } from '../types/PromptbookString';
18
+ import type { ScriptLanguage } from '../types/ScriptLanguage';
19
+ import type { TaskProgress } from '../types/TaskProgress';
20
+ import type { ExecutionReportJson } from '../types/execution-report/ExecutionReportJson';
21
+ import type { string_char_emoji } from '../types/typeAliasEmoji';
22
+ 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_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, 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';
23
+ import { FromtoItems } from '../utils/FromtoItems';
24
+ export { AvailableModel, client_id, CommonExecutionToolsOptions, ExecutionReportJson, ExecutionTools, ExecutionType, EXPECTATION_UNITS, ExpectationAmount, Expectations, ExpectationUnit, FromtoItems, LlmExecutionTools, LlmTemplateJson, ModelRequirements, ModelVariant, Parameters, Prompt, PromptbookExecutor, PromptbookJson, PromptbookLibrary, PromptbookString, PromptChatResult, PromptCommonResult, PromptCompletionResult, PromptDialogJson, PromptResult, PromptTemplateJson, PromptTemplateParameterJson, ScriptExecutionTools, ScriptExecutionToolsExecuteOptions, ScriptJson, ScriptLanguage, SimpleTemplateJson, 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_prompt, string_promptbook_url, string_promptbook_url_with_hashtemplate, 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, TaskProgress, UserInterfaceTools, UserInterfaceToolsPromptDialogOptions, };
25
+ /**
26
+ * TODO: [🧠][🆔] Is this the best package to export custom errors from?
27
+ * TODO: Delete type aliases (from ../types/typeAliases) that are not exported here
28
+ */
@@ -0,0 +1,73 @@
1
+ import { spaceTrim } from 'spacetrim';
2
+ import { prettifyPromptbookString } from '../conversion/prettify/prettifyPromptbookString';
3
+ import { renderPromptbookMermaid } from '../conversion/prettify/renderPromptbookMermaid';
4
+ import { extractParametersFromPromptTemplate } from '../conversion/utils/extractParametersFromPromptTemplate';
5
+ import { extractVariables } from '../conversion/utils/extractVariables';
6
+ import { parseNumber } from '../conversion/utils/parseNumber';
7
+ import { renameParameter } from '../conversion/utils/renameParameter';
8
+ import { titleToName } from '../conversion/utils/titleToName';
9
+ import { assertsExecutionSuccessful } from '../execution/assertsExecutionSuccessful';
10
+ import { checkExpectations, isPassingExpectations } from '../execution/utils/checkExpectations';
11
+ import { replaceParameters } from '../execution/utils/replaceParameters';
12
+ import { executionReportJsonToString } from '../types/execution-report/executionReportJsonToString';
13
+ import { ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults } from '../types/execution-report/ExecutionReportStringOptions';
14
+ import { CountUtils } from '../utils/expectation-counters';
15
+ import { countCharacters } from '../utils/expectation-counters/countCharacters';
16
+ import { countLines } from '../utils/expectation-counters/countLines';
17
+ import { countPages } from '../utils/expectation-counters/countPages';
18
+ import { countParagraphs } from '../utils/expectation-counters/countParagraphs';
19
+ import { countSentences, splitIntoSentences } from '../utils/expectation-counters/countSentences';
20
+ import { countWords } from '../utils/expectation-counters/countWords';
21
+ import { extractParameters } from '../utils/extractParameters';
22
+ import { isValidJsonString } from '../utils/isValidJsonString';
23
+ import { extractAllBlocksFromMarkdown } from '../utils/markdown/extractAllBlocksFromMarkdown';
24
+ import { extractAllListItemsFromMarkdown } from '../utils/markdown/extractAllListItemsFromMarkdown';
25
+ import { extractOneBlockFromMarkdown } from '../utils/markdown/extractOneBlockFromMarkdown';
26
+ import { removeContentComments } from '../utils/markdown/removeContentComments';
27
+ import { removeMarkdownFormatting } from '../utils/markdown/removeMarkdownFormatting';
28
+ import { capitalize } from '../utils/normalization/capitalize';
29
+ import { decapitalize } from '../utils/normalization/decapitalize';
30
+ import { DIACRITIC_VARIANTS_LETTERS } from '../utils/normalization/DIACRITIC_VARIANTS_LETTERS';
31
+ import { IKeywords, string_keyword } from '../utils/normalization/IKeywords';
32
+ import { isValidKeyword } from '../utils/normalization/isValidKeyword';
33
+ import { nameToUriPart } from '../utils/normalization/nameToUriPart';
34
+ import { nameToUriParts } from '../utils/normalization/nameToUriParts';
35
+ import { normalizeToKebabCase } from '../utils/normalization/normalize-to-kebab-case';
36
+ import { normalizeTo_camelCase } from '../utils/normalization/normalizeTo_camelCase';
37
+ import { normalizeTo_PascalCase } from '../utils/normalization/normalizeTo_PascalCase';
38
+ import { normalizeTo_SCREAMING_CASE } from '../utils/normalization/normalizeTo_SCREAMING_CASE';
39
+ import { normalizeTo_snake_case } from '../utils/normalization/normalizeTo_snake_case';
40
+ import { normalizeWhitespaces } from '../utils/normalization/normalizeWhitespaces';
41
+ import { parseKeywords } from '../utils/normalization/parseKeywords';
42
+ import { parseKeywordsFromString } from '../utils/normalization/parseKeywordsFromString';
43
+ import { removeDiacritics } from '../utils/normalization/removeDiacritics';
44
+ import { searchKeywords } from '../utils/normalization/searchKeywords';
45
+ import { extractBlock } from '../utils/postprocessing/extractBlock';
46
+ import { removeEmojis } from '../utils/removeEmojis';
47
+ import { removeQuotes } from '../utils/removeQuotes';
48
+ import { difference } from '../utils/sets/difference';
49
+ import { intersection } from '../utils/sets/intersection';
50
+ import { union } from '../utils/sets/union';
51
+ import { trimCodeBlock } from '../utils/trimCodeBlock';
52
+ import { trimEndOfCodeBlock } from '../utils/trimEndOfCodeBlock';
53
+ import { unwrapResult } from '../utils/unwrapResult';
54
+ export { assertsExecutionSuccessful, checkExpectations, executionReportJsonToString, ExecutionReportStringOptions, ExecutionReportStringOptionsDefaults, extractAllBlocksFromMarkdown, // <- [🌻]
55
+ extractAllListItemsFromMarkdown, extractBlock, // <- [🌻]
56
+ extractOneBlockFromMarkdown, extractParameters, extractVariables, isPassingExpectations, isValidJsonString, parseNumber, // <- [🌻]
57
+ prettifyPromptbookString, removeContentComments, removeEmojis, removeMarkdownFormatting, removeQuotes, replaceParameters, spaceTrim, trimCodeBlock, trimEndOfCodeBlock, unwrapResult, };
58
+ export { countCharacters, countLines, countPages, countParagraphs, countSentences, CountUtils, countWords };
59
+ export { splitIntoSentences };
60
+ export declare const normalizeTo: {
61
+ camelCase: typeof normalizeTo_camelCase;
62
+ PascalCase: typeof normalizeTo_PascalCase;
63
+ SCREAMING_CASE: typeof normalizeTo_SCREAMING_CASE;
64
+ snake_case: typeof normalizeTo_snake_case;
65
+ 'kebab-case': typeof normalizeToKebabCase;
66
+ };
67
+ 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, };
68
+ export { extractParametersFromPromptTemplate, renameParameter, renderPromptbookMermaid };
69
+ export { difference, intersection, union };
70
+ /**
71
+ * TODO: [🧠] Maybe create some indipendent package like `markdown-tools` from both here exported and @private utilities
72
+ * Note: [🕙] It does not make sence to have simple lower / UPPER case normalization
73
+ */
@@ -0,0 +1,5 @@
1
+ import { Wizzard } from '../wizzard/Wizzard';
2
+ export { Wizzard };
3
+ /**
4
+ * TODO: [🧙‍♂️]
5
+ */
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The maximum number of iterations for a loops
3
+ */
4
+ export declare const LOOP_LIMIT = 1000;
5
+ /**
6
+ * The maximum number of iterations for a loops which adds characters one by one
7
+ */
8
+ export declare const CHARACTER_LOOP_LIMIT = 100000;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Options for `prettifyPromptbookString` function
3
+ */
4
+ export type PrettifyOptions = {
5
+ /***
6
+ * If true, adds Mermaid graph to the Promptbook string
7
+ */
8
+ isGraphAdded?: boolean;
9
+ /**
10
+ * If true, the string is prettifyed as markdown
11
+ */
12
+ isPrettifyed?: boolean;
13
+ };
@@ -0,0 +1,10 @@
1
+ import { PromptbookString } from '../../types/PromptbookString';
2
+ import type { PrettifyOptions } from './PrettifyOptions';
3
+ /**
4
+ * Prettyfies Promptbook string and adds Mermaid graph
5
+ */
6
+ export declare function prettifyPromptbookString(promptbookString: PromptbookString, options: PrettifyOptions): PromptbookString;
7
+ /**
8
+ * TODO: Maybe use some Mermaid library instead of string templating
9
+ * TODO: [🕌] When more than 2 functionalities, split into separate functions
10
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Runs CLI script for prettifying promptbooks
3
+ */
4
+ export declare function prettifyPromptbookStringCli(): Promise<void>;
5
+ /**
6
+ * TODO: [🥠] Do not export to utils directly, its just for CLI script
7
+ * TODO: [🕌] When more functionalities, rename
8
+ * Note: 11:11
9
+ */
@@ -0,0 +1,24 @@
1
+ import type { PromptbookJson, PromptTemplateJson } from '../../_packages/types.index';
2
+ import type { string_href } from '../../types/typeAliases';
3
+ /**
4
+ * Addtional options for rendering Mermaid graph
5
+ */
6
+ export type renderPromptbookMermaidOptions = {
7
+ /**
8
+ * Callback for creating from prompt template graph node
9
+ */
10
+ linkPromptTemplate?(promptTemplate: PromptTemplateJson): {
11
+ href: string_href;
12
+ title: string;
13
+ } | null;
14
+ };
15
+ /**
16
+ * Creates a Mermaid graph based on the promptbook
17
+ *
18
+ * Note: The result is not wrapped in a Markdown code block
19
+ */
20
+ export declare function renderPromptbookMermaid(promptbookJson: PromptbookJson, options?: renderPromptbookMermaidOptions): string;
21
+ /**
22
+ * TODO: Maybe use some Mermaid library instead of string templating
23
+ * TODO: [🕌] When more than 2 functionalities, split into separate functions
24
+ */
@@ -0,0 +1,12 @@
1
+ import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
+ import type { PromptbookString } from '../types/PromptbookString';
3
+ /**
4
+ * Converts promptbook in JSON format to string format
5
+ *
6
+ * @param promptbookJson Promptbook in JSON format (.ptbk.json)
7
+ * @returns Promptbook in string format (.ptbk.md)
8
+ */
9
+ export declare function promptbookJsonToString(promptbookJson: PromptbookJson): PromptbookString;
10
+ /**
11
+ * TODO: Escape all
12
+ */
@@ -0,0 +1,15 @@
1
+ import type { PromptbookJson } from '../types/PromptbookJson/PromptbookJson';
2
+ import type { PromptbookString } from '../types/PromptbookString';
3
+ /**
4
+ * Parse promptbook from string format to JSON format
5
+ *
6
+ * @throws {PromptbookSyntaxError} if the promptbook string is not valid
7
+ *
8
+ * Note: This function does not validate logic of the pipeline only the syntax
9
+ */
10
+ export declare function promptbookStringToJson(promptbookString: PromptbookString): PromptbookJson;
11
+ /**
12
+ * TODO: Report here line/column of error
13
+ * TODO: Use spaceTrim more effectively
14
+ * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
15
+ */
@@ -0,0 +1,13 @@
1
+ import { PromptTemplateJson } from '../../types/PromptbookJson/PromptTemplateJson';
2
+ import { string_name } from '../../types/typeAliases';
3
+ /**
4
+ * Parses the prompt template and returns the set of all used parameters
5
+ *
6
+ * @param promptTemplate the template with used parameters
7
+ * @returns the set of parameter names
8
+ * @throws {PromptbookSyntaxError} if the script is invalid
9
+ */
10
+ export declare function extractParametersFromPromptTemplate(promptTemplate: Pick<PromptTemplateJson, 'title' | 'description' | 'executionType' | 'content'>): Set<string_name>;
11
+ /**
12
+ * TODO: [🔣] If script require contentLanguage
13
+ */
@@ -0,0 +1,12 @@
1
+ import { string_javascript, string_javascript_name } from '../../types/typeAliases';
2
+ /**
3
+ * Parses the given script and returns the list of all used variables that are not defined in the script
4
+ *
5
+ * @param script from which to extract the variables
6
+ * @returns the list of variable names
7
+ * @throws {PromptbookSyntaxError} if the script is invalid
8
+ */
9
+ export declare function extractVariables(script: string_javascript): Set<string_javascript_name>;
10
+ /**
11
+ * TODO: [🔣] Support for multiple languages - python, java,...
12
+ */
@@ -0,0 +1,11 @@
1
+ import type { Command } from '../../types/Command';
2
+ import type { string_markdown_text } from '../../types/typeAliases';
3
+ /**
4
+ * Parses one line of ul/ol to command
5
+ *
6
+ * @returns parsed command object
7
+ * @throws {PromptbookSyntaxError} if the command is invalid
8
+ *
9
+ * @private within the promptbookStringToJson
10
+ */
11
+ export declare function parseCommand(listItem: string_markdown_text): Command;
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧠] Probbably change syntax MODEL VARIANT -> MODEL
4
+ */
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Function parseNumber will parse number from string
3
+ *
4
+ * Unlike Number.parseInt, Number.parseFloat it will never ever result in NaN
5
+ * Note: it also works only with decimal numbers
6
+ *
7
+ * @returns parsed number
8
+ * @throws {PromptbookSyntaxError} if the value is not a number
9
+ *
10
+ * @private within the parseCommand
11
+ */
12
+ export declare function parseNumber(value: string | number): number;
13
+ /**
14
+ * TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
15
+ */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
+ import type { string_name } from '../../types/typeAliases';
3
+ type RenameParameterOptions = {
4
+ /**
5
+ * Promptbook to search and replace for parameters
6
+ * This promptbook is returned as copy with replaced parameters
7
+ */
8
+ promptbook: PromptbookJson;
9
+ /**
10
+ * Original parameter name that should be replaced
11
+ */
12
+ oldParameterName: string_name;
13
+ /**
14
+ * New parameter name that should replace the original parameter name
15
+ */
16
+ newParameterName: string_name;
17
+ };
18
+ /**
19
+ * Function renameParameter will find all usable parameters for given prompt template
20
+ * In other words, it will find all parameters that are not used in the prompt template itseld and all its dependencies
21
+ *
22
+ * @throws {PromptbookLogicError} If the new parameter name is already used in the promptbook
23
+ */
24
+ export declare function renameParameter(options: RenameParameterOptions): PromptbookJson;
25
+ export {};
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Function normalizes title to name which can be used as identifier
3
+ */
4
+ export declare function titleToName(value: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
+ import { PromptbookString } from '../../types/PromptbookString';
3
+ /**
4
+ * Import the text file
5
+ *
6
+ * Note: Using here custom import to work in jest tests
7
+ * Note: Using sync version is 💩 in the production code, but it's ok here in tests
8
+ *
9
+ * @param path - The path to the file relative to samples/templates directory
10
+ * @private
11
+ */
12
+ export declare function importPromptbook(path: `${string}.ptbk.md`): PromptbookString;
13
+ export declare function importPromptbook(path: `${string}.ptbk.json`): PromptbookJson;
@@ -0,0 +1,27 @@
1
+ import type { PromptbookJson } from '../../types/PromptbookJson/PromptbookJson';
2
+ /**
3
+ * Validates PromptbookJson if it is logically valid
4
+ *
5
+ * It checks:
6
+ * - if it has correct parameters dependency
7
+ *
8
+ * It does NOT check:
9
+ * - if it is valid json
10
+ * - if it is meaningful
11
+ *
12
+ * @param promptbook valid or invalid PromptbookJson
13
+ * @returns the same promptbook if it is logically valid
14
+ * @throws {PromptbookLogicError} on logical error in the promptbook
15
+ */
16
+ export declare function validatePromptbookJson(promptbook: PromptbookJson): PromptbookJson;
17
+ /**
18
+ * TODO: [🧠] Work with promptbookVersion
19
+ * TODO: Use here some json-schema, Zod or something similar and change it to:
20
+ * > /**
21
+ * > * Validates PromptbookJson if it is logically valid.
22
+ * > *
23
+ * > * It checks:
24
+ * > * - it has a valid structure
25
+ * > * - ...
26
+ * > ex port function validatePromptbookJson(promptbook: unknown): asserts promptbook is PromptbookJson {
27
+ */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates errors during the execution of the promptbook
3
+ */
4
+ export declare class PromptbookExecutionError extends Error {
5
+ readonly name = "PromptbookExecutionError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
3
+ */
4
+ export declare class PromptbookLogicError extends Error {
5
+ readonly name = "PromptbookLogicError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that promptbook not found in the library
3
+ */
4
+ export declare class PromptbookNotFoundError extends Error {
5
+ readonly name = "PromptbookNotFoundError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates errors in referencing promptbooks between each other
3
+ */
4
+ export declare class PromptbookReferenceError extends Error {
5
+ readonly name = "PromptbookReferenceError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
3
+ */
4
+ export declare class PromptbookSyntaxError extends Error {
5
+ readonly name = "PromptbookSyntaxError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This error occurs during the parameter replacement in the template
3
+ *
4
+ * Note: This is a kindof subtype of PromptbookExecutionError because it occurs during the execution of the pipeline
5
+ */
6
+ export declare class TemplateError extends Error {
7
+ readonly name = "TemplateError";
8
+ constructor(message: string);
9
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This error type indicates that the error should not happen and its last check before crashing with some other error
3
+ */
4
+ export declare class UnexpectedError extends Error {
5
+ readonly name = "UnexpectedError";
6
+ constructor(message: string);
7
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This error occurs when some expectation is not met in the execution of the pipeline
3
+ *
4
+ * @private Always catched and rethrown as `PromptbookExecutionError`
5
+ * Note: This is a kindof subtype of PromptbookExecutionError
6
+ */
7
+ export declare class ExpectError extends Error {
8
+ readonly name = "ExpectError";
9
+ constructor(message: string);
10
+ }
@@ -0,0 +1,9 @@
1
+ export type CommonExecutionToolsOptions = {
2
+ /**
3
+ * If true, the internal executions will be logged
4
+ */
5
+ readonly isVerbose?: boolean;
6
+ };
7
+ /**
8
+ * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
9
+ */
@@ -0,0 +1,30 @@
1
+ import type { LlmExecutionTools } from './LlmExecutionTools';
2
+ import type { ScriptExecutionTools } from './ScriptExecutionTools';
3
+ import type { UserInterfaceTools } from './UserInterfaceTools';
4
+ /**
5
+ * All the tools needed to execute prompts (template pipelines).
6
+ *
7
+ * @see https://github.com/webgptorg/promptbook#execution-tools
8
+ */
9
+ export type ExecutionTools = {
10
+ /**
11
+ * Tools for executing prompts to large language models like GPT-4
12
+ */
13
+ llm: LlmExecutionTools;
14
+ /**
15
+ * Tools for executing scripts
16
+ *
17
+ * Note: You can pass multiple ScriptExecutionTools, they will be tried one by one until one of them supports the script
18
+ * If none of them supports the script, an error is thrown
19
+ */
20
+ script: Array<ScriptExecutionTools>;
21
+ /**
22
+ * Tools for interacting with the user
23
+ *
24
+ * Note: When undefined, the user interface is disabled and promptbook which requires user interaction will fail
25
+ */
26
+ userInterface?: UserInterfaceTools;
27
+ };
28
+ /**
29
+ * TODO: [🍓] !!!! Allow to have more LlmExecutionTools
30
+ */