@promptbook/types 0.72.0-8 → 0.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/README.md +8 -8
  2. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  3. package/esm/typings/src/_packages/cli.index.d.ts +20 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +42 -30
  5. package/esm/typings/src/_packages/documents.index.d.ts +8 -0
  6. package/esm/typings/src/_packages/legacy-documents.index.d.ts +8 -0
  7. package/esm/typings/src/_packages/markdown-utils.index.d.ts +6 -0
  8. package/esm/typings/src/_packages/node.index.d.ts +12 -4
  9. package/esm/typings/src/_packages/pdf.index.d.ts +8 -0
  10. package/esm/typings/src/_packages/types.index.d.ts +33 -17
  11. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  12. package/esm/typings/src/_packages/website-crawler.index.d.ts +8 -0
  13. package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
  14. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +2 -2
  15. package/esm/typings/src/collection/collectionToJson.d.ts +1 -1
  16. package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +5 -3
  17. package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -1
  18. package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -1
  19. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +5 -5
  20. package/esm/typings/src/config.d.ts +26 -13
  21. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +3 -1
  22. package/esm/typings/src/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +2 -2
  23. package/esm/typings/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -3
  24. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +12 -0
  25. package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +11 -0
  26. package/esm/typings/src/executables/apps/locatePandoc.d.ts +11 -0
  27. package/esm/typings/src/executables/locateApp.d.ts +33 -0
  28. package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +12 -0
  29. package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +12 -0
  30. package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +12 -0
  31. package/esm/typings/src/execution/{CommonExecutionToolsOptions.d.ts → CommonToolsOptions.d.ts} +1 -1
  32. package/esm/typings/src/execution/EmbeddingVector.d.ts +1 -1
  33. package/esm/typings/src/execution/Executables.d.ts +18 -0
  34. package/esm/typings/src/execution/ExecutionTools.d.ts +32 -6
  35. package/esm/typings/src/execution/FilesystemTools.d.ts +9 -0
  36. package/esm/typings/src/execution/LlmExecutionTools.d.ts +2 -2
  37. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +2 -2
  38. package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +3 -2
  39. package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +29 -6
  40. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +3 -12
  41. package/esm/typings/src/execution/createPipelineExecutor/20-executeTemplate.d.ts +4 -18
  42. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +9 -19
  43. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -3
  44. package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +1 -0
  45. package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +13 -0
  46. package/esm/typings/src/execution/utils/addUsage.d.ts +1 -1
  47. package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -1
  48. package/esm/typings/src/formats/_common/FormatDefinition.d.ts +2 -2
  49. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +2 -2
  50. package/esm/typings/src/llm-providers/_common/{$llmToolsMetadataRegister.d.ts → register/$llmToolsMetadataRegister.d.ts} +4 -1
  51. package/esm/typings/src/llm-providers/_common/{$llmToolsRegister.d.ts → register/$llmToolsRegister.d.ts} +5 -2
  52. package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfigurationFromEnv.d.ts → register/$provideLlmToolsConfigurationFromEnv.d.ts} +3 -3
  53. package/esm/typings/src/llm-providers/_common/{getLlmToolsForCli.d.ts → register/$provideLlmToolsForCli.d.ts} +4 -11
  54. package/esm/typings/src/llm-providers/_common/{getLlmToolsForTestingAndScriptsAndPlayground.d.ts → register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts} +4 -3
  55. package/esm/typings/src/llm-providers/_common/{createLlmToolsFromEnv.d.ts → register/$provideLlmToolsFromEnv.d.ts} +6 -5
  56. package/esm/typings/src/llm-providers/_common/{$registeredLlmToolsMessage.d.ts → register/$registeredLlmToolsMessage.d.ts} +5 -2
  57. package/esm/typings/src/llm-providers/_common/{LlmToolsConfiguration.d.ts → register/LlmToolsConfiguration.d.ts} +6 -5
  58. package/esm/typings/src/llm-providers/_common/{LlmToolsMetadata.d.ts → register/LlmToolsMetadata.d.ts} +5 -4
  59. package/esm/typings/src/llm-providers/_common/{LlmToolsOptions.d.ts → register/LlmToolsOptions.d.ts} +4 -1
  60. package/esm/typings/src/llm-providers/_common/{createLlmToolsFromConfiguration.d.ts → register/createLlmToolsFromConfiguration.d.ts} +12 -4
  61. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +4 -1
  62. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
  63. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +5 -5
  64. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  65. package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +4 -3
  66. package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +4 -3
  67. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
  68. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +4 -3
  69. package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +4 -3
  70. package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +4 -3
  71. package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +1 -1
  72. package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
  73. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +4 -4
  74. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +4 -4
  75. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +4 -4
  76. package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +1 -1
  77. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +0 -1
  78. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -2
  79. package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +4 -4
  80. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  81. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +5 -4
  82. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +5 -4
  83. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +4 -4
  84. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +16 -7
  85. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +4 -4
  86. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +7 -13
  87. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +3 -3
  88. package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +11 -16
  89. package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +24 -9
  90. package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -1
  91. package/esm/typings/src/personas/preparePersona.d.ts +2 -1
  92. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +10 -28
  93. package/esm/typings/src/prepare/preparePipeline.d.ts +2 -1
  94. package/esm/typings/src/prepare/prepareTemplates.d.ts +3 -2
  95. package/esm/typings/src/scrapers/_common/Converter.d.ts +4 -10
  96. package/esm/typings/src/scrapers/_common/Scraper.d.ts +5 -17
  97. package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -1
  98. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +11 -0
  99. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +12 -0
  100. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +15 -0
  101. package/esm/typings/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +12 -0
  102. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +13 -0
  103. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +13 -0
  104. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +41 -0
  105. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +12 -0
  106. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +3 -2
  107. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -2
  108. package/esm/typings/src/scrapers/document/{documentScraper.d.ts → DocumentScraper.d.ts} +18 -12
  109. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +20 -0
  110. package/esm/typings/src/scrapers/document/register-constructor.d.ts +13 -0
  111. package/esm/typings/src/scrapers/document/register-metadata.d.ts +24 -0
  112. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +43 -0
  113. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +20 -0
  114. package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +13 -0
  115. package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +24 -0
  116. package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +29 -0
  117. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +20 -0
  118. package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +13 -0
  119. package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +24 -0
  120. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +40 -0
  121. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +20 -0
  122. package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +13 -0
  123. package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +24 -0
  124. package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +50 -0
  125. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +20 -0
  126. package/esm/typings/src/scrapers/website/register-constructor.d.ts +13 -0
  127. package/esm/typings/src/scrapers/website/register-metadata.d.ts +24 -0
  128. package/esm/typings/src/scrapers/website/utils/createShowdownConverter.d.ts +7 -0
  129. package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +2 -2
  130. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  131. package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +3 -3
  132. package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +3 -3
  133. package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +5 -3
  134. package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +1 -1
  135. package/esm/typings/src/storage/{utils → memory/utils}/PrefixStorage.d.ts +1 -1
  136. package/esm/typings/src/storage/{utils → memory/utils}/makePromptbookStorageFromWebStorage.d.ts +1 -1
  137. package/esm/typings/src/types/Arrayable.d.ts +1 -1
  138. package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +7 -0
  139. package/esm/typings/src/types/PipelineJson/KnowledgePieceJson.d.ts +4 -4
  140. package/esm/typings/src/types/PipelineJson/KnowledgeSourceJson.d.ts +1 -1
  141. package/esm/typings/src/types/PipelineJson/PersonaJson.d.ts +1 -1
  142. package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
  143. package/esm/typings/src/types/Prompt.d.ts +2 -1
  144. package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +1 -1
  145. package/esm/typings/src/types/typeAliases.d.ts +18 -8
  146. package/esm/typings/src/utils/$Register.d.ts +20 -7
  147. package/esm/typings/src/utils/FromtoItems.d.ts +1 -1
  148. package/esm/typings/src/utils/arrayableToArray.d.ts +1 -1
  149. package/esm/typings/src/utils/emojis.d.ts +1 -1
  150. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +5 -3
  151. package/esm/typings/src/utils/execCommand/$execCommandNormalizeOptions.d.ts +12 -0
  152. package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
  153. package/esm/typings/src/utils/execCommand/ExecCommandOptions.d.ts +45 -0
  154. package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
  155. package/esm/typings/src/utils/files/isDirectoryExisting.d.ts +14 -0
  156. package/esm/typings/src/utils/files/isExecutable.d.ts +11 -0
  157. package/esm/typings/src/utils/files/isFileExisting.d.ts +13 -0
  158. package/esm/typings/src/utils/files/isFileExisting.test.d.ts +1 -0
  159. package/esm/typings/src/utils/files/{$listAllFiles.d.ts → listAllFiles.d.ts} +3 -4
  160. package/esm/typings/src/utils/files/listAllFiles.test.d.ts +1 -0
  161. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
  162. package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -1
  163. package/esm/typings/src/utils/normalization/IKeywords.d.ts +2 -2
  164. package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -2
  165. package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +2 -2
  166. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +2 -2
  167. package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
  168. package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
  169. package/esm/typings/src/utils/random/$randomSeed.d.ts +1 -1
  170. package/esm/typings/src/utils/sets/intersection.d.ts +1 -1
  171. package/esm/typings/src/utils/sets/union.d.ts +1 -1
  172. package/esm/typings/src/utils/unwrapResult.d.ts +4 -4
  173. package/package.json +3 -2
  174. package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorSettings.d.ts +0 -29
  175. package/esm/typings/src/scrapers/document-legacy/legacyDocumentScraper.d.ts +0 -37
  176. package/esm/typings/src/scrapers/index.d.ts +0 -8
  177. package/esm/typings/src/scrapers/markdown/markdownScraper.d.ts +0 -29
  178. package/esm/typings/src/scrapers/pdf/pdfScraper.d.ts +0 -35
  179. package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +0 -12
  180. package/esm/typings/src/scrapers/website/websiteScraper.d.ts +0 -43
  181. package/esm/typings/src/utils/execCommand/IExecCommandOptions.d.ts +0 -23
  182. package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +0 -10
  183. package/esm/typings/src/utils/files/$isDirectoryExisting.d.ts +0 -15
  184. package/esm/typings/src/utils/files/$isFileExisting.d.ts +0 -14
  185. /package/esm/typings/src/{scrapers/website/utils/markdownConverter.test.d.ts → executables/apps/locateLibreoffice.test.d.ts} +0 -0
  186. /package/esm/typings/src/{scrapers/website/websiteScraper.test.d.ts → executables/apps/locatePandoc.test.d.ts} +0 -0
  187. /package/esm/typings/src/{utils/files/$isDirectoryExisting.test.d.ts → executables/locateApp.test.d.ts} +0 -0
  188. /package/esm/typings/src/scrapers/document/{documentScraper.test.d.ts → DocumentScraper.test.d.ts} +0 -0
  189. /package/esm/typings/src/scrapers/document-legacy/{legacyDocumentScraper.test.d.ts → LegacyDocumentScraper.test.d.ts} +0 -0
  190. /package/esm/typings/src/scrapers/markdown/{markdownScraper.test.d.ts → MarkdownScraper.test.d.ts} +0 -0
  191. /package/esm/typings/src/{utils/files/$isFileExisting.test.d.ts → scrapers/website/utils/createShowdownConverter.test.d.ts} +0 -0
  192. /package/esm/typings/src/utils/files/{$listAllFiles.test.d.ts → isDirectoryExisting.test.d.ts} +0 -0
