@promptbook/remote-server 0.70.0-1 → 0.71.0-12

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 (237) hide show
  1. package/README.md +33 -59
  2. package/esm/index.es.js +134 -25
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/promptbook-collection/index.d.ts +0 -3
  5. package/esm/typings/src/_packages/browser.index.d.ts +3 -1
  6. package/esm/typings/src/_packages/cli.index.d.ts +20 -0
  7. package/esm/typings/src/_packages/core.index.d.ts +45 -15
  8. package/esm/typings/src/_packages/documents.index.d.ts +8 -0
  9. package/esm/typings/src/_packages/legacy-documents.index.d.ts +8 -0
  10. package/esm/typings/src/_packages/markdown-utils.index.d.ts +6 -0
  11. package/esm/typings/src/_packages/node.index.d.ts +14 -6
  12. package/esm/typings/src/_packages/pdf.index.d.ts +8 -0
  13. package/esm/typings/src/_packages/types.index.d.ts +53 -25
  14. package/esm/typings/src/_packages/utils.index.d.ts +4 -4
  15. package/esm/typings/src/_packages/website-crawler.index.d.ts +8 -0
  16. package/esm/typings/src/cli/cli-commands/about.d.ts +1 -1
  17. package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
  18. package/esm/typings/src/cli/cli-commands/make.d.ts +2 -2
  19. package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
  20. package/esm/typings/src/cli/cli-commands/test-command.d.ts +13 -0
  21. package/esm/typings/src/cli/main.d.ts +1 -1
  22. package/esm/typings/src/cli/promptbookCli.d.ts +1 -1
  23. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +11 -6
  24. package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
  25. package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +1 -1
  26. package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +3 -7
  27. package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +27 -0
  28. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -3
  29. package/esm/typings/src/commands/FORMAT/formatCommandParser.d.ts +1 -1
  30. package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +1 -1
  31. package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -1
  32. package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.d.ts +11 -0
  33. package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.test.d.ts +4 -0
  34. package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +1 -1
  35. package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -1
  36. package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +1 -1
  37. package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -1
  38. package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +1 -1
  39. package/esm/typings/src/commands/TEMPLATE/templateCommandParser.d.ts +1 -1
  40. package/esm/typings/src/commands/URL/urlCommandParser.d.ts +1 -1
  41. package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +1 -1
  42. package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -1
  43. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  44. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -4
  45. package/esm/typings/src/config.d.ts +32 -3
  46. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +4 -15
  47. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
  48. package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -0
  49. package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +2 -1
  50. package/esm/typings/src/conversion/validation/_importPipeline.d.ts +1 -1
  51. package/esm/typings/src/conversion/validation/validatePipeline.d.ts +10 -5
  52. package/esm/typings/src/{knowledge/dialogs → dialogs}/callback/CallbackInterfaceTools.d.ts +2 -2
  53. package/esm/typings/src/{knowledge/dialogs → dialogs}/callback/CallbackInterfaceToolsOptions.d.ts +3 -3
  54. package/esm/typings/src/{knowledge/dialogs → dialogs}/simple-prompt/SimplePromptInterfaceTools.d.ts +5 -5
  55. package/esm/typings/src/errors/AbstractFormatError.d.ts +11 -0
  56. package/esm/typings/src/errors/KnowledgeScrapeError.d.ts +9 -0
  57. package/esm/typings/src/errors/MissingToolsError.d.ts +9 -0
  58. package/esm/typings/src/execution/{CommonExecutionToolsOptions.d.ts → CommonToolsOptions.d.ts} +1 -1
  59. package/esm/typings/src/execution/ExecutionTools.d.ts +20 -8
  60. package/esm/typings/src/execution/PipelineExecutor.d.ts +1 -0
  61. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +9 -8
  62. package/esm/typings/src/execution/createPipelineExecutor/$OngoingTemplateResult.d.ts +45 -0
  63. package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +23 -0
  64. package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +29 -0
  65. package/esm/typings/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +13 -0
  66. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +58 -0
  67. package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +60 -0
  68. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -0
  69. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +69 -0
  70. package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +34 -0
  71. package/esm/typings/src/execution/createPipelineExecutor/getContextForTemplate.d.ts +10 -0
  72. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTemplate.d.ts +27 -0
  73. package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTemplate.d.ts +30 -0
  74. package/esm/typings/src/execution/createPipelineExecutor/getSamplesForTemplate.d.ts +10 -0
  75. package/esm/typings/src/execution/embeddingVectorToString.d.ts +1 -1
  76. package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -0
  77. package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +13 -0
  78. package/esm/typings/src/execution/utils/checkExpectations.d.ts +2 -0
  79. package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -0
  80. package/esm/typings/src/execution/utils/usageToHuman.d.ts +3 -4
  81. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +14 -15
  82. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +31 -0
  83. package/esm/typings/src/formats/csv/{ListFormatDefinition.d.ts → CsvFormatDefinition.d.ts} +6 -3
  84. package/esm/typings/src/formats/csv/CsvFormatError.d.ts +10 -0
  85. package/esm/typings/src/formats/csv/CsvSettings.d.ts +13 -0
  86. package/esm/typings/src/formats/index.d.ts +1 -1
  87. package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +4 -3
  88. package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +19 -0
  89. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +4 -3
  90. package/esm/typings/src/llm-providers/_common/{$llmToolsMetadataRegister.d.ts → register/$llmToolsMetadataRegister.d.ts} +4 -1
  91. package/esm/typings/src/llm-providers/_common/{$llmToolsRegister.d.ts → register/$llmToolsRegister.d.ts} +5 -2
  92. package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfigurationFromEnv.d.ts → register/$provideLlmToolsConfigurationFromEnv.d.ts} +3 -3
  93. package/esm/typings/src/llm-providers/_common/{getLlmToolsForCli.d.ts → register/$provideLlmToolsForCli.d.ts} +4 -3
  94. package/esm/typings/src/llm-providers/_common/{getLlmToolsForTestingAndScriptsAndPlayground.d.ts → register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts} +4 -3
  95. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +27 -0
  96. package/esm/typings/src/llm-providers/_common/{$registeredLlmToolsMessage.d.ts → register/$registeredLlmToolsMessage.d.ts} +5 -2
  97. package/esm/typings/src/llm-providers/_common/{LlmToolsConfiguration.d.ts → register/LlmToolsConfiguration.d.ts} +5 -4
  98. package/esm/typings/src/llm-providers/_common/{LlmToolsMetadata.d.ts → register/LlmToolsMetadata.d.ts} +5 -4
  99. package/esm/typings/src/llm-providers/_common/{LlmToolsOptions.d.ts → register/LlmToolsOptions.d.ts} +4 -1
  100. package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfiguration.d.ts → register/createLlmToolsFromConfiguration.d.ts} +5 -4
  101. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +1 -1
  102. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -1
  103. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
  104. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  105. package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +2 -2
  106. package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +3 -2
  107. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +4 -3
  108. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +4 -3
  109. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +8 -1
  110. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +2 -2
  111. package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +1 -0
  112. package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +4 -3
  113. package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +4 -3
  114. package/esm/typings/src/llm-providers/langtail/playground/playground.d.ts +3 -0
  115. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -2
  116. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -2
  117. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -0
  118. package/esm/typings/src/llm-providers/multiple/playground/playground.d.ts +3 -0
  119. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -1
  120. package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -2
  121. package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +2 -1
  122. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +4 -3
  123. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +4 -3
  124. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +1 -1
  125. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +1 -1
  126. package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +3 -3
  127. package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +2 -2
  128. package/esm/typings/src/llm-providers/remote/playground/playground.d.ts +3 -0
  129. package/esm/typings/src/personas/preparePersona.d.ts +4 -3
  130. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +68 -0
  131. package/esm/typings/src/prepare/isPipelinePrepared.d.ts +1 -1
  132. package/esm/typings/src/prepare/preparePipeline.d.ts +3 -2
  133. package/esm/typings/src/prepare/prepareTemplates.d.ts +4 -3
  134. package/esm/typings/src/scrapers/_common/Converter.d.ts +22 -0
  135. package/esm/typings/src/scrapers/_common/Scraper.d.ts +66 -0
  136. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +11 -0
  137. package/esm/typings/src/{knowledge/prepare-knowledge → scrapers}/_common/prepareKnowledgePieces.d.ts +5 -4
  138. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +12 -0
  139. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +15 -0
  140. package/esm/typings/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +12 -0
  141. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +13 -0
  142. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +13 -0
  143. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +41 -0
  144. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +12 -0
  145. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +33 -0
  146. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +4 -0
  147. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +13 -0
  148. package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +43 -0
  149. package/esm/typings/src/scrapers/document/DocumentScraper.test.d.ts +4 -0
  150. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +20 -0
  151. package/esm/typings/src/scrapers/document/playground/document-scraper-playground.d.ts +5 -0
  152. package/esm/typings/src/scrapers/document/register-constructor.d.ts +13 -0
  153. package/esm/typings/src/scrapers/document/register-metadata.d.ts +24 -0
  154. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +43 -0
  155. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +4 -0
  156. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +20 -0
  157. package/esm/typings/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +5 -0
  158. package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +13 -0
  159. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +24 -0
  160. package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +29 -0
  161. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +20 -0
  162. package/esm/typings/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +5 -0
  163. package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +13 -0
  164. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +24 -0
  165. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +40 -0
  166. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +20 -0
  167. package/esm/typings/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +5 -0
  168. package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +13 -0
  169. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +24 -0
  170. package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +47 -0
  171. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +20 -0
  172. package/esm/typings/src/scrapers/website/playground/website-scraper-playground.d.ts +5 -0
  173. package/esm/typings/src/scrapers/website/register-constructor.d.ts +13 -0
  174. package/esm/typings/src/scrapers/website/register-metadata.d.ts +24 -0
  175. package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +12 -0
  176. package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +2 -2
  177. package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +2 -2
  178. package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +2 -2
  179. package/esm/typings/src/storage/{files-storage/FilesStorage.d.ts → file-cache-storage/FileCacheStorage.d.ts} +4 -4
  180. package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +10 -0
  181. package/esm/typings/src/storage/{files-storage → file-cache-storage}/utils/nameToSubfolderPath.d.ts +1 -1
  182. package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +1 -1
  183. package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +1 -1
  184. package/esm/typings/src/storage/{utils → memory/utils}/PrefixStorage.d.ts +1 -1
  185. package/esm/typings/src/storage/{utils → memory/utils}/makePromptbookStorageFromWebStorage.d.ts +1 -1
  186. package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +9 -2
  187. package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +1 -0
  188. package/esm/typings/src/types/PipelineJson/PipelineJson.d.ts +3 -3
  189. package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +5 -0
  190. package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -1
  191. package/esm/typings/src/types/typeAliases.d.ts +16 -12
  192. package/esm/typings/src/utils/$Register.d.ts +19 -6
  193. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +14 -0
  194. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +17 -0
  195. package/esm/typings/src/utils/execCommand/IExecCommandOptions.d.ts +23 -0
  196. package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +10 -0
  197. package/esm/typings/src/utils/expectation-counters/index.d.ts +3 -0
  198. package/esm/typings/src/utils/files/$isDirectoryExisting.d.ts +3 -3
  199. package/esm/typings/src/utils/files/$isFileExisting.d.ts +3 -3
  200. package/esm/typings/src/utils/files/$listAllFiles.d.ts +5 -4
  201. package/esm/typings/src/utils/files/extensionToMimeType.d.ts +8 -0
  202. package/esm/typings/src/utils/files/getFileExtension.d.ts +8 -0
  203. package/esm/typings/src/utils/files/getFileExtension.test.d.ts +1 -0
  204. package/esm/typings/src/utils/organization/{f.d.ts → empty_object.d.ts} +5 -1
  205. package/esm/typings/src/utils/organization/just_empty_object.d.ts +12 -0
  206. package/esm/typings/src/utils/{extractParameterNames.d.ts → parameters/extractParameterNames.d.ts} +2 -2
  207. package/esm/typings/src/utils/parameters/extractParameterNames.test.d.ts +1 -0
  208. package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +27 -0
  209. package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.test.d.ts +1 -0
  210. package/esm/typings/src/utils/{replaceParameters.d.ts → parameters/replaceParameters.d.ts} +2 -2
  211. package/esm/typings/src/utils/parameters/replaceParameters.test.d.ts +1 -0
  212. package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  213. package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +1 -1
  214. package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +2 -2
  215. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +10 -0
  216. package/esm/typings/src/utils/validators/parameterName/validateParameterName.test.d.ts +1 -0
  217. package/package.json +17 -13
  218. package/umd/index.umd.js +134 -25
  219. package/umd/index.umd.js.map +1 -1
  220. package/esm/typings/src/execution/createPipelineExecutor.d.ts +0 -72
  221. package/esm/typings/src/formats/list/ListFormatDefinition.d.ts +0 -16
  222. package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +0 -37
  223. package/esm/typings/src/knowledge/prepare-knowledge/markdown/playground/markdown-knowledge-playground.d.ts +0 -2
  224. package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +0 -14
  225. package/esm/typings/src/knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.d.ts +0 -15
  226. package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +0 -25
  227. package/esm/typings/src/prepare/PrepareOptions.d.ts +0 -22
  228. package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -10
  229. /package/esm/typings/src/{knowledge/dialogs → dialogs}/user-interface-execution-tools.test.d.ts +0 -0
  230. /package/esm/typings/src/{knowledge/prepare-knowledge → scrapers}/_common/prepareKnowledgePieces.test.d.ts +0 -0
  231. /package/esm/typings/src/{knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.test.d.ts → scrapers/markdown/MarkdownScraper.test.d.ts} +0 -0
  232. /package/esm/typings/src/{execution/utils/usageToHuman.test.d.ts → scrapers/website/WebsiteScraper.test.d.ts} +0 -0
  233. /package/esm/typings/src/{knowledge/prepare-knowledge/pdf/prepareKnowledgeFromPdf.test.d.ts → scrapers/website/utils/markdownConverter.test.d.ts} +0 -0
  234. /package/esm/typings/src/storage/{files-storage → file-cache-storage}/utils/nameToSubfolderPath.test.d.ts +0 -0
  235. /package/esm/typings/src/{personas/preparePersona.test.d.ts → utils/execCommand/execCommand.test.d.ts} +0 -0
  236. /package/esm/typings/src/utils/{extractParameterNames.test.d.ts → execCommand/execCommandNormalizeOptions.test.d.ts} +0 -0
  237. /package/esm/typings/src/utils/{replaceParameters.test.d.ts → files/extensionToMimeType.test.d.ts} +0 -0
