@promptbook/node 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 +2 -2
- package/umd/index.umd.js +23 -16
- package/umd/index.umd.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/node",
|
|
3
|
-
"version": "0.75.
|
|
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,
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"module": "./esm/index.es.js",
|
|
55
55
|
"typings": "./esm/typings/src/_packages/node.index.d.ts",
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@promptbook/core": "0.75.
|
|
57
|
+
"@promptbook/core": "0.75.3"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
*
|
|
44
44
|
* @see https://github.com/webgptorg/promptbook
|
|
45
45
|
*/
|
|
46
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
46
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
|
|
47
47
|
/**
|
|
48
48
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
49
49
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -4775,16 +4775,16 @@
|
|
|
4775
4775
|
* Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
|
|
4776
4776
|
*/
|
|
4777
4777
|
var all = [];
|
|
4778
|
-
var _loop_1 = function (packageName, className) {
|
|
4778
|
+
var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
|
|
4779
4779
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
4780
4780
|
return "continue";
|
|
4781
4781
|
}
|
|
4782
|
-
all.push({ packageName: packageName, className: className });
|
|
4782
|
+
all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
|
|
4783
4783
|
};
|
|
4784
4784
|
try {
|
|
4785
4785
|
for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
4786
|
-
var _e = _d.value, packageName = _e.packageName, className = _e.className;
|
|
4787
|
-
_loop_1(packageName, className);
|
|
4786
|
+
var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
|
|
4787
|
+
_loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
|
|
4788
4788
|
}
|
|
4789
4789
|
}
|
|
4790
4790
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -4794,16 +4794,16 @@
|
|
|
4794
4794
|
}
|
|
4795
4795
|
finally { if (e_1) throw e_1.error; }
|
|
4796
4796
|
}
|
|
4797
|
-
var _loop_2 = function (packageName, className) {
|
|
4797
|
+
var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
|
|
4798
4798
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
4799
4799
|
return "continue";
|
|
4800
4800
|
}
|
|
4801
|
-
all.push({ packageName: packageName, className: className });
|
|
4801
|
+
all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
|
|
4802
4802
|
};
|
|
4803
4803
|
try {
|
|
4804
4804
|
for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
4805
|
-
var _h = _g.value, packageName = _h.packageName, className = _h.className;
|
|
4806
|
-
_loop_2(packageName, className);
|
|
4805
|
+
var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
|
|
4806
|
+
_loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
|
|
4807
4807
|
}
|
|
4808
4808
|
}
|
|
4809
4809
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -4833,29 +4833,33 @@
|
|
|
4833
4833
|
}
|
|
4834
4834
|
return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
|
|
4835
4835
|
.map(function (_a, i) {
|
|
4836
|
-
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
|
|
4836
|
+
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
|
|
4837
4837
|
var more;
|
|
4838
|
+
// TODO: Use documentationUrl
|
|
4838
4839
|
if (just(false)) {
|
|
4839
4840
|
more = '';
|
|
4840
4841
|
}
|
|
4841
4842
|
else if (!isMetadataAviailable && !isInstalled) {
|
|
4842
4843
|
// TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
|
|
4843
|
-
more = "(not installed and no metadata, looks like a unexpected behavior)";
|
|
4844
|
+
more = "*(not installed and no metadata, looks like a unexpected behavior)*";
|
|
4844
4845
|
}
|
|
4845
4846
|
else if (isMetadataAviailable && !isInstalled) {
|
|
4846
4847
|
// TODO: [�][�]
|
|
4847
|
-
more = "(not installed)";
|
|
4848
|
+
more = "*(not installed)*";
|
|
4848
4849
|
}
|
|
4849
4850
|
else if (!isMetadataAviailable && isInstalled) {
|
|
4850
|
-
more = "(no metadata, looks like a unexpected behavior)";
|
|
4851
|
+
more = "*(no metadata, looks like a unexpected behavior)*";
|
|
4851
4852
|
}
|
|
4852
4853
|
else if (isMetadataAviailable && isInstalled) {
|
|
4853
4854
|
more = "(installed)";
|
|
4854
4855
|
}
|
|
4855
4856
|
else {
|
|
4856
|
-
more = "(unknown state, looks like a unexpected behavior)";
|
|
4857
|
+
more = "*(unknown state, looks like a unexpected behavior)*";
|
|
4857
4858
|
}
|
|
4858
|
-
|
|
4859
|
+
if (!isAvilableInBrowser) {
|
|
4860
|
+
more += " *(not available in browser)*";
|
|
4861
|
+
}
|
|
4862
|
+
return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
|
|
4859
4863
|
})
|
|
4860
4864
|
.join('\n')), "\n "); });
|
|
4861
4865
|
}
|
|
@@ -5240,7 +5244,10 @@
|
|
|
5240
5244
|
return [7 /*endfinally*/];
|
|
5241
5245
|
case 9:
|
|
5242
5246
|
if (partialPieces === null) {
|
|
5243
|
-
throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source
|
|
5247
|
+
throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
|
|
5248
|
+
.split('\n')
|
|
5249
|
+
.map(function (line) { return "> ".concat(line); })
|
|
5250
|
+
.join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
|
|
5244
5251
|
}
|
|
5245
5252
|
pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
|
|
5246
5253
|
{
|