@promptbook/markdown-utils 0.92.0-8 → 0.92.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 (207) hide show
  1. package/README.md +1 -5
  2. package/esm/index.es.js +585 -404
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +26 -14
  6. package/esm/typings/src/_packages/types.index.d.ts +6 -2
  7. package/esm/typings/src/collection/PipelineCollection.d.ts +0 -2
  8. package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
  9. package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
  10. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +0 -2
  11. package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -1
  12. package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -1
  13. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +36 -28
  14. package/esm/typings/src/config.d.ts +41 -11
  15. package/esm/typings/src/constants.d.ts +43 -2
  16. package/esm/typings/src/conversion/parsePipeline.d.ts +2 -2
  17. package/esm/typings/src/errors/0-BoilerplateError.d.ts +2 -2
  18. package/esm/typings/src/errors/CollectionError.d.ts +1 -1
  19. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -1
  20. package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +2 -1
  21. package/esm/typings/src/executables/apps/locatePandoc.d.ts +2 -1
  22. package/esm/typings/src/executables/locateApp.d.ts +2 -2
  23. package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +2 -1
  24. package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +2 -1
  25. package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +2 -1
  26. package/esm/typings/src/execution/AbstractTaskResult.d.ts +1 -1
  27. package/esm/typings/src/execution/CommonToolsOptions.d.ts +5 -1
  28. package/esm/typings/src/execution/ExecutionTask.d.ts +19 -1
  29. package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +2 -1
  30. package/esm/typings/src/execution/PipelineExecutorResult.d.ts +4 -2
  31. package/esm/typings/src/execution/PromptbookFetch.d.ts +1 -1
  32. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
  33. package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +12 -9
  34. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +13 -10
  35. package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +12 -9
  36. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -3
  37. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +21 -15
  38. package/esm/typings/src/execution/createPipelineExecutor/computeCosineSimilarity.d.ts +13 -0
  39. package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +7 -6
  40. package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +5 -1
  41. package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +1 -1
  42. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +12 -9
  43. package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +18 -5
  44. package/esm/typings/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +9 -0
  45. package/esm/typings/src/execution/execution-report/ExecutionReportJson.d.ts +1 -1
  46. package/esm/typings/src/execution/execution-report/ExecutionReportString.d.ts +1 -1
  47. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +4 -4
  48. package/esm/typings/src/execution/utils/checkExpectations.d.ts +3 -3
  49. package/esm/typings/src/execution/utils/uncertainNumber.d.ts +3 -2
  50. package/esm/typings/src/execution/utils/usageToWorktime.d.ts +1 -1
  51. package/esm/typings/src/formats/_common/{FormatDefinition.d.ts → FormatParser.d.ts} +8 -6
  52. package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +66 -0
  53. package/esm/typings/src/formats/csv/CsvFormatParser.d.ts +17 -0
  54. package/esm/typings/src/formats/csv/CsvSettings.d.ts +2 -2
  55. package/esm/typings/src/formats/csv/utils/csvParse.d.ts +12 -0
  56. package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
  57. package/esm/typings/src/formats/index.d.ts +2 -2
  58. package/esm/typings/src/formats/json/JsonFormatParser.d.ts +19 -0
  59. package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
  60. package/esm/typings/src/formats/json/utils/jsonParse.d.ts +0 -3
  61. package/esm/typings/src/formats/text/{TextFormatDefinition.d.ts → TextFormatParser.d.ts} +7 -7
  62. package/esm/typings/src/formats/xml/XmlFormatParser.d.ts +19 -0
  63. package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
  64. package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +3 -2
  65. package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +16 -7
  66. package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -1
  67. package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +2 -1
  68. package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +2 -2
  69. package/esm/typings/src/formfactors/completion/CompletionFormfactorDefinition.d.ts +29 -0
  70. package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +2 -1
  71. package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +2 -2
  72. package/esm/typings/src/formfactors/index.d.ts +33 -8
  73. package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +4 -2
  74. package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +3 -2
  75. package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +3 -2
  76. package/esm/typings/src/high-level-abstractions/index.d.ts +2 -2
  77. package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +3 -3
  78. package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +3 -3
  79. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +4 -4
  80. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +4 -3
  81. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +18 -5
  82. package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +11 -4
  83. package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +21 -42
  84. package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +9 -2
  85. package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +13 -4
  86. package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +10 -5
  87. package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +11 -3
  88. package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +3 -3
  89. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +5 -5
  90. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +6 -0
  91. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  92. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +5 -1
  93. package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +4 -4
  94. package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  95. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  96. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -1
  97. package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
  98. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  99. package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +2 -2
  100. package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +2 -2
  101. package/esm/typings/src/migrations/migratePipeline.d.ts +9 -0
  102. package/esm/typings/src/other/templates/getBookTemplates.d.ts +2 -2
  103. package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +3 -3
  104. package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +1 -1
  105. package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +1 -1
  106. package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +5 -4
  107. package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +1 -1
  108. package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +10 -7
  109. package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +1 -1
  110. package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +3 -2
  111. package/esm/typings/src/pipeline/PipelineString.d.ts +3 -1
  112. package/esm/typings/src/pipeline/book-notation.d.ts +2 -2
  113. package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +1 -1
  114. package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +2 -2
  115. package/esm/typings/src/prepare/prepareTasks.d.ts +8 -5
  116. package/esm/typings/src/remote-server/openapi.d.ts +1 -1
  117. package/esm/typings/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +1 -1
  118. package/esm/typings/src/remote-server/startRemoteServer.d.ts +1 -1
  119. package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +7 -6
  120. package/esm/typings/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +3 -3
  121. package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -1
  122. package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -1
  123. package/esm/typings/src/scrapers/_common/Converter.d.ts +3 -1
  124. package/esm/typings/src/scrapers/_common/Scraper.d.ts +4 -3
  125. package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +4 -2
  126. package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -2
  127. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -1
  128. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +6 -3
  129. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +3 -5
  130. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
  131. package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +3 -2
  132. package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +8 -5
  133. package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +2 -1
  134. package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +6 -5
  135. package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +3 -1
  136. package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -1
  137. package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +2 -1
  138. package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +4 -1
  139. package/esm/typings/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
  140. package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +2 -1
  141. package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +3 -4
  142. package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -1
  143. package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +5 -1
  144. package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +1 -1
  145. package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -1
  146. package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +12 -5
  147. package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +4 -2
  148. package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +2 -1
  149. package/esm/typings/src/storage/local-storage/getIndexedDbStorage.d.ts +11 -0
  150. package/esm/typings/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +14 -0
  151. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +8 -0
  152. package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +2 -1
  153. package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +2 -1
  154. package/esm/typings/src/types/ModelRequirements.d.ts +2 -2
  155. package/esm/typings/src/types/ModelVariant.d.ts +5 -5
  156. package/esm/typings/src/types/typeAliases.d.ts +22 -19
  157. package/esm/typings/src/utils/$Register.d.ts +8 -7
  158. package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +2 -2
  159. package/esm/typings/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +4 -1
  160. package/esm/typings/src/utils/editable/utils/isFlatPipeline.d.ts +2 -1
  161. package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
  162. package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -1
  163. package/esm/typings/src/utils/expectation-counters/index.d.ts +1 -1
  164. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
  165. package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
  166. package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -2
  167. package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +4 -4
  168. package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +4 -4
  169. package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -3
  170. package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +3 -3
  171. package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +4 -4
  172. package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +3 -3
  173. package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +3 -3
  174. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +4 -1
  175. package/esm/typings/src/utils/normalization/titleToName.d.ts +4 -4
  176. package/esm/typings/src/utils/organization/TODO_USE.d.ts +1 -1
  177. package/esm/typings/src/utils/organization/empty_object.d.ts +2 -2
  178. package/esm/typings/src/utils/organization/just.d.ts +1 -1
  179. package/esm/typings/src/utils/organization/just_empty_object.d.ts +4 -4
  180. package/esm/typings/src/utils/organization/keepUnused.d.ts +1 -1
  181. package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
  182. package/esm/typings/src/utils/removeQuotes.d.ts +2 -2
  183. package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
  184. package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
  185. package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -1
  186. package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +1 -1
  187. package/esm/typings/src/utils/unwrapResult.d.ts +2 -2
  188. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
  189. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
  190. package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +1 -1
  191. package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +1 -1
  192. package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +1 -1
  193. package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -1
  194. package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +1 -1
  195. package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +1 -1
  196. package/esm/typings/src/version.d.ts +2 -1
  197. package/esm/typings/src/wizzard/wizzard.d.ts +1 -1
  198. package/package.json +13 -1
  199. package/umd/index.umd.js +585 -404
  200. package/umd/index.umd.js.map +1 -1
  201. package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +0 -31
  202. package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +0 -17
  203. package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +0 -19
  204. package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +0 -19
  205. /package/esm/typings/src/llm-providers/{multiple → _multiple}/MultipleLlmExecutionTools.d.ts +0 -0
  206. /package/esm/typings/src/llm-providers/{multiple → _multiple}/joinLlmExecutionTools.d.ts +0 -0
  207. /package/esm/typings/src/llm-providers/{multiple → _multiple}/playground/playground.d.ts +0 -0
