@promptbook/markdown-utils 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 +1 -1
- 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
|
|
@@ -836,6 +836,12 @@ var LOOP_LIMIT = 1000;
|
|
|
836
836
|
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
837
837
|
*/
|
|
838
838
|
var IMMEDIATE_TIME = 10;
|
|
839
|
+
/**
|
|
840
|
+
* Strategy for caching the intermediate results for knowledge sources
|
|
841
|
+
*
|
|
842
|
+
* @public exported from `@promptbook/core`
|
|
843
|
+
*/
|
|
844
|
+
var DEFAULT_INTERMEDIATE_FILES_STRATEGY = 'HIDE_AND_KEEP';
|
|
839
845
|
// <- TODO: [๐ก] Change to 'VISIBLE'
|
|
840
846
|
/**
|
|
841
847
|
* The maximum number of (LLM) tasks running in parallel
|
|
@@ -849,6 +855,14 @@ var DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [๐คนโโ๏ธ]
|
|
|
849
855
|
* @public exported from `@promptbook/core`
|
|
850
856
|
*/
|
|
851
857
|
var DEFAULT_MAX_EXECUTION_ATTEMPTS = 3; // <- TODO: [๐คนโโ๏ธ]
|
|
858
|
+
/**
|
|
859
|
+
* Where to store the scrape cache
|
|
860
|
+
*
|
|
861
|
+
* Note: When the folder does not exist, it is created recursively
|
|
862
|
+
*
|
|
863
|
+
* @public exported from `@promptbook/core`
|
|
864
|
+
*/
|
|
865
|
+
var DEFAULT_SCRAPE_CACHE_DIRNAME = './.promptbook/scrape-cache';
|
|
852
866
|
/**
|
|
853
867
|
* Nonce which is used for replacing things in strings
|
|
854
868
|
*
|
|
@@ -901,6 +915,12 @@ var DEFAULT_CSV_SETTINGS = Object.freeze({
|
|
|
901
915
|
* @public exported from `@promptbook/core`
|
|
902
916
|
*/
|
|
903
917
|
var DEFAULT_IS_VERBOSE = false;
|
|
918
|
+
/**
|
|
919
|
+
* @@@
|
|
920
|
+
*
|
|
921
|
+
* @public exported from `@promptbook/core`
|
|
922
|
+
*/
|
|
923
|
+
var DEFAULT_IS_AUTO_INSTALLED = false;
|
|
904
924
|
/**
|
|
905
925
|
* @@@
|
|
906
926
|
*
|
|
@@ -3971,7 +3991,7 @@ var CsvFormatDefinition = {
|
|
|
3971
3991
|
case 0:
|
|
3972
3992
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
3973
3993
|
if (csv.errors.length !== 0) {
|
|
3974
|
-
throw new CsvFormatError(spaceTrim(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 "); }));
|
|
3994
|
+
throw new CsvFormatError(spaceTrim(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 "); }));
|
|
3975
3995
|
}
|
|
3976
3996
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
|
|
3977
3997
|
var _a, _b;
|
|
@@ -4009,7 +4029,7 @@ var CsvFormatDefinition = {
|
|
|
4009
4029
|
case 0:
|
|
4010
4030
|
csv = parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
|
|
4011
4031
|
if (csv.errors.length !== 0) {
|
|
4012
|
-
throw new CsvFormatError(spaceTrim(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 "); }));
|
|
4032
|
+
throw new CsvFormatError(spaceTrim(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 "); }));
|
|
4013
4033
|
}
|
|
4014
4034
|
return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
|
|
4015
4035
|
var _this = this;
|
|
@@ -5034,12 +5054,12 @@ function getReservedParametersForTask(options) {
|
|
|
5034
5054
|
*/
|
|
5035
5055
|
function executeTask(options) {
|
|
5036
5056
|
return __awaiter(this, void 0, void 0, function () {
|
|
5037
|
-
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification,
|
|
5038
|
-
var e_1,
|
|
5039
|
-
return __generator(this, function (
|
|
5040
|
-
switch (
|
|
5057
|
+
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;
|
|
5058
|
+
var e_1, _f, _g;
|
|
5059
|
+
return __generator(this, function (_h) {
|
|
5060
|
+
switch (_h.label) {
|
|
5041
5061
|
case 0:
|
|
5042
|
-
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification,
|
|
5062
|
+
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;
|
|
5043
5063
|
name = "pipeline-executor-frame-".concat(currentTask.name);
|
|
5044
5064
|
title = currentTask.title;
|
|
5045
5065
|
priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
@@ -5054,7 +5074,7 @@ function executeTask(options) {
|
|
|
5054
5074
|
// <- [๐ธ]
|
|
5055
5075
|
})];
|
|
5056
5076
|
case 1:
|
|
5057
|
-
|
|
5077
|
+
_h.sent();
|
|
5058
5078
|
usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5059
5079
|
dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5060
5080
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
@@ -5065,15 +5085,15 @@ function executeTask(options) {
|
|
|
5065
5085
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
5066
5086
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
5067
5087
|
}
|
|
5068
|
-
|
|
5069
|
-
|
|
5088
|
+
_b = (_a = Object).freeze;
|
|
5089
|
+
_c = [{}];
|
|
5070
5090
|
return [4 /*yield*/, getReservedParametersForTask({
|
|
5071
5091
|
preparedPipeline: preparedPipeline,
|
|
5072
5092
|
task: currentTask,
|
|
5073
5093
|
pipelineIdentification: pipelineIdentification,
|
|
5074
5094
|
})];
|
|
5075
5095
|
case 2:
|
|
5076
|
-
definedParameters =
|
|
5096
|
+
definedParameters = _b.apply(_a, [__assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), parametersToPass])]);
|
|
5077
5097
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
5078
5098
|
parameters = {};
|
|
5079
5099
|
_loop_1 = function (parameterName) {
|
|
@@ -5093,15 +5113,15 @@ function executeTask(options) {
|
|
|
5093
5113
|
try {
|
|
5094
5114
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this task
|
|
5095
5115
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
5096
|
-
for (
|
|
5097
|
-
parameterName =
|
|
5116
|
+
for (_d = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
5117
|
+
parameterName = _e.value;
|
|
5098
5118
|
_loop_1(parameterName);
|
|
5099
5119
|
}
|
|
5100
5120
|
}
|
|
5101
5121
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5102
5122
|
finally {
|
|
5103
5123
|
try {
|
|
5104
|
-
if (
|
|
5124
|
+
if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
|
|
5105
5125
|
}
|
|
5106
5126
|
finally { if (e_1) throw e_1.error; }
|
|
5107
5127
|
}
|
|
@@ -5121,9 +5141,18 @@ function executeTask(options) {
|
|
|
5121
5141
|
tools: tools,
|
|
5122
5142
|
$executionReport: $executionReport,
|
|
5123
5143
|
pipelineIdentification: pipelineIdentification,
|
|
5144
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
5145
|
+
maxParallelCount: maxParallelCount,
|
|
5146
|
+
csvSettings: csvSettings,
|
|
5147
|
+
isVerbose: isVerbose,
|
|
5148
|
+
rootDirname: rootDirname,
|
|
5149
|
+
cacheDirname: cacheDirname,
|
|
5150
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5151
|
+
isAutoInstalled: isAutoInstalled,
|
|
5152
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5124
5153
|
})];
|
|
5125
5154
|
case 3:
|
|
5126
|
-
resultString =
|
|
5155
|
+
resultString = _h.sent();
|
|
5127
5156
|
return [4 /*yield*/, onProgress({
|
|
5128
5157
|
name: name,
|
|
5129
5158
|
title: title,
|
|
@@ -5135,12 +5164,12 @@ function executeTask(options) {
|
|
|
5135
5164
|
// <- [๐ธ]
|
|
5136
5165
|
})];
|
|
5137
5166
|
case 4:
|
|
5138
|
-
|
|
5139
|
-
return [2 /*return*/, Object.freeze((
|
|
5140
|
-
|
|
5167
|
+
_h.sent();
|
|
5168
|
+
return [2 /*return*/, Object.freeze((_g = {},
|
|
5169
|
+
_g[currentTask.resultingParameterName] =
|
|
5141
5170
|
// <- Note: [๐ฉโ๐ฉโ๐ง] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
5142
5171
|
resultString,
|
|
5143
|
-
|
|
5172
|
+
_g))];
|
|
5144
5173
|
}
|
|
5145
5174
|
});
|
|
5146
5175
|
});
|
|
@@ -5199,12 +5228,12 @@ function filterJustOutputParameters(options) {
|
|
|
5199
5228
|
*/
|
|
5200
5229
|
function executePipeline(options) {
|
|
5201
5230
|
return __awaiter(this, void 0, void 0, function () {
|
|
5202
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname,
|
|
5203
|
-
var e_1,
|
|
5204
|
-
return __generator(this, function (
|
|
5205
|
-
switch (
|
|
5231
|
+
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;
|
|
5232
|
+
var e_1, _e, e_2, _f;
|
|
5233
|
+
return __generator(this, function (_g) {
|
|
5234
|
+
switch (_g.label) {
|
|
5206
5235
|
case 0:
|
|
5207
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname,
|
|
5236
|
+
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;
|
|
5208
5237
|
preparedPipeline = options.preparedPipeline;
|
|
5209
5238
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
5210
5239
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -5213,9 +5242,9 @@ function executePipeline(options) {
|
|
|
5213
5242
|
maxParallelCount: maxParallelCount,
|
|
5214
5243
|
})];
|
|
5215
5244
|
case 1:
|
|
5216
|
-
preparedPipeline =
|
|
5245
|
+
preparedPipeline = _g.sent();
|
|
5217
5246
|
setPreparedPipeline(preparedPipeline);
|
|
5218
|
-
|
|
5247
|
+
_g.label = 2;
|
|
5219
5248
|
case 2:
|
|
5220
5249
|
errors = [];
|
|
5221
5250
|
warnings = [];
|
|
@@ -5228,17 +5257,17 @@ function executePipeline(options) {
|
|
|
5228
5257
|
promptExecutions: [],
|
|
5229
5258
|
};
|
|
5230
5259
|
isReturned = false;
|
|
5231
|
-
|
|
5260
|
+
_g.label = 3;
|
|
5232
5261
|
case 3:
|
|
5233
|
-
|
|
5234
|
-
|
|
5262
|
+
_g.trys.push([3, 9, 10, 11]);
|
|
5263
|
+
_a = __values(preparedPipeline.parameters.filter(function (_a) {
|
|
5235
5264
|
var isInput = _a.isInput;
|
|
5236
5265
|
return isInput;
|
|
5237
|
-
})),
|
|
5238
|
-
|
|
5266
|
+
})), _b = _a.next();
|
|
5267
|
+
_g.label = 4;
|
|
5239
5268
|
case 4:
|
|
5240
|
-
if (!!
|
|
5241
|
-
parameter =
|
|
5269
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
5270
|
+
parameter = _b.value;
|
|
5242
5271
|
if (!(inputParameters[parameter.name] === undefined)) return [3 /*break*/, 7];
|
|
5243
5272
|
isReturned = true;
|
|
5244
5273
|
if (!(onProgress !== undefined)) return [3 /*break*/, 6];
|
|
@@ -5246,8 +5275,8 @@ function executePipeline(options) {
|
|
|
5246
5275
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5247
5276
|
case 5:
|
|
5248
5277
|
// Note: Wait a short time to prevent race conditions
|
|
5249
|
-
|
|
5250
|
-
|
|
5278
|
+
_g.sent();
|
|
5279
|
+
_g.label = 6;
|
|
5251
5280
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
5252
5281
|
isSuccessful: false,
|
|
5253
5282
|
errors: __spreadArray([
|
|
@@ -5260,24 +5289,24 @@ function executePipeline(options) {
|
|
|
5260
5289
|
preparedPipeline: preparedPipeline,
|
|
5261
5290
|
})];
|
|
5262
5291
|
case 7:
|
|
5263
|
-
|
|
5292
|
+
_b = _a.next();
|
|
5264
5293
|
return [3 /*break*/, 4];
|
|
5265
5294
|
case 8: return [3 /*break*/, 11];
|
|
5266
5295
|
case 9:
|
|
5267
|
-
e_1_1 =
|
|
5296
|
+
e_1_1 = _g.sent();
|
|
5268
5297
|
e_1 = { error: e_1_1 };
|
|
5269
5298
|
return [3 /*break*/, 11];
|
|
5270
5299
|
case 10:
|
|
5271
5300
|
try {
|
|
5272
|
-
if (
|
|
5301
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
5273
5302
|
}
|
|
5274
5303
|
finally { if (e_1) throw e_1.error; }
|
|
5275
5304
|
return [7 /*endfinally*/];
|
|
5276
5305
|
case 11:
|
|
5277
5306
|
_loop_1 = function (parameterName) {
|
|
5278
5307
|
var parameter;
|
|
5279
|
-
return __generator(this, function (
|
|
5280
|
-
switch (
|
|
5308
|
+
return __generator(this, function (_h) {
|
|
5309
|
+
switch (_h.label) {
|
|
5281
5310
|
case 0:
|
|
5282
5311
|
parameter = preparedPipeline.parameters.find(function (_a) {
|
|
5283
5312
|
var name = _a.name;
|
|
@@ -5294,8 +5323,8 @@ function executePipeline(options) {
|
|
|
5294
5323
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5295
5324
|
case 2:
|
|
5296
5325
|
// Note: Wait a short time to prevent race conditions
|
|
5297
|
-
|
|
5298
|
-
|
|
5326
|
+
_h.sent();
|
|
5327
|
+
_h.label = 3;
|
|
5299
5328
|
case 3: return [2 /*return*/, { value: $asDeeplyFrozenSerializableJson(spaceTrim$1(function (block) { return "\n Unuccessful PipelineExecutorResult (with extra parameter {".concat(parameter.name, "}) PipelineExecutorResult\n\n ").concat(block(pipelineIdentification), "\n "); }), {
|
|
5300
5329
|
isSuccessful: false,
|
|
5301
5330
|
errors: __spreadArray([
|
|
@@ -5311,39 +5340,39 @@ function executePipeline(options) {
|
|
|
5311
5340
|
}
|
|
5312
5341
|
});
|
|
5313
5342
|
};
|
|
5314
|
-
|
|
5343
|
+
_g.label = 12;
|
|
5315
5344
|
case 12:
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5345
|
+
_g.trys.push([12, 17, 18, 19]);
|
|
5346
|
+
_c = __values(Object.keys(inputParameters)), _d = _c.next();
|
|
5347
|
+
_g.label = 13;
|
|
5319
5348
|
case 13:
|
|
5320
|
-
if (!!
|
|
5321
|
-
parameterName =
|
|
5349
|
+
if (!!_d.done) return [3 /*break*/, 16];
|
|
5350
|
+
parameterName = _d.value;
|
|
5322
5351
|
return [5 /*yield**/, _loop_1(parameterName)];
|
|
5323
5352
|
case 14:
|
|
5324
|
-
state_1 =
|
|
5353
|
+
state_1 = _g.sent();
|
|
5325
5354
|
if (typeof state_1 === "object")
|
|
5326
5355
|
return [2 /*return*/, state_1.value];
|
|
5327
|
-
|
|
5356
|
+
_g.label = 15;
|
|
5328
5357
|
case 15:
|
|
5329
|
-
|
|
5358
|
+
_d = _c.next();
|
|
5330
5359
|
return [3 /*break*/, 13];
|
|
5331
5360
|
case 16: return [3 /*break*/, 19];
|
|
5332
5361
|
case 17:
|
|
5333
|
-
e_2_1 =
|
|
5362
|
+
e_2_1 = _g.sent();
|
|
5334
5363
|
e_2 = { error: e_2_1 };
|
|
5335
5364
|
return [3 /*break*/, 19];
|
|
5336
5365
|
case 18:
|
|
5337
5366
|
try {
|
|
5338
|
-
if (
|
|
5367
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
5339
5368
|
}
|
|
5340
5369
|
finally { if (e_2) throw e_2.error; }
|
|
5341
5370
|
return [7 /*endfinally*/];
|
|
5342
5371
|
case 19:
|
|
5343
5372
|
parametersToPass = inputParameters;
|
|
5344
|
-
|
|
5373
|
+
_g.label = 20;
|
|
5345
5374
|
case 20:
|
|
5346
|
-
|
|
5375
|
+
_g.trys.push([20, 25, , 28]);
|
|
5347
5376
|
resovedParameterNames_1 = preparedPipeline.parameters
|
|
5348
5377
|
.filter(function (_a) {
|
|
5349
5378
|
var isInput = _a.isInput;
|
|
@@ -5358,8 +5387,8 @@ function executePipeline(options) {
|
|
|
5358
5387
|
loopLimit = LOOP_LIMIT;
|
|
5359
5388
|
_loop_2 = function () {
|
|
5360
5389
|
var currentTask, work_1;
|
|
5361
|
-
return __generator(this, function (
|
|
5362
|
-
switch (
|
|
5390
|
+
return __generator(this, function (_j) {
|
|
5391
|
+
switch (_j.label) {
|
|
5363
5392
|
case 0:
|
|
5364
5393
|
if (loopLimit-- < 0) {
|
|
5365
5394
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
@@ -5395,7 +5424,7 @@ function executePipeline(options) {
|
|
|
5395
5424
|
if (!!currentTask) return [3 /*break*/, 3];
|
|
5396
5425
|
/* [๐คนโโ๏ธ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|
|
5397
5426
|
case 2:
|
|
5398
|
-
/* [๐คนโโ๏ธ] */
|
|
5427
|
+
/* [๐คนโโ๏ธ] */ _j.sent();
|
|
5399
5428
|
return [3 /*break*/, 4];
|
|
5400
5429
|
case 3:
|
|
5401
5430
|
unresovedTasks_1 = unresovedTasks_1.filter(function (task) { return task !== currentTask; });
|
|
@@ -5420,24 +5449,24 @@ function executePipeline(options) {
|
|
|
5420
5449
|
// <- Note: Errors are catched here [3]
|
|
5421
5450
|
// 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
|
|
5422
5451
|
resolving_1.push(work_1);
|
|
5423
|
-
|
|
5452
|
+
_j.label = 4;
|
|
5424
5453
|
case 4: return [2 /*return*/];
|
|
5425
5454
|
}
|
|
5426
5455
|
});
|
|
5427
5456
|
};
|
|
5428
|
-
|
|
5457
|
+
_g.label = 21;
|
|
5429
5458
|
case 21:
|
|
5430
5459
|
if (!(unresovedTasks_1.length > 0)) return [3 /*break*/, 23];
|
|
5431
5460
|
return [5 /*yield**/, _loop_2()];
|
|
5432
5461
|
case 22:
|
|
5433
|
-
|
|
5462
|
+
_g.sent();
|
|
5434
5463
|
return [3 /*break*/, 21];
|
|
5435
5464
|
case 23: return [4 /*yield*/, Promise.all(resolving_1)];
|
|
5436
5465
|
case 24:
|
|
5437
|
-
|
|
5466
|
+
_g.sent();
|
|
5438
5467
|
return [3 /*break*/, 28];
|
|
5439
5468
|
case 25:
|
|
5440
|
-
error_1 =
|
|
5469
|
+
error_1 = _g.sent();
|
|
5441
5470
|
if (!(error_1 instanceof Error)) {
|
|
5442
5471
|
throw error_1;
|
|
5443
5472
|
}
|
|
@@ -5457,8 +5486,8 @@ function executePipeline(options) {
|
|
|
5457
5486
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5458
5487
|
case 26:
|
|
5459
5488
|
// Note: Wait a short time to prevent race conditions
|
|
5460
|
-
|
|
5461
|
-
|
|
5489
|
+
_g.sent();
|
|
5490
|
+
_g.label = 27;
|
|
5462
5491
|
case 27: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Unuccessful PipelineExecutorResult (with misc errors) PipelineExecutorResult', {
|
|
5463
5492
|
isSuccessful: false,
|
|
5464
5493
|
errors: __spreadArray([error_1], __read(errors), false).map(serializeError),
|
|
@@ -5485,8 +5514,8 @@ function executePipeline(options) {
|
|
|
5485
5514
|
return [4 /*yield*/, forTime(IMMEDIATE_TIME)];
|
|
5486
5515
|
case 29:
|
|
5487
5516
|
// Note: Wait a short time to prevent race conditions
|
|
5488
|
-
|
|
5489
|
-
|
|
5517
|
+
_g.sent();
|
|
5518
|
+
_g.label = 30;
|
|
5490
5519
|
case 30: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Successful PipelineExecutorResult', {
|
|
5491
5520
|
isSuccessful: true,
|
|
5492
5521
|
errors: errors.map(serializeError),
|
|
@@ -5513,7 +5542,7 @@ function executePipeline(options) {
|
|
|
5513
5542
|
*/
|
|
5514
5543
|
function createPipelineExecutor(options) {
|
|
5515
5544
|
var _this = this;
|
|
5516
|
-
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 =
|
|
5545
|
+
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;
|
|
5517
5546
|
validatePipeline(pipeline);
|
|
5518
5547
|
var pipelineIdentification = (function () {
|
|
5519
5548
|
// Note: This is a ๐ implementation of [๐]
|
|
@@ -5553,6 +5582,9 @@ function createPipelineExecutor(options) {
|
|
|
5553
5582
|
isVerbose: isVerbose,
|
|
5554
5583
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5555
5584
|
rootDirname: rootDirname,
|
|
5585
|
+
cacheDirname: cacheDirname,
|
|
5586
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5587
|
+
isAutoInstalled: isAutoInstalled,
|
|
5556
5588
|
})];
|
|
5557
5589
|
});
|
|
5558
5590
|
}); };
|