@promptbook/website-crawler 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
@@ -24,7 +24,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
24
24
  *
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- var PROMPTBOOK_ENGINE_VERSION = '0.75.0';
27
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1847,7 +1847,6 @@ function validatePipelineCore(pipeline) {
1847
1847
  while (unresovedTasks.length > 0) {
1848
1848
  _loop_3();
1849
1849
  }
1850
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
1851
1850
  }
1852
1851
  /**
1853
1852
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -2979,16 +2978,16 @@ function $registeredScrapersMessage() {
2979
2978
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
2980
2979
  */
2981
2980
  var all = [];
2982
- var _loop_1 = function (packageName, className) {
2981
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
2983
2982
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
2984
2983
  return "continue";
2985
2984
  }
2986
- all.push({ packageName: packageName, className: className });
2985
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
2987
2986
  };
2988
2987
  try {
2989
2988
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
2990
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
2991
- _loop_1(packageName, className);
2989
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
2990
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
2992
2991
  }
2993
2992
  }
2994
2993
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -2998,16 +2997,16 @@ function $registeredScrapersMessage() {
2998
2997
  }
2999
2998
  finally { if (e_1) throw e_1.error; }
3000
2999
  }
3001
- var _loop_2 = function (packageName, className) {
3000
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
3002
3001
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
3003
3002
  return "continue";
3004
3003
  }
3005
- all.push({ packageName: packageName, className: className });
3004
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3006
3005
  };
3007
3006
  try {
3008
3007
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
3009
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
3010
- _loop_2(packageName, className);
3008
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
3009
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3011
3010
  }
3012
3011
  }
3013
3012
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -3037,29 +3036,33 @@ function $registeredScrapersMessage() {
3037
3036
  }
3038
3037
  return spaceTrim$1(function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
3039
3038
  .map(function (_a, i) {
3040
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
3039
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
3041
3040
  var more;
3041
+ // TODO: Use documentationUrl
3042
3042
  if (just(false)) {
3043
3043
  more = '';
3044
3044
  }
3045
3045
  else if (!isMetadataAviailable && !isInstalled) {
3046
3046
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
3047
- more = "(not installed and no metadata, looks like a unexpected behavior)";
3047
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
3048
3048
  }
3049
3049
  else if (isMetadataAviailable && !isInstalled) {
3050
3050
  // TODO: [�][�]
3051
- more = "(not installed)";
3051
+ more = "*(not installed)*";
3052
3052
  }
3053
3053
  else if (!isMetadataAviailable && isInstalled) {
3054
- more = "(no metadata, looks like a unexpected behavior)";
3054
+ more = "*(no metadata, looks like a unexpected behavior)*";
3055
3055
  }
3056
3056
  else if (isMetadataAviailable && isInstalled) {
3057
3057
  more = "(installed)";
3058
3058
  }
3059
3059
  else {
3060
- more = "(unknown state, looks like a unexpected behavior)";
3060
+ more = "*(unknown state, looks like a unexpected behavior)*";
3061
3061
  }
3062
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
3062
+ if (!isAvilableInBrowser) {
3063
+ more += " *(not available in browser)*";
3064
+ }
3065
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
3063
3066
  })
3064
3067
  .join('\n')), "\n "); });
3065
3068
  }
@@ -3356,7 +3359,10 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
3356
3359
  return [7 /*endfinally*/];
3357
3360
  case 9:
3358
3361
  if (partialPieces === null) {
3359
- 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 "); }));
3362
+ throw new KnowledgeScrapeError(spaceTrim$1(function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
3363
+ .split('\n')
3364
+ .map(function (line) { return "> ".concat(line); })
3365
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3360
3366
  }
3361
3367
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
3362
3368
  {