@@ -19,8 +19,8 @@ export type CodeBlock = {
19
19
  /**
20
20
  * Extracts all code blocks from markdown.
21
21
  *
22
- * Note: There are multiple simmilar function:
23
- * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
22
+ * Note: There are multiple similar functions:
23
+ * - `extractBlock` just extracts the content of the code block which is also used as built-in function for postprocessing
24
24
  * - `extractJsonBlock` extracts exactly one valid JSON code block
25
25
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
26
26
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
@@ -9,7 +9,7 @@ import type { string_markdown_text } from '../../types/typeAliases';
9
9
  * Note: It can not work with html syntax and comments
10
10
  *
11
11
  * @param markdown any valid markdown
12
- * @returns @@@
12
+ * @returns An array of strings, each representing an individual list item found in the markdown
13
13
  * @public exported from `@promptbook/markdown-utils`
14
14
  */
15
15
  export declare function extractAllListItemsFromMarkdown(markdown: string_markdown): string_markdown_text[];
@@ -5,8 +5,8 @@ import type { CodeBlock } from './extractAllBlocksFromMarkdown';
5
5
  *
6
6
  * - When there are multiple or no code blocks the function throws a `ParseError`
7
7
  *
8
- * Note: There are multiple simmilar function:
9
- * - `extractBlock` just extracts the content of the code block which is also used as build-in function for postprocessing
8
+ * Note: There are multiple similar functions:
9
+ * - `extractBlock` just extracts the content of the code block which is also used as built-in function for postprocessing
10
10
  * - `extractJsonBlock` extracts exactly one valid JSON code block
11
11
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
12
12
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @@@
2
+ * Converts a name string into a URI-compatible format.
3
3
  *
4
- * @param name @@@
5
- * @returns @@@
6
- * @example @@@
4
+ * @param name The string to be converted to a URI-compatible format.
5
+ * @returns A URI-compatible string derived from the input name.
6
+ * @example 'Hello World' -> 'hello-world'
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
9
  export declare function nameToUriPart(name: string): string;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @@@
2
+ * Converts a given name into URI-compatible parts.
3
3
  *
4
- * @param name @@@
5
- * @returns @@@
6
- * @example @@@
4
+ * @param name The name to be converted into URI parts.
5
+ * @returns An array of URI-compatible parts derived from the name.
6
+ * @example 'Example Name' -> ['example', 'name']
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
9
  export declare function nameToUriParts(name: string): string[];
@@ -7,10 +7,10 @@
7
7
  */
8
8
  export type string_kebab_case = string;
9
9
  /**
10
- * @@@
10
+ * Converts a given text to kebab-case format.
11
11
  *
12
- * @param text @@@
13
- * @returns @@@
12
+ * @param text The text to be converted.
13
+ * @returns The kebab-case formatted string.
14
14
  * @example 'hello-world'
15
15
  * @example 'i-love-promptbook'
16
16
  * @public exported from `@promptbook/utils`
@@ -7,10 +7,10 @@
7
7
  */
8
8
  export type string_SCREAMING_CASE = string;
9
9
  /**
10
- * @@@
10
+ * Normalizes a text string to SCREAMING_CASE (all uppercase with underscores).
11
11
  *
12
- * @param text @@@
13
- * @returns @@@
12
+ * @param text The text string to be converted to SCREAMING_CASE format.
13
+ * @returns The normalized text in SCREAMING_CASE format.
14
14
  * @example 'HELLO_WORLD'
15
15
  * @example 'I_LOVE_PROMPTBOOK'
16
16
  * @public exported from `@promptbook/utils`
@@ -7,11 +7,11 @@
7
7
  */
8
8
  export type string_camelCase = string;
9
9
  /**
10
- * @@@
10
+ * Normalizes a given text to camelCase format.
11
11
  *
12
- * @param text @@@
13
- * @param _isFirstLetterCapital @@@
14
- * @returns @@@
12
+ * @param text The text to be normalized.
13
+ * @param _isFirstLetterCapital Whether the first letter should be capitalized.
14
+ * @returns The camelCase formatted string.
15
15
  * @example 'helloWorld'
16
16
  * @example 'iLovePromptbook'
17
17
  * @public exported from `@promptbook/utils`
@@ -6,10 +6,10 @@
6
6
  */
7
7
  export type string_snake_case = string;
8
8
  /**
9
- * @@@
9
+ * Normalizes a text string to snake_case format.
10
10
  *
11
- * @param text @@@
12
- * @returns @@@
11
+ * @param text The text string to be converted to snake_case format.
12
+ * @returns The normalized text in snake_case format.
13
13
  * @example 'hello_world'
14
14
  * @example 'i_love_promptbook'
15
15
  * @public exported from `@promptbook/utils`
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @@@
2
+ * Removes diacritic marks (accents) from characters in a string.
3
3
  *
4
- * @param input @@@
5
- * @returns @@@
4
+ * @param input The string containing diacritics to be normalized.
5
+ * @returns The string with diacritics removed or normalized.
6
6
  * @public exported from `@promptbook/utils`
7
7
  */
8
8
  export declare function removeDiacritics(input: string): string;
@@ -1,6 +1,6 @@
1
1
  import type { Keywords } from './IKeywords';
2
2
  /**
3
- * @@@
3
+ * Searches set of keywords for a specific keyword
4
4
  *
5
5
  * @param haystack
6
6
  * @param needle
@@ -8,3 +8,6 @@ import type { Keywords } from './IKeywords';
8
8
  * @public exported from `@promptbook/utils`
9
9
  */
10
10
  export declare function searchKeywords(haystack: Keywords, needle: Keywords): boolean;
11
+ /**
12
+ * TODO: Rename to `isKeywordInKeywords`
13
+ */
@@ -1,9 +1,9 @@
1
1
  /**
2
- * @@@
2
+ * Converts a title string into a normalized name.
3
3
  *
4
- * @param value @@@
5
- * @returns @@@
6
- * @example @@@
4
+ * @param value The title string to be converted to a name.
5
+ * @returns A normalized name derived from the input title.
6
+ * @example 'Hello World!' -> 'hello-world'
7
7
  * @public exported from `@promptbook/utils`
8
8
  */
9
9
  export declare function titleToName(value: string): string;
@@ -3,7 +3,7 @@ import type { really_any } from './really_any';
3
3
  * Just marks a place of place where should be something implemented
4
4
  * No side effects.
5
5
  *
6
- * Note: It can be usefull suppressing eslint errors of unused variables
6
+ * Note: It can be useful suppressing eslint errors of unused variables
7
7
  *
8
8
  * @param value any values
9
9
  * @returns void
@@ -2,8 +2,8 @@
2
2
  * Organizational helper to better mark the place where to really use empty object `{}`
3
3
  *
4
4
  * Note: There are 2 similar types>
5
- * - `empty_object` @@@
6
- * - `just_empty_object` @@@
5
+ * - `empty_object` Type used for empty data objects allowing for potential future extensions
6
+ * - `just_empty_object` Type used when an object must remain permanently empty
7
7
  *
8
8
  * @private within the repository
9
9
  */
@@ -2,7 +2,7 @@
2
2
  * Returns the same value that is passed as argument.
3
3
  * No side effects.
4
4
  *
5
- * Note: It can be usefull for:
5
+ * Note: It can be useful for:
6
6
  *
7
7
  * 1) Leveling indentation