@@ -1,18 +1,17 @@
1
+ import type { FilesystemTools } from '../../execution/FilesystemTools';
1
2
  import type { string_dirname } from '../../types/typeAliases';
2
3
  import type { string_filename } from '../../types/typeAliases';
3
4
  /**
4
5
  * Reads all files in the directory
5
6
  *
6
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the filesystem
7
- *
8
7
  * @param path
9
8
  * @param isRecursive
10
9
  * @returns List of all files in the directory
11
10
  * @private internal function of `createCollectionFromDirectory`
12
11
  */
13
- export declare function $listAllFiles(path: string_dirname, isRecursive: boolean): Promise<Array<string_filename>>;
12
+ export declare function listAllFiles(path: string_dirname, isRecursive: boolean, fs: FilesystemTools): Promise<Array<string_filename>>;
14
13
  /**
15
14
  * TODO: [😶] Unite floder listing
16
- * Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
15
+ * Note: Not [~🟢~] because it is not directly dependent on `fs
17
16
  * TODO: [🖇] What about symlinks?
18
17
  */
@@ -0,0 +1 @@
1
+ export {};
@@ -30,7 +30,7 @@ export type CodeBlock = {
30
30
  * @throws {ParseError} if block is not closed properly
31
31
  * @public exported from `@promptbook/markdown-utils`
32
32
  */
33
- export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
33
+ export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): ReadonlyArray<CodeBlock>;
34
34
  /**
35
35
  * TODO: Maybe name for `blockNotation` instead of '```' and '>'
36
36
  */
