@promptbook/markdown-utils 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/esm/index.es.js +23 -16
- package/esm/index.es.js.map +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +23 -16
- package/umd/index.umd.js.map +1 -1
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
25
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3050,16 +3050,16 @@
|
|
|
3050
3050
|
* Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
|
|
3051
3051
|
*/
|
|
3052
3052
|
var all = [];
|
|
3053
|
-
var _loop_1 = function (packageName, className) {
|
|
3053
|
+
var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
|
|
3054
3054
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
3055
3055
|
return "continue";
|
|
3056
3056
|
}
|
|
3057
|
-
all.push({ packageName: packageName, className: className });
|
|
3057
|
+
all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
|
|
3058
3058
|
};
|
|
3059
3059
|
try {
|
|
3060
3060
|
for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
3061
|
-
var _e = _d.value, packageName = _e.packageName, className = _e.className;
|
|
3062
|
-
_loop_1(packageName, className);
|
|
3061
|
+
var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
|
|
3062
|
+
_loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
|
|
3063
3063
|
}
|
|
3064
3064
|
}
|
|
3065
3065
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -3069,16 +3069,16 @@
|
|
|
3069
3069
|
}
|
|
3070
3070
|
finally { if (e_1) throw e_1.error; }
|
|
3071
3071
|
}
|
|
3072
|
-
var _loop_2 = function (packageName, className) {
|
|
3072
|
+
var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
|
|
3073
3073
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
3074
3074
|
return "continue";
|
|
3075
3075
|
}
|
|
3076
|
-
all.push({ packageName: packageName, className: className });
|
|
3076
|
+
all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
|
|
3077
3077
|
};
|
|
3078
3078
|
try {
|
|
3079
3079
|
for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
3080
|
-
var _h = _g.value, packageName = _h.packageName, className = _h.className;
|
|
3081
|
-
_loop_2(packageName, className);
|
|
3080
|
+
var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
|
|
3081
|
+
_loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
|
|
3082
3082
|
}
|
|
3083
3083
|
}
|
|
3084
3084
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -3108,29 +3108,33 @@
|
|
|
3108
3108
|
}
|
|
3109
3109
|
return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
|
|
3110
3110
|
.map(function (_a, i) {
|
|
3111
|
-
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
|
|
3111
|
+
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
|
|
3112
3112
|
var more;
|
|
3113
|
+
// TODO: Use documentationUrl
|
|
3113
3114
|
if (just(false)) {
|
|
3114
3115
|
more = '';
|
|
3115
3116
|
}
|
|
3116
3117
|
else if (!isMetadataAviailable && !isInstalled) {
|
|
3117
3118
|
// TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
|
|
3118
|
-
more = "(not installed and no metadata, looks like a unexpected behavior)";
|
|
3119
|
+
more = "*(not installed and no metadata, looks like a unexpected behavior)*";
|
|
3119
3120
|
}
|
|
3120
3121
|
else if (isMetadataAviailable && !isInstalled) {
|
|
3121
3122
|
// TODO: [�][�]
|
|
3122
|
-
more = "(not installed)";
|
|
3123
|
+
more = "*(not installed)*";
|
|
3123
3124
|
}
|
|
3124
3125
|
else if (!isMetadataAviailable && isInstalled) {
|
|
3125
|
-
more = "(no metadata, looks like a unexpected behavior)";
|
|
3126
|
+
more = "*(no metadata, looks like a unexpected behavior)*";
|
|
3126
3127
|
}
|
|
3127
3128
|
else if (isMetadataAviailable && isInstalled) {
|
|
3128
3129
|
more = "(installed)";
|
|
3129
3130
|
}
|
|
3130
3131
|
else {
|
|
3131
|
-
more = "(unknown state, looks like a unexpected behavior)";
|
|
3132
|
+
more = "*(unknown state, looks like a unexpected behavior)*";
|
|
3132
3133
|
}
|
|
3133
|
-
|
|
3134
|
+
if (!isAvilableInBrowser) {
|
|
3135
|
+
more += " *(not available in browser)*";
|
|
3136
|
+
}
|
|
3137
|
+
return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
|
|
3134
3138
|
})
|
|
3135
3139
|
.join('\n')), "\n "); });
|
|
3136
3140
|
}
|
|
@@ -3427,7 +3431,10 @@
|
|
|
3427
3431
|
return [7 /*endfinally*/];
|
|
3428
3432
|
case 9:
|
|
3429
3433
|
if (partialPieces === null) {
|
|
3430
|
-
throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source
|
|
3434
|
+
throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
|
|
3435
|
+
.split('\n')
|
|
3436
|
+
.map(function (line) { return "> ".concat(line); })
|
|
3437
|
+
.join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
|
|
3431
3438
|
}
|
|
3432
3439
|
pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
|
|
3433
3440
|
{
|