8
8
  * 2) Putting always-true or always-false conditions without getting eslint errors
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Organizational helper to better @@@@
2
+ * Organizational helper to better distinguish different empty object use cases.
3
3
  *
4
- * Note: There are 2 similar types>
5
- * - `empty_object` @@@
6
- * - `just_empty_object` @@@
4
+ * Note: There are 2 similar types:
5
+ * - `empty_object` Type used for empty data objects with potential extensions
6
+ * - `just_empty_object` Type used specifically for objects that must remain empty
7
7
  *
8
8
  * Note: In most cases, you should use `empty_object`
9
9
  *
@@ -3,7 +3,7 @@ import type { really_any } from './really_any';
3
3
  * Just says that the variable is not used but should be kept
4
4
  * No side effects.
5
5
  *
6
- * Note: It can be usefull for:
6
+ * Note: It can be useful for:
7
7
  *
8
8
  * 1) Suppressing eager optimization of unused imports
9
9
  * 2) Suppressing eslint errors of unused variables in the tests
@@ -1,26 +1,26 @@
1
1
  import type { string_parameter_name } from '../../types/typeAliases';
2
2
  import type { string_parameter_value } from '../../types/typeAliases';
3
3
  /**
4
- * @@@
4
+ * Options for mapping available parameters to expected parameters in a pipeline task.
5
5
  */