@@ -5,7 +5,7 @@ import type { string_markdown_section } from '../../types/typeAliases';
5
5
  *
6
6
  * @public exported from `@promptbook/markdown-utils`
7
7
  */
8
- export declare function splitMarkdownIntoSections(markdown: string_markdown): Array<string_markdown_section>;
8
+ export declare function splitMarkdownIntoSections(markdown: string_markdown): ReadonlyArray<string_markdown_section>;
9
9
  /**
10
10
  * TODO: [🏛] This can be part of markdown builder
11
11
  * Note: [🕞] In past (commit 42086e1603cbed506482997c00a8ee979af0a247) there was much more
@@ -2,7 +2,7 @@
2
2
  * Semantic helper
3
3
  *
4
4
  * Keyword is string without diacritics in lowercase [a-z1-9]
5
- * Words are splitted between multiple keywords @see IKeywords
5
+ * Words are splitted between multiple keywords @see Keywords
6
6
  *
7
7
  * For example `"keyword"`
8
8
  *
@@ -15,7 +15,7 @@ export type string_keyword = string;
15
15
  *
16
16
  * @public exported from `@promptbook/utils`
17
17
  */
18
- export type IKeywords = Set<string_keyword>;
18
+ export type Keywords = Set<string_keyword>;
19
19
  /**
20
20
  * TODO: [🌮] Keywords with weight
21
21
  */
