@promptbook/cli 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
@@ -37,7 +37,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
37
37
  *
38
38
  * @see https://github.com/webgptorg/promptbook
39
39
  */
40
- var PROMPTBOOK_ENGINE_VERSION = '0.75.0';
40
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
41
41
  /**
42
42
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
43
43
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -2002,7 +2002,6 @@ function validatePipelineCore(pipeline) {
2002
2002
  while (unresovedTasks.length > 0) {
2003
2003
  _loop_3();
2004
2004
  }
2005
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
2006
2005
  }
2007
2006
  /**
2008
2007
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -4962,16 +4961,16 @@ function $registeredScrapersMessage() {
4962
4961
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
4963
4962
  */
4964
4963
  var all = [];
4965
- var _loop_1 = function (packageName, className) {
4964
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4966
4965
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4967
4966
  return "continue";
4968
4967
  }
4969
- all.push({ packageName: packageName, className: className });
4968
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
4970
4969
  };
4971
4970
  try {
4972
4971
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
4973
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
4974
- _loop_1(packageName, className);
4972
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
4973
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
4975
4974
  }
4976
4975
  }
4977
4976
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -4981,16 +4980,16 @@ function $registeredScrapersMessage() {
4981
4980
  }
4982
4981
  finally { if (e_1) throw e_1.error; }
4983
4982
  }
4984
- var _loop_2 = function (packageName, className) {
4983
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4985
4984
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4986
4985
  return "continue";
4987
4986
  }
4988
- all.push({ packageName: packageName, className: className });
4987
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
4989
4988
  };
4990
4989
  try {
4991
4990
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
4992
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
4993
- _loop_2(packageName, className);
4991
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
4992
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
4994
4993
  }
4995
4994
  }
4996
4995
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -5020,29 +5019,33 @@ function $registeredScrapersMessage() {
5020
5019
  }
5021
5020
  return spaceTrim$1(function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
5022
5021
  .map(function (_a, i) {
5023
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
5022
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
5024
5023
  var more;
5024
+ // TODO: Use documentationUrl
5025
5025
  if (just(false)) {
5026
5026
  more = '';
5027
5027
  }
5028
5028
  else if (!isMetadataAviailable && !isInstalled) {
5029
5029
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
5030
- more = "(not installed and no metadata, looks like a unexpected behavior)";
5030
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
5031
5031
  }
5032
5032
  else if (isMetadataAviailable && !isInstalled) {
5033
5033
  // TODO: [�][�]
5034
- more = "(not installed)";
5034
+ more = "*(not installed)*";
5035
5035
  }
5036
5036
  else if (!isMetadataAviailable && isInstalled) {
5037
- more = "(no metadata, looks like a unexpected behavior)";
5037
+ more = "*(no metadata, looks like a unexpected behavior)*";
5038
5038
  }
5039
5039
  else if (isMetadataAviailable && isInstalled) {
5040
5040
  more = "(installed)";
5041
5041
  }
5042
5042
  else {
5043
- more = "(unknown state, looks like a unexpected behavior)";
5043
+ more = "*(unknown state, looks like a unexpected behavior)*";
5044
5044
  }
5045
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
5045
+ if (!isAvilableInBrowser) {
5046
+ more += " *(not available in browser)*";
5047
+ }
5048
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
5046
5049
  })
5047
5050
  .join('\n')), "\n "); });
5048
5051
  }
@@ -5427,7 +5430,10 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
5427
5430
  return [7 /*endfinally*/];
5428
5431
  case 9:
5429
5432
  if (partialPieces === null) {
5430
- 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 "); }));
5433
+ throw new KnowledgeScrapeError(spaceTrim$1(function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
5434
+ .split('\n')
5435
+ .map(function (line) { return "> ".concat(line); })
5436
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
5431
5437
  }
5432
5438
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
5433
5439
  {