@promptbook/pdf 0.75.1 → 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.0';
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
@@ -1163,7 +1163,6 @@ function validatePipelineCore(pipeline) {
1163
1163
  while (unresovedTasks.length > 0) {
1164
1164
  _loop_3();
1165
1165
  }
1166
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
1167
1166
  }
1168
1167
  /**
1169
1168
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -2867,16 +2866,16 @@ function $registeredScrapersMessage() {
2867
2866
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
2868
2867
  */
2869
2868
  var all = [];
2870
- var _loop_1 = function (packageName, className) {
2869
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
2871
2870
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
2872
2871
  return "continue";
2873
2872
  }
2874
- all.push({ packageName: packageName, className: className });
2873
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
2875
2874
  };
2876
2875
  try {
2877
2876
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
2878
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
2879
- _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);
2880
2879
  }
2881
2880
  }
2882
2881
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -2886,16 +2885,16 @@ function $registeredScrapersMessage() {
2886
2885
  }
2887
2886
  finally { if (e_1) throw e_1.error; }
2888
2887
  }
2889
- var _loop_2 = function (packageName, className) {
2888
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
2890
2889
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
2891
2890
  return "continue";
2892
2891
  }
2893
- all.push({ packageName: packageName, className: className });
2892
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
2894
2893
  };
2895
2894
  try {
2896
2895
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
2897
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
2898
- _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);
2899
2898
  }
2900
2899
  }
2901
2900
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -2925,29 +2924,33 @@ function $registeredScrapersMessage() {
2925
2924
  }
2926
2925
  return spaceTrim$1(function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
2927
2926
  .map(function (_a, i) {
2928
- 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;
2929
2928
  var more;
2929
+ // TODO: Use documentationUrl
2930
2930
  if (just(false)) {
2931
2931
  more = '';
2932
2932
  }
2933
2933
  else if (!isMetadataAviailable && !isInstalled) {
2934
2934
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
2935
- more = "(not installed and no metadata, looks like a unexpected behavior)";
2935
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
2936
2936
  }
2937
2937
  else if (isMetadataAviailable && !isInstalled) {
2938
2938
  // TODO: [�][�]
2939
- more = "(not installed)";
2939
+ more = "*(not installed)*";
2940
2940
  }
2941
2941
  else if (!isMetadataAviailable && isInstalled) {
2942
- more = "(no metadata, looks like a unexpected behavior)";
2942
+ more = "*(no metadata, looks like a unexpected behavior)*";
2943
2943
  }
2944
2944
  else if (isMetadataAviailable && isInstalled) {
2945
2945
  more = "(installed)";
2946
2946
  }
2947
2947
  else {
2948
- more = "(unknown state, looks like a unexpected behavior)";
2948
+ more = "*(unknown state, looks like a unexpected behavior)*";
2949
2949
  }
2950
- 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);
2951
2954
  })
2952
2955
  .join('\n')), "\n "); });
2953
2956
  }
@@ -3244,7 +3247,10 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
3244
3247
  return [7 /*endfinally*/];
3245
3248
  case 9:
3246
3249
  if (partialPieces === null) {
3247
- 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 "); }));
3248
3254
  }
3249
3255
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
3250
3256
  {