6
6
  type MakeapAvailableToExpectedParametersOptions = {
7
7
  /**
8
- * @@@
8
+ * The set of expected parameter names (keys) for the task, all values are null.
9
9
  */
10
10
  readonly expectedParameters: Readonly<Record<string_parameter_name, null>>;
11
11
  /**
12
- * @@@
12
+ * The set of available parameters (name-value pairs) to map to the expected parameters.
13
13
  */
14
14
  readonly availableParameters: Readonly<Record<string_parameter_name, string_parameter_value>>;
15
15
  };
16
16
  /**
17
- * Maps available parameters to expected parameters
17
+ * Maps available parameters to expected parameters for a pipeline task.
18
18
  *
19
19
  * The strategy is:
20
- * 1) @@@
21
- * 2) @@@
20
+ * 1) First, match parameters by name where both available and expected.
21
+ * 2) Then, if there are unmatched expected and available parameters, map them by order.
22
22
  *
23
- * @throws {PipelineExecutionError} @@@
23
+ * @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
24
24
  * @private within the repository used in `createPipelineExecutor`
25
25
  */
26
26
  export declare function mapAvailableToExpectedParameters(options: MakeapAvailableToExpectedParametersOptions): Readonly<Record<string_parameter_name, string_parameter_value>>;
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Removes quotes from a string
3
3
  *