@@ -1,5 +1,5 @@
1
1
  import type { really_unknown } from '../organization/really_unknown';
2
- import type { IKeywords } from './IKeywords';
2
+ import type { Keywords } from './IKeywords';
3
3
  /**
4
4
  * Parses keywords from any object and recursively walks through
5
5
  *
@@ -9,7 +9,7 @@ import type { IKeywords } from './IKeywords';
9
9
  * @returns {Set} of keywords without diacritics in lowercase
10
10
  * @public exported from `@promptbook/utils`
11
11
  */
12
- export declare function parseKeywords(input: really_unknown): IKeywords;
12
+ export declare function parseKeywords(input: really_unknown): Keywords;
13
13
  /**
14
14
  * Note: Not using spread in input param because of keeping second parameter for options
15
15
  * TODO: [🌺] Use some intermediate util splitWords
@@ -1,4 +1,4 @@
1
- import type { IKeywords } from './IKeywords';
1
+ import type { Keywords } from './IKeywords';
2
2
  /**
3
3
  * Parses keywords from a string
4
4
  *
@@ -6,4 +6,4 @@ import type { IKeywords } from './IKeywords';
6
6
  * @returns {Set} of keywords without diacritics in lowercase
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
- export declare function parseKeywordsFromString(input: string): IKeywords;
9
+ export declare function parseKeywordsFromString(input: string): Keywords;
@@ -1,4 +1,4 @@
1
- import type { IKeywords } from './IKeywords';
1
+ import type { Keywords } from './IKeywords';
2
2
  /**
3
3
  * @@@
4
4
  *
@@ -7,4 +7,4 @@ import type { IKeywords } from './IKeywords';
7
7
  * @returns
8
8
  * @public exported from `@promptbook/utils`
9
9
  */
