@promptbook/cli 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.75.2",
3
+ "version": "0.75.3",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "--note-0": " <- [🐊]",
6
6
  "private": false,
package/umd/index.umd.js CHANGED
@@ -49,7 +49,7 @@
49
49
  *
50
50
  * @see https://github.com/webgptorg/promptbook
51
51
  */
52
- var PROMPTBOOK_ENGINE_VERSION = '0.75.1';
52
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
53
53
  /**
54
54
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
55
55
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -4973,16 +4973,16 @@
4973
4973
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
4974
4974
  */
4975
4975
  var all = [];
4976
- var _loop_1 = function (packageName, className) {
4976
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4977
4977
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4978
4978
  return "continue";
4979
4979
  }
4980
- all.push({ packageName: packageName, className: className });
4980
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
4981
4981
  };
4982
4982
  try {
4983
4983
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
4984
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
4985
- _loop_1(packageName, className);
4984
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
4985
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
4986
4986
  }
4987
4987
  }
4988
4988
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -4992,16 +4992,16 @@
4992
4992
  }
4993
4993
  finally { if (e_1) throw e_1.error; }
4994
4994
  }
4995
- var _loop_2 = function (packageName, className) {
4995
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
4996
4996
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
4997
4997
  return "continue";
4998
4998
  }
4999
- all.push({ packageName: packageName, className: className });
4999
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
5000
5000
  };
5001
5001
  try {
5002
5002
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
5003
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
5004
- _loop_2(packageName, className);
5003
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
5004
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
5005
5005
  }
5006
5006
  }
5007
5007
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -5031,29 +5031,33 @@
5031
5031
  }
5032
5032
  return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
5033
5033
  .map(function (_a, i) {
5034
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
5034
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
5035
5035
  var more;
5036
+ // TODO: Use documentationUrl
5036
5037
  if (just(false)) {
5037
5038
  more = '';
5038
5039
  }
5039
5040
  else if (!isMetadataAviailable && !isInstalled) {
5040
5041
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
5041
- more = "(not installed and no metadata, looks like a unexpected behavior)";
5042
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
5042
5043
  }
5043
5044
  else if (isMetadataAviailable && !isInstalled) {
5044
5045
  // TODO: [�][�]
5045
- more = "(not installed)";
5046
+ more = "*(not installed)*";
5046
5047
  }
5047
5048
  else if (!isMetadataAviailable && isInstalled) {
5048
- more = "(no metadata, looks like a unexpected behavior)";
5049
+ more = "*(no metadata, looks like a unexpected behavior)*";
5049
5050
  }
5050
5051
  else if (isMetadataAviailable && isInstalled) {
5051
5052
  more = "(installed)";
5052
5053
  }
5053
5054
  else {
5054
- more = "(unknown state, looks like a unexpected behavior)";
5055
+ more = "*(unknown state, looks like a unexpected behavior)*";
5055
5056
  }
5056
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
5057
+ if (!isAvilableInBrowser) {
5058
+ more += " *(not available in browser)*";
5059
+ }
5060
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
5057
5061
  })
5058
5062
  .join('\n')), "\n "); });
5059
5063
  }
@@ -5438,7 +5442,10 @@
5438
5442
  return [7 /*endfinally*/];
5439
5443
  case 9:
5440
5444
  if (partialPieces === null) {
5441
- throw new KnowledgeScrapeError(spaceTrim__default["default"](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 "); }));
5445
+ throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
5446
+ .split('\n')
5447
+ .map(function (line) { return "> ".concat(line); })
5448
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
5442
5449
  }
5443
5450
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
5444
5451
  {