@@ -0,0 +1,40 @@
1
+ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
2
+ import type { Scraper } from '../_common/Scraper';
3
+ import type { ScraperSourceHandler } from '../_common/Scraper';
4
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
5
+ import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
6
+ import type { Converter } from '../_common/Converter';
7
+ import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
8
+ import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
9
+ /**
10
+ * Scraper for .docx files
11
+ *
12
+ * @see `documentationUrl` for more details
13
+ * @public exported from `@promptbook/pdf`
14
+ */
15
+ export declare class PdfScraper implements Converter, Scraper {
16
+ private readonly tools;
17
+ private readonly options;
18
+ /**
19
+ * Metadata of the scraper which includes title, mime types, etc.
20
+ */
21
+ get metadata(): ScraperAndConverterMetadata;
22
+ /**
23
+ * Markdown scraper is used internally
24
+ */
25
+ private readonly markdownScraper;
26
+ constructor(tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions);
27
+ /**
28
+ * Converts the `.pdf` file to `.md` file and returns intermediate source
29
+ */
30
+ $convert(source: ScraperSourceHandler): Promise<ScraperIntermediateSource>;
31
+ /**
32
+ * Scrapes the `.pdf` file and returns the knowledge pieces or `null` if it can't scrape it
33
+ */
34
+ scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
35
+ }
36
+ /**
37
+ * TODO: [👣] Converted pdf documents can act as cached items - there is no need to run conversion each time
38
+ * TODO: [🪂] Do it in parallel 11:11
39
+ * Note: No need to aggregate usage here, it is done by intercepting the llmTools
40
+ */
@@ -0,0 +1,20 @@
1
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
2
+ import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
3
+ import { PdfScraper } from './PdfScraper';
4
+ /**
5
+ * @@@
6
+ *
7
+ * @public exported from `@promptbook/pdf`
8
+ */
9
+ export declare const createPdfScraper: ((tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions) => PdfScraper) & import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
10
+ title: string;
11
+ packageName: string;
12
+ className: string;
13
+ mimeTypes: string[];
14
+ documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
15
+ isAvilableInBrowser: true;
16
+ requiredExecutables: string[];
17
+ }>;
18
+ /**
19
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
20
+ */
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ts-node
2
+ export {};
3
+ /**
4
+ * Note: [⚫] Code in this file should never be published in any package
5
+ */
@@ -0,0 +1,13 @@
1
+ import type { Registration } from '../../utils/$Register';
2
+ /**
3
+ * Registration of known scraper
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
+ *
7
+ * @public exported from `@promptbook/pdf`
8
+ * @public exported from `@promptbook/cli`
9
+ */
10
+ export declare const _PdfScraperRegistration: Registration;
11
+ /**
12
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
13
+ */
@@ -0,0 +1,24 @@
1
+ import type { Registration } from '../../utils/$Register';
2
+ /**
3
+ * Metadata of the scraper
4
+ *
5
+ * @private within the scraper directory
6
+ */
7
+ export declare const pdfScraperMetadata: import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
8
+ title: string;
9
+ packageName: string;
10
+ className: string;
11
+ mimeTypes: string[];
12
+ documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
13
+ isAvilableInBrowser: true;
14
+ requiredExecutables: string[];
15
+ }>;
16
+ /**
17
+ * Registration of known scraper metadata
18
+ *
19
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
+ *
21
+ * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/cli`
23
+ */
24
+ export declare const _PdfScraperMetadataRegistration: Registration;
@@ -0,0 +1,47 @@
1
+ import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
2
+ import type { string_markdown } from '../../types/typeAliases';
3
+ import type { Converter } from '../_common/Converter';
4
+ import type { Scraper } from '../_common/Scraper';
5
+ import type { ScraperSourceHandler } from '../_common/Scraper';
6
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
7
+ import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
8
+ import type { ScraperAndConverterMetadata } from '../_common/register/ScraperAndConverterMetadata';
9
+ import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
10
+ /**
11
+ * Scraper for .docx files
12
+ *
13
+ * @see `documentationUrl` for more details
14
+ * @public exported from `@promptbook/website-crawler`
15
+ */
16
+ export declare class WebsiteScraper implements Converter, Scraper {
17
+ private readonly tools;
18
+ private readonly options;
19
+ /**
20
+ * Metadata of the scraper which includes title, mime types, etc.
21
+ */
22
+ get metadata(): ScraperAndConverterMetadata;
23
+ /**
24
+ * Markdown scraper is used internally
25
+ */
26
+ private readonly markdownScraper;
27
+ constructor(tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions);
28
+ /**
29
+ * Convert the website to `.md` file and returns intermediate source
30
+ *
31
+ * Note: `$` is used to indicate that this function is not a pure function - it leaves files on the disk and you are responsible for cleaning them by calling `destroy` method of returned object
32
+ */
33
+ $convert(source: ScraperSourceHandler): Promise<ScraperIntermediateSource & {
34
+ markdown: string_markdown;
35
+ }>;
36
+ /**
37
+ * Scrapes the website and returns the knowledge pieces or `null` if it can't scrape it
38
+ */
39
+ scrape(source: ScraperSourceHandler): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
40
+ }
41
+ /**
42
+ * TODO: !!!!!! Put into separate package
43
+ * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
44
+ * TODO: [🪂] Do it in parallel 11:11
45
+ * Note: No need to aggregate usage here, it is done by intercepting the llmTools
46
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
47
+ */
@@ -0,0 +1,20 @@
1
+ import type { ExecutionTools } from '../../execution/ExecutionTools';
2
+ import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
3
+ import { WebsiteScraper } from './WebsiteScraper';
4
+ /**
5
+ * @@@
6
+ *
7
+ * @public exported from `@promptbook/website-crawler`
8
+ */
9
+ export declare const createWebsiteScraper: ((tools: Pick<ExecutionTools, 'llm'>, options: PrepareAndScrapeOptions) => WebsiteScraper) & import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
10
+ title: string;
11
+ packageName: string;
12
+ className: string;
13
+ mimeTypes: string[];
14
+ documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
15
+ isAvilableInBrowser: false;
16
+ requiredExecutables: string[];
17
+ }>;
18
+ /**
19
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
20
+ */
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ts-node
2
+ export {};
3
+ /**
4
+ * Note: [⚫] Code in this file should never be published in any package
5
+ */
@@ -0,0 +1,13 @@
1
+ import type { Registration } from '../../utils/$Register';
2
+ /**
3
+ * Registration of known scraper
4
+ *
5
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
6
+ *
7
+ * @public exported from `@promptbook/website-crawler`
8
+ * @public exported from `@promptbook/cli`
9
+ */
10
+ export declare const _WebsiteScraperRegistration: Registration;
11
+ /**
12
+ * TODO: [🎶] Naming "constructor" vs "creator" vs "factory"
13
+ */
@@ -0,0 +1,24 @@
1
+ import type { Registration } from '../../utils/$Register';
2
+ /**
3
+ * Metadata of the scraper
4
+ *
5
+ * @private within the scraper directory
6
+ */
7
+ export declare const websiteScraperMetadata: import("type-fest/source/readonly-deep").ReadonlyObjectDeep<{
8
+ title: string;
9
+ packageName: string;
10
+ className: string;
11
+ mimeTypes: string[];
12
+ documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
13
+ isAvilableInBrowser: false;
14
+ requiredExecutables: string[];
15
+ }>;
16
+ /**
17
+ * Registration of known scraper metadata
18
+ *
19
+ * Warning: This is not useful for the end user, it is just a side effect of the mechanism that handles all available known scrapers
20
+ *
21
+ * @public exported from `@promptbook/core`
22
+ * @public exported from `@promptbook/cli`
23
+ */
24
+ export declare const _WebsiteScraperMetadataRegistration: Registration;
@@ -0,0 +1,12 @@
1
+ import { Converter } from 'showdown';
2
+ /**
3
+ * A converter instance that uses showdown and highlight extensions
4
+ *
5
+ * @type {Converter}
6
+ * @private for markdown and html knowledge scrapers
7
+ */
8
+ export declare const markdownConverter: Converter;
9
+ /**
10
+ * TODO: !!!!!! Figure out better name not to confuse with `Converter`
11
+ * TODO: !!!!!! Lazy-make converter
12
+ */
@@ -1,10 +1,10 @@
1
1
  import type { Promisable } from 'type-fest';
