@promptbook/node 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 +2 -2
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/node",
|
|
3
|
-
"version": "0.75.
|
|
3
|
+
"version": "0.75.9",
|
|
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.9"
|
|
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.8';
|
|
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
|
|
@@ -406,6 +406,12 @@
|
|
|
406
406
|
* @public exported from `@promptbook/core`
|
|
407
407
|
*/
|
|
408
408
|
var MAX_FILENAME_LENGTH = 30;
|
|
409
|
+
/**
|
|
410
|
+
* Strategy for caching the intermediate results for knowledge sources
|
|
411
|
+
*
|
|
412
|
+
* @public exported from `@promptbook/core`
|
|
413
|
+
*/
|
|
414
|
+
var DEFAULT_INTERMEDIATE_FILES_STRATEGY = 'HIDE_AND_KEEP';
|
|
409
415
|
// <- TODO: [๐ก] Change to 'VISIBLE'
|
|
410
416
|
/**
|
|
411
417
|
* The maximum number of (LLM) tasks running in parallel
|
|
@@ -419,6 +425,14 @@
|
|
|
419
425
|
* @public exported from `@promptbook/core`
|
|
420
426
|
*/
|
|
421
427
|
var DEFAULT_MAX_EXECUTION_ATTEMPTS = 3; // <- TODO: [๐คนโโ๏ธ]
|
|
428
|
+
/**
|
|
429
|
+
* Where to store the scrape cache
|
|
430
|
+
*
|
|
431
|
+
* Note: When the folder does not exist, it is created recursively
|
|
432
|
+
*
|
|
433
|
+
* @public exported from `@promptbook/core`
|
|
434
|
+
*/
|
|
435
|
+
var DEFAULT_SCRAPE_CACHE_DIRNAME = './.promptbook/scrape-cache';
|
|
422
436
|
/**
|
|
423
437
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
424
438
|
*
|
|
@@ -477,6 +491,12 @@
|
|
|
477
491
|
* @public exported from `@promptbook/core`
|
|
478
492
|
*/
|
|
479
493
|
var DEFAULT_IS_VERBOSE = false;
|
|
494
|
+
/**
|
|
495
|
+
* @@@
|
|
496
|
+
*
|
|
497
|
+
* @public exported from `@promptbook/core`
|
|
498
|
+
*/
|
|
499
|
+
var DEFAULT_IS_AUTO_INSTALLED = false;
|
|
480
500
|
/**
|
|
481
501
|
* @@@
|
|
482
502
|
*
|
|
@@ -4007,12 +4027,12 @@
|
|
|
4007
4027
|
*/
|
|
4008
4028
|
function executeTask(options) {
|
|
4009
4029
|
return __awaiter(this, void 0, void 0, function () {
|
|
4010
|
-
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification,
|
|
4011
|
-
var e_1,
|
|
4012
|
-
return __generator(this, function (
|
|
4013
|
-
switch (
|
|
4030
|
+
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;
|
|
4031
|
+
var e_1, _f, _g;
|
|
4032
|
+
return __generator(this, function (_h) {
|
|
4033
|
+
switch (_h.label) {
|
|
4014
4034
|
case 0:
|
|
4015
|
-
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification,
|
|
4035
|
+
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;
|
|
4016
4036
|
name = "pipeline-executor-frame-".concat(currentTask.name);
|
|
4017
4037
|
title = currentTask.title;
|
|
4018
4038
|
priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
@@ -4027,7 +4047,7 @@
|
|
|
4027
4047
|
// <- [๐ธ]
|
|
4028
4048
|
})];
|
|
4029
4049
|
case 1:
|
|
4030
|
-
|
|
4050
|
+
_h.sent();
|
|
4031
4051
|
usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
4032
4052
|
dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
4033
4053
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
@@ -4038,15 +4058,15 @@
|
|
|
4038
4058
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
4039
4059
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
4040
4060
|
}
|
|
4041
|
-
|
|
4042
|
-
|
|
4061
|
+
_b = (_a = Object).freeze;
|
|
4062
|
+
_c = [{}];
|
|
4043
4063
|
return [4 /*yield*/, getReservedParametersForTask({
|
|
4044
4064
|
preparedPipeline: preparedPipeline,
|
|
4045
4065
|
task: currentTask,
|
|
4046
4066
|
pipelineIdentification: pipelineIdentification,
|
|
4047
4067
|
})];
|
|
4048
4068
|
case 2:
|
|
4049
|
-
definedParameters =
|
|
4069
|
+
definedParameters = _b.apply(_a, [__assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), parametersToPass])]);
|
|
4050
4070
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
4051
4071
|
parameters = {};
|
|
4052
4072
|
_loop_1 = function (parameterName) {
|
|
@@ -4066,15 +4086,15 @@
|
|
|
4066
4086
|
try {
|
|
4067
4087
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this task
|
|
4068
4088
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
4069
|
-
for (
|
|
4070
|
-
parameterName =
|
|
4089
|
+
for (_d = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
4090
|
+
parameterName = _e.value;
|
|
4071
4091
|
_loop_1(parameterName);
|
|
4072
4092
|
}
|
|
4073
4093
|
}
|
|
4074
4094
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4075
4095
|
finally {
|
|
4076
4096
|
try {
|
|
4077
|
-
if (
|
|
4097
|
+
if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
|
|
4078
4098
|
}
|
|
4079
4099
|
finally { if (e_1) throw e_1.error; }
|
|
4080
4100
|
}
|
|
@@ -4094,9 +4114,18 @@
|
|
|
4094
4114
|
tools: tools,
|
|
4095
4115
|
$executionReport: $executionReport,
|
|
4096
4116
|
pipelineIdentification: pipelineIdentification,
|
|
4117
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
4118
|
+
maxParallelCount: maxParallelCount,
|
|
4119
|
+
csvSettings: csvSettings,
|
|
4120
|
+
isVerbose: isVerbose,
|
|
4121
|
+
rootDirname: rootDirname,
|
|
4122
|
+
cacheDirname: cacheDirname,
|
|
4123
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
4124
|
+
isAutoInstalled: isAutoInstalled,
|
|
4125
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4097
4126
|
})];
|
|
4098
4127
|
case 3:
|
|
4099
|
-
resultString =
|
|
4128
|
+
resultString = _h.sent();
|
|
4100
4129
|
return [4 /*yield*/, onProgress({
|
|
4101
4130
|
name: name,
|
|
4102
4131
|
title: title,
|
|
@@ -4108,12 +4137,12 @@
|
|
|
4108
4137
|
// <- [๐ธ]
|
|
4109
4138
|
})];
|
|
4110
4139
|
case 4:
|
|
4111
|
-
|
|
4112
|
-
return [2 /*return*/, Object.freeze((
|
|
4113
|
-
|
|
4140
|
+
_h.sent();
|
|
4141
|
+
return [2 /*return*/, Object.freeze((_g = {},
|
|
4142
|
+
_g[currentTask.resultingParameterName] =
|
|
4114
4143
|
// <- Note: [๐ฉโ๐ฉโ๐ง] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
4115
4144
|
resultString,
|
|
4116
|
-
|
|
4145
|
+
_g))];
|
|
4117
4146
|
}
|
|
4118
4147
|
});
|
|
4119
4148
|
});
|
|
@@ -4172,12 +4201,12 @@
|
|
|
4172
4201
|
*/
|
|
4173
4202
|
function executePipeline(options) {
|
|
4174
4203
|
return __awaiter(this, void 0, void 0, function () {
|
|
4175
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname,
|
|
4176
|
-
var e_1,
|
|
4177
|
-
return __generator(this, function (
|
|
4178
|
-
switch (
|
|
4204
|
+
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;
|
|
4205
|
+
var e_1, _e, e_2, _f;
|
|
4206
|
+
return __generator(this, function (_g) {
|
|
4207
|
+
switch (_g.label) {
|
|
4179
4208
|
case 0:
|
|
4180
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname,
|
|
4209
|
+
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;
|
|
4181
4210
|
preparedPipeline = options.preparedPipeline;
|
|
4182
4211
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
4183
4212
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -4186,9 +4215,9 @@
|
|
|
4186
4215
|
maxParallelCount: maxParallelCount,
|
|
4187
4216
|
})];
|
|
4188
4217
|
case 1:
|
|
4189
|
-
preparedPipeline =
|
|
4218
|
+
preparedPipeline = _g.sent();
|
|
4190
4219
|
setPreparedPipeline(preparedPipeline);
|
|
4191
|
-
|
|
4220
|
+
_g.label = 2;
|
|
4192
4221
|
case 2:
|
|
4193
4222
|
errors = [];
|
|
4194
4223
|
warnings = [];
|
|
@@ -4201,17 +4230,17 @@
|
|
|
4201
4230
|
promptExecutions: [],
|
|
4202
4231
|
};
|
|
4203
4232
|
isReturned = false;
|
|
4204
|
-
|
|
4233
|
+
_g.label = 3;
|
|
4205
4234
|
case 3:
|
|
4206
|
-
|
|
4207
|
-
|
|
4235
|
+
_g.trys.push([3, 9, 10, 11]);
|
|
4236
|
+
_a = __values(preparedPipeline.parameters.filter(function (_a) {
|
|
4208
4237
|
var isInput = _a.isInput;
|
|
4209
4238
|
return isInput;
|
|
4210
|
-
})),
|
|
4211
|
-
|
|
4239
|
+
})), _b = _a.next();
|
|
4240
|
+
_g.label = 4;
|
|
4212
4241
|
case 4:
|
|
4213
|
-
if (!!
|
|
4214
|
-
parameter =
|
|
4242
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
4243
|
+
parameter = _b.value;
|
|
4215
4244
|
if (!(inputParameters[parameter.name] === undefined)) return [3 /*break*/, 7];
|
|
4216
4245
|
isReturned = true;
|
|
4217
4246
|
if (!(onProgress !== undefined)) return [3 /*break*/, 6];
|
|
@@ -4219,8 +4248,8 @@
|
|
|
4219
4248
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4220
4249
|
case 5:
|
|
4221
4250
|
// Note: Wait a short time to prevent race conditions
|
|
4222
|
-
|
|
4223
|
-
|
|
4251
|
+
_g.sent();
|
|
4252
|
+
_g.label = 6;
|
|
4224
4253
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
4225
4254
|
isSuccessful: false,
|
|
4226
4255
|
errors: __spreadArray([
|
|
@@ -4233,24 +4262,24 @@
|
|
|
4233
4262
|
preparedPipeline: preparedPipeline,
|
|
4234
4263
|
})];
|
|
4235
4264
|
case 7:
|
|
4236
|
-
|
|
4265
|
+
_b = _a.next();
|
|
4237
4266
|
return [3 /*break*/, 4];
|
|
4238
4267
|
case 8: return [3 /*break*/, 11];
|
|
4239
4268
|
case 9:
|
|
4240
|
-
e_1_1 =
|
|
4269
|
+
e_1_1 = _g.sent();
|
|
4241
4270
|
e_1 = { error: e_1_1 };
|
|
4242
4271
|
return [3 /*break*/, 11];
|
|
4243
4272
|
case 10:
|
|
4244
4273
|
try {
|
|
4245
|
-
if (
|
|
4274
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
4246
4275
|
}
|
|
4247
4276
|
finally { if (e_1) throw e_1.error; }
|
|
4248
4277
|
return [7 /*endfinally*/];
|
|
4249
4278
|
case 11:
|
|
4250
4279
|
_loop_1 = function (parameterName) {
|
|
4251
4280
|
var parameter;
|
|
4252
|
-
return __generator(this, function (
|
|
4253
|
-
switch (
|
|
4281
|
+
return __generator(this, function (_h) {
|
|
4282
|
+
switch (_h.label) {
|
|
4254
4283
|
case 0:
|
|
4255
4284
|
parameter = preparedPipeline.parameters.find(function (_a) {
|
|
4256
4285
|
var name = _a.name;
|
|
@@ -4267,8 +4296,8 @@
|
|
|
4267
4296
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4268
4297
|
case 2:
|
|
4269
4298
|
// Note: Wait a short time to prevent race conditions
|
|
4270
|
-
|
|
4271
|
-
|
|
4299
|
+
_h.sent();
|
|
4300
|
+
_h.label = 3;
|
|
4272
4301
|
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 "); }), {
|
|
4273
4302
|
isSuccessful: false,
|
|
4274
4303
|
errors: __spreadArray([
|
|
@@ -4284,39 +4313,39 @@
|
|
|
4284
4313
|
}
|
|
4285
4314
|
});
|
|
4286
4315
|
};
|
|
4287
|
-
|
|
4316
|
+
_g.label = 12;
|
|
4288
4317
|
case 12:
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4318
|
+
_g.trys.push([12, 17, 18, 19]);
|
|
4319
|
+
_c = __values(Object.keys(inputParameters)), _d = _c.next();
|
|
4320
|
+
_g.label = 13;
|
|
4292
4321
|
case 13:
|
|
4293
|
-
if (!!
|
|
4294
|
-
parameterName =
|
|
4322
|
+
if (!!_d.done) return [3 /*break*/, 16];
|
|
4323
|
+
parameterName = _d.value;
|
|
4295
4324
|
return [5 /*yield**/, _loop_1(parameterName)];
|
|
4296
4325
|
case 14:
|
|
4297
|
-
state_1 =
|
|
4326
|
+
state_1 = _g.sent();
|
|
4298
4327
|
if (typeof state_1 === "object")
|
|
4299
4328
|
return [2 /*return*/, state_1.value];
|
|
4300
|
-
|
|
4329
|
+
_g.label = 15;
|
|
4301
4330
|
case 15:
|
|
4302
|
-
|
|
4331
|
+
_d = _c.next();
|
|
4303
4332
|
return [3 /*break*/, 13];
|
|
4304
4333
|
case 16: return [3 /*break*/, 19];
|
|
4305
4334
|
case 17:
|
|
4306
|
-
e_2_1 =
|
|
4335
|
+
e_2_1 = _g.sent();
|
|
4307
4336
|
e_2 = { error: e_2_1 };
|
|
4308
4337
|
return [3 /*break*/, 19];
|
|
4309
4338
|
case 18:
|
|
4310
4339
|
try {
|
|
4311
|
-
if (
|
|
4340
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
4312
4341
|
}
|
|
4313
4342
|
finally { if (e_2) throw e_2.error; }
|
|
4314
4343
|
return [7 /*endfinally*/];
|
|
4315
4344
|
case 19:
|
|
4316
4345
|
parametersToPass = inputParameters;
|
|
4317
|
-
|
|
4346
|
+
_g.label = 20;
|
|
4318
4347
|
case 20:
|
|
4319
|
-
|
|
4348
|
+
_g.trys.push([20, 25, , 28]);
|
|
4320
4349
|
resovedParameterNames_1 = preparedPipeline.parameters
|
|
4321
4350
|
.filter(function (_a) {
|
|
4322
4351
|
var isInput = _a.isInput;
|
|
@@ -4331,8 +4360,8 @@
|
|
|
4331
4360
|
loopLimit = LOOP_LIMIT;
|
|
4332
4361
|
_loop_2 = function () {
|
|
4333
4362
|
var currentTask, work_1;
|
|
4334
|
-
return __generator(this, function (
|
|
4335
|
-
switch (
|
|
4363
|
+
return __generator(this, function (_j) {
|
|
4364
|
+
switch (_j.label) {
|
|
4336
4365
|
case 0:
|
|
4337
4366
|
if (loopLimit-- < 0) {
|
|
4338
4367
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
@@ -4368,7 +4397,7 @@
|
|
|
4368
4397
|
if (!!currentTask) return [3 /*break*/, 3];
|
|
4369
4398
|
/* [๐คนโโ๏ธ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|
|
4370
4399
|
case 2:
|
|
4371
|
-
/* [๐คนโโ๏ธ] */
|
|
4400
|
+
/* [๐คนโโ๏ธ] */ _j.sent();
|
|
4372
4401
|
return [3 /*break*/, 4];
|
|
4373
4402
|
case 3:
|
|
4374
4403
|
unresovedTasks_1 = unresovedTasks_1.filter(function (task) { return task !== currentTask; });
|
|
@@ -4393,24 +4422,24 @@
|
|
|
4393
4422
|
// <- Note: Errors are catched here [3]
|
|
4394
4423
|
// 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
|
|
4395
4424
|
resolving_1.push(work_1);
|
|
4396
|
-
|
|
4425
|
+
_j.label = 4;
|
|
4397
4426
|
case 4: return [2 /*return*/];
|
|
4398
4427
|
}
|
|
4399
4428
|
});
|
|
4400
4429
|
};
|
|
4401
|
-
|
|
4430
|
+
_g.label = 21;
|
|
4402
4431
|
case 21:
|
|
4403
4432
|
if (!(unresovedTasks_1.length > 0)) return [3 /*break*/, 23];
|
|
4404
4433
|
return [5 /*yield**/, _loop_2()];
|
|
4405
4434
|
case 22:
|
|
4406
|
-
|
|
4435
|
+
_g.sent();
|
|
4407
4436
|
return [3 /*break*/, 21];
|
|
4408
4437
|
case 23: return [4 /*yield*/, Promise.all(resolving_1)];
|
|
4409
4438
|
case 24:
|
|
4410
|
-
|
|
4439
|
+
_g.sent();
|
|
4411
4440
|
return [3 /*break*/, 28];
|
|
4412
4441
|
case 25:
|
|
4413
|
-
error_1 =
|
|
4442
|
+
error_1 = _g.sent();
|
|
4414
4443
|
if (!(error_1 instanceof Error)) {
|
|
4415
4444
|
throw error_1;
|
|
4416
4445
|
}
|
|
@@ -4430,8 +4459,8 @@
|
|
|
4430
4459
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4431
4460
|
case 26:
|
|
4432
4461
|
// Note: Wait a short time to prevent race conditions
|
|
4433
|
-
|
|
4434
|
-
|
|
4462
|
+
_g.sent();
|
|
4463
|
+
_g.label = 27;
|
|
4435
4464
|
case 27: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Unuccessful PipelineExecutorResult (with misc errors) PipelineExecutorResult', {
|
|
4436
4465
|
isSuccessful: false,
|
|
4437
4466
|
errors: __spreadArray([error_1], __read(errors), false).map(serializeError),
|
|
@@ -4458,8 +4487,8 @@
|
|
|
4458
4487
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4459
4488
|
case 29:
|
|
4460
4489
|
// Note: Wait a short time to prevent race conditions
|
|
4461
|
-
|
|
4462
|
-
|
|
4490
|
+
_g.sent();
|
|
4491
|
+
_g.label = 30;
|
|
4463
4492
|
case 30: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Successful PipelineExecutorResult', {
|
|
4464
4493
|
isSuccessful: true,
|
|
4465
4494
|
errors: errors.map(serializeError),
|
|
@@ -4486,7 +4515,7 @@
|
|
|
4486
4515
|
*/
|
|
4487
4516
|
function createPipelineExecutor(options) {
|
|
4488
4517
|
var _this = this;
|
|
4489
|
-
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 =
|
|
4518
|
+
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;
|
|
4490
4519
|
validatePipeline(pipeline);
|
|
4491
4520
|
var pipelineIdentification = (function () {
|
|
4492
4521
|
// Note: This is a ๐ implementation of [๐]
|
|
@@ -4526,6 +4555,9 @@
|
|
|
4526
4555
|
isVerbose: isVerbose,
|
|
4527
4556
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4528
4557
|
rootDirname: rootDirname,
|
|
4558
|
+
cacheDirname: cacheDirname,
|
|
4559
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
4560
|
+
isAutoInstalled: isAutoInstalled,
|
|
4529
4561
|
})];
|
|
4530
4562
|
});
|
|
4531
4563
|
}); };
|