10
- export declare function searchKeywords(haystack: IKeywords, needle: IKeywords): boolean;
10
+ export declare function searchKeywords(haystack: Keywords, needle: Keywords): boolean;
@@ -9,4 +9,4 @@ import type { really_any } from './really_any';
9
9
  * @returns void
10
10
  * @private within the repository
11
11
  */
12
- export declare function TODO_USE(...value: Array<really_any>): void;
12
+ export declare function TODO_USE(...value: ReadonlyArray<really_any>): void;
@@ -13,4 +13,4 @@ import type { really_any } from './really_any';
13
13
  * @returns void
14
14
  * @private within the repository
15
15
  */
16
- export declare function keepUnused<TTypeToKeep1 = really_any, TTypeToKeep2 = really_any, TTypeToKeep3 = really_any>(...valuesToKeep: Array<really_any>): void;
16
+ export declare function keepUnused<TTypeToKeep1 = really_any, TTypeToKeep2 = really_any, TTypeToKeep3 = really_any>(...valuesToKeep: ReadonlyArray<really_any>): void;
@@ -3,7 +3,7 @@ import type { number_seed } from '../../types/typeAliases';
3
3
  * Generates random seed
4
4
  *
5
5
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
6
- * Warning: This function is not cryptographically secure (it uses Math.random internally)
6
+ * Warning: This function is NOT cryptographically secure (it uses Math.random internally)
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
9
  export declare function $randomSeed(): number_seed;
@@ -4,4 +4,4 @@
4
4
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
5
5
  * @public exported from `@promptbook/utils`
6
6
  */
7
- export declare function intersection<TItem>(...sets: Array<Set<TItem>>): Set<TItem>;
7
+ export declare function intersection<TItem>(...sets: ReadonlyArray<Set<TItem>>): Set<TItem>;
@@ -4,4 +4,4 @@
4
4
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
5
5
  * @public exported from `@promptbook/utils`
6
6
  */
7
- export declare function union<TItem>(...sets: Array<Set<TItem>>): Set<TItem>;
7
+ export declare function union<TItem>(...sets: ReadonlyArray<Set<TItem>>): Set<TItem>;
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Additional options for `unwrapResult`
3
3
  */
