@promptbook/cli 0.41.109

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 (363) hide show
  1. package/README.md +5 -0
  2. package/bin/promptbook-cli.js +11 -0
  3. package/esm/index.es.js +1356 -0
  4. package/esm/index.es.js.map +1 -0
  5. package/esm/typings/_packages/cli.index.d.ts +8 -0
  6. package/esm/typings/_packages/core.index.d.ts +20 -0
  7. package/esm/typings/_packages/execute-javascript.index.d.ts +3 -0
  8. package/esm/typings/_packages/openai.index.d.ts +3 -0
  9. package/esm/typings/_packages/remote-client.index.d.ts +4 -0
  10. package/esm/typings/_packages/remote-server.index.d.ts +3 -0
  11. package/esm/typings/_packages/types.index.d.ts +27 -0
  12. package/esm/typings/_packages/utils.index.d.ts +31 -0
  13. package/esm/typings/_packages/wizzard.index.d.ts +5 -0
  14. package/esm/typings/config.d.ts +4 -0
  15. package/esm/typings/conversion/prettify/PrettifyOptions.d.ts +7 -0
  16. package/esm/typings/conversion/prettify/prettifyPromptbookString.d.ts +10 -0
  17. package/esm/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -0
  18. package/esm/typings/conversion/promptbookStringToJson.d.ts +13 -0
  19. package/esm/typings/conversion/utils/extractVariables.d.ts +10 -0
  20. package/esm/typings/conversion/utils/extractVariables.test.d.ts +1 -0
  21. package/esm/typings/conversion/utils/parseCommand.d.ts +8 -0
  22. package/esm/typings/conversion/utils/parseCommand.test.d.ts +4 -0
  23. package/esm/typings/conversion/utils/parseNumber.d.ts +12 -0
  24. package/esm/typings/conversion/utils/parseNumber.test.d.ts +1 -0
  25. package/esm/typings/conversion/validation/_importPromptbook.d.ts +12 -0
  26. package/esm/typings/conversion/validation/promptbookStringToJson-syntaxErrors.test.d.ts +1 -0
  27. package/esm/typings/conversion/validation/promptbookStringToJson.test.d.ts +1 -0
  28. package/esm/typings/conversion/validation/validatePromptbookJson-logicErrors.test.d.ts +1 -0
  29. package/esm/typings/conversion/validation/validatePromptbookJson.d.ts +26 -0
  30. package/esm/typings/conversion/validation/validatePromptbookJson.test.d.ts +1 -0
  31. package/esm/typings/errors/ExpectError.d.ts +9 -0
  32. package/esm/typings/errors/NotFoundError.d.ts +7 -0
  33. package/esm/typings/errors/PromptbookExecutionError.d.ts +7 -0
  34. package/esm/typings/errors/PromptbookLogicError.d.ts +7 -0
  35. package/esm/typings/errors/PromptbookReferenceError.d.ts +7 -0
  36. package/esm/typings/errors/PromptbookSyntaxError.d.ts +7 -0
  37. package/esm/typings/errors/UnexpectedError.d.ts +7 -0
  38. package/esm/typings/execution/CommonExecutionToolsOptions.d.ts +9 -0
  39. package/esm/typings/execution/ExecutionTools.d.ts +25 -0
  40. package/esm/typings/execution/NaturalExecutionTools.d.ts +23 -0
  41. package/esm/typings/execution/PromptResult.d.ts +74 -0
  42. package/esm/typings/execution/PromptbookExecutor.d.ts +39 -0
  43. package/esm/typings/execution/ScriptExecutionTools.d.ts +37 -0
  44. package/esm/typings/execution/UserInterfaceTools.d.ts +45 -0
  45. package/esm/typings/execution/assertsExecutionSuccessful.d.ts +11 -0
  46. package/esm/typings/execution/createPromptbookExecutor.d.ts +41 -0
  47. package/esm/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -0
  48. package/esm/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -0
  49. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
  50. package/esm/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
  51. package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +28 -0
  52. package/esm/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -0
  53. package/esm/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts +3 -0
  54. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -0
  55. package/esm/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +23 -0
  56. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
  57. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
  58. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
  59. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
  60. package/esm/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -0
  61. package/esm/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts +17 -0
  62. package/esm/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -0
  63. package/esm/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
  64. package/esm/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -0
  65. package/esm/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
  66. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
  67. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
  68. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -0
  69. package/esm/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -0
  70. package/esm/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
  71. package/esm/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -0
  72. package/esm/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -0
  73. package/esm/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
  74. package/esm/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
  75. package/esm/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -0
  76. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -0
  77. package/esm/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
  78. package/esm/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -0
  79. package/esm/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
  80. package/esm/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
  81. package/esm/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
  82. package/esm/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
  83. package/esm/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
  84. package/esm/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
  85. package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -0
  86. package/esm/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
  87. package/esm/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
  88. package/esm/typings/execution/utils/replaceParameters.d.ts +12 -0
  89. package/esm/typings/execution/utils/replaceParameters.test.d.ts +1 -0
  90. package/esm/typings/library/PromptbookLibrary.d.ts +25 -0
  91. package/esm/typings/library/SimplePromptbookLibrary.d.ts +35 -0
  92. package/esm/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +5 -0
  93. package/esm/typings/library/constructors/createPromptbookLibraryFromList.d.ts +5 -0
  94. package/esm/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +7 -0
  95. package/esm/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +16 -0
  96. package/esm/typings/library/constructors/createPromptbookSublibrary.d.ts +6 -0
  97. package/esm/typings/types/Command.d.ts +98 -0
  98. package/esm/typings/types/ExecutionTypes.d.ts +13 -0
  99. package/esm/typings/types/ModelRequirements.d.ts +41 -0
  100. package/esm/typings/types/Parameters.d.ts +14 -0
  101. package/esm/typings/types/Prompt.d.ts +41 -0
  102. package/esm/typings/types/PromptbookJson/PromptTemplateJson.d.ts +126 -0
  103. package/esm/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -0
  104. package/esm/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -0
  105. package/esm/typings/types/PromptbookString.d.ts +12 -0
  106. package/esm/typings/types/ScriptLanguage.d.ts +9 -0
  107. package/esm/typings/types/TaskProgress.d.ts +42 -0
  108. package/esm/typings/types/execution-report/ExecutionReportJson.d.ts +56 -0
  109. package/esm/typings/types/execution-report/ExecutionReportString.d.ts +16 -0
  110. package/esm/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
  111. package/esm/typings/types/execution-report/config.d.ts +8 -0
  112. package/esm/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
  113. package/esm/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
  114. package/esm/typings/types/execution-report/executionReportJsonToString.d.ts +11 -0
  115. package/esm/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -0
  116. package/esm/typings/types/typeAliasEmoji.d.ts +9 -0
  117. package/esm/typings/types/typeAliases.d.ts +432 -0
  118. package/esm/typings/utils/FromtoItems.d.ts +19 -0
  119. package/esm/typings/utils/emojis.d.ts +22 -0
  120. package/esm/typings/utils/expectation-counters/countCharacters.d.ts +5 -0
  121. package/esm/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -0
  122. package/esm/typings/utils/expectation-counters/countLines.d.ts +5 -0
  123. package/esm/typings/utils/expectation-counters/countLines.test.d.ts +1 -0
  124. package/esm/typings/utils/expectation-counters/countPages.d.ts +5 -0
  125. package/esm/typings/utils/expectation-counters/countPages.test.d.ts +1 -0
  126. package/esm/typings/utils/expectation-counters/countParagraphs.d.ts +5 -0
  127. package/esm/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
  128. package/esm/typings/utils/expectation-counters/countSentences.d.ts +5 -0
  129. package/esm/typings/utils/expectation-counters/countSentences.test.d.ts +1 -0
  130. package/esm/typings/utils/expectation-counters/countWords.d.ts +5 -0
  131. package/esm/typings/utils/expectation-counters/countWords.test.d.ts +1 -0
  132. package/esm/typings/utils/expectation-counters/index.d.ts +5 -0
  133. package/esm/typings/utils/extractParameters.d.ts +10 -0
  134. package/esm/typings/utils/extractParameters.test.d.ts +1 -0
  135. package/esm/typings/utils/formatNumber.d.ts +6 -0
  136. package/esm/typings/utils/formatNumber.test.d.ts +1 -0
  137. package/esm/typings/utils/getCurrentIsoDate.d.ts +7 -0
  138. package/esm/typings/utils/isRunningInWhatever.d.ts +12 -0
  139. package/esm/typings/utils/isValidJsonString.d.ts +4 -0
  140. package/esm/typings/utils/isValidJsonString.test.d.ts +1 -0
  141. package/esm/typings/utils/just.d.ts +10 -0
  142. package/esm/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -0
  143. package/esm/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
  144. package/esm/typings/utils/markdown/createMarkdownChart.d.ts +41 -0
  145. package/esm/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
  146. package/esm/typings/utils/markdown/createMarkdownTable.d.ts +7 -0
  147. package/esm/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
  148. package/esm/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
  149. package/esm/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
  150. package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
  151. package/esm/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
  152. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -0
  153. package/esm/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
  154. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
  155. package/esm/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
  156. package/esm/typings/utils/markdown/prettifyMarkdown.d.ts +8 -0
  157. package/esm/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
  158. package/esm/typings/utils/markdown/removeContentComments.d.ts +8 -0
  159. package/esm/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
  160. package/esm/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
  161. package/esm/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
  162. package/esm/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
  163. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
  164. package/esm/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
  165. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
  166. package/esm/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
  167. package/esm/typings/utils/postprocessing/extractBlock.d.ts +12 -0
  168. package/esm/typings/utils/removeEmojis.d.ts +7 -0
  169. package/esm/typings/utils/removeEmojis.test.d.ts +1 -0
  170. package/esm/typings/utils/removeQuotes.d.ts +13 -0
  171. package/esm/typings/utils/removeQuotes.test.d.ts +1 -0
  172. package/esm/typings/utils/trimCodeBlock.d.ts +8 -0
  173. package/esm/typings/utils/trimCodeBlock.test.d.ts +1 -0
  174. package/esm/typings/utils/trimEndOfCodeBlock.d.ts +7 -0
  175. package/esm/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -0
  176. package/esm/typings/utils/unwrapResult.d.ts +36 -0
  177. package/esm/typings/utils/unwrapResult.test.d.ts +1 -0
  178. package/esm/typings/utils/validators/url/isValidUrl.d.ts +7 -0
  179. package/esm/typings/utils/validators/url/isValidUrl.test.d.ts +1 -0
  180. package/esm/typings/version.d.ts +5 -0
  181. package/esm/typings/wizzard/Wizzard.d.ts +4 -0
  182. package/esm/typings/wizzard/sample.d.ts +6 -0
  183. package/package.json +54 -0
  184. package/umd/index.umd.js +1364 -0
  185. package/umd/index.umd.js.map +1 -0
  186. package/umd/typings/_packages/cli.index.d.ts +8 -0
  187. package/umd/typings/_packages/core.index.d.ts +20 -0
  188. package/umd/typings/_packages/execute-javascript.index.d.ts +3 -0
  189. package/umd/typings/_packages/openai.index.d.ts +3 -0
  190. package/umd/typings/_packages/remote-client.index.d.ts +4 -0
  191. package/umd/typings/_packages/remote-server.index.d.ts +3 -0
  192. package/umd/typings/_packages/types.index.d.ts +27 -0
  193. package/umd/typings/_packages/utils.index.d.ts +31 -0
  194. package/umd/typings/_packages/wizzard.index.d.ts +5 -0
  195. package/umd/typings/config.d.ts +4 -0
  196. package/umd/typings/conversion/prettify/PrettifyOptions.d.ts +7 -0
  197. package/umd/typings/conversion/prettify/prettifyPromptbookString.d.ts +10 -0
  198. package/umd/typings/conversion/prettify/prettifyPromptbookStringCli.d.ts +9 -0
  199. package/umd/typings/conversion/promptbookStringToJson.d.ts +13 -0
  200. package/umd/typings/conversion/utils/extractVariables.d.ts +10 -0
  201. package/umd/typings/conversion/utils/extractVariables.test.d.ts +1 -0
  202. package/umd/typings/conversion/utils/parseCommand.d.ts +8 -0
  203. package/umd/typings/conversion/utils/parseCommand.test.d.ts +4 -0
  204. package/umd/typings/conversion/utils/parseNumber.d.ts +12 -0
  205. package/umd/typings/conversion/utils/parseNumber.test.d.ts +1 -0
  206. package/umd/typings/conversion/validation/_importPromptbook.d.ts +12 -0
  207. package/umd/typings/conversion/validation/promptbookStringToJson-syntaxErrors.test.d.ts +1 -0
  208. package/umd/typings/conversion/validation/promptbookStringToJson.test.d.ts +1 -0
  209. package/umd/typings/conversion/validation/validatePromptbookJson-logicErrors.test.d.ts +1 -0
  210. package/umd/typings/conversion/validation/validatePromptbookJson.d.ts +26 -0
  211. package/umd/typings/conversion/validation/validatePromptbookJson.test.d.ts +1 -0
  212. package/umd/typings/errors/ExpectError.d.ts +9 -0
  213. package/umd/typings/errors/NotFoundError.d.ts +7 -0
  214. package/umd/typings/errors/PromptbookExecutionError.d.ts +7 -0
  215. package/umd/typings/errors/PromptbookLogicError.d.ts +7 -0
  216. package/umd/typings/errors/PromptbookReferenceError.d.ts +7 -0
  217. package/umd/typings/errors/PromptbookSyntaxError.d.ts +7 -0
  218. package/umd/typings/errors/UnexpectedError.d.ts +7 -0
  219. package/umd/typings/execution/CommonExecutionToolsOptions.d.ts +9 -0
  220. package/umd/typings/execution/ExecutionTools.d.ts +25 -0
  221. package/umd/typings/execution/NaturalExecutionTools.d.ts +23 -0
  222. package/umd/typings/execution/PromptResult.d.ts +74 -0
  223. package/umd/typings/execution/PromptbookExecutor.d.ts +39 -0
  224. package/umd/typings/execution/ScriptExecutionTools.d.ts +37 -0
  225. package/umd/typings/execution/UserInterfaceTools.d.ts +45 -0
  226. package/umd/typings/execution/assertsExecutionSuccessful.d.ts +11 -0
  227. package/umd/typings/execution/createPromptbookExecutor.d.ts +41 -0
  228. package/umd/typings/execution/plugins/natural-execution-tools/mocked/MockedEchoNaturalExecutionTools.d.ts +22 -0
  229. package/umd/typings/execution/plugins/natural-execution-tools/mocked/joker.test.d.ts +4 -0
  230. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-chat.test.d.ts +4 -0
  231. package/umd/typings/execution/plugins/natural-execution-tools/mocked/mocked-completion.test.d.ts +4 -0
  232. package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionTools.d.ts +28 -0
  233. package/umd/typings/execution/plugins/natural-execution-tools/openai/OpenAiExecutionToolsOptions.d.ts +16 -0
  234. package/umd/typings/execution/plugins/natural-execution-tools/openai/computeOpenaiUsage.d.ts +3 -0
  235. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionTools.d.ts +35 -0
  236. package/umd/typings/execution/plugins/natural-execution-tools/remote/RemoteNaturalExecutionToolsOptions.d.ts +23 -0
  237. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Error.d.ts +11 -0
  238. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Progress.d.ts +12 -0
  239. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Request.d.ts +17 -0
  240. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/Promptbook_Server_Response.d.ts +12 -0
  241. package/umd/typings/execution/plugins/natural-execution-tools/remote/interfaces/RemoteServerOptions.d.ts +27 -0
  242. package/umd/typings/execution/plugins/natural-execution-tools/remote/startRemoteServer.d.ts +17 -0
  243. package/umd/typings/execution/plugins/script-execution-tools/custom-function-async.test.ts.test.d.ts +1 -0
  244. package/umd/typings/execution/plugins/script-execution-tools/custom-function-missing.test.d.ts +1 -0
  245. package/umd/typings/execution/plugins/script-execution-tools/custom-function-with-dependencies.test.d.ts +1 -0
  246. package/umd/typings/execution/plugins/script-execution-tools/custom-function.test.d.ts +1 -0
  247. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.d.ts +20 -0
  248. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
  249. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionTools.d.ts +20 -0
  250. package/umd/typings/execution/plugins/script-execution-tools/javascript/JavascriptExecutionToolsOptions.d.ts +22 -0
  251. package/umd/typings/execution/plugins/script-execution-tools/javascript/utils/preserve.d.ts +11 -0
  252. package/umd/typings/execution/plugins/script-execution-tools/postprocessing.test.d.ts +1 -0
  253. package/umd/typings/execution/plugins/script-execution-tools/python/PythonExecutionTools.d.ts +15 -0
  254. package/umd/typings/execution/plugins/script-execution-tools/script-execution-errors.test.d.ts +1 -0
  255. package/umd/typings/execution/plugins/script-execution-tools/script-execution-tools.test.d.ts +1 -0
  256. package/umd/typings/execution/plugins/script-execution-tools/typescript/TypescriptExecutionTools.d.ts +15 -0
  257. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceTools.d.ts +14 -0
  258. package/umd/typings/execution/plugins/user-interface-execution-tools/callback/CallbackInterfaceToolsOptions.d.ts +12 -0
  259. package/umd/typings/execution/plugins/user-interface-execution-tools/simple-prompt/SimplePromptInterfaceTools.d.ts +16 -0
  260. package/umd/typings/execution/plugins/user-interface-execution-tools/user-interface-execution-tools.test.d.ts +1 -0
  261. package/umd/typings/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +4 -0
  262. package/umd/typings/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +9 -0
  263. package/umd/typings/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +5 -0
  264. package/umd/typings/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -0
  265. package/umd/typings/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +4 -0
  266. package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +1 -0
  267. package/umd/typings/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
  268. package/umd/typings/execution/translation/automatic-translate/translateMessages.d.ts +5 -0
  269. package/umd/typings/execution/utils/replaceParameters.d.ts +12 -0
  270. package/umd/typings/execution/utils/replaceParameters.test.d.ts +1 -0
  271. package/umd/typings/library/PromptbookLibrary.d.ts +25 -0
  272. package/umd/typings/library/SimplePromptbookLibrary.d.ts +35 -0
  273. package/umd/typings/library/constructors/createPromptbookLibraryFromDirectory.d.ts +5 -0
  274. package/umd/typings/library/constructors/createPromptbookLibraryFromList.d.ts +5 -0
  275. package/umd/typings/library/constructors/createPromptbookLibraryFromPromise.d.ts +7 -0
  276. package/umd/typings/library/constructors/createPromptbookLibraryFromSources.d.ts +16 -0
  277. package/umd/typings/library/constructors/createPromptbookSublibrary.d.ts +6 -0
  278. package/umd/typings/types/Command.d.ts +98 -0
  279. package/umd/typings/types/ExecutionTypes.d.ts +13 -0
  280. package/umd/typings/types/ModelRequirements.d.ts +41 -0
  281. package/umd/typings/types/Parameters.d.ts +14 -0
  282. package/umd/typings/types/Prompt.d.ts +41 -0
  283. package/umd/typings/types/PromptbookJson/PromptTemplateJson.d.ts +126 -0
  284. package/umd/typings/types/PromptbookJson/PromptTemplateParameterJson.d.ts +25 -0
  285. package/umd/typings/types/PromptbookJson/PromptbookJson.d.ts +51 -0
  286. package/umd/typings/types/PromptbookString.d.ts +12 -0
  287. package/umd/typings/types/ScriptLanguage.d.ts +9 -0
  288. package/umd/typings/types/TaskProgress.d.ts +42 -0
  289. package/umd/typings/types/execution-report/ExecutionReportJson.d.ts +56 -0
  290. package/umd/typings/types/execution-report/ExecutionReportString.d.ts +16 -0
  291. package/umd/typings/types/execution-report/ExecutionReportStringOptions.d.ts +21 -0
  292. package/umd/typings/types/execution-report/config.d.ts +8 -0
  293. package/umd/typings/types/execution-report/countWorkingDuration.d.ts +7 -0
  294. package/umd/typings/types/execution-report/countWorkingDuration.test.d.ts +1 -0
  295. package/umd/typings/types/execution-report/executionReportJsonToString.d.ts +11 -0
  296. package/umd/typings/types/execution-report/executionReportJsonToString.test.d.ts +1 -0
  297. package/umd/typings/types/typeAliasEmoji.d.ts +9 -0
  298. package/umd/typings/types/typeAliases.d.ts +432 -0
  299. package/umd/typings/utils/FromtoItems.d.ts +19 -0
  300. package/umd/typings/utils/emojis.d.ts +22 -0
  301. package/umd/typings/utils/expectation-counters/countCharacters.d.ts +5 -0
  302. package/umd/typings/utils/expectation-counters/countCharacters.test.d.ts +1 -0
  303. package/umd/typings/utils/expectation-counters/countLines.d.ts +5 -0
  304. package/umd/typings/utils/expectation-counters/countLines.test.d.ts +1 -0
  305. package/umd/typings/utils/expectation-counters/countPages.d.ts +5 -0
  306. package/umd/typings/utils/expectation-counters/countPages.test.d.ts +1 -0
  307. package/umd/typings/utils/expectation-counters/countParagraphs.d.ts +5 -0
  308. package/umd/typings/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
  309. package/umd/typings/utils/expectation-counters/countSentences.d.ts +5 -0
  310. package/umd/typings/utils/expectation-counters/countSentences.test.d.ts +1 -0
  311. package/umd/typings/utils/expectation-counters/countWords.d.ts +5 -0
  312. package/umd/typings/utils/expectation-counters/countWords.test.d.ts +1 -0
  313. package/umd/typings/utils/expectation-counters/index.d.ts +5 -0
  314. package/umd/typings/utils/extractParameters.d.ts +10 -0
  315. package/umd/typings/utils/extractParameters.test.d.ts +1 -0
  316. package/umd/typings/utils/formatNumber.d.ts +6 -0
  317. package/umd/typings/utils/formatNumber.test.d.ts +1 -0
  318. package/umd/typings/utils/getCurrentIsoDate.d.ts +7 -0
  319. package/umd/typings/utils/isRunningInWhatever.d.ts +12 -0
  320. package/umd/typings/utils/isValidJsonString.d.ts +4 -0
  321. package/umd/typings/utils/isValidJsonString.test.d.ts +1 -0
  322. package/umd/typings/utils/just.d.ts +10 -0
  323. package/umd/typings/utils/markdown/addAutoGeneratedSection.d.ts +10 -0
  324. package/umd/typings/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
  325. package/umd/typings/utils/markdown/createMarkdownChart.d.ts +41 -0
  326. package/umd/typings/utils/markdown/createMarkdownChart.test.d.ts +1 -0
  327. package/umd/typings/utils/markdown/createMarkdownTable.d.ts +7 -0
  328. package/umd/typings/utils/markdown/createMarkdownTable.test.d.ts +1 -0
  329. package/umd/typings/utils/markdown/escapeMarkdownBlock.d.ts +6 -0
  330. package/umd/typings/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
  331. package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.d.ts +27 -0
  332. package/umd/typings/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
  333. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.d.ts +13 -0
  334. package/umd/typings/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
  335. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.d.ts +19 -0
  336. package/umd/typings/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
  337. package/umd/typings/utils/markdown/prettifyMarkdown.d.ts +8 -0
  338. package/umd/typings/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
  339. package/umd/typings/utils/markdown/removeContentComments.d.ts +8 -0
  340. package/umd/typings/utils/markdown/removeContentComments.test.d.ts +1 -0
  341. package/umd/typings/utils/markdown/removeMarkdownFormatting.d.ts +8 -0
  342. package/umd/typings/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
  343. package/umd/typings/utils/markdown-json/MarkdownStructure.d.ts +25 -0
  344. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.d.ts +7 -0
  345. package/umd/typings/utils/markdown-json/countMarkdownStructureDeepness.test.d.ts +1 -0
  346. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.d.ts +13 -0
  347. package/umd/typings/utils/markdown-json/markdownToMarkdownStructure.test.d.ts +1 -0
  348. package/umd/typings/utils/postprocessing/extractBlock.d.ts +12 -0
  349. package/umd/typings/utils/removeEmojis.d.ts +7 -0
  350. package/umd/typings/utils/removeEmojis.test.d.ts +1 -0
  351. package/umd/typings/utils/removeQuotes.d.ts +13 -0
  352. package/umd/typings/utils/removeQuotes.test.d.ts +1 -0
  353. package/umd/typings/utils/trimCodeBlock.d.ts +8 -0
  354. package/umd/typings/utils/trimCodeBlock.test.d.ts +1 -0
  355. package/umd/typings/utils/trimEndOfCodeBlock.d.ts +7 -0
  356. package/umd/typings/utils/trimEndOfCodeBlock.test.d.ts +1 -0
  357. package/umd/typings/utils/unwrapResult.d.ts +36 -0
  358. package/umd/typings/utils/unwrapResult.test.d.ts +1 -0
  359. package/umd/typings/utils/validators/url/isValidUrl.d.ts +7 -0
  360. package/umd/typings/utils/validators/url/isValidUrl.test.d.ts +1 -0
  361. package/umd/typings/version.d.ts +5 -0
  362. package/umd/typings/wizzard/Wizzard.d.ts +4 -0
  363. package/umd/typings/wizzard/sample.d.ts +6 -0
