@promptbook/core 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 +79 -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 +79 -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
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @see https://github.com/webgptorg/promptbook
|
|
26
26
|
*/
|
|
27
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
27
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.8';
|
|
28
28
|
/**
|
|
29
29
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
30
30
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -4358,12 +4358,12 @@
|
|
|
4358
4358
|
*/
|
|
4359
4359
|
function executeTask(options) {
|
|
4360
4360
|
return __awaiter(this, void 0, void 0, function () {
|
|
4361
|
-
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification,
|
|
4362
|
-
var e_1,
|
|
4363
|
-
return __generator(this, function (
|
|
4364
|
-
switch (
|
|
4361
|
+
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;
|
|
4362
|
+
var e_1, _f, _g;
|
|
4363
|
+
return __generator(this, function (_h) {
|
|
4364
|
+
switch (_h.label) {
|
|
4365
4365
|
case 0:
|
|
4366
|
-
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification,
|
|
4366
|
+
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;
|
|
4367
4367
|
name = "pipeline-executor-frame-".concat(currentTask.name);
|
|
4368
4368
|
title = currentTask.title;
|
|
4369
4369
|
priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
@@ -4378,7 +4378,7 @@
|
|
|
4378
4378
|
// <- [๐ธ]
|
|
4379
4379
|
})];
|
|
4380
4380
|
case 1:
|
|
4381
|
-
|
|
4381
|
+
_h.sent();
|
|
4382
4382
|
usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
4383
4383
|
dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
4384
4384
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
@@ -4389,15 +4389,15 @@
|
|
|
4389
4389
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
4390
4390
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
4391
4391
|
}
|
|
4392
|
-
|
|
4393
|
-
|
|
4392
|
+
_b = (_a = Object).freeze;
|
|
4393
|
+
_c = [{}];
|
|
4394
4394
|
return [4 /*yield*/, getReservedParametersForTask({
|
|
4395
4395
|
preparedPipeline: preparedPipeline,
|
|
4396
4396
|
task: currentTask,
|
|
4397
4397
|
pipelineIdentification: pipelineIdentification,
|
|
4398
4398
|
})];
|
|
4399
4399
|
case 2:
|
|
4400
|
-
definedParameters =
|
|
4400
|
+
definedParameters = _b.apply(_a, [__assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), parametersToPass])]);
|
|
4401
4401
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
4402
4402
|
parameters = {};
|
|
4403
4403
|
_loop_1 = function (parameterName) {
|
|
@@ -4417,15 +4417,15 @@
|
|
|
4417
4417
|
try {
|
|
4418
4418
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this task
|
|
4419
4419
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
4420
|
-
for (
|
|
4421
|
-
parameterName =
|
|
4420
|
+
for (_d = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
4421
|
+
parameterName = _e.value;
|
|
4422
4422
|
_loop_1(parameterName);
|
|
4423
4423
|
}
|
|
4424
4424
|
}
|
|
4425
4425
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4426
4426
|
finally {
|
|
4427
4427
|
try {
|
|
4428
|
-
if (
|
|
4428
|
+
if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
|
|
4429
4429
|
}
|
|
4430
4430
|
finally { if (e_1) throw e_1.error; }
|
|
4431
4431
|
}
|
|
@@ -4445,9 +4445,18 @@
|
|
|
4445
4445
|
tools: tools,
|
|
4446
4446
|
$executionReport: $executionReport,
|
|
4447
4447
|
pipelineIdentification: pipelineIdentification,
|
|
4448
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
4449
|
+
maxParallelCount: maxParallelCount,
|
|
4450
|
+
csvSettings: csvSettings,
|
|
4451
|
+
isVerbose: isVerbose,
|
|
4452
|
+
rootDirname: rootDirname,
|
|
4453
|
+
cacheDirname: cacheDirname,
|
|
4454
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
4455
|
+
isAutoInstalled: isAutoInstalled,
|
|
4456
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4448
4457
|
})];
|
|
4449
4458
|
case 3:
|
|
4450
|
-
resultString =
|
|
4459
|
+
resultString = _h.sent();
|
|
4451
4460
|
return [4 /*yield*/, onProgress({
|
|
4452
4461
|
name: name,
|
|
4453
4462
|
title: title,
|
|
@@ -4459,12 +4468,12 @@
|
|
|
4459
4468
|
// <- [๐ธ]
|
|
4460
4469
|
})];
|
|
4461
4470
|
case 4:
|
|
4462
|
-
|
|
4463
|
-
return [2 /*return*/, Object.freeze((
|
|
4464
|
-
|
|
4471
|
+
_h.sent();
|
|
4472
|
+
return [2 /*return*/, Object.freeze((_g = {},
|
|
4473
|
+
_g[currentTask.resultingParameterName] =
|
|
4465
4474
|
// <- Note: [๐ฉโ๐ฉโ๐ง] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
4466
4475
|
resultString,
|
|
4467
|
-
|
|
4476
|
+
_g))];
|
|
4468
4477
|
}
|
|
4469
4478
|
});
|
|
4470
4479
|
});
|
|
@@ -4523,12 +4532,12 @@
|
|
|
4523
4532
|
*/
|
|
4524
4533
|
function executePipeline(options) {
|
|
4525
4534
|
return __awaiter(this, void 0, void 0, function () {
|
|
4526
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname,
|
|
4527
|
-
var e_1,
|
|
4528
|
-
return __generator(this, function (
|
|
4529
|
-
switch (
|
|
4535
|
+
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;
|
|
4536
|
+
var e_1, _e, e_2, _f;
|
|
4537
|
+
return __generator(this, function (_g) {
|
|
4538
|
+
switch (_g.label) {
|
|
4530
4539
|
case 0:
|
|
4531
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname,
|
|
4540
|
+
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;
|
|
4532
4541
|
preparedPipeline = options.preparedPipeline;
|
|
4533
4542
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
4534
4543
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -4537,9 +4546,9 @@
|
|
|
4537
4546
|
maxParallelCount: maxParallelCount,
|
|
4538
4547
|
})];
|
|
4539
4548
|
case 1:
|
|
4540
|
-
preparedPipeline =
|
|
4549
|
+
preparedPipeline = _g.sent();
|
|
4541
4550
|
setPreparedPipeline(preparedPipeline);
|
|
4542
|
-
|
|
4551
|
+
_g.label = 2;
|
|
4543
4552
|
case 2:
|
|
4544
4553
|
errors = [];
|
|
4545
4554
|
warnings = [];
|
|
@@ -4552,17 +4561,17 @@
|
|
|
4552
4561
|
promptExecutions: [],
|
|
4553
4562
|
};
|
|
4554
4563
|
isReturned = false;
|
|
4555
|
-
|
|
4564
|
+
_g.label = 3;
|
|
4556
4565
|
case 3:
|
|
4557
|
-
|
|
4558
|
-
|
|
4566
|
+
_g.trys.push([3, 9, 10, 11]);
|
|
4567
|
+
_a = __values(preparedPipeline.parameters.filter(function (_a) {
|
|
4559
4568
|
var isInput = _a.isInput;
|
|
4560
4569
|
return isInput;
|
|
4561
|
-
})),
|
|
4562
|
-
|
|
4570
|
+
})), _b = _a.next();
|
|
4571
|
+
_g.label = 4;
|
|
4563
4572
|
case 4:
|
|
4564
|
-
if (!!
|
|
4565
|
-
parameter =
|
|
4573
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
4574
|
+
parameter = _b.value;
|
|
4566
4575
|
if (!(inputParameters[parameter.name] === undefined)) return [3 /*break*/, 7];
|
|
4567
4576
|
isReturned = true;
|
|
4568
4577
|
if (!(onProgress !== undefined)) return [3 /*break*/, 6];
|
|
@@ -4570,8 +4579,8 @@
|
|
|
4570
4579
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4571
4580
|
case 5:
|
|
4572
4581
|
// Note: Wait a short time to prevent race conditions
|
|
4573
|
-
|
|
4574
|
-
|
|
4582
|
+
_g.sent();
|
|
4583
|
+
_g.label = 6;
|
|
4575
4584
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
4576
4585
|
isSuccessful: false,
|
|
4577
4586
|
errors: __spreadArray([
|
|
@@ -4584,24 +4593,24 @@
|
|
|
4584
4593
|
preparedPipeline: preparedPipeline,
|
|
4585
4594
|
})];
|
|
4586
4595
|
case 7:
|
|
4587
|
-
|
|
4596
|
+
_b = _a.next();
|
|
4588
4597
|
return [3 /*break*/, 4];
|
|
4589
4598
|
case 8: return [3 /*break*/, 11];
|
|
4590
4599
|
case 9:
|
|
4591
|
-
e_1_1 =
|
|
4600
|
+
e_1_1 = _g.sent();
|
|
4592
4601
|
e_1 = { error: e_1_1 };
|
|
4593
4602
|
return [3 /*break*/, 11];
|
|
4594
4603
|
case 10:
|
|
4595
4604
|
try {
|
|
4596
|
-
if (
|
|
4605
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
4597
4606
|
}
|
|
4598
4607
|
finally { if (e_1) throw e_1.error; }
|
|
4599
4608
|
return [7 /*endfinally*/];
|
|
4600
4609
|
case 11:
|
|
4601
4610
|
_loop_1 = function (parameterName) {
|
|
4602
4611
|
var parameter;
|
|
4603
|
-
return __generator(this, function (
|
|
4604
|
-
switch (
|
|
4612
|
+
return __generator(this, function (_h) {
|
|
4613
|
+
switch (_h.label) {
|
|
4605
4614
|
case 0:
|
|
4606
4615
|
parameter = preparedPipeline.parameters.find(function (_a) {
|
|
4607
4616
|
var name = _a.name;
|
|
@@ -4618,8 +4627,8 @@
|
|
|
4618
4627
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4619
4628
|
case 2:
|
|
4620
4629
|
// Note: Wait a short time to prevent race conditions
|
|
4621
|
-
|
|
4622
|
-
|
|
4630
|
+
_h.sent();
|
|
4631
|
+
_h.label = 3;
|
|
4623
4632
|
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 "); }), {
|
|
4624
4633
|
isSuccessful: false,
|
|
4625
4634
|
errors: __spreadArray([
|
|
@@ -4635,39 +4644,39 @@
|
|
|
4635
4644
|
}
|
|
4636
4645
|
});
|
|
4637
4646
|
};
|
|
4638
|
-
|
|
4647
|
+
_g.label = 12;
|
|
4639
4648
|
case 12:
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4649
|
+
_g.trys.push([12, 17, 18, 19]);
|
|
4650
|
+
_c = __values(Object.keys(inputParameters)), _d = _c.next();
|
|
4651
|
+
_g.label = 13;
|
|
4643
4652
|
case 13:
|
|
4644
|
-
if (!!
|
|
4645
|
-
parameterName =
|
|
4653
|
+
if (!!_d.done) return [3 /*break*/, 16];
|
|
4654
|
+
parameterName = _d.value;
|
|
4646
4655
|
return [5 /*yield**/, _loop_1(parameterName)];
|
|
4647
4656
|
case 14:
|
|
4648
|
-
state_1 =
|
|
4657
|
+
state_1 = _g.sent();
|
|
4649
4658
|
if (typeof state_1 === "object")
|
|
4650
4659
|
return [2 /*return*/, state_1.value];
|
|
4651
|
-
|
|
4660
|
+
_g.label = 15;
|
|
4652
4661
|
case 15:
|
|
4653
|
-
|
|
4662
|
+
_d = _c.next();
|
|
4654
4663
|
return [3 /*break*/, 13];
|
|
4655
4664
|
case 16: return [3 /*break*/, 19];
|
|
4656
4665
|
case 17:
|
|
4657
|
-
e_2_1 =
|
|
4666
|
+
e_2_1 = _g.sent();
|
|
4658
4667
|
e_2 = { error: e_2_1 };
|
|
4659
4668
|
return [3 /*break*/, 19];
|
|
4660
4669
|
case 18:
|
|
4661
4670
|
try {
|
|
4662
|
-
if (
|
|
4671
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
4663
4672
|
}
|
|
4664
4673
|
finally { if (e_2) throw e_2.error; }
|
|
4665
4674
|
return [7 /*endfinally*/];
|
|
4666
4675
|
case 19:
|
|
4667
4676
|
parametersToPass = inputParameters;
|
|
4668
|
-
|
|
4677
|
+
_g.label = 20;
|
|
4669
4678
|
case 20:
|
|
4670
|
-
|
|
4679
|
+
_g.trys.push([20, 25, , 28]);
|
|
4671
4680
|
resovedParameterNames_1 = preparedPipeline.parameters
|
|
4672
4681
|
.filter(function (_a) {
|
|
4673
4682
|
var isInput = _a.isInput;
|
|
@@ -4682,8 +4691,8 @@
|
|
|
4682
4691
|
loopLimit = LOOP_LIMIT;
|
|
4683
4692
|
_loop_2 = function () {
|
|
4684
4693
|
var currentTask, work_1;
|
|
4685
|
-
return __generator(this, function (
|
|
4686
|
-
switch (
|
|
4694
|
+
return __generator(this, function (_j) {
|
|
4695
|
+
switch (_j.label) {
|
|
4687
4696
|
case 0:
|
|
4688
4697
|
if (loopLimit-- < 0) {
|
|
4689
4698
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
@@ -4719,7 +4728,7 @@
|
|
|
4719
4728
|
if (!!currentTask) return [3 /*break*/, 3];
|
|
4720
4729
|
/* [๐คนโโ๏ธ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|
|
4721
4730
|
case 2:
|
|
4722
|
-
/* [๐คนโโ๏ธ] */
|
|
4731
|
+
/* [๐คนโโ๏ธ] */ _j.sent();
|
|
4723
4732
|
return [3 /*break*/, 4];
|
|
4724
4733
|
case 3:
|
|
4725
4734
|
unresovedTasks_1 = unresovedTasks_1.filter(function (task) { return task !== currentTask; });
|
|
@@ -4744,24 +4753,24 @@
|
|
|
4744
4753
|
// <- Note: Errors are catched here [3]
|
|
4745
4754
|
// 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
|
|
4746
4755
|
resolving_1.push(work_1);
|
|
4747
|
-
|
|
4756
|
+
_j.label = 4;
|
|
4748
4757
|
case 4: return [2 /*return*/];
|
|
4749
4758
|
}
|
|
4750
4759
|
});
|
|
4751
4760
|
};
|
|
4752
|
-
|
|
4761
|
+
_g.label = 21;
|
|
4753
4762
|
case 21:
|
|
4754
4763
|
if (!(unresovedTasks_1.length > 0)) return [3 /*break*/, 23];
|
|
4755
4764
|
return [5 /*yield**/, _loop_2()];
|
|
4756
4765
|
case 22:
|
|
4757
|
-
|
|
4766
|
+
_g.sent();
|
|
4758
4767
|
return [3 /*break*/, 21];
|
|
4759
4768
|
case 23: return [4 /*yield*/, Promise.all(resolving_1)];
|
|
4760
4769
|
case 24:
|
|
4761
|
-
|
|
4770
|
+
_g.sent();
|
|
4762
4771
|
return [3 /*break*/, 28];
|
|
4763
4772
|
case 25:
|
|
4764
|
-
error_1 =
|
|
4773
|
+
error_1 = _g.sent();
|
|
4765
4774
|
if (!(error_1 instanceof Error)) {
|
|
4766
4775
|
throw error_1;
|
|
4767
4776
|
}
|
|
@@ -4781,8 +4790,8 @@
|
|
|
4781
4790
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4782
4791
|
case 26:
|
|
4783
4792
|
// Note: Wait a short time to prevent race conditions
|
|
4784
|
-
|
|
4785
|
-
|
|
4793
|
+
_g.sent();
|
|
4794
|
+
_g.label = 27;
|
|
4786
4795
|
case 27: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Unuccessful PipelineExecutorResult (with misc errors) PipelineExecutorResult', {
|
|
4787
4796
|
isSuccessful: false,
|
|
4788
4797
|
errors: __spreadArray([error_1], __read(errors), false).map(serializeError),
|
|
@@ -4809,8 +4818,8 @@
|
|
|
4809
4818
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
4810
4819
|
case 29:
|
|
4811
4820
|
// Note: Wait a short time to prevent race conditions
|
|
4812
|
-
|
|
4813
|
-
|
|
4821
|
+
_g.sent();
|
|
4822
|
+
_g.label = 30;
|
|
4814
4823
|
case 30: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Successful PipelineExecutorResult', {
|
|
4815
4824
|
isSuccessful: true,
|
|
4816
4825
|
errors: errors.map(serializeError),
|
|
@@ -4837,7 +4846,7 @@
|
|
|
4837
4846
|
*/
|
|
4838
4847
|
function createPipelineExecutor(options) {
|
|
4839
4848
|
var _this = this;
|
|
4840
|
-
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 ? exports.DEFAULT_IS_VERBOSE : _d, _e = options.isNotPreparedWarningSupressed, isNotPreparedWarningSupressed = _e === void 0 ? false : _e, _f = options.rootDirname, rootDirname =
|
|
4849
|
+
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 ? exports.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;
|
|
4841
4850
|
validatePipeline(pipeline);
|
|
4842
4851
|
var pipelineIdentification = (function () {
|
|
4843
4852
|
// Note: This is a ๐ implementation of [๐]
|
|
@@ -4877,6 +4886,9 @@
|
|
|
4877
4886
|
isVerbose: isVerbose,
|
|
4878
4887
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
4879
4888
|
rootDirname: rootDirname,
|
|
4889
|
+
cacheDirname: cacheDirname,
|
|
4890
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
4891
|
+
isAutoInstalled: isAutoInstalled,
|
|
4880
4892
|
})];
|
|
4881
4893
|
});
|
|
4882
4894
|
}); };
|