@promptbook/markdown-utils 0.71.0-16 → 0.71.0-18

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 (37) hide show
  1. package/README.md +5 -1
  2. package/esm/index.es.js +6 -9
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/core.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/node.index.d.ts +2 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +8 -8
  7. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  8. package/esm/typings/src/execution/Executables.d.ts +18 -0
  9. package/esm/typings/src/execution/ExecutionTools.d.ts +9 -3
  10. package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +11 -3
  11. package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +1 -2
  12. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +4 -4
  13. package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +3 -3
  14. package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +0 -19
  15. package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -1
  16. package/esm/typings/src/scrapers/_common/register/$provideExecutablesForNode.d.ts +12 -0
  17. package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +1 -1
  18. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -2
  19. package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +1 -1
  20. package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +2 -2
  21. package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +1 -1
  22. package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +5 -2
  23. package/esm/typings/src/scrapers/website/utils/createShowdownConverter.d.ts +7 -0
  24. package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
  25. package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -2
  26. package/esm/typings/src/utils/execCommand/{IExecCommandOptions.d.ts → ExecCommandOptions.d.ts} +2 -6
  27. package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.d.ts +3 -3
  28. package/esm/typings/src/utils/normalization/IKeywords.d.ts +2 -2
  29. package/esm/typings/src/utils/normalization/parseKeywords.d.ts +2 -2
  30. package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +2 -2
  31. package/esm/typings/src/utils/normalization/searchKeywords.d.ts +2 -2
  32. package/esm/typings/src/utils/unwrapResult.d.ts +4 -4
  33. package/package.json +3 -2
  34. package/umd/index.umd.js +10 -12
  35. package/umd/index.umd.js.map +1 -1
  36. package/esm/typings/src/scrapers/website/utils/markdownConverter.d.ts +0 -12
  37. /package/esm/typings/src/scrapers/website/utils/{markdownConverter.test.d.ts → createShowdownConverter.test.d.ts} +0 -0
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Promptbook logo - cube with letters P and B](./other/design/logo-h1.png) Promptbook
4
4
 
5
- Supercharge your use of large language models
5
+ Build responsible, controlled and transparent applications on top of LLM models!
6
6
 
7
7
 
8
8
 
@@ -26,6 +26,10 @@ Supercharge your use of large language models
26
26
 
27
27
 
28
28
 
29
+ <blockquote style="color: #ff8811">
30
+ <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
31
+ </blockquote>
32
+
29
33
  ## 📦 Package `@promptbook/markdown-utils`
30
34
 
31
35
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -3,7 +3,6 @@ import { format } from 'prettier';
3
3
  import parserHtml from 'prettier/parser-html';
4
4
  import { basename, join } from 'path';
5
5
  import { forTime } from 'waitasecond';
6
- import { readFile } from 'fs/promises';
7
6
  import { SHA256 } from 'crypto-js';
8
7
  import hexEncoder from 'crypto-js/enc-hex';
9
8
  import { lookup } from 'mime-types';
@@ -13,7 +12,7 @@ import { unparse, parse } from 'papaparse';
13
12
  /**
14
13
  * The version of the Promptbook library
15
14
  */
16
- var PROMPTBOOK_VERSION = '0.71.0-15';
15
+ var PROMPTBOOK_VERSION = '0.71.0-17';
17
16
  // TODO: [main] !!!! List here all the versions and annotate + put into script
18
17
 
19
18
  /*! *****************************************************************************
@@ -2432,8 +2431,7 @@ function countTotalUsage(llmTools) {
2432
2431
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
2433
2432
  *
2434
2433
  * Note: Internal utility of `joinLlmExecutionTools` but exposed type
2435
- * @public exported from `@promptbook/types`
2436
- * TODO: !!!!!! Export as runtime class not just type
2434
+ * @public exported from `@promptbook/core`
2437
2435
  */
2438
2436
  var MultipleLlmExecutionTools = /** @class */ (function () {
2439
2437
  /**
@@ -2987,7 +2985,7 @@ var $scrapersRegister = new $Register('scraper_constructors');
2987
2985
  * TODO: [®] DRY Register logic
2988
2986
  */
2989
2987
 
2990
- // TODO: !!!!!! Maybe delete this function
2988
+ // TODO: !!!!!!last - Maybe delete this function
2991
2989
  /**
2992
2990
  * Creates a message with all registered scrapers
2993
2991
  *
@@ -3095,7 +3093,6 @@ function $registeredScrapersMessage() {
3095
3093
  * @private within the repository
3096
3094
  */
3097
3095
  function sourceContentToName(sourceContent) {
3098
- // TODO: !!!!!! Better name for source than gibberish hash
3099
3096
  var hash = SHA256(hexEncoder.parse(JSON.stringify(sourceContent)))
3100
3097
  // <- TODO: [🥬] Encapsulate sha256 to some private utility function
3101
3098
  .toString( /* hex */)
@@ -3272,7 +3269,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
3272
3269
  content = _a.sent();
3273
3270
  return [2 /*return*/, new Blob([
3274
3271
  content,
3275
- // <- TODO: !!!!!! Maybe not working
3272
+ // <- TODO: !!!!!! Test that this is working
3276
3273
  ], { type: mimeType_1 })];
3277
3274
  }
3278
3275
  });
@@ -3285,7 +3282,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
3285
3282
  switch (_c.label) {
3286
3283
  case 0:
3287
3284
  _b = (_a = JSON).parse;
3288
- return [4 /*yield*/, readFile(filename_1, 'utf-8')];
3285
+ return [4 /*yield*/, tools.fs.readFile(filename_1, 'utf-8')];
3289
3286
  case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
3290
3287
  }
3291
3288
  });
@@ -3295,7 +3292,7 @@ function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
3295
3292
  return __awaiter(this, void 0, void 0, function () {
3296
3293
  return __generator(this, function (_a) {
3297
3294
  switch (_a.label) {
3298
- case 0: return [4 /*yield*/, readFile(filename_1, 'utf-8')];
3295
+ case 0: return [4 /*yield*/, tools.fs.readFile(filename_1, 'utf-8')];
3299
3296
  case 1: return [2 /*return*/, _a.sent()];
3300
3297
  }
3301
3298
  });