@promptbook/markdown-utils 0.75.6 โ 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 +99 -67
- 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 +99 -67
- 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
|
@@ -55,7 +55,6 @@ import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anth
|
|
|
55
55
|
import type { AnthropicClaudeExecutionToolsDirectOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
56
56
|
import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
|
|
57
57
|
import type { AzureOpenAiExecutionToolsOptions } from '../llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions';
|
|
58
|
-
import type { LangtailExecutionToolsOptions } from '../llm-providers/langtail/LangtailExecutionToolsOptions';
|
|
59
58
|
import type { OpenAiAssistantExecutionToolsOptions } from '../llm-providers/openai/OpenAiAssistantExecutionToolsOptions';
|
|
60
59
|
import type { OpenAiExecutionToolsOptions } from '../llm-providers/openai/OpenAiExecutionToolsOptions';
|
|
61
60
|
import type { PromptbookServer_Error } from '../llm-providers/remote/interfaces/PromptbookServer_Error';
|
|
@@ -309,7 +308,6 @@ export type { AnthropicClaudeExecutionToolsOptions };
|
|
|
309
308
|
export type { AnthropicClaudeExecutionToolsDirectOptions };
|
|
310
309
|
export type { AnthropicClaudeExecutionToolsProxiedOptions };
|
|
311
310
|
export type { AzureOpenAiExecutionToolsOptions };
|
|
312
|
-
export type { LangtailExecutionToolsOptions };
|
|
313
311
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
314
312
|
export type { OpenAiExecutionToolsOptions };
|
|
315
313
|
export type { PromptbookServer_Error };
|
|
@@ -9,7 +9,7 @@ import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorO
|
|
|
9
9
|
*
|
|
10
10
|
* @private internal type of `executePipeline`
|
|
11
11
|
*/
|
|
12
|
-
type ExecutePipelineOptions = CreatePipelineExecutorOptions & {
|
|
12
|
+
type ExecutePipelineOptions = Required<CreatePipelineExecutorOptions> & {
|
|
13
13
|
/**
|
|
14
14
|
* @@@
|
|
15
15
|
*/
|
|
@@ -10,7 +10,7 @@ import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorO
|
|
|
10
10
|
*
|
|
11
11
|
* @private internal type of `executeTask`
|
|
12
12
|
*/
|
|
13
|
-
type executeSingleTaskOptions = CreatePipelineExecutorOptions & {
|
|
13
|
+
type executeSingleTaskOptions = Required<CreatePipelineExecutorOptions> & {
|
|
14
14
|
/**
|
|
15
15
|
* @@@
|
|
16
16
|
*/
|
|
@@ -11,7 +11,7 @@ import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorO
|
|
|
11
11
|
*
|
|
12
12
|
* @private internal type of `executeAttempts`
|
|
13
13
|
*/
|
|
14
|
-
export type ExecuteAttemptsOptions = Omit<CreatePipelineExecutorOptions, 'pipeline'
|
|
14
|
+
export type ExecuteAttemptsOptions = Required<Omit<CreatePipelineExecutorOptions, 'pipeline'>> & {
|
|
15
15
|
/**
|
|
16
16
|
* @@@
|
|
17
17
|
*/
|
|
@@ -10,7 +10,7 @@ export type PrepareAndScrapeOptions = {
|
|
|
10
10
|
* Note: When the pipeline is not created from files, it is `null`
|
|
11
11
|
* Note: This folder must exist (=it is not created recursively)
|
|
12
12
|
*
|
|
13
|
-
* @default process.cwd()
|
|
13
|
+
* @default null or `process.cwd()` when created via `$provide...` function in node
|
|
14
14
|
*/
|
|
15
15
|
readonly rootDirname?: string_dirname | null;
|
|
16
16
|
/**
|
|
@@ -18,7 +18,7 @@ export type PrepareAndScrapeOptions = {
|
|
|
18
18
|
*
|
|
19
19
|
* Note: When the folder does not exist, it is created recursively
|
|
20
20
|
*
|
|
21
|
-
* @default
|
|
21
|
+
* @default DEFAULT_SCRAPE_CACHE_DIRNAME
|
|
22
22
|
*/
|
|
23
23
|
readonly cacheDirname?: string_dirname;
|
|
24
24
|
/**
|
|
@@ -30,17 +30,19 @@ export type PrepareAndScrapeOptions = {
|
|
|
30
30
|
/**
|
|
31
31
|
* Maximum number of tasks running in parallel
|
|
32
32
|
*
|
|
33
|
-
* @default
|
|
33
|
+
* @default DEFAULT_MAX_PARALLEL_COUNT
|
|
34
34
|
*/
|
|
35
35
|
readonly maxParallelCount?: number;
|
|
36
36
|
/**
|
|
37
37
|
* If true, the missing software is automatically installed
|
|
38
|
+
*
|
|
39
|
+
* @default DEFAULT_IS_AUTO_INSTALLED
|
|
38
40
|
*/
|
|
39
41
|
readonly isAutoInstalled?: boolean;
|
|
40
42
|
/**
|
|
41
43
|
* If true, the preparation logs additional information
|
|
42
44
|
*
|
|
43
|
-
* @default
|
|
45
|
+
* @default DEFAULT_IS_VERBOSE
|
|
44
46
|
*/
|
|
45
47
|
readonly isVerbose?: boolean;
|
|
46
48
|
};
|
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.8';
|
|
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
|
|
@@ -838,6 +838,12 @@
|
|
|
838
838
|
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
839
839
|
*/
|
|
840
840
|
var IMMEDIATE_TIME = 10;
|
|
841
|
+
/**
|
|
842
|
+
* Strategy for caching the intermediate results for knowledge sources
|
|
843
|
+
*
|
|
844
|
+
* @public exported from `@promptbook/core`
|
|
845
|
+
*/
|
|
846
|
+
var DEFAULT_INTERMEDIATE_FILES_STRATEGY = 'HIDE_AND_KEEP';
|
|
841
847
|
// <- TODO: [๐ก] Change to 'VISIBLE'
|
|
842
848
|
/**
|
|
843
849
|
* The maximum number of (LLM) tasks running in parallel
|
|
@@ -851,6 +857,14 @@
|
|
|
851
857
|
* @public exported from `@promptbook/core`
|
|
852
858
|
*/
|
|
853
859
|
var DEFAULT_MAX_EXECUTION_ATTEMPTS = 3; // <- TODO: [๐คนโโ๏ธ]
|
|
860
|
+
/**
|
|
861
|
+
* Where to store the scrape cache
|
|
862
|
+
*
|
|
863
|
+
* Note: When the folder does not exist, it is created recursively
|
|
864
|
+
*
|
|
865
|
+
* @public exported from `@promptbook/core`
|
|
866
|
+
*/
|
|
867
|
+
var DEFAULT_SCRAPE_CACHE_DIRNAME = './.promptbook/scrape-cache';
|
|
854
868
|
/**
|
|
855
869
|
* Nonce which is used for replacing things in strings
|
|
856
870
|
*
|
|
@@ -903,6 +917,12 @@
|
|
|
903
917
|
* @public exported from `@promptbook/core`
|
|
904
918
|
*/
|
|
905
919
|
var DEFAULT_IS_VERBOSE = false;
|
|
920
|
+
/**
|
|
921
|
+
* @@@
|
|
922
|
+
*
|
|
923
|
+
* @public exported from `@promptbook/core`
|
|
924
|
+
*/
|
|
925
|
+
var DEFAULT_IS_AUTO_INSTALLED = false;
|
|
906
926
|
/**
|
|
907
927
|
* @@@
|
|
908
928
|
*
|
|
@@ -5036,12 +5056,12 @@
|
|
|
5036
5056
|
*/
|
|
5037
5057
|
function executeTask(options) {
|
|
5038
5058
|
return __awaiter(this, void 0, void 0, function () {
|
|
5039
|
-
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification,
|
|
5040
|
-
var e_1,
|
|
5041
|
-
return __generator(this, function (
|
|
5042
|
-
switch (
|
|
5059
|
+
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;
|
|
5060
|
+
var e_1, _f, _g;
|
|
5061
|
+
return __generator(this, function (_h) {
|
|
5062
|
+
switch (_h.label) {
|
|
5043
5063
|
case 0:
|
|
5044
|
-
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification,
|
|
5064
|
+
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;
|
|
5045
5065
|
name = "pipeline-executor-frame-".concat(currentTask.name);
|
|
5046
5066
|
title = currentTask.title;
|
|
5047
5067
|
priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
@@ -5056,7 +5076,7 @@
|
|
|
5056
5076
|
// <- [๐ธ]
|
|
5057
5077
|
})];
|
|
5058
5078
|
case 1:
|
|
5059
|
-
|
|
5079
|
+
_h.sent();
|
|
5060
5080
|
usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5061
5081
|
dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5062
5082
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
@@ -5067,15 +5087,15 @@
|
|
|
5067
5087
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
5068
5088
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
5069
5089
|
}
|
|
5070
|
-
|
|
5071
|
-
|
|
5090
|
+
_b = (_a = Object).freeze;
|
|
5091
|
+
_c = [{}];
|
|
5072
5092
|
return [4 /*yield*/, getReservedParametersForTask({
|
|
5073
5093
|
preparedPipeline: preparedPipeline,
|
|
5074
5094
|
task: currentTask,
|
|
5075
5095
|
pipelineIdentification: pipelineIdentification,
|
|
5076
5096
|
})];
|
|
5077
5097
|
case 2:
|
|
5078
|
-
definedParameters =
|
|
5098
|
+
definedParameters = _b.apply(_a, [__assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), parametersToPass])]);
|
|
5079
5099
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
5080
5100
|
parameters = {};
|
|
5081
5101
|
_loop_1 = function (parameterName) {
|
|
@@ -5095,15 +5115,15 @@
|
|
|
5095
5115
|
try {
|
|
5096
5116
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this task
|
|
5097
5117
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
5098
|
-
for (
|
|
5099
|
-
parameterName =
|
|
5118
|
+
for (_d = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
5119
|
+
parameterName = _e.value;
|
|
5100
5120
|
_loop_1(parameterName);
|
|
5101
5121
|
}
|
|
5102
5122
|
}
|
|
5103
5123
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5104
5124
|
finally {
|
|
5105
5125
|
try {
|
|
5106
|
-
if (
|
|
5126
|
+
if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
|
|
5107
5127
|
}
|
|
5108
5128
|
finally { if (e_1) throw e_1.error; }
|
|
5109
5129
|
}
|
|
@@ -5123,9 +5143,18 @@
|
|
|
5123
5143
|
tools: tools,
|
|
5124
5144
|
$executionReport: $executionReport,
|
|
5125
5145
|
pipelineIdentification: pipelineIdentification,
|
|
5146
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
5147
|
+
maxParallelCount: maxParallelCount,
|
|
5148
|
+
csvSettings: csvSettings,
|
|
5149
|
+
isVerbose: isVerbose,
|
|
5150
|
+
rootDirname: rootDirname,
|
|
5151
|
+
cacheDirname: cacheDirname,
|
|
5152
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5153
|
+
isAutoInstalled: isAutoInstalled,
|
|
5154
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5126
5155
|
})];
|
|
5127
5156
|
case 3:
|
|
5128
|
-
resultString =
|
|
5157
|
+
resultString = _h.sent();
|
|
5129
5158
|
return [4 /*yield*/, onProgress({
|
|
5130
5159
|
name: name,
|
|
5131
5160
|
title: title,
|
|
@@ -5137,12 +5166,12 @@
|
|
|
5137
5166
|
// <- [๐ธ]
|
|
5138
5167
|
})];
|
|
5139
5168
|
case 4:
|
|
5140
|
-
|
|
5141
|
-
return [2 /*return*/, Object.freeze((
|
|
5142
|
-
|
|
5169
|
+
_h.sent();
|
|
5170
|
+
return [2 /*return*/, Object.freeze((_g = {},
|
|
5171
|
+
_g[currentTask.resultingParameterName] =
|
|
5143
5172
|
// <- Note: [๐ฉโ๐ฉโ๐ง] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
5144
5173
|
resultString,
|
|
5145
|
-
|
|
5174
|
+
_g))];
|
|
5146
5175
|
}
|
|
5147
5176
|
});
|
|
5148
5177
|
});
|
|
@@ -5201,12 +5230,12 @@
|
|
|
5201
5230
|
*/
|
|
5202
5231
|
function executePipeline(options) {
|
|
5203
5232
|
return __awaiter(this, void 0, void 0, function () {
|
|
5204
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname,
|
|
5205
|
-
var e_1,
|
|
5206
|
-
return __generator(this, function (
|
|
5207
|
-
switch (
|
|
5233
|
+
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;
|
|
5234
|
+
var e_1, _e, e_2, _f;
|
|
5235
|
+
return __generator(this, function (_g) {
|
|
5236
|
+
switch (_g.label) {
|
|
5208
5237
|
case 0:
|
|
5209
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname,
|
|
5238
|
+
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;
|
|
5210
5239
|
preparedPipeline = options.preparedPipeline;
|
|
5211
5240
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
5212
5241
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -5215,9 +5244,9 @@
|
|
|
5215
5244
|
maxParallelCount: maxParallelCount,
|
|
5216
5245
|
})];
|
|
5217
5246
|
case 1:
|
|
5218
|
-
preparedPipeline =
|
|
5247
|
+
preparedPipeline = _g.sent();
|
|
5219
5248
|
setPreparedPipeline(preparedPipeline);
|
|
5220
|
-
|
|
5249
|
+
_g.label = 2;
|
|
5221
5250
|
case 2:
|
|
5222
5251
|
errors = [];
|
|
5223
5252
|
warnings = [];
|
|
@@ -5230,17 +5259,17 @@
|
|
|
5230
5259
|
promptExecutions: [],
|
|
5231
5260
|
};
|
|
5232
5261
|
isReturned = false;
|
|
5233
|
-
|
|
5262
|
+
_g.label = 3;
|
|
5234
5263
|
case 3:
|
|
5235
|
-
|
|
5236
|
-
|
|
5264
|
+
_g.trys.push([3, 9, 10, 11]);
|
|
5265
|
+
_a = __values(preparedPipeline.parameters.filter(function (_a) {
|
|
5237
5266
|
var isInput = _a.isInput;
|
|
5238
5267
|
return isInput;
|
|
5239
|
-
})),
|
|
5240
|
-
|
|
5268
|
+
})), _b = _a.next();
|
|
5269
|
+
_g.label = 4;
|
|
5241
5270
|
case 4:
|
|
5242
|
-
if (!!
|
|
5243
|
-
parameter =
|
|
5271
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
5272
|
+
parameter = _b.value;
|
|
5244
5273
|
if (!(inputParameters[parameter.name] === undefined)) return [3 /*break*/, 7];
|
|
5245
5274
|
isReturned = true;
|
|
5246
5275
|
if (!(onProgress !== undefined)) return [3 /*break*/, 6];
|
|
@@ -5248,8 +5277,8 @@
|
|
|
5248
5277
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5249
5278
|
case 5:
|
|
5250
5279
|
// Note: Wait a short time to prevent race conditions
|
|
5251
|
-
|
|
5252
|
-
|
|
5280
|
+
_g.sent();
|
|
5281
|
+
_g.label = 6;
|
|
5253
5282
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
5254
5283
|
isSuccessful: false,
|
|
5255
5284
|
errors: __spreadArray([
|
|
@@ -5262,24 +5291,24 @@
|
|
|
5262
5291
|
preparedPipeline: preparedPipeline,
|
|
5263
5292
|
})];
|
|
5264
5293
|
case 7:
|
|
5265
|
-
|
|
5294
|
+
_b = _a.next();
|
|
5266
5295
|
return [3 /*break*/, 4];
|
|
5267
5296
|
case 8: return [3 /*break*/, 11];
|
|
5268
5297
|
case 9:
|
|
5269
|
-
e_1_1 =
|
|
5298
|
+
e_1_1 = _g.sent();
|
|
5270
5299
|
e_1 = { error: e_1_1 };
|
|
5271
5300
|
return [3 /*break*/, 11];
|
|
5272
5301
|
case 10:
|
|
5273
5302
|
try {
|
|
5274
|
-
if (
|
|
5303
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
5275
5304
|
}
|
|
5276
5305
|
finally { if (e_1) throw e_1.error; }
|
|
5277
5306
|
return [7 /*endfinally*/];
|
|
5278
5307
|
case 11:
|
|
5279
5308
|
_loop_1 = function (parameterName) {
|
|
5280
5309
|
var parameter;
|
|
5281
|
-
return __generator(this, function (
|
|
5282
|
-
switch (
|
|
5310
|
+
return __generator(this, function (_h) {
|
|
5311
|
+
switch (_h.label) {
|
|
5283
5312
|
case 0:
|
|
5284
5313
|
parameter = preparedPipeline.parameters.find(function (_a) {
|
|
5285
5314
|
var name = _a.name;
|
|
@@ -5296,8 +5325,8 @@
|
|
|
5296
5325
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5297
5326
|
case 2:
|
|
5298
5327
|
// Note: Wait a short time to prevent race conditions
|
|
5299
|
-
|
|
5300
|
-
|
|
5328
|
+
_h.sent();
|
|
5329
|
+
_h.label = 3;
|
|
5301
5330
|
case 3: return [2 /*return*/, { value: $asDeeplyFrozenSerializableJson(spaceTrim.spaceTrim(function (block) { return "\n Unuccessful PipelineExecutorResult (with extra parameter {".concat(parameter.name, "}) PipelineExecutorResult\n\n ").concat(block(pipelineIdentification), "\n "); }), {
|
|
5302
5331
|
isSuccessful: false,
|
|
5303
5332
|
errors: __spreadArray([
|
|
@@ -5313,39 +5342,39 @@
|
|
|
5313
5342
|
}
|
|
5314
5343
|
});
|
|
5315
5344
|
};
|
|
5316
|
-
|
|
5345
|
+
_g.label = 12;
|
|
5317
5346
|
case 12:
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5347
|
+
_g.trys.push([12, 17, 18, 19]);
|
|
5348
|
+
_c = __values(Object.keys(inputParameters)), _d = _c.next();
|
|
5349
|
+
_g.label = 13;
|
|
5321
5350
|
case 13:
|
|
5322
|
-
if (!!
|
|
5323
|
-
parameterName =
|
|
5351
|
+
if (!!_d.done) return [3 /*break*/, 16];
|
|
5352
|
+
parameterName = _d.value;
|
|
5324
5353
|
return [5 /*yield**/, _loop_1(parameterName)];
|
|
5325
5354
|
case 14:
|
|
5326
|
-
state_1 =
|
|
5355
|
+
state_1 = _g.sent();
|
|
5327
5356
|
if (typeof state_1 === "object")
|
|
5328
5357
|
return [2 /*return*/, state_1.value];
|
|
5329
|
-
|
|
5358
|
+
_g.label = 15;
|
|
5330
5359
|
case 15:
|
|
5331
|
-
|
|
5360
|
+
_d = _c.next();
|
|
5332
5361
|
return [3 /*break*/, 13];
|
|
5333
5362
|
case 16: return [3 /*break*/, 19];
|
|
5334
5363
|
case 17:
|
|
5335
|
-
e_2_1 =
|
|
5364
|
+
e_2_1 = _g.sent();
|
|
5336
5365
|
e_2 = { error: e_2_1 };
|
|
5337
5366
|
return [3 /*break*/, 19];
|
|
5338
5367
|
case 18:
|
|
5339
5368
|
try {
|
|
5340
|
-
if (
|
|
5369
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
5341
5370
|
}
|
|
5342
5371
|
finally { if (e_2) throw e_2.error; }
|
|
5343
5372
|
return [7 /*endfinally*/];
|
|
5344
5373
|
case 19:
|
|
5345
5374
|
parametersToPass = inputParameters;
|
|
5346
|
-
|
|
5375
|
+
_g.label = 20;
|
|
5347
5376
|
case 20:
|
|
5348
|
-
|
|
5377
|
+
_g.trys.push([20, 25, , 28]);
|
|
5349
5378
|
resovedParameterNames_1 = preparedPipeline.parameters
|
|
5350
5379
|
.filter(function (_a) {
|
|
5351
5380
|
var isInput = _a.isInput;
|
|
@@ -5360,8 +5389,8 @@
|
|
|
5360
5389
|
loopLimit = LOOP_LIMIT;
|
|
5361
5390
|
_loop_2 = function () {
|
|
5362
5391
|
var currentTask, work_1;
|
|
5363
|
-
return __generator(this, function (
|
|
5364
|
-
switch (
|
|
5392
|
+
return __generator(this, function (_j) {
|
|
5393
|
+
switch (_j.label) {
|
|
5365
5394
|
case 0:
|
|
5366
5395
|
if (loopLimit-- < 0) {
|
|
5367
5396
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
@@ -5397,7 +5426,7 @@
|
|
|
5397
5426
|
if (!!currentTask) return [3 /*break*/, 3];
|
|
5398
5427
|
/* [๐คนโโ๏ธ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|
|
5399
5428
|
case 2:
|
|
5400
|
-
/* [๐คนโโ๏ธ] */
|
|
5429
|
+
/* [๐คนโโ๏ธ] */ _j.sent();
|
|
5401
5430
|
return [3 /*break*/, 4];
|
|
5402
5431
|
case 3:
|
|
5403
5432
|
unresovedTasks_1 = unresovedTasks_1.filter(function (task) { return task !== currentTask; });
|
|
@@ -5422,24 +5451,24 @@
|
|
|
5422
5451
|
// <- Note: Errors are catched here [3]
|
|
5423
5452
|
// 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
|
|
5424
5453
|
resolving_1.push(work_1);
|
|
5425
|
-
|
|
5454
|
+
_j.label = 4;
|
|
5426
5455
|
case 4: return [2 /*return*/];
|
|
5427
5456
|
}
|
|
5428
5457
|
});
|
|
5429
5458
|
};
|
|
5430
|
-
|
|
5459
|
+
_g.label = 21;
|
|
5431
5460
|
case 21:
|
|
5432
5461
|
if (!(unresovedTasks_1.length > 0)) return [3 /*break*/, 23];
|
|
5433
5462
|
return [5 /*yield**/, _loop_2()];
|
|
5434
5463
|
case 22:
|
|
5435
|
-
|
|
5464
|
+
_g.sent();
|
|
5436
5465
|
return [3 /*break*/, 21];
|
|
5437
5466
|
case 23: return [4 /*yield*/, Promise.all(resolving_1)];
|
|
5438
5467
|
case 24:
|
|
5439
|
-
|
|
5468
|
+
_g.sent();
|
|
5440
5469
|
return [3 /*break*/, 28];
|
|
5441
5470
|
case 25:
|
|
5442
|
-
error_1 =
|
|
5471
|
+
error_1 = _g.sent();
|
|
5443
5472
|
if (!(error_1 instanceof Error)) {
|
|
5444
5473
|
throw error_1;
|
|
5445
5474
|
}
|
|
@@ -5459,8 +5488,8 @@
|
|
|
5459
5488
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5460
5489
|
case 26:
|
|
5461
5490
|
// Note: Wait a short time to prevent race conditions
|
|
5462
|
-
|
|
5463
|
-
|
|
5491
|
+
_g.sent();
|
|
5492
|
+
_g.label = 27;
|
|
5464
5493
|
case 27: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Unuccessful PipelineExecutorResult (with misc errors) PipelineExecutorResult', {
|
|
5465
5494
|
isSuccessful: false,
|
|
5466
5495
|
errors: __spreadArray([error_1], __read(errors), false).map(serializeError),
|
|
@@ -5487,8 +5516,8 @@
|
|
|
5487
5516
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5488
5517
|
case 29:
|
|
5489
5518
|
// Note: Wait a short time to prevent race conditions
|
|
5490
|
-
|
|
5491
|
-
|
|
5519
|
+
_g.sent();
|
|
5520
|
+
_g.label = 30;
|
|
5492
5521
|
case 30: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Successful PipelineExecutorResult', {
|
|
5493
5522
|
isSuccessful: true,
|
|
5494
5523
|
errors: errors.map(serializeError),
|
|
@@ -5515,7 +5544,7 @@
|
|
|
5515
5544
|
*/
|
|
5516
5545
|
function createPipelineExecutor(options) {
|
|
5517
5546
|
var _this = this;
|
|
5518
|
-
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 =
|
|
5547
|
+
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;
|
|
5519
5548
|
validatePipeline(pipeline);
|
|
5520
5549
|
var pipelineIdentification = (function () {
|
|
5521
5550
|
// Note: This is a ๐ implementation of [๐]
|
|
@@ -5555,6 +5584,9 @@
|
|
|
5555
5584
|
isVerbose: isVerbose,
|
|
5556
5585
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5557
5586
|
rootDirname: rootDirname,
|
|
5587
|
+
cacheDirname: cacheDirname,
|
|
5588
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5589
|
+
isAutoInstalled: isAutoInstalled,
|
|
5558
5590
|
})];
|
|
5559
5591
|
});
|
|
5560
5592
|
}); };
|