@@ -0,0 +1,6 @@
1
+ import { string_markdown_text } from '../../types/typeAliases';
2
+ /**
3
+ * Function escapeMarkdownBlock will escape markdown block if needed
4
+ * It is useful when you want have block in block
5
+ */
6
+ export declare function escapeMarkdownBlock(value: string_markdown_text): string_markdown_text;
@@ -0,0 +1,27 @@
1
+ import { string_markdown } from '../../types/typeAliases';
2
+ /**
3
+ * Single code block inside markdown.
4
+ */
5
+ export type CodeBlock = {
6
+ /**
7
+ * Language of the code block OR null if the language is not specified in opening ```
8
+ */
9
+ language: string | null;
10
+ /**
11
+ * Content of the code block (unescaped)
12
+ */
13
+ content: string;
14
+ };
15
+ /**
16
+ * Extracts all code blocks from markdown.
17
+ *
18
+ * Note: There are 3 simmilar function:
19
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
20
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
21
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
22
+ *
23
+ * @param markdown any valid markdown
24
+ * @returns code blocks with language and content
25
+ *
26
+ */
27
+ export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
@@ -0,0 +1,13 @@
1
+ import { string_markdown, string_markdown_text } from '../.././types/typeAliases';
2
+ /**
3
+ * Utility function to extract all list items from markdown
4
+ *
5
+ * Note: It works with both ul and ol
6
+ * Note: It omits list items in code blocks
7
+ * Note: It flattens nested lists
8
+ * Note: It can not work with html syntax and comments
9
+ *
10
+ * @param markdown any valid markdown
11
+ * @returns
12
+ */
13
+ export declare function extractAllListItemsFromMarkdown(markdown: string_markdown): string_markdown_text[];
@@ -0,0 +1,19 @@
1
+ import { string_markdown } from '../.././types/typeAliases';
2
+ import { CodeBlock } from './extractAllBlocksFromMarkdown';
3
+ /**
4
+ * Extracts exactly ONE code block from markdown.
5
+ *
6
+ * Note: If there are multiple or no code blocks the function throws an error
7
+ *
8
+ * Note: There are 3 simmilar function:
9
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
10
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
11
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
12
+ *
13
+ * @param markdown any valid markdown
14
+ * @returns code block with language and content
15
+ */
16
+ export declare function extractOneBlockFromMarkdown(markdown: string_markdown): CodeBlock;
17
+ /***
18
+ * TODO: [🌻] !!! Decide of this is internal util, external util OR validator/postprocessor
19
+ */
@@ -0,0 +1,8 @@
1
+ import type { string_html } from '../../types/typeAliases';
2
+ /**
3
+ * Prettify the html code
4
+ *
5
+ * @param html raw html code
6
+ * @returns formatted html code
7
+ */
8
+ export declare function prettifyMarkdown(html: string_html): string_html;
@@ -0,0 +1,8 @@
1
+ import { string_html, string_markdown } from '../../types/typeAliases';
2
+ /**
3
+ * Removes HTML or Markdown comments from a string.
4
+ *
5
+ * @param {string} content - The string to remove comments from.
6
+ * @returns {string} The input string with all comments removed.
7
+ */
8
+ export declare function removeContentComments<TContent extends string_html | string_markdown>(content: TContent): TContent;
@@ -0,0 +1,8 @@
1
+ import { string_markdown_text } from '../../types/typeAliases';
2
+ /**
3
+ * Removes Markdown formatting tags from a string.
4
+ *
5
+ * @param {string} str - The string to remove Markdown tags from.
6
+ * @returns {string} The input string with all Markdown tags removed.
7
+ */
8
+ export declare function removeMarkdownFormatting(str: string_markdown_text): string;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Represents the structure of a markdown file.
3
+ *
4
+ * @private within the library
5
+ */
6
+ export type MarkdownStructure = {
7
+ /**
8
+ * The section level of the markdown file.
9
+ * h1 is level 1, h2 is level 2, etc.
10
+ */
11
+ level: number;
12
+ /**
13
+ * The title of the markdown file.
14
+ */
15
+ title: string;
16
+ /**
17
+ * Content of the section.
18
+ * It contains text, images, formatting, ul, ol, hr, blockquotes, etc. BUT not headings and sub-sections
19
+ */
20
+ content: string;
21
+ /**
22
+ * The sub-sections of current section which are recursively structured.
23
+ */
24
+ sections: MarkdownStructure[];
25
+ };
@@ -0,0 +1,7 @@
1
+ import { MarkdownStructure } from './MarkdownStructure';
2
+ /**
3
+ * Computes the deepness of the markdown structure.
4
+ *
5
+ * @private within the library
6
+ */
7
+ export declare function countMarkdownStructureDeepness(markdownStructure: MarkdownStructure): number;
@@ -0,0 +1,13 @@
1
+ import { MarkdownStructure } from './MarkdownStructure';
2
+ /**
3
+ * Parse a markdown string into a MarkdownStructure object.
4
+ *
5
+ * Note: This function does work with code blocks
6
+ * Note: This function does not work with markdown comments
7
+ *
8
+ * @param markdown The markdown string to parse.
9
+ * @returns The MarkdownStructure object.
10
+ *
11
+ * @private within the library
12
+ */
13
+ export declare function markdownToMarkdownStructure(markdown: string): MarkdownStructure;
@@ -0,0 +1,12 @@
1
+ import { string_markdown } from '../../types/typeAliases';
2
+ /**
3
+ * Extracts code block from markdown.
4
+ *
5
+ * Note: If there are multiple or no code blocks the function throws an error
6
+ *
7
+ * Note: There are 3 simmilar function:
8
+ * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
9
+ * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
10
+ * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
11
+ */
12
+ export declare function extractBlock(markdown: string_markdown): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Removes emojis from a string and fix whitespaces
3
+ *
4
+ * @param text with emojis
5
+ * @returns text without emojis
6
+ */
7
+ export declare function removeEmojis(text: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Removes quotes from a string
3
+ *
4
+ * Tip: This is very usefull for post-processing of the result of the LLM model
5
+ * Note: This function removes only the same quotes from the beginning and the end of the string
6
+ * Note: There are two simmilar functions:
7
+ * - `removeQuotes` which removes only bounding quotes
8
+ * - `unwrapResult` which removes whole introduce sentence
9
+ *
10
+ * @param text optionally quoted text
11
+ * @returns text without quotes
12
+ */
13
+ export declare function removeQuotes(text: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Function trimCodeBlock will trim starting and ending code block from the string if it is present.
3
+ *
4
+ * Note: This is usefull for post-processing of the result of the chat LLM model
5
+ * when the model wraps the result in the (markdown) code block.
6
+ *
7
+ */
8
+ export declare function trimCodeBlock(value: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
3
+ *
4
+ * Note: This is usefull for post-processing of the result of the completion LLM model
5
+ * if you want to start code block in the prompt but you don't want to end it in the result.
6
+ */
7
+ export declare function trimEndOfCodeBlock(value: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Additional options for `unwrapResult`
3
+ */
4
+ interface UnwrapResultOptions {
5
+ /**
6
+ * If true, the text is trimmed before processing
7
+ */
8
+ isTrimmed?: boolean;
9
+ /**
10
+ * If true, the introduce sentence is removed
11
+ *
12
+ * For example:
13
+ * - If `true`> 'Hello, "world"' -> 'world'
14
+ * - If `false`> 'Hello, "world"' -> 'Hello, "world"'
15
+ *
16
+ * @default true
17
+ */
18
+ isIntroduceSentenceRemoved?: boolean;
19
+ }
20
+ /**
21
+ * Removes quotes and optional introduce text from a string
22
+ *
23
+ * Tip: This is very usefull for post-processing of the result of the LLM model
24
+ * Note: This function trims the text and removes whole introduce sentence if it is present
25
+ * Note: There are two simmilar functions:
26
+ * - `removeQuotes` which removes only bounding quotes
27
+ * - `unwrapResult` which removes whole introduce sentence
28
+ *
29
+ * @param text optionally quoted text
30
+ * @returns text without quotes
31
+ */
32
+ export declare function unwrapResult(text: string, options?: UnwrapResultOptions): string;
33
+ export {};
34
+ /**
35
+ * TODO: [🧠] Should this also unwrap the (parenthesis)
36
+ */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { string_url } from '../../../types/typeAliases';
2
+ /**
3
+ * Tests if given string is valid URL.
4
+ *
5
+ * Note: Dataurl are considered perfectly valid.
6
+ */
7
+ export declare function isValidUrl(url: unknown): url is string_url;
@@ -0,0 +1,5 @@
1
+ import type { string_version } from './types/typeAliases';
2
+ /**
3
+ * The version of the Promptbook library
4
+ */
5
+ export declare const PROMPTBOOK_VERSION: string_version;
@@ -0,0 +1,4 @@
1
+ export declare const Wizzard: any;
2
+ /**
3
+ * TODO: [🧙‍♂️]
4
+ */
@@ -0,0 +1,6 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🧙‍♂️]
4
+ url, sources nebo folder
5
+ * TODO: [🧠] OpenAi apiKey vs token
6
+ */
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@promptbook/cli",
3
+ "version": "0.41.109",
4
+ "description": "Library to supercharge your use of large language models",
5
+ "private": false,
6
+ "sideEffects": false,
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/webgptorg/promptbook"
10
+ },
11
+ "contributors": [
12
+ "Pavol Hejný <me@pavolhejny.com> (https://www.pavolhejny.com/)"
13
+ ],
14
+ "keywords": [
15
+ "autogpt",
16
+ "openai",
17
+ "gpt-3",
18
+ "gpt-4",
19
+ "chatgpt",
20
+ "ai",
21
+ "machine-learning",
22
+ "natural-language-processing",
23
+ "nlp",
24
+ "prompt",
25
+ "template",
26
+ "pipeline",
27
+ "automation",
28
+ "text-generation",
29
+ "language-model"
30
+ ],
31
+ "license": "SEE LICENSE IN LICENSE",
32
+ "bugs": {
33
+ "url": "https://github.com/webgptorg/promptbook/issues"
34
+ },
35
+ "homepage": "https://www.npmjs.com/package/@promptbook/core",
36
+ "dependencies": {
37
+ "glob-promise": "6.0.5",
38
+ "colors": "1.4.0",
39
+ "commander": "12.0.0",
40
+ "n12": "1.8.18",
41
+ "prettier": "2.8.1",
42
+ "spacetrim": "0.11.2",
43
+ "waitasecond": "1.11.33"
44
+ },
45
+ "peerDependencies": {
46
+ "@promptbook/core": "0.41.109"
47
+ },
48
+ "main": "./umd/index.umd.js",
49
+ "module": "./esm/index.es.js",
50
+ "typings": "./esm/typings/_packages/cli.index.d.ts",
51
+ "bin": {
52
+ "promptbook": "bin/promptbook-cli.js"
53
+ }
54
+ }