@promptbook/core 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 +73 -17
- package/esm/index.es.js.map +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +73 -17
- package/umd/index.umd.js.map +1 -1
package/package.json
CHANGED
package/umd/index.umd.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
27
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.2';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -5116,16 +5116,16 @@
|
|
|
5116
5116
|
* Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
|
|
5117
5117
|
*/
|
|
5118
5118
|
var all = [];
|
|
5119
|
-
var _loop_1 = function (packageName, className) {
|
|
5119
|
+
var _loop_1 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
|
|
5120
5120
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
5121
5121
|
return "continue";
|
|
5122
5122
|
}
|
|
5123
|
-
all.push({ packageName: packageName, className: className });
|
|
5123
|
+
all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
|
|
5124
5124
|
};
|
|
5125
5125
|
try {
|
|
5126
5126
|
for (var _c = __values($scrapersMetadataRegister.list()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
5127
|
-
var _e = _d.value, packageName = _e.packageName, className = _e.className;
|
|
5128
|
-
_loop_1(packageName, className);
|
|
5127
|
+
var _e = _d.value, packageName = _e.packageName, className = _e.className, mimeTypes = _e.mimeTypes, documentationUrl = _e.documentationUrl, isAvilableInBrowser = _e.isAvilableInBrowser;
|
|
5128
|
+
_loop_1(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
|
|
5129
5129
|
}
|
|
5130
5130
|
}
|
|
5131
5131
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -5135,16 +5135,16 @@
|
|
|
5135
5135
|
}
|
|
5136
5136
|
finally { if (e_1) throw e_1.error; }
|
|
5137
5137
|
}
|
|
5138
|
-
var _loop_2 = function (packageName, className) {
|
|
5138
|
+
var _loop_2 = function (packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser) {
|
|
5139
5139
|
if (all.some(function (item) { return item.packageName === packageName && item.className === className; })) {
|
|
5140
5140
|
return "continue";
|
|
5141
5141
|
}
|
|
5142
|
-
all.push({ packageName: packageName, className: className });
|
|
5142
|
+
all.push({ packageName: packageName, className: className, mimeTypes: mimeTypes, documentationUrl: documentationUrl, isAvilableInBrowser: isAvilableInBrowser });
|
|
5143
5143
|
};
|
|
5144
5144
|
try {
|
|
5145
5145
|
for (var _f = __values($scrapersRegister.list()), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
5146
|
-
var _h = _g.value, packageName = _h.packageName, className = _h.className;
|
|
5147
|
-
_loop_2(packageName, className);
|
|
5146
|
+
var _h = _g.value, packageName = _h.packageName, className = _h.className, mimeTypes = _h.mimeTypes, documentationUrl = _h.documentationUrl, isAvilableInBrowser = _h.isAvilableInBrowser;
|
|
5147
|
+
_loop_2(packageName, className, mimeTypes, documentationUrl, isAvilableInBrowser);
|
|
5148
5148
|
}
|
|
5149
5149
|
}
|
|
5150
5150
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -5174,29 +5174,33 @@
|
|
|
5174
5174
|
}
|
|
5175
5175
|
return spaceTrim__default["default"](function (block) { return "\n Available scrapers are:\n ".concat(block(metadata
|
|
5176
5176
|
.map(function (_a, i) {
|
|
5177
|
-
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled;
|
|
5177
|
+
var packageName = _a.packageName, className = _a.className, isMetadataAviailable = _a.isMetadataAviailable, isInstalled = _a.isInstalled, mimeTypes = _a.mimeTypes, isAvilableInBrowser = _a.isAvilableInBrowser;
|
|
5178
5178
|
var more;
|
|
5179
|
+
// TODO: Use documentationUrl
|
|
5179
5180
|
if (just(false)) {
|
|
5180
5181
|
more = '';
|
|
5181
5182
|
}
|
|
5182
5183
|
else if (!isMetadataAviailable && !isInstalled) {
|
|
5183
5184
|
// TODO: [�][�] Maybe do allow to do auto-install if package not registered and not found
|
|
5184
|
-
more = "(not installed and no metadata, looks like a unexpected behavior)";
|
|
5185
|
+
more = "*(not installed and no metadata, looks like a unexpected behavior)*";
|
|
5185
5186
|
}
|
|
5186
5187
|
else if (isMetadataAviailable && !isInstalled) {
|
|
5187
5188
|
// TODO: [�][�]
|
|
5188
|
-
more = "(not installed)";
|
|
5189
|
+
more = "*(not installed)*";
|
|
5189
5190
|
}
|
|
5190
5191
|
else if (!isMetadataAviailable && isInstalled) {
|
|
5191
|
-
more = "(no metadata, looks like a unexpected behavior)";
|
|
5192
|
+
more = "*(no metadata, looks like a unexpected behavior)*";
|
|
5192
5193
|
}
|
|
5193
5194
|
else if (isMetadataAviailable && isInstalled) {
|
|
5194
5195
|
more = "(installed)";
|
|
5195
5196
|
}
|
|
5196
5197
|
else {
|
|
5197
|
-
more = "(unknown state, looks like a unexpected behavior)";
|
|
5198
|
+
more = "*(unknown state, looks like a unexpected behavior)*";
|
|
5198
5199
|
}
|
|
5199
|
-
|
|
5200
|
+
if (!isAvilableInBrowser) {
|
|
5201
|
+
more += " *(not available in browser)*";
|
|
5202
|
+
}
|
|
5203
|
+
return "".concat(i + 1, ") `").concat(className, "` from `").concat(packageName, "` compatible to scrape ").concat(mimeTypes.join(', '), " ").concat(more);
|
|
5200
5204
|
})
|
|
5201
5205
|
.join('\n')), "\n "); });
|
|
5202
5206
|
}
|
|
@@ -5581,7 +5585,10 @@
|
|
|
5581
5585
|
return [7 /*endfinally*/];
|
|
5582
5586
|
case 9:
|
|
5583
5587
|
if (partialPieces === null) {
|
|
5584
|
-
throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source
|
|
5588
|
+
throw new KnowledgeScrapeError(spaceTrim__default["default"](function (block) { return "\n Cannot scrape knowledge from source:\n \n > ".concat(block(knowledgeSource.sourceContent
|
|
5589
|
+
.split('\n')
|
|
5590
|
+
.map(function (line) { return "> ".concat(line); })
|
|
5591
|
+
.join('\n')), "\n\n No scraper found for the mime type \"").concat(sourceHandler.mimeType, "\"\n\n ").concat(block($registeredScrapersMessage()), "\n\n\n "); }));
|
|
5585
5592
|
}
|
|
5586
5593
|
pieces = partialPieces.map(function (partialPiece) { return (__assign(__assign({}, partialPiece), { sources: [
|
|
5587
5594
|
{
|
|
@@ -10115,7 +10122,56 @@
|
|
|
10115
10122
|
* @public exported from `@promptbook/core`
|
|
10116
10123
|
*/
|
|
10117
10124
|
function isPipelineInterfacesEqual(pipelineInterface1, pipelineInterface2) {
|
|
10118
|
-
|
|
10125
|
+
var e_1, _a, e_2, _b;
|
|
10126
|
+
try {
|
|
10127
|
+
for (var _c = __values(['inputParameters', 'outputParameters']), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
10128
|
+
var whichParameters = _d.value;
|
|
10129
|
+
var parameters1 = pipelineInterface1[whichParameters]; // <- Note: `isPipelineInterfacesEqual` is just temporary solution, no need to fix this
|
|
10130
|
+
var parameters2 = pipelineInterface2[whichParameters];
|
|
10131
|
+
if (parameters1.length !== parameters2.length) {
|
|
10132
|
+
return false;
|
|
10133
|
+
}
|
|
10134
|
+
var _loop_1 = function (parameter) {
|
|
10135
|
+
var matchingParameter = parameters2.find(function (_a) {
|
|
10136
|
+
var name = _a.name;
|
|
10137
|
+
return name === parameter.name;
|
|
10138
|
+
});
|
|
10139
|
+
if (!matchingParameter) {
|
|
10140
|
+
return { value: false };
|
|
10141
|
+
}
|
|
10142
|
+
// Note: Do not compare description, it is not relevant for compatibility
|
|
10143
|
+
if (matchingParameter.isInput !== parameter.isInput) {
|
|
10144
|
+
return { value: false };
|
|
10145
|
+
}
|
|
10146
|
+
if (matchingParameter.isOutput !== parameter.isOutput) {
|
|
10147
|
+
return { value: false };
|
|
10148
|
+
}
|
|
10149
|
+
};
|
|
10150
|
+
try {
|
|
10151
|
+
for (var parameters1_1 = (e_2 = void 0, __values(parameters1)), parameters1_1_1 = parameters1_1.next(); !parameters1_1_1.done; parameters1_1_1 = parameters1_1.next()) {
|
|
10152
|
+
var parameter = parameters1_1_1.value;
|
|
10153
|
+
var state_1 = _loop_1(parameter);
|
|
10154
|
+
if (typeof state_1 === "object")
|
|
10155
|
+
return state_1.value;
|
|
10156
|
+
}
|
|
10157
|
+
}
|
|
10158
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
10159
|
+
finally {
|
|
10160
|
+
try {
|
|
10161
|
+
if (parameters1_1_1 && !parameters1_1_1.done && (_b = parameters1_1.return)) _b.call(parameters1_1);
|
|
10162
|
+
}
|
|
10163
|
+
finally { if (e_2) throw e_2.error; }
|
|
10164
|
+
}
|
|
10165
|
+
}
|
|
10166
|
+
}
|
|
10167
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
10168
|
+
finally {
|
|
10169
|
+
try {
|
|
10170
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
10171
|
+
}
|
|
10172
|
+
finally { if (e_1) throw e_1.error; }
|
|
10173
|
+
}
|
|
10174
|
+
return true;
|
|
10119
10175
|
}
|
|
10120
10176
|
|
|
10121
10177
|
/**
|