4
- interface UnwrapResultOptions {
4
+ type UnwrapResultOptions = {
5
5
  /**
6
6
  * If true, the text is trimmed before processing
7
7
  */
8
- isTrimmed?: boolean;
8
+ readonly isTrimmed?: boolean;
9
9
  /**
10
10
  * If true, the introduce sentence is removed
11
11
  *
@@ -15,8 +15,8 @@ interface UnwrapResultOptions {
15
15
  *
16
16
  * @default true
17
17
  */
18
- isIntroduceSentenceRemoved?: boolean;
19
- }
18
+ readonly isIntroduceSentenceRemoved?: boolean;
19
+ };
20
20
  /**
21
21
  * Removes quotes and optional introduce text from a string
22
22
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.72.0-8",
3
+ "version": "0.72.0",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -11,6 +11,7 @@
11
11
  "contributors": [
12
12
  "Pavol Hejný <me@pavolhejny.com> (https://www.pavolhejny.com/)"
13
13
  ],
14
+ "todo-0": "TODO: [❇️] Make better list of keywords",
14
15
  "keywords": [
15
16
  "ai",
16
17
  "llm",
@@ -49,6 +50,6 @@
49
50
  ],
50
51
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
51
52
  "peerDependencies": {
52
- "@promptbook/core": "0.72.0-8"
53
+ "@promptbook/core": "0.72.0"
53
54
  }
54
55
  }
@@ -1,29 +0,0 @@
1
- import type { CsvSettings } from '../../formats/csv/CsvSettings';
2
- import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
3
- export type CreatePipelineExecutorSettings = Omit<PrepareAndScrapeOptions, 'llmTools'> & {
4
- /**
5
- * When executor does not satisfy expectations it will be retried this amount of times
6
- *
7
- * @default MAX_EXECUTION_ATTEMPTS
8
- */
9
- readonly maxExecutionAttempts: number;
10
- /**
11
- * Settings for CSV format
12
- *
13
- * @default DEFAULT_CSV_SETTINGS
14
- */
15
- readonly csvSettings: CsvSettings;
16
- /**
17
- * If you pass fully prepared pipeline, this does not matter
18
- *
19
- * Otherwise:
20
- * If false or not set, warning is shown when pipeline is not prepared
21
- * If true, warning is suppressed
22
- *
23
- * @default false
24
- */
25
- readonly isNotPreparedWarningSupressed: boolean;
26
- };
27
- /**
28
- * TODO: [🤹‍♂️] More granular setting for limits of execution + better waiting for queue
29
- */
@@ -1,37 +0,0 @@
1
- import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
2
- import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
3
- import type { ScraperSourceHandler } from '../_common/Scraper';
4
- import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
5
- /**
6
- * Scraper for .docx files
7
- *
8
- * @see `documentationUrl` for more details
9
- * @public exported from `@promptbook/core`
10
- */
11
- export declare const legacyDocumentScraper: {
12
- /**
13
- * Mime types that this scraper can handle
14
- */
15
- mimeTypes: string[];
16
- /**
17
- * Link to documentation
18
- */
19
- documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
20
- /**
21
- * Convert the `.doc` or `.rtf` to `.doc` file and returns intermediate source
22
- *
23
- * 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
24
- */
25
- $convert(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<ScraperIntermediateSource>;
26
- /**
27
- * Scrapes the `.doc` or `.rtf` file and returns the knowledge pieces or `null` if it can't scrape it
28
- */
29
- scrape(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
30
- };
31
- /**
32
- * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
33
- * TODO: [🦖] Make some system for putting scrapers to separete packages
34
- * TODO: [🪂] Do it in parallel 11:11
35
- * TODO: [🦷] Ideally use `as const satisfies Converter & Scraper` BUT this combination throws errors
36
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
37
- */
@@ -1,8 +0,0 @@
1
- import type { Scraper } from './_common/Scraper';
2
- /**
3
- * @@@
4
- *
5
- * @private because this will be replaced by a system of one scraper per package [🦖]
6
- * TODO: [🦖] System for scrapers NOT public exported from `@promptbook/core`
7
- */
8
- export declare const SCRAPERS: Array<Scraper>;
@@ -1,29 +0,0 @@
1
- import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
2
- import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
3
- import type { ScraperSourceHandler } from '../_common/Scraper';
4
- /**
5
- * Scraper for markdown files
6
- *
7
- * @see `documentationUrl` for more details
8
- * @public exported from `@promptbook/core`
9
- */
10
- export declare const markdownScraper: {
11
- /**
12
- * Mime types that this scraper can handle
13
- */
14
- mimeTypes: string[];
15
- /**
16
- * Link to documentation
17
- */
18
- documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
19
- /**
20
- * Scrapes the markdown file and returns the knowledge pieces or `null` if it can't scrape it
21
- */
22
- scrape(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
23
- };
24
- /**
25
- * TODO: [🦖] Make some system for putting scrapers to separete packages
26
- * TODO: [🪂] Do it in parallel 11:11
27
- * TODO: [🦷] Ideally use `as const satisfies Scraper` BUT this combination throws errors
28
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
29
- */
@@ -1,35 +0,0 @@
1
- import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
2
- import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
3
- import type { ScraperSourceHandler } from '../_common/Scraper';
4
- import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
5
- /**
6
- * Scraper for .docx files
7
- *
8
- * @see `documentationUrl` for more details
9
- * @public exported from `@promptbook/core`
10
- */
11
- export declare const pdfScraper: {
12
- /**
13
- * Mime types that this scraper can handle
14
- */
15
- mimeTypes: string[];
16
- /**
17
- * Link to documentation
18
- */
19
- documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
20
- /**
21
- * Converts the `.pdf` file to `.md` file and returns intermediate source
22
- */
23
- $convert(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<ScraperIntermediateSource>;
24
- /**
25
- * Scrapes the `.pdf` file and returns the knowledge pieces or `null` if it can't scrape it
26
- */
27
- scrape(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
28
- };
29
- /**
30
- * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
31
- * TODO: [🦖] Make some system for putting scrapers to separete packages
32
- * TODO: [🪂] Do it in parallel 11:11
33
- * TODO: [🦷] Ideally use `as const satisfies Converter & Scraper` BUT this combination throws errors
34
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
35
- */
@@ -1,12 +0,0 @@
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,43 +0,0 @@
1
- import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
2
- import type { KnowledgePiecePreparedJson } from '../../types/PipelineJson/KnowledgePieceJson';
3
- import type { string_markdown } from '../../types/typeAliases';
4
- import type { ScraperSourceHandler } from '../_common/Scraper';
5
- import type { ScraperIntermediateSource } from '../_common/ScraperIntermediateSource';
6
- /**
7
- * Scraper for .docx files
8
- *
9
- * @see `documentationUrl` for more details
10
- * @public exported from `@promptbook/core`
11
- */
12
- export declare const websiteScraper: {
13
- /**
14
- * Mime types that this scraper can handle
15
- */
16
- mimeTypes: string[];
17
- /**
18
- * Link to documentation
19
- */
20
- documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
21
- /**
22
- * Convert the website to `.md` file and returns intermediate source
23
- *
24
- * 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
25
- */
26
- $convert(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<import("destroyable").IDestroyable & {
27
- readonly filename: string;
28
- } & {
29
- markdown: string_markdown;
30
- }>;
31
- /**
32
- * Scrapes the website and returns the knowledge pieces or `null` if it can't scrape it
33
- */
34
- scrape(source: ScraperSourceHandler, options: PrepareAndScrapeOptions): Promise<Array<Omit<KnowledgePiecePreparedJson, 'sources' | 'preparationIds'>> | null>;
35
- };
36
- /**
37
- * TODO: !!!!!! Put into separate package
38
- * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
39
- * TODO: [🦖] Make some system for putting scrapers to separete packages
40
- * TODO: [🪂] Do it in parallel 11:11
41
- * TODO: [🦷] Ideally use `as const satisfies Converter & Scraper` BUT this combination throws errors
42
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
43
- */
@@ -1,23 +0,0 @@
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 {};
@@ -1,10 +0,0 @@
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
- };
@@ -1,15 +0,0 @@
1
- import type { string_dirname } from '../../types/typeAliases';
2
- /**
3
- * Checks if the directory exists
4
- *
5
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the filesystem
6
- *
7
- * @private within the repository
8
- */
9
- export declare function $isDirectoryExisting(directoryPath: string_dirname): Promise<boolean>;
10
- /**
11
- * Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
12
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
13
- * TODO: [🧠][📂] "directory" vs "folder"
14
- * TODO: [🖇] What about symlinks?
15
- */
@@ -1,14 +0,0 @@
1
- import type { string_filename } from '../../types/typeAliases';
2
- /**
3
- * Checks if the file exists
4
- *
5
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the filesystem
6
- *
7
- * @private within the repository
8
- */
9
- export declare function $isFileExisting(filename: string_filename): Promise<boolean>;
10
- /**
11
- * Note: [🟢 <- TODO: [🦖] !!!!!! Split scrapers into packages and enable] Code in this file should never be published outside of `@promptbook/node` and `@promptbook/cli`
12
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
13
- * TODO: [🖇] What about symlinks?
14
- */