2
- import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
2
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
3
3
  import type { string_postprocessing_function_name } from '../../types/typeAliases';
4
4
  /**
5
5
  * Options for `JavascriptExecutionTools`
6
6
  */
7
- export type JavascriptExecutionToolsOptions = CommonExecutionToolsOptions & {
7
+ export type JavascriptExecutionToolsOptions = CommonToolsOptions & {
8
8
  /**
9
9
  * Functions to be executed in the JavaScript evaluation.
10
10
  *
@@ -1,4 +1,4 @@
1
- import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
1
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
2
2
  import type { ScriptExecutionTools } from '../../execution/ScriptExecutionTools';
3
3
  import type { ScriptExecutionToolsExecuteOptions } from '../../execution/ScriptExecutionTools';
4
4
  /**
@@ -10,7 +10,7 @@ import type { ScriptExecutionToolsExecuteOptions } from '../../execution/ScriptE
10
10
  */
11
11
  export declare class PythonExecutionTools implements ScriptExecutionTools {
12
12
  private readonly options;
13
- constructor(options?: CommonExecutionToolsOptions);
13
+ constructor(options?: CommonToolsOptions);
14
14
  /**
15
15
  * Executes a Python
16
16
  */
@@ -1,4 +1,4 @@
1
- import type { CommonExecutionToolsOptions } from '../../execution/CommonExecutionToolsOptions';
1
+ import type { CommonToolsOptions } from '../../execution/CommonToolsOptions';
2
2
  import type { ScriptExecutionTools } from '../../execution/ScriptExecutionTools';
3
3
  import type { ScriptExecutionToolsExecuteOptions } from '../../execution/ScriptExecutionTools';
4
4
  /**
@@ -10,7 +10,7 @@ import type { ScriptExecutionToolsExecuteOptions } from '../../execution/ScriptE
10
10
  */
11
11
  export declare class TypescriptExecutionTools implements ScriptExecutionTools {
12
12
  private readonly options;
13
- constructor(options?: CommonExecutionToolsOptions);
13
+ constructor(options?: CommonToolsOptions);
14
14
  /**
15
15
  * Executes a TypeScript
16
16
  */
@@ -1,13 +1,13 @@
1
1
  import type { PromptbookStorage } from '../_common/PromptbookStorage';
2
- import type { FilesStorageOptions } from './FilesStorageOptions';
2
+ import type { FileCacheStorageOptions } from './FileCacheStorageOptions';
3
3
  /**
4
4
  * @@@
5
5
  *
6
6
  * @public exported from `@promptbook/node`
7
7
  */
8
- export declare class FilesStorage<TItem> implements PromptbookStorage<TItem> {
8
+ export declare class FileCacheStorage<TItem> implements PromptbookStorage<TItem> {
9
9
  private readonly options;
10
- constructor(options: FilesStorageOptions);
10
+ constructor(options: FileCacheStorageOptions);
11
11
  /**
12
12
  * @@@
13
13
  */
@@ -27,5 +27,5 @@ export declare class FilesStorage<TItem> implements PromptbookStorage<TItem> {
27
27
  }
28
28
  /**
29
29
  * TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
30
- * Note: [🟢] This code should never be published outside of `@promptbook/node` and `@promptbook/cli` and `@promptbook/cli`
30
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31
31
  */
@@ -0,0 +1,10 @@
1
+ import type { string_dirname } from '../../types/typeAliases';
2
+ /**
3
+ * @@@
4
+ */
5
+ export type FileCacheStorageOptions = {
6
+ /**
7
+ * @@@
8
+ */
9
+ rootFolderPath: string_dirname;
10
+ };
@@ -2,6 +2,6 @@ import type { string_name } from '../../../types/typeAliases';
2
2
  /**
3
3
  * @@@
4
4
  *
5
- * @private for `FilesStorage`
5
+ * @private for `FileCacheStorage`
6
6
  */
7
7
  export declare function nameToSubfolderPath(name: string_name): Array<string>;
@@ -6,5 +6,5 @@ import type { PromptbookStorage } from '../_common/PromptbookStorage';
6
6
  */
7
7
  export declare function getLocalStorage<TItem>(): PromptbookStorage<TItem>;
8
8
  /**
9
- * Note: [🔵] This code should never be published outside of `@promptbook/browser`
9
+ * Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
10
10
  */
@@ -6,5 +6,5 @@ import type { PromptbookStorage } from '../_common/PromptbookStorage';
6
6
  */
7
7
  export declare function getSessionStorage<TItem>(): PromptbookStorage<TItem>;
8
8
  /**
9
- * Note: [🔵] This code should never be published outside of `@promptbook/browser`
9
+ * Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
10
10
  */
@@ -1,5 +1,5 @@
1
1
  import type { Promisable } from 'type-fest';
2
- import type { PromptbookStorage } from '../_common/PromptbookStorage';
2
+ import type { PromptbookStorage } from '../../_common/PromptbookStorage';
3
3
  /**
4
4
  * This class behaves like LocalStorage but separates keys by prefix
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { PromptbookStorage } from '../_common/PromptbookStorage';
1
+ import type { PromptbookStorage } from '../../_common/PromptbookStorage';
2
2
  /**
3
3
  * @@@
4
4
  *
@@ -11,11 +11,18 @@ import type { string_name } from '../typeAliases';
11
11
  */
12
12
  export type KnowledgeSourceJson = {
13
13
  /**
14
- * @@@
14
+ * Unique identifier of the knowledge source
15
15
  */
16
16
  readonly name: string_name;
17
17
  /**
18
- * @@@
18
+ * Source of one knowledge
19
+ *
20
+ * It can be a link, a relative path to file or direct text or combination of those
21
+ *
22
+ * For example `"https://pavolhejny.com/"`
23
+ * For example `"./pavol-hejny-cv.pdf"`
24
+ * For example `"Pavol Hejný has web https://pavolhejny.com/"`
25
+ * For example `"Pavol Hejný is web developer and creator of Promptbook and Collboard"`
19
26
  */
20
27
  readonly sourceContent: string_knowledge_source_content;
21
28
  };
@@ -33,6 +33,7 @@ export type ParameterJson = {
33
33
  readonly sampleValues?: Array<string_parameter_value>;
34
34
  };
35
35
  /**
36
+ * TODO: [🧠] Should be here registered subparameters from foreach or not?
36
37
  * TODO: [♈] Probbably move expectations from templates to parameters
37
38
  * TODO: [🍙] Make some standard order of json properties
38
39
  */
@@ -1,5 +1,5 @@
1
1
  import type { ModelRequirements } from '../ModelRequirements';
2
- import type { string_file_path } from '../typeAliases';
2
+ import type { string_filename } from '../typeAliases';
3
3
  import type { string_markdown_text } from '../typeAliases';
4
4
  import type { string_pipeline_url } from '../typeAliases';
5
5
  import type { string_semantic_version } from '../typeAliases';
@@ -33,7 +33,7 @@ export type PipelineJson = {
33
33
  /**
34
34
  * Internal helper for tracking the source `.ptbk.md` file of the pipeline
35
35
  */
36
- readonly sourceFile?: string_file_path;
36
+ readonly sourceFile?: string_filename;
37
37
  /**
38
38
  * Title of the promptbook
39
39
  * -It can use simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
@@ -42,7 +42,7 @@ export type PipelineJson = {
42
42
  /**
43
43
  * Version of the .ptbk.json file
44
44
  */
45
- readonly promptbookVersion: string_semantic_version;
45
+ readonly promptbookVersion?: string_semantic_version;
46
46
  /**
47
47
  * Description of the promptbook
48
48
  * It can use multiple paragraphs of simple markdown formatting like **bold**, *italic*, [link](https://example.com), ... BUT not code blocks and structure
@@ -1,3 +1,4 @@
1
+ import type { ForeachJson } from '../../commands/FOREACH/ForeachJson';
1
2
  import type { FormatCommand } from '../../commands/FORMAT/FormatCommand';
2
3
  import type { TemplateType } from '../../commands/TEMPLATE/TemplateTypes';
3
4
  import type { string_javascript } from '../typeAliases';
@@ -42,6 +43,10 @@ export interface TemplateJsonCommon {
42
43
  * @see https://github.com/webgptorg/promptbook/discussions/66
43
44
  */
44
45
  readonly jokerParameterNames?: Array<string_parameter_name>;
46
+ /**
47
+ * @@@
48
+ */
49
+ readonly foreach?: ForeachJson;
45
50
  /**
46
51
  * Type of the execution
47
52
  * This determines if the template is send to LLM, user or some scripting evaluation
@@ -1,3 +1,4 @@
1
+ import type { ReadonlyDeep } from 'type-fest';
1
2
  import type { ExecutionReportJson } from './ExecutionReportJson';
2
3
  import type { ExecutionReportString } from './ExecutionReportString';
3
4
  import type { ExecutionReportStringOptions } from './ExecutionReportStringOptions';
@@ -6,7 +7,7 @@ import type { ExecutionReportStringOptions } from './ExecutionReportStringOption
6
7
  *
7
8
  * @public exported from `@promptbook/core`
8
9
  */
9
- export declare function executionReportJsonToString(executionReportJson: ExecutionReportJson, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
10
+ export declare function executionReportJsonToString(executionReportJson: ReadonlyDeep<ExecutionReportJson>, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
10
11
  /**
11
12
  * TODO: Add mermaid chart for every report
12
13
  * TODO: [🧠] Allow to filter out some parts of the report by options
@@ -156,7 +156,7 @@ export type string_knowledge_source_content = string_knowledge_source_link | str
156
156
  *
157
157
  * @@@ string_knowledge_source vs string_knowledge_source_link
158
158
  */
159
- export type string_knowledge_source_link = string_url | string_file_path;
159
+ export type string_knowledge_source_link = string_url | string_filename;
160
160
  /**
161
161
  * Semantic helper
162
162
  *
@@ -331,6 +331,13 @@ export type string_href = string;
331
331
  * For example `"https://collboard.com/9SeSQTupmQHwuSrLi.png?width=1200&height=630"`
332
332
  */
333
333
  export type string_url_image = string;
334
+ /**
335
+ * Semantic helper
336
+ *
337
+ * For example `"C:/Users/me/AppData/Local/Pandoc/pandoc.exe"`
338
+ * For example `"C:/Program Files/LibreOffice/program/swriter.exe"`
339
+ */
340
+ export type string_executable_path = string;
334
341
  /**
335
342
  * Semantic helper
336
343
  *
@@ -386,6 +393,7 @@ export type string_emails = string;
386
393
  * - `isValidUuid to check validity
387
394
  *
388
395
  * For example `"5a0a153d-7be9-4018-9eda-e0e2e2b89bd9"`
396
+ * TODO: [🥬] Make some system for hashes and ids of promptbook
389
397
  */
390
398
  export type string_uuid = string & {
391
399
  readonly _type: 'uuid';
@@ -423,37 +431,33 @@ export type string_file_extension = string;
423
431
  *
424
432
  * For example `"C:/Users/me/work/collboard/modules-sdk/src/colldev/commands/develop/ColldevDevelop.tsx"`
425
433
  */
426
- export type string_file_absolute_path = string;
434
+ export type string_absolute_filename = string;
427
435
  /**
428
436
  * Semantic helper
429
437
  *
430
438
  * For example `"./src/colldev/commands/develop/ColldevDevelop.tsx"`
431
439
  */
432
- export type string_file_relative_path = string;
440
+ export type string_relative_filename = string;
433
441
  /**
434
442
  * Semantic helper
435
443
  */
436
- export type string_file_path = string_file_absolute_path | string_file_relative_path;
444
+ export type string_filename = string_absolute_filename | string_relative_filename;
437
445
  /**
438
446
  * Semantic helper
439
447
  *
440
448
  * For example `"C:/Users/me/work/collboard/modules-sdk/src/colldev/commands/develop/ColldevDevelop.tsx"`
441
449
  */
442
- export type string_folder_absolute_path = string;
450
+ export type string_absolute_dirname = string;
443
451
  /**
444
452
  * Semantic helper
445
453
  *
446
454
  * For example `"./src/colldev/commands/develop/ColldevDevelop.tsx"`
447
455
  */
448
- export type string_folder_relative_path = string;
449
- /**
450
- * Semantic helper
451
- */
452
- export type string_folder_path = string_file_absolute_path | string_file_relative_path;
456
+ export type string_relative_dirname = string;
453
457
  /**
454
458
  * Semantic helper
455
459
  */
456
- export type string_filename = string;
460
+ export type string_dirname = string_absolute_dirname | string_relative_dirname;
457
461
  /**
458
462
  * Semantic helper
459
463
  *
@@ -592,7 +596,7 @@ export type number_megabytes = number_positive;
592
596
  export type number_gigabytes = number_positive;
593
597
  export type number_terabytes = number_positive;
594
598
  /**.
595
- * TODO: !!! Change "For example" to @example
599
+ * TODO: [main] !!! Change "For example" to @example
596
600
  * TODO: !! Change to branded types
597
601
  * TODO: Delete type aliases that are not exported or used internally
598
602
  */
@@ -1,14 +1,27 @@
1
- import type { string_javascript_name } from '../types/typeAliases';
1
+ import { type IDestroyable } from 'destroyable';
2
+ import type { string_name } from '../types/typeAliases';
2
3
  import type { TODO_string } from './organization/TODO_string';
4
+ /**
5
+ * @@@
6
+ */
3
7
  export type Registered = {
4
8
  /**
5
9
  * @@@
6
10
  */
7
- packageName: TODO_string;
11
+ readonly packageName: TODO_string;
12
+ /**
13
+ * @@@
14
+ */
15
+ readonly className: TODO_string;
16
+ };
17
+ /**
18
+ * @@@
19
+ */
20
+ export type Registration = Registered & IDestroyable & {
8
21
  /**
9
22
  * @@@
10
23
  */
11
- className: TODO_string;
24
+ readonly registerName: string_name;
12
25
  };
13
26
  /**
14
27
  * Register is @@@
@@ -18,9 +31,9 @@ export type Registered = {
18
31
  * @private internal utility, exported are only signleton instances of this class
19
32
  */
20
33
  export declare class $Register<TRegistered extends Registered> {
21
- private readonly storageName;
34
+ private readonly registerName;
22
35
  private readonly storage;
23
- constructor(storageName: string_javascript_name);
36
+ constructor(registerName: string_name);
24
37
  list(): Array<TRegistered>;
25
- register(registered: TRegistered): void;
38
+ register(registered: TRegistered): Registration;
26
39
  }
@@ -0,0 +1,14 @@
1
+ import type { IExecCommandOptions } from './IExecCommandOptions';
2
+ /**
3
+ * Run one command in a shell
4
+ *
5
+ * Note: There are 2 similar functions in the codebase:
6
+ * - `$execCommand` which runs a single command
7
+ * - `$execCommands` which runs multiple commands
8
+ *
9
+ * @public exported from `@promptbook/node`
10
+ */
11
+ export declare function $execCommand(options: IExecCommandOptions): Promise<string>;
12
+ /**
13
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
14
+ */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Run multiple commands in a shell in sequence
3
+ *
4
+ * Note: There are 2 similar functions in the codebase:
5
+ * - `$execCommand` which runs a single command
6
+ * - `$execCommands` which runs multiple commands
7
+ *
8
+ * @public exported from `@promptbook/node`
9
+ */
10
+ export declare function $execCommands({ commands, cwd, crashOnError, }: {
11
+ readonly commands: string[];
12
+ readonly cwd: string;
13
+ readonly crashOnError?: boolean;
14
+ }): Promise<void>;
15
+ /**
16
+ * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17
+ */
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @deprecated Use sth from type-fest or move this to type helpers
3
+ */
4
+ type RequiredAndOptional<TBase, TRequired extends keyof TBase, TOptional extends keyof TBase> = Pick<TBase, TRequired> & Partial<Pick<TBase, TOptional>>;
5
+ /**
6
+ * Simple options for `execCommand`
7
+ *
8
+ * TODO: !!!!!! Rename - remove I prefix
9
+ */
10
+ export type IExecCommandOptions = string | RequiredAndOptional<IExecCommandOptionsAdvanced, 'command', 'args' | 'cwd' | 'crashOnError' | 'timeout'>;
11
+ /**
12
+ * Advanced options for `execCommand`
13
+ *
14
+ * TODO: !!!!!! Rename - remove I prefix
15
+ */
16
+ export type IExecCommandOptionsAdvanced = {
17
+ readonly command: string;
18
+ readonly args: string[];
19
+ readonly cwd: string;
20
+ readonly crashOnError: boolean;
21
+ readonly timeout: number;
22
+ };
23
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { IExecCommandOptions } from './IExecCommandOptions';
2
+ import type { IExecCommandOptionsAdvanced } from './IExecCommandOptions';
3
+ /**
4
+ * Normalize options for `execCommand` and `execCommands`
5
+ *
6
+ * @private internal utility of `execCommand` and `execCommands`
7
+ */
8
+ export declare function execCommandNormalizeOptions(options: IExecCommandOptions): Pick<IExecCommandOptionsAdvanced, 'command' | 'args' | 'cwd' | 'crashOnError' | 'timeout'> & {
9
+ humanReadableCommand: string;
10
+ };