4
- * Tip: This is very usefull for post-processing of the result of the LLM model
4
+ * Tip: This is very useful for post-processing of the result of the LLM model
5
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:
6
+ * Note: There are two similar functions:
7
7
  * - `removeQuotes` which removes only bounding quotes
8
8
  * - `unwrapResult` which removes whole introduce sentence
9
9
  *
@@ -1,10 +1,11 @@
1
1
  import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
2
2
  /**
3
- * @@@
3
+ * Creates a deep clone of a PipelineJson object, copying all properties explicitly.
4
4
  *
5
- * Note: It is usefull @@@
5
+ * Note: It is useful for ensuring that modifications to the returned pipeline do not affect the original.
6
6
  *
7
- * @param pipeline
7
+ * @param pipeline The pipeline to clone.
8
+ * @returns A new PipelineJson object with the same properties as the input.
8
9
  * @public exported from `@promptbook/utils`
9
10
  */
10
11
  export declare function clonePipeline(pipeline: PipelineJson): PipelineJson;
@@ -1,7 +1,11 @@
1
1
  import type { WritableDeep } from 'type-fest';
2
2
  /**
3
- * @@@
3
+ * Creates a deep clone of the given object
4
4
  *
5
+ * Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
6
+ *
7
+ * @param objectValue The object to clone.
8
+ * @returns A deep, writable clone of the input object.
5
9
  * @public exported from `@promptbook/utils`
6
10
  */
