@promptbook/legacy-documents 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
@@ -23,7 +23,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
23
23
  *
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- var PROMPTBOOK_ENGINE_VERSION = '0.75.0';
26
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1885,7 +1885,6 @@ function validatePipelineCore(pipeline) {
1885
1885
  while (unresovedTasks.length > 0) {
1886
1886
  _loop_3();
1887
1887
  }
1888
- // TODO: !!!!!! Test that pipeline interface implements declared formfactor interface
1889
1888
  }
1890
1889
  /**
1891
1890
  * TODO: !! [🧞‍♀️] Do not allow joker + foreach
@@ -3168,16 +3167,16 @@ function $registeredScrapersMessage() {
3168
3167
  * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
3169
3168
  */
3170
3169
  var all = [];
3171
- var _loop_1 = function (packageName, className) {
3170
+ var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
3172
3171
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
3173
3172
  return "continue";
3174
3173
  }
3175
- all.push({ packageName: packageName, className: className });
3174
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3176
3175
  };
3177
3176
  try {
3178
3177
  for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
3179
- var _e = _d.value, packageName = _e.packageName, className = _e.className;
3180
- _loop_1(packageName, className);
3178
+ var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
3179
+ _loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3181
3180
  }
3182
3181
  }
3183
3182
  catch (e_1_1) { e_1 = { error: e_1_1 }; }
@@ -3187,16 +3186,16 @@ function $registeredScrapersMessage() {
3187
3186
  }
3188
3187
  finally { if (e_1) throw e_1.error; }
3189
3188
  }
3190
- var _loop_2 = function (packageName, className) {
3189
+ var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
3191
3190
  if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
3192
3191
  return "continue";
3193
3192
  }
3194
- all.push({ packageName: packageName, className: className });
3193
+ all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
3195
3194
  };
3196
3195
  try {
3197
3196
  for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
3198
- var _h = _g.value, packageName = _h.packageName, className = _h.className;
3199
- _loop_2(packageName, className);
3197
+ var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
3198
+ _loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
3200
3199
  }
3201
3200
  }
3202
3201
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
@@ -3226,29 +3225,33 @@ function $registeredScrapersMessage() {
3226
3225
  }
3227
3226
  return spaceTrim$1(function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
3228
3227
  .map(function (_a, i) {
3229
- var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
3228
+ var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
3230
3229
  var more;
3230
+ // TODO: Use documentationUrl
3231
3231
  if (just(false)) {
3232
3232
  more = '';
3233
3233
  }
3234
3234
  else if (!isMetadataAviailable && !isInstalled) {
3235
3235
  // TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
3236
- more = "(not installed and no metadata, looks like a unexpected behavior)";
3236
+ more = "*(not installed and no metadata, looks like a unexpected behavior)*";
3237
3237
  }
3238
3238
  else if (isMetadataAviailable && !isInstalled) {
3239
3239
  // TODO: [�][�]
3240
- more = "(not installed)";
3240
+ more = "*(not installed)*";
3241
3241
  }
3242
3242
  else if (!isMetadataAviailable && isInstalled) {
3243
- more = "(no metadata, looks like a unexpected behavior)";
3243
+ more = "*(no metadata, looks like a unexpected behavior)*";
3244
3244
  }
3245
3245
  else if (isMetadataAviailable && isInstalled) {
3246
3246
  more = "(installed)";
3247
3247
  }
3248
3248
  else {
3249
- more = "(unknown state, looks like a unexpected behavior)";
3249
+ more = "*(unknown state, looks like a unexpected behavior)*";
3250
3250
  }
3251
- return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` ").concat(more);
3251
+ if (!isAvilableInBrowser) {
3252
+ more += " *(not available in browser)*";
3253
+ }
3254
+ return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
3252
3255
  })
3253
3256
  .join('\n')), "\n "); });
3254
3257
  }
@@ -3499,7 +3502,10 @@ function prepareKnowledgePieces(knowledgeSources, tools, options) {
3499
3502
  return [7 /*endfinally*/];
3500
3503
  case 9:
3501
3504
  if (partialPieces === null) {
3502
- 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 "); }));
3505
+ throw new KnowledgeScrapeError(spaceTrim$1(function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
3506
+ .split('\n')
3507
+ .map(function (line) { return "> ".concat(line); })
3508
+ .join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
3503
3509
  }
3504
3510
  pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
3505
3511
  {