@promptbook/pdf 0.75.5 โ 0.75.9
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 +101 -69
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/types.index.d.ts +0 -2
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -1
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +6 -4
- package/package.json +2 -2
- package/umd/index.umd.js +101 -69
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/_packages/langtail.index.d.ts +0 -6
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +0 -17
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +0 -13
- package/esm/typings/src/llm-providers/langtail/playground/playground.d.ts +0 -5
package/esm/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
20
20
|
*
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
23
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.8';
|
|
24
24
|
/**
|
|
25
25
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
26
26
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -651,6 +651,12 @@ var LOOP_LIMIT = 1000;
|
|
|
651
651
|
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
652
652
|
*/
|
|
653
653
|
var IMMEDIATE_TIME = 10;
|
|
654
|
+
/**
|
|
655
|
+
* Strategy for caching the intermediate results for knowledge sources
|
|
656
|
+
*
|
|
657
|
+
* @public exported from `@promptbook/core`
|
|
658
|
+
*/
|
|
659
|
+
var DEFAULT_INTERMEDIATE_FILES_STRATEGY = 'HIDE_AND_KEEP';
|
|
654
660
|
// <- TODO: [๐ก] Change to 'VISIBLE'
|
|
655
661
|
/**
|
|
656
662
|
* The maximum number of (LLM) tasks running in parallel
|
|
@@ -664,6 +670,14 @@ var DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [๐คนโโ๏ธ]
|
|
|
664
670
|
* @public exported from `@promptbook/core`
|
|
665
671
|
*/
|
|
666
672
|
var DEFAULT_MAX_EXECUTION_ATTEMPTS = 3; // <- TODO: [๐คนโโ๏ธ]
|
|
673
|
+
/**
|
|
674
|
+
* Where to store the scrape cache
|
|
675
|
+
*
|
|
676
|
+
* Note: When the folder does not exist, it is created recursively
|
|
677
|
+
*
|
|
678
|
+
* @public exported from `@promptbook/core`
|
|
679
|
+
*/
|
|
680
|
+
var DEFAULT_SCRAPE_CACHE_DIRNAME = './.promptbook/scrape-cache';
|
|
667
681
|
/**
|
|
668
682
|
* Nonce which is used for replacing things in strings
|
|
669
683
|
*
|
|
@@ -716,6 +730,12 @@ var DEFAULT_CSV_SETTINGS = Object.freeze({
|
|
|
716
730
|
* @public exported from `@promptbook/core`
|
|
717
731
|
*/
|
|
718
732
|
var DEFAULT_IS_VERBOSE = false;
|
|
733
|
+
/**
|
|
734
|
+
* @@@
|
|
735
|
+
*
|
|
736
|
+
* @public exported from `@promptbook/core`
|
|
737
|
+
*/
|
|
738
|
+
var DEFAULT_IS_AUTO_INSTALLED = false;
|
|
719
739
|
/**
|
|
720
740
|
* @@@
|
|
721
741
|
*
|
|
@@ -3789,7 +3809,7 @@ var CsvFormatDefinition = {
|
|
|
3789
3809
|
case 0:
|
|
3790
3810
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
3791
3811
|
if (csv.errors.length !== 0) {
|
|
3792
|
-
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
3812
|
+
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV setings:\n ").concat(block(JSON.stringify(__assign(__assign({}, settings), MANDATORY_CSV_SETTINGS), null, 2)), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
3793
3813
|
}
|
|
3794
3814
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
3795
3815
|
var _a, _b;
|
|
@@ -3827,7 +3847,7 @@ var CsvFormatDefinition = {
|
|
|
3827
3847
|
case 0:
|
|
3828
3848
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
3829
3849
|
if (csv.errors.length !== 0) {
|
|
3830
|
-
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
3850
|
+
throw new CsvFormatError(spaceTrim$1(function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV setings:\n ").concat(block(JSON.stringify(__assign(__assign({}, settings), MANDATORY_CSV_SETTINGS), null, 2)), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
|
|
3831
3851
|
}
|
|
3832
3852
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
|
|
3833
3853
|
var _this = this;
|
|
@@ -4989,12 +5009,12 @@ function getReservedParametersForTask(options) {
|
|
|
4989
5009
|
*/
|
|
4990
5010
|
function executeTask(options) {
|
|
4991
5011
|
return __awaiter(this, void 0, void 0, function () {
|
|
4992
|
-
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification,
|
|
4993
|
-
var e_1,
|
|
4994
|
-
return __generator(this, function (
|
|
4995
|
-
switch (
|
|
5012
|
+
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification, maxExecutionAttempts, maxParallelCount, csvSettings, isVerbose, rootDirname, cacheDirname, intermediateFilesStrategy, isAutoInstalled, isNotPreparedWarningSupressed, name, title, priority, usedParameterNames, dependentParameterNames, definedParameters, _a, _b, _c, definedParameterNames, parameters, _loop_1, _d, _e, parameterName, maxAttempts, jokerParameterNames, preparedContent, resultString;
|
|
5013
|
+
var e_1, _f, _g;
|
|
5014
|
+
return __generator(this, function (_h) {
|
|
5015
|
+
switch (_h.label) {
|
|
4996
5016
|
case 0:
|
|
4997
|
-
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification,
|
|
5017
|
+
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification, maxExecutionAttempts = options.maxExecutionAttempts, maxParallelCount = options.maxParallelCount, csvSettings = options.csvSettings, isVerbose = options.isVerbose, rootDirname = options.rootDirname, cacheDirname = options.cacheDirname, intermediateFilesStrategy = options.intermediateFilesStrategy, isAutoInstalled = options.isAutoInstalled, isNotPreparedWarningSupressed = options.isNotPreparedWarningSupressed;
|
|
4998
5018
|
name = "pipeline-executor-frame-".concat(currentTask.name);
|
|
4999
5019
|
title = currentTask.title;
|
|
5000
5020
|
priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
@@ -5009,7 +5029,7 @@ function executeTask(options) {
|
|
|
5009
5029
|
// <- [๐ธ]
|
|
5010
5030
|
})];
|
|
5011
5031
|
case 1:
|
|
5012
|
-
|
|
5032
|
+
_h.sent();
|
|
5013
5033
|
usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5014
5034
|
dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5015
5035
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
@@ -5020,15 +5040,15 @@ function executeTask(options) {
|
|
|
5020
5040
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
5021
5041
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
5022
5042
|
}
|
|
5023
|
-
|
|
5024
|
-
|
|
5043
|
+
_b = (_a = Object).freeze;
|
|
5044
|
+
_c = [{}];
|
|
5025
5045
|
return [4 /*yield*/, getReservedParametersForTask({
|
|
5026
5046
|
preparedPipeline: preparedPipeline,
|
|
5027
5047
|
task: currentTask,
|
|
5028
5048
|
pipelineIdentification: pipelineIdentification,
|
|
5029
5049
|
})];
|
|
5030
5050
|
case 2:
|
|
5031
|
-
definedParameters =
|
|
5051
|
+
definedParameters = _b.apply(_a, [__assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), parametersToPass])]);
|
|
5032
5052
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
5033
5053
|
parameters = {};
|
|
5034
5054
|
_loop_1 = function (parameterName) {
|
|
@@ -5048,15 +5068,15 @@ function executeTask(options) {
|
|
|
5048
5068
|
try {
|
|
5049
5069
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this task
|
|
5050
5070
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
5051
|
-
for (
|
|
5052
|
-
parameterName =
|
|
5071
|
+
for (_d = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
5072
|
+
parameterName = _e.value;
|
|
5053
5073
|
_loop_1(parameterName);
|
|
5054
5074
|
}
|
|
5055
5075
|
}
|
|
5056
5076
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5057
5077
|
finally {
|
|
5058
5078
|
try {
|
|
5059
|
-
if (
|
|
5079
|
+
if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
|
|
5060
5080
|
}
|
|
5061
5081
|
finally { if (e_1) throw e_1.error; }
|
|
5062
5082
|
}
|
|
@@ -5076,9 +5096,18 @@ function executeTask(options) {
|
|
|
5076
5096
|
tools: tools,
|
|
5077
5097
|
$executionReport: $executionReport,
|
|
5078
5098
|
pipelineIdentification: pipelineIdentification,
|
|
5099
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
5100
|
+
maxParallelCount: maxParallelCount,
|
|
5101
|
+
csvSettings: csvSettings,
|
|
5102
|
+
isVerbose: isVerbose,
|
|
5103
|
+
rootDirname: rootDirname,
|
|
5104
|
+
cacheDirname: cacheDirname,
|
|
5105
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5106
|
+
isAutoInstalled: isAutoInstalled,
|
|
5107
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5079
5108
|
})];
|
|
5080
5109
|
case 3:
|
|
5081
|
-
resultString =
|
|
5110
|
+
resultString = _h.sent();
|
|
5082
5111
|
return [4 /*yield*/, onProgress({
|
|
5083
5112
|
name: name,
|
|
5084
5113
|
title: title,
|
|
@@ -5090,12 +5119,12 @@ function executeTask(options) {
|
|
|
5090
5119
|
// <- [๐ธ]
|
|
5091
5120
|
})];
|
|
5092
5121
|
case 4:
|
|
5093
|
-
|
|
5094
|
-
return [2 /*return*/, Object.freeze((
|
|
5095
|
-
|
|
5122
|
+
_h.sent();
|
|
5123
|
+
return [2 /*return*/, Object.freeze((_g = {},
|
|
5124
|
+
_g[currentTask.resultingParameterName] =
|
|
5096
5125
|
// <- Note: [๐ฉโ๐ฉโ๐ง] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
5097
5126
|
resultString,
|
|
5098
|
-
|
|
5127
|
+
_g))];
|
|
5099
5128
|
}
|
|
5100
5129
|
});
|
|
5101
5130
|
});
|
|
@@ -5154,12 +5183,12 @@ function filterJustOutputParameters(options) {
|
|
|
5154
5183
|
*/
|
|
5155
5184
|
function executePipeline(options) {
|
|
5156
5185
|
return __awaiter(this, void 0, void 0, function () {
|
|
5157
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname,
|
|
5158
|
-
var e_1,
|
|
5159
|
-
return __generator(this, function (
|
|
5160
|
-
switch (
|
|
5186
|
+
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname, isVerbose, preparedPipeline, errors, warnings, executionReport, isReturned, _a, _b, parameter, e_1_1, _loop_1, _c, _d, parameterName, state_1, e_2_1, parametersToPass, resovedParameterNames_1, unresovedTasks_1, resolving_1, loopLimit, _loop_2, error_1, usage_1, outputParameters_1, usage, outputParameters;
|
|
5187
|
+
var e_1, _e, e_2, _f;
|
|
5188
|
+
return __generator(this, function (_g) {
|
|
5189
|
+
switch (_g.label) {
|
|
5161
5190
|
case 0:
|
|
5162
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname,
|
|
5191
|
+
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname, isVerbose = options.isVerbose;
|
|
5163
5192
|
preparedPipeline = options.preparedPipeline;
|
|
5164
5193
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
5165
5194
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -5168,9 +5197,9 @@ function executePipeline(options) {
|
|
|
5168
5197
|
maxParallelCount: maxParallelCount,
|
|
5169
5198
|
})];
|
|
5170
5199
|
case 1:
|
|
5171
|
-
preparedPipeline =
|
|
5200
|
+
preparedPipeline = _g.sent();
|
|
5172
5201
|
setPreparedPipeline(preparedPipeline);
|
|
5173
|
-
|
|
5202
|
+
_g.label = 2;
|
|
5174
5203
|
case 2:
|
|
5175
5204
|
errors = [];
|
|
5176
5205
|
warnings = [];
|
|
@@ -5183,17 +5212,17 @@ function executePipeline(options) {
|
|
|
5183
5212
|
promptExecutions: [],
|
|
5184
5213
|
};
|
|
5185
5214
|
isReturned = false;
|
|
5186
|
-
|
|
5215
|
+
_g.label = 3;
|
|
5187
5216
|
case 3:
|
|
5188
|
-
|
|
5189
|
-
|
|
5217
|
+
_g.trys.push([3, 9, 10, 11]);
|
|
5218
|
+
_a = __values(preparedPipeline.parameters.filter(function (_a) {
|
|
5190
5219
|
var isInput = _a.isInput;
|
|
5191
5220
|
return isInput;
|
|
5192
|
-
})),
|
|
5193
|
-
|
|
5221
|
+
})), _b = _a.next();
|
|
5222
|
+
_g.label = 4;
|
|
5194
5223
|
case 4:
|
|
5195
|
-
if (!!
|
|
5196
|
-
parameter =
|
|
5224
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
5225
|
+
parameter = _b.value;
|
|
5197
5226
|
if (!(inputParameters[parameter.name] === undefined)) return [3 /*break*/, 7];
|
|
5198
5227
|
isReturned = true;
|
|
5199
5228
|
if (!(onProgress !== undefined)) return [3 /*break*/, 6];
|
|
@@ -5201,8 +5230,8 @@ function executePipeline(options) {
|
|
|
5201
5230
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5202
5231
|
case 5:
|
|
5203
5232
|
// Note: Wait a short time to prevent race conditions
|
|
5204
|
-
|
|
5205
|
-
|
|
5233
|
+
_g.sent();
|
|
5234
|
+
_g.label = 6;
|
|
5206
5235
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
5207
5236
|
isSuccessful: false,
|
|
5208
5237
|
errors: __spreadArray([
|
|
@@ -5215,24 +5244,24 @@ function executePipeline(options) {
|
|
|
5215
5244
|
preparedPipeline: preparedPipeline,
|
|
5216
5245
|
})];
|
|
5217
5246
|
case 7:
|
|
5218
|
-
|
|
5247
|
+
_b = _a.next();
|
|
5219
5248
|
return [3 /*break*/, 4];
|
|
5220
5249
|
case 8: return [3 /*break*/, 11];
|
|
5221
5250
|
case 9:
|
|
5222
|
-
e_1_1 =
|
|
5251
|
+
e_1_1 = _g.sent();
|
|
5223
5252
|
e_1 = { error: e_1_1 };
|
|
5224
5253
|
return [3 /*break*/, 11];
|
|
5225
5254
|
case 10:
|
|
5226
5255
|
try {
|
|
5227
|
-
if (
|
|
5256
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
5228
5257
|
}
|
|
5229
5258
|
finally { if (e_1) throw e_1.error; }
|
|
5230
5259
|
return [7 /*endfinally*/];
|
|
5231
5260
|
case 11:
|
|
5232
5261
|
_loop_1 = function (parameterName) {
|
|
5233
5262
|
var parameter;
|
|
5234
|
-
return __generator(this, function (
|
|
5235
|
-
switch (
|
|
5263
|
+
return __generator(this, function (_h) {
|
|
5264
|
+
switch (_h.label) {
|
|
5236
5265
|
case 0:
|
|
5237
5266
|
parameter = preparedPipeline.parameters.find(function (_a) {
|
|
5238
5267
|
var name = _a.name;
|
|
@@ -5249,8 +5278,8 @@ function executePipeline(options) {
|
|
|
5249
5278
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5250
5279
|
case 2:
|
|
5251
5280
|
// Note: Wait a short time to prevent race conditions
|
|
5252
|
-
|
|
5253
|
-
|
|
5281
|
+
_h.sent();
|
|
5282
|
+
_h.label = 3;
|
|
5254
5283
|
case 3: return [2 /*return*/, { value: $asDeeplyFrozenSerializableJson(spaceTrim(function (block) { return "\n Unuccessful PipelineExecutorResult (with extra parameter {".concat(parameter.name, "}) PipelineExecutorResult\n\n ").concat(block(pipelineIdentification), "\n "); }), {
|
|
5255
5284
|
isSuccessful: false,
|
|
5256
5285
|
errors: __spreadArray([
|
|
@@ -5266,39 +5295,39 @@ function executePipeline(options) {
|
|
|
5266
5295
|
}
|
|
5267
5296
|
});
|
|
5268
5297
|
};
|
|
5269
|
-
|
|
5298
|
+
_g.label = 12;
|
|
5270
5299
|
case 12:
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5300
|
+
_g.trys.push([12, 17, 18, 19]);
|
|
5301
|
+
_c = __values(Object.keys(inputParameters)), _d = _c.next();
|
|
5302
|
+
_g.label = 13;
|
|
5274
5303
|
case 13:
|
|
5275
|
-
if (!!
|
|
5276
|
-
parameterName =
|
|
5304
|
+
if (!!_d.done) return [3 /*break*/, 16];
|
|
5305
|
+
parameterName = _d.value;
|
|
5277
5306
|
return [5 /*yield**/, _loop_1(parameterName)];
|
|
5278
5307
|
case 14:
|
|
5279
|
-
state_1 =
|
|
5308
|
+
state_1 = _g.sent();
|
|
5280
5309
|
if (typeof state_1 === "object")
|
|
5281
5310
|
return [2 /*return*/, state_1.value];
|
|
5282
|
-
|
|
5311
|
+
_g.label = 15;
|
|
5283
5312
|
case 15:
|
|
5284
|
-
|
|
5313
|
+
_d = _c.next();
|
|
5285
5314
|
return [3 /*break*/, 13];
|
|
5286
5315
|
case 16: return [3 /*break*/, 19];
|
|
5287
5316
|
case 17:
|
|
5288
|
-
e_2_1 =
|
|
5317
|
+
e_2_1 = _g.sent();
|
|
5289
5318
|
e_2 = { error: e_2_1 };
|
|
5290
5319
|
return [3 /*break*/, 19];
|
|
5291
5320
|
case 18:
|
|
5292
5321
|
try {
|
|
5293
|
-
if (
|
|
5322
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
5294
5323
|
}
|
|
5295
5324
|
finally { if (e_2) throw e_2.error; }
|
|
5296
5325
|
return [7 /*endfinally*/];
|
|
5297
5326
|
case 19:
|
|
5298
5327
|
parametersToPass = inputParameters;
|
|
5299
|
-
|
|
5328
|
+
_g.label = 20;
|
|
5300
5329
|
case 20:
|
|
5301
|
-
|
|
5330
|
+
_g.trys.push([20, 25, , 28]);
|
|
5302
5331
|
resovedParameterNames_1 = preparedPipeline.parameters
|
|
5303
5332
|
.filter(function (_a) {
|
|
5304
5333
|
var isInput = _a.isInput;
|
|
@@ -5313,8 +5342,8 @@ function executePipeline(options) {
|
|
|
5313
5342
|
loopLimit = LOOP_LIMIT;
|
|
5314
5343
|
_loop_2 = function () {
|
|
5315
5344
|
var currentTask, work_1;
|
|
5316
|
-
return __generator(this, function (
|
|
5317
|
-
switch (
|
|
5345
|
+
return __generator(this, function (_j) {
|
|
5346
|
+
switch (_j.label) {
|
|
5318
5347
|
case 0:
|
|
5319
5348
|
if (loopLimit-- < 0) {
|
|
5320
5349
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
@@ -5350,7 +5379,7 @@ function executePipeline(options) {
|
|
|
5350
5379
|
if (!!currentTask) return [3 /*break*/, 3];
|
|
5351
5380
|
/* [๐คนโโ๏ธ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|
|
5352
5381
|
case 2:
|
|
5353
|
-
/* [๐คนโโ๏ธ] */
|
|
5382
|
+
/* [๐คนโโ๏ธ] */ _j.sent();
|
|
5354
5383
|
return [3 /*break*/, 4];
|
|
5355
5384
|
case 3:
|
|
5356
5385
|
unresovedTasks_1 = unresovedTasks_1.filter(function (task) { return task !== currentTask; });
|
|
@@ -5375,24 +5404,24 @@ function executePipeline(options) {
|
|
|
5375
5404
|
// <- Note: Errors are catched here [3]
|
|
5376
5405
|
// TODO: BUT if in multiple tasks are errors, only the first one is catched so maybe we should catch errors here and save them to errors array here
|
|
5377
5406
|
resolving_1.push(work_1);
|
|
5378
|
-
|
|
5407
|
+
_j.label = 4;
|
|
5379
5408
|
case 4: return [2 /*return*/];
|
|
5380
5409
|
}
|
|
5381
5410
|
});
|
|
5382
5411
|
};
|
|
5383
|
-
|
|
5412
|
+
_g.label = 21;
|
|
5384
5413
|
case 21:
|
|
5385
5414
|
if (!(unresovedTasks_1.length > 0)) return [3 /*break*/, 23];
|
|
5386
5415
|
return [5 /*yield**/, _loop_2()];
|
|
5387
5416
|
case 22:
|
|
5388
|
-
|
|
5417
|
+
_g.sent();
|
|
5389
5418
|
return [3 /*break*/, 21];
|
|
5390
5419
|
case 23: return [4 /*yield*/, Promise.all(resolving_1)];
|
|
5391
5420
|
case 24:
|
|
5392
|
-
|
|
5421
|
+
_g.sent();
|
|
5393
5422
|
return [3 /*break*/, 28];
|
|
5394
5423
|
case 25:
|
|
5395
|
-
error_1 =
|
|
5424
|
+
error_1 = _g.sent();
|
|
5396
5425
|
if (!(error_1 instanceof Error)) {
|
|
5397
5426
|
throw error_1;
|
|
5398
5427
|
}
|
|
@@ -5412,8 +5441,8 @@ function executePipeline(options) {
|
|
|
5412
5441
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5413
5442
|
case 26:
|
|
5414
5443
|
// Note: Wait a short time to prevent race conditions
|
|
5415
|
-
|
|
5416
|
-
|
|
5444
|
+
_g.sent();
|
|
5445
|
+
_g.label = 27;
|
|
5417
5446
|
case 27: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Unuccessful PipelineExecutorResult (with misc errors) PipelineExecutorResult', {
|
|
5418
5447
|
isSuccessful: false,
|
|
5419
5448
|
errors: __spreadArray([error_1], __read(errors), false).map(serializeError),
|
|
@@ -5440,8 +5469,8 @@ function executePipeline(options) {
|
|
|
5440
5469
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5441
5470
|
case 29:
|
|
5442
5471
|
// Note: Wait a short time to prevent race conditions
|
|
5443
|
-
|
|
5444
|
-
|
|
5472
|
+
_g.sent();
|
|
5473
|
+
_g.label = 30;
|
|
5445
5474
|
case 30: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Successful PipelineExecutorResult', {
|
|
5446
5475
|
isSuccessful: true,
|
|
5447
5476
|
errors: errors.map(serializeError),
|
|
@@ -5468,7 +5497,7 @@ function executePipeline(options) {
|
|
|
5468
5497
|
*/
|
|
5469
5498
|
function createPipelineExecutor(options) {
|
|
5470
5499
|
var _this = this;
|
|
5471
|
-
var pipeline = options.pipeline, tools = options.tools, _a = options.maxExecutionAttempts, maxExecutionAttempts = _a === void 0 ? DEFAULT_MAX_EXECUTION_ATTEMPTS : _a, _b = options.maxParallelCount, maxParallelCount = _b === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _b, _c = options.csvSettings, csvSettings = _c === void 0 ? DEFAULT_CSV_SETTINGS : _c, _d = options.isVerbose, isVerbose = _d === void 0 ? DEFAULT_IS_VERBOSE : _d, _e = options.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _e === void 0 ? false : _e, _f = options.rootDirname, rootDirname =
|
|
5500
|
+
var pipeline = options.pipeline, tools = options.tools, _a = options.maxExecutionAttempts, maxExecutionAttempts = _a === void 0 ? DEFAULT_MAX_EXECUTION_ATTEMPTS : _a, _b = options.maxParallelCount, maxParallelCount = _b === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _b, _c = options.csvSettings, csvSettings = _c === void 0 ? DEFAULT_CSV_SETTINGS : _c, _d = options.isVerbose, isVerbose = _d === void 0 ? DEFAULT_IS_VERBOSE : _d, _e = options.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _e === void 0 ? false : _e, _f = options.cacheDirname, cacheDirname = _f === void 0 ? DEFAULT_SCRAPE_CACHE_DIRNAME : _f, _g = options.intermediateFilesStrategy, intermediateFilesStrategy = _g === void 0 ? DEFAULT_INTERMEDIATE_FILES_STRATEGY : _g, _h = options.isAutoInstalled, isAutoInstalled = _h === void 0 ? DEFAULT_IS_AUTO_INSTALLED : _h, _j = options.rootDirname, rootDirname = _j === void 0 ? null : _j;
|
|
5472
5501
|
validatePipeline(pipeline);
|
|
5473
5502
|
var pipelineIdentification = (function () {
|
|
5474
5503
|
// Note: This is a ๐ implementation of [๐]
|
|
@@ -5508,6 +5537,9 @@ function createPipelineExecutor(options) {
|
|
|
5508
5537
|
isVerbose: isVerbose,
|
|
5509
5538
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5510
5539
|
rootDirname: rootDirname,
|
|
5540
|
+
cacheDirname: cacheDirname,
|
|
5541
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5542
|
+
isAutoInstalled: isAutoInstalled,
|
|
5511
5543
|
})];
|
|
5512
5544
|
});
|
|
5513
5545
|
}); };
|