7
11
  export declare function deepClone<TObject>(objectValue: TObject): WritableDeep<TObject>;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Function trimCodeBlock will trim starting and ending code block from the string if it is present.
3
3
  *
4
- * Note: This is usefull for post-processing of the result of the chat LLM model
4
+ * Note: This is useful for post-processing of the result of the chat LLM model
5
5
  * when the model wraps the result in the (markdown) code block.
6
6
  *
7
7
  * @public exported from `@promptbook/utils`
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
3
3
  *
4
- * Note: This is usefull for post-processing of the result of the completion LLM model
4
+ * Note: This is useful for post-processing of the result of the completion LLM model
5
5
  * if you want to start code block in the prompt but you don't want to end it in the result.
6
6
  *
7
7
  * @public exported from `@promptbook/utils`
@@ -20,9 +20,9 @@ type UnwrapResultOptions = {
20
20
  /**
21
21
  * Removes quotes and optional introduce text from a string
22
22
  *
23
- * Tip: This is very usefull for post-processing of the result of the LLM model
23
+ * Tip: This is very useful for post-processing of the result of the LLM model
24
24
  * Note: This function trims the text and removes whole introduce sentence if it is present
25
- * Note: There are two simmilar functions:
25
+ * Note: There are two similar functions:
26
26
  * - `removeQuotes` which removes only bounding quotes
27
27
  * - `unwrapResult` which removes whole introduce sentence
28
28
  *
@@ -1,10 +1,10 @@
1
1
  import type { string_javascript_name } from '../../../types/typeAliases';
2
2
  import type { really_unknown } from '../../organization/really_unknown';
3
3
  /**
4
- * @@@
4
+ * Checks if the given value is a valid JavaScript identifier name.
5
5
  *
6
- * @param javascriptName @@@
7
- * @returns @@@
6
+ * @param javascriptName The value to check for JavaScript identifier validity.
7
+ * @returns `true` if the value is a valid JavaScript name, false otherwise.
8
8
  * @public exported from `@promptbook/utils`
9
9
  */
10
10
  export declare function isValidJavascriptName(javascriptName: really_unknown): javascriptName is string_javascript_name;
@@ -1,10 +1,11 @@
1
1
  import type { string_parameter_name } from '../../../types/typeAliases';
2
2
  /**
3
- * Function `validateParameterName` will @@@
3
+ * Function `validateParameterName` will normalize and validate a parameter name for use in pipelines.
4
+ * It removes diacritics, emojis, and quotes, normalizes to camelCase, and checks for reserved names and invalid characters.
4
5
  *
5
- * @param parameterName @@@
6
- * @returns @@@
7
- * @throws {ParseError} @@@
6
+ * @param parameterName The parameter name to validate and normalize.
7
+ * @returns The validated and normalized parameter name.
8
+ * @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
8
9
  * @private within the repository
9
10
  */
10
11
  export declare function validateParameterName(parameterName: string): string_parameter_name;
@@ -6,7 +6,7 @@ import type { really_unknown } from '../../organization/really_unknown';
6
6
  *
7
7
  * @see https://www.npmjs.com/package/promptbook?activeTab=versions
8
8
  * Note: When you are using for example promptbook 2.0.0 and there already is promptbook 3.0.0 it don`t know about it.
9
- * Note: There are two simmilar functions:
9
+ * Note: There are two similar functions:
10
10
  * - `isValidSemanticVersion` which tests any semantic version
11
11
  * - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
12
12
  *
@@ -3,7 +3,7 @@ import type { really_unknown } from '../../organization/really_unknown';
3
3
  /**
4
4
  * Tests if given string is valid semantic version
5
5
  *
6
- * Note: There are two simmilar functions:
6
+ * Note: There are two similar functions:
7
7
  * - `isValidSemanticVersion` which tests any semantic version
8
8
  * - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
9
9
  *
@@ -2,7 +2,7 @@ import type { string_hostname } from '../../../types/typeAliases';
2
2
  /**
3
3
  * Checks if an URL is reserved for private networks or localhost.
4
4
  *
5
- * Note: There are two simmilar functions:
5
+ * Note: There are two similar functions:
6
6
  * - `isUrlOnPrivateNetwork` which tests full URL
7
7
  * - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
8
8
  *
@@ -2,7 +2,7 @@ import type { string_url } from '../../../types/typeAliases';
2
2
  /**
3
3
  * Checks if an IP address or hostname is reserved for private networks or localhost.
4
4
  *
5
- * Note: There are two simmilar functions:
5
+ * Note: There are two similar functions:
6
6
  * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
7
7
  * - `isHostnameOnPrivateNetwork` which tests just hostname
8
8
  *
@@ -3,7 +3,7 @@ import type { really_unknown } from '../../organization/really_unknown';
3
3
  /**
4
4
  * Tests if given string is valid pipeline URL URL.
5
5
  *
6
- * Note: There are two simmilar functions:
6
+ * Note: There are two similar functions:
7
7
  * - `isValidUrl` which tests any URL
8
8
  * - `isValidPipelineUrl` *(this one)* which tests just pipeline URL
9
9
  *
@@ -4,7 +4,7 @@ import type { really_unknown } from '../../organization/really_unknown';
4
4
  * Tests if given string is valid URL.
5
5
  *
6
6
  * Note: Dataurl are considered perfectly valid.
7
- * Note: There are two simmilar functions:
7
+ * Note: There are two similar functions:
8
8
  * - `isValidUrl` which tests any URL
9
9
  * - `isValidPipelineUrl` *(this one)* which tests just promptbook URL
10
10
  *
@@ -14,7 +14,8 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
14
14
  */
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
- * @@@
17
+ * Represents the version string of the Promptbook engine.
18
+ * It follows semantic versioning (e.g., `0.92.0-35`).
18
19
  *
19
20
  * @generated
20
21
  */
@@ -24,7 +24,7 @@ declare class Wizzard {
24
24
  * 2) As a URL https://promptbook.studio/hejny/write-cv.book fetched from the internet
25
25
  * 3) As a string
26
26
  *
27
- * Note: This works simmilar to the `ptbk run` command
27
+ * Note: This works similar to the `ptbk run` command
28
28
  */
29
29
  execute(book: string_pipeline_url | string_filename | PipelineString, inputParameters: InputParameters): Promise<{
30
30
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/markdown-utils",
3
- "version": "0.92.0-8",
3
+ "version": "0.92.0",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -47,6 +47,18 @@
47
47
  "node": ">=16.0.0",
48
48
  "npm": ">=8.0.0"
49
49
  },
50
+ "cspell": {
51
+ "version": "0.2",
52
+ "language": "en",
53
+ "ignorePaths": [
54
+ "node_modules",
55
+ ".next",
56
+ "coverage",
57
+ "dist",
58
+ ".git"
59
+ ],
60
+ "words": []
61
+ },
50
62
  "main": "./umd/index.umd.js",
51
63
  "module": "./esm/index.es.js",
52
64
  "typings": "./esm/typings/src/_packages/markdown-utils.index.d.ts",