@promptbook/pdf 0.75.2 → 0.75.3

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.
package/esm/index.es.js CHANGED
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  *
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- var PROMPTBOOK_ENGINE_VERSION = '0.75.1';
23
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2866,16 +2866,16 @@ function $registeredScrapersMessage() {
2866
2866
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
2867
2867
  */
2868
2868
  var all = [];
2869
- var _loop_1 = function (packageName, className) {
2869
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
2870
2870
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
2871
2871
  return "continue";
2872
2872
  }
2873
- all.push({ packageName: packageName, className: className });
2873
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
2874
2874
  };
2875
2875
  try {
2876
2876
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
2877
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
2878
- _loop_1(packageName, className);
2877
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
2878
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
2879
2879
  }
2880
2880
  }
2881
2881
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -2885,16 +2885,16 @@ function $registeredScrapersMessage() {
2885
2885
  }
2886
2886
  finally { if (e_1) throw e_1.error; }
2887
2887
  }
2888
- var _loop_2 = function (packageName, className) {
2888
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
2889
2889
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
2890
2890
  return "continue";
2891
2891
  }
2892
- all.push({ packageName: packageName, className: className });
2892
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
2893
2893
  };
2894
2894
  try {
2895
2895
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
2896
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
2897
- _loop_2(packageName, className);
2896
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
2897
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
2898
2898
  }
2899
2899
  }
2900
2900
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -2924,29 +2924,33 @@ function $registeredScrapersMessage() {
2924
2924
  }
2925
2925
  return spaceTrim$1(function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
2926
2926
  .map(function (_a, i) {
2927
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
2927
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
2928
2928
  var more;
2929
+ // TODO: Use documentationUrl
2929
2930
  if (just(false)) {
2930
2931
  more = '';
2931
2932
  }
2932
2933
  else if (!isMetadataAviailable && !isInstalled) {
2933
2934
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
2934
- more = "(not installed and no metadata, looks like a unexpected behavior)";
2935
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
2935
2936
  }
2936
2937
  else if (isMetadataAviailable && !isInstalled) {
2937
2938
  // TODO: [�][�]
2938
- more = "(not installed)";
2939
+ more = "*(not installed)*";
2939
2940
  }
2940
2941
  else if (!isMetadataAviailable && isInstalled) {
2941
- more = "(no metadata, looks like a unexpected behavior)";
2942
+ more = "*(no metadata, looks like a unexpected behavior)*";
2942
2943
  }
2943
2944
  else if (isMetadataAviailable && isInstalled) {
2944
2945
  more = "(installed)";
2945
2946
  }
2946
2947
  else {
2947
- more = "(unknown state, looks like a unexpected behavior)";
2948
+ more = "*(unknown state, looks like a unexpected behavior)*";
2948
2949
  }
2949
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
2950
+ if (!isAvilableInBrowser) {
2951
+ more += " *(not available in browser)*";
2952
+ }
2953
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
2950
2954
  })
2951
2955
  .join('\n')), "\n "); });
2952
2956
  }
@@ -3243,7 +3247,10 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
3243
3247
  return [7 /*endfinally*/];
3244
3248
  case 9:
3245
3249
  if (partialPieces === null) {
3246
- throw new KnowledgeScrapeError(spaceTrim$1(function (block) { return "\n Cannot scrape knowledge from source: ".concat(knowledgeSource.sourceContent, "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3250
+ throw new KnowledgeScrapeError(spaceTrim$1(function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
3251
+ .split('\n')
3252
+ .map(function (line) { return "> ".concat(line); })
3253
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3247
3254
  }
3248
3255
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
3249
3256
  {