@promptbook/legacy-documents 0.75.6 โ 0.75.10
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/README.md +8 -2
- package/esm/index.es.js +85 -67
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +2 -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/formfactors/index.d.ts +1 -0
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +1 -0
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +6 -4
- package/esm/typings/src/types/typeAliases.d.ts +10 -0
- package/package.json +2 -2
- package/umd/index.umd.js +85 -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
|
@@ -8,6 +8,7 @@ import type { string_markdown } from '../types/typeAliases';
|
|
|
8
8
|
import type { string_markdown_section } from '../types/typeAliases';
|
|
9
9
|
import type { string_markdown_section_content } from '../types/typeAliases';
|
|
10
10
|
import type { string_markdown_text } from '../types/typeAliases';
|
|
11
|
+
import type { string_markdown_codeblock_language } from '../types/typeAliases';
|
|
11
12
|
import { addAutoGeneratedSection } from '../utils/markdown/addAutoGeneratedSection';
|
|
12
13
|
import { createMarkdownChart } from '../utils/markdown/createMarkdownChart';
|
|
13
14
|
import { createMarkdownTable } from '../utils/markdown/createMarkdownTable';
|
|
@@ -31,6 +32,7 @@ export type { string_markdown };
|
|
|
31
32
|
export type { string_markdown_section };
|
|
32
33
|
export type { string_markdown_section_content };
|
|
33
34
|
export type { string_markdown_text };
|
|
35
|
+
export type { string_markdown_codeblock_language };
|
|
34
36
|
export { addAutoGeneratedSection };
|
|
35
37
|
export { createMarkdownChart };
|
|
36
38
|
export { createMarkdownTable };
|
|
@@ -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';
|
|
@@ -151,6 +150,7 @@ import type { string_markdown } from '../types/typeAliases';
|
|
|
151
150
|
import type { string_markdown_section } from '../types/typeAliases';
|
|
152
151
|
import type { string_markdown_section_content } from '../types/typeAliases';
|
|
153
152
|
import type { string_markdown_text } from '../types/typeAliases';
|
|
153
|
+
import type { string_markdown_codeblock_language } from '../types/typeAliases';
|
|
154
154
|
import type { string_promptbook_documentation_url } from '../types/typeAliases';
|
|
155
155
|
import type { string_domain } from '../types/typeAliases';
|
|
156
156
|
import type { string_tdl } from '../types/typeAliases';
|
|
@@ -309,7 +309,6 @@ export type { AnthropicClaudeExecutionToolsOptions };
|
|
|
309
309
|
export type { AnthropicClaudeExecutionToolsDirectOptions };
|
|
310
310
|
export type { AnthropicClaudeExecutionToolsProxiedOptions };
|
|
311
311
|
export type { AzureOpenAiExecutionToolsOptions };
|
|
312
|
-
export type { LangtailExecutionToolsOptions };
|
|
313
312
|
export type { OpenAiAssistantExecutionToolsOptions };
|
|
314
313
|
export type { OpenAiExecutionToolsOptions };
|
|
315
314
|
export type { PromptbookServer_Error };
|
|
@@ -405,6 +404,7 @@ export type { string_markdown };
|
|
|
405
404
|
export type { string_markdown_section };
|
|
406
405
|
export type { string_markdown_section_content };
|
|
407
406
|
export type { string_markdown_text };
|
|
407
|
+
export type { string_markdown_codeblock_language };
|
|
408
408
|
export type { string_promptbook_documentation_url };
|
|
409
409
|
export type { string_domain };
|
|
410
410
|
export type { string_tdl };
|
|
@@ -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
|
*/
|
|
@@ -74,6 +74,7 @@ export declare const FORMFACTOR_DEFINITIONS: readonly [{
|
|
|
74
74
|
};
|
|
75
75
|
}, {
|
|
76
76
|
readonly name: "SHEETS";
|
|
77
|
+
readonly aliasNames: readonly ["SHEETS", "SHEET"];
|
|
77
78
|
readonly description: "@@@";
|
|
78
79
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/176";
|
|
79
80
|
readonly pipelineInterface: {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const SheetsFormfactorDefinition: {
|
|
7
7
|
readonly name: "SHEETS";
|
|
8
|
+
readonly aliasNames: readonly ["SHEETS", "SHEET"];
|
|
8
9
|
readonly description: "@@@";
|
|
9
10
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/176";
|
|
10
11
|
readonly pipelineInterface: {
|
|
@@ -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
|
};
|
|
@@ -208,6 +208,16 @@ export type string_markdown_section_content = string;
|
|
|
208
208
|
* @public exported from `@promptbook/markdown-utils`
|
|
209
209
|
*/
|
|
210
210
|
export type string_markdown_text = string;
|
|
211
|
+
/**
|
|
212
|
+
* Semantic helper
|
|
213
|
+
*
|
|
214
|
+
* Markdown code block language
|
|
215
|
+
*
|
|
216
|
+
* For example ```js -> `"js"`
|
|
217
|
+
*
|
|
218
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
219
|
+
*/
|
|
220
|
+
export type string_markdown_codeblock_language = 'book' | 'markdown' | 'text' | 'javascript' | 'css' | 'json';
|
|
211
221
|
/**
|
|
212
222
|
* @@@
|
|
213
223
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/legacy-documents",
|
|
3
|
-
"version": "0.75.
|
|
3
|
+
"version": "0.75.10",
|
|
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/legacy-documents.index.d.ts",
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@promptbook/core": "0.75.
|
|
57
|
+
"@promptbook/core": "0.75.10"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"colors": "1.4.0",
|
package/umd/index.umd.js
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.75.
|
|
26
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.75.9';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -453,6 +453,12 @@
|
|
|
453
453
|
* @public exported from `@promptbook/core`
|
|
454
454
|
*/
|
|
455
455
|
var DEFAULT_IS_VERBOSE = false;
|
|
456
|
+
/**
|
|
457
|
+
* @@@
|
|
458
|
+
*
|
|
459
|
+
* @public exported from `@promptbook/core`
|
|
460
|
+
*/
|
|
461
|
+
var DEFAULT_IS_AUTO_INSTALLED = false;
|
|
456
462
|
/**
|
|
457
463
|
* @@@
|
|
458
464
|
*
|
|
@@ -5244,12 +5250,12 @@
|
|
|
5244
5250
|
*/
|
|
5245
5251
|
function executeTask(options) {
|
|
5246
5252
|
return __awaiter(this, void 0, void 0, function () {
|
|
5247
|
-
var currentTask, preparedPipeline, parametersToPass, tools, onProgress, $executionReport, pipelineIdentification,
|
|
5248
|
-
var e_1,
|
|
5249
|
-
return __generator(this, function (
|
|
5250
|
-
switch (
|
|
5253
|
+
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;
|
|
5254
|
+
var e_1, _f, _g;
|
|
5255
|
+
return __generator(this, function (_h) {
|
|
5256
|
+
switch (_h.label) {
|
|
5251
5257
|
case 0:
|
|
5252
|
-
currentTask = options.currentTask, preparedPipeline = options.preparedPipeline, parametersToPass = options.parametersToPass, tools = options.tools, onProgress = options.onProgress, $executionReport = options.$executionReport, pipelineIdentification = options.pipelineIdentification,
|
|
5258
|
+
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;
|
|
5253
5259
|
name = "pipeline-executor-frame-".concat(currentTask.name);
|
|
5254
5260
|
title = currentTask.title;
|
|
5255
5261
|
priority = preparedPipeline.tasks.length - preparedPipeline.tasks.indexOf(currentTask);
|
|
@@ -5264,7 +5270,7 @@
|
|
|
5264
5270
|
// <- [๐ธ]
|
|
5265
5271
|
})];
|
|
5266
5272
|
case 1:
|
|
5267
|
-
|
|
5273
|
+
_h.sent();
|
|
5268
5274
|
usedParameterNames = extractParameterNamesFromTask(currentTask);
|
|
5269
5275
|
dependentParameterNames = new Set(currentTask.dependentParameterNames);
|
|
5270
5276
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
@@ -5275,15 +5281,15 @@
|
|
|
5275
5281
|
.map(function (name) { return "{".concat(name, "}"); })
|
|
5276
5282
|
.join(', '), "\n\n ").concat(block(pipelineIdentification), "\n\n "); }));
|
|
5277
5283
|
}
|
|
5278
|
-
|
|
5279
|
-
|
|
5284
|
+
_b = (_a = Object).freeze;
|
|
5285
|
+
_c = [{}];
|
|
5280
5286
|
return [4 /*yield*/, getReservedParametersForTask({
|
|
5281
5287
|
preparedPipeline: preparedPipeline,
|
|
5282
5288
|
task: currentTask,
|
|
5283
5289
|
pipelineIdentification: pipelineIdentification,
|
|
5284
5290
|
})];
|
|
5285
5291
|
case 2:
|
|
5286
|
-
definedParameters =
|
|
5292
|
+
definedParameters = _b.apply(_a, [__assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_h.sent())])), parametersToPass])]);
|
|
5287
5293
|
definedParameterNames = new Set(Object.keys(definedParameters));
|
|
5288
5294
|
parameters = {};
|
|
5289
5295
|
_loop_1 = function (parameterName) {
|
|
@@ -5303,15 +5309,15 @@
|
|
|
5303
5309
|
try {
|
|
5304
5310
|
// Note: [2] Check that all used parameters are defined and removing unused parameters for this task
|
|
5305
5311
|
// TODO: [๐ฉ๐พโ๐คโ๐ฉ๐ป] Use here `mapAvailableToExpectedParameters`
|
|
5306
|
-
for (
|
|
5307
|
-
parameterName =
|
|
5312
|
+
for (_d = __values(Array.from(union(definedParameterNames, usedParameterNames, dependentParameterNames))), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
5313
|
+
parameterName = _e.value;
|
|
5308
5314
|
_loop_1(parameterName);
|
|
5309
5315
|
}
|
|
5310
5316
|
}
|
|
5311
5317
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5312
5318
|
finally {
|
|
5313
5319
|
try {
|
|
5314
|
-
if (
|
|
5320
|
+
if (_e && !_e.done && (_f = _d.return)) _f.call(_d);
|
|
5315
5321
|
}
|
|
5316
5322
|
finally { if (e_1) throw e_1.error; }
|
|
5317
5323
|
}
|
|
@@ -5331,9 +5337,18 @@
|
|
|
5331
5337
|
tools: tools,
|
|
5332
5338
|
$executionReport: $executionReport,
|
|
5333
5339
|
pipelineIdentification: pipelineIdentification,
|
|
5340
|
+
maxExecutionAttempts: maxExecutionAttempts,
|
|
5341
|
+
maxParallelCount: maxParallelCount,
|
|
5342
|
+
csvSettings: csvSettings,
|
|
5343
|
+
isVerbose: isVerbose,
|
|
5344
|
+
rootDirname: rootDirname,
|
|
5345
|
+
cacheDirname: cacheDirname,
|
|
5346
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5347
|
+
isAutoInstalled: isAutoInstalled,
|
|
5348
|
+
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5334
5349
|
})];
|
|
5335
5350
|
case 3:
|
|
5336
|
-
resultString =
|
|
5351
|
+
resultString = _h.sent();
|
|
5337
5352
|
return [4 /*yield*/, onProgress({
|
|
5338
5353
|
name: name,
|
|
5339
5354
|
title: title,
|
|
@@ -5345,12 +5360,12 @@
|
|
|
5345
5360
|
// <- [๐ธ]
|
|
5346
5361
|
})];
|
|
5347
5362
|
case 4:
|
|
5348
|
-
|
|
5349
|
-
return [2 /*return*/, Object.freeze((
|
|
5350
|
-
|
|
5363
|
+
_h.sent();
|
|
5364
|
+
return [2 /*return*/, Object.freeze((_g = {},
|
|
5365
|
+
_g[currentTask.resultingParameterName] =
|
|
5351
5366
|
// <- Note: [๐ฉโ๐ฉโ๐ง] No need to detect parameter collision here because pipeline checks logic consistency during construction
|
|
5352
5367
|
resultString,
|
|
5353
|
-
|
|
5368
|
+
_g))];
|
|
5354
5369
|
}
|
|
5355
5370
|
});
|
|
5356
5371
|
});
|
|
@@ -5409,12 +5424,12 @@
|
|
|
5409
5424
|
*/
|
|
5410
5425
|
function executePipeline(options) {
|
|
5411
5426
|
return __awaiter(this, void 0, void 0, function () {
|
|
5412
|
-
var inputParameters, tools, onProgress, pipeline, setPreparedPipeline, pipelineIdentification, maxParallelCount, rootDirname,
|
|
5413
|
-
var e_1,
|
|
5414
|
-
return __generator(this, function (
|
|
5415
|
-
switch (
|
|
5427
|
+
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;
|
|
5428
|
+
var e_1, _e, e_2, _f;
|
|
5429
|
+
return __generator(this, function (_g) {
|
|
5430
|
+
switch (_g.label) {
|
|
5416
5431
|
case 0:
|
|
5417
|
-
inputParameters = options.inputParameters, tools = options.tools, onProgress = options.onProgress, pipeline = options.pipeline, setPreparedPipeline = options.setPreparedPipeline, pipelineIdentification = options.pipelineIdentification, maxParallelCount = options.maxParallelCount, rootDirname = options.rootDirname,
|
|
5432
|
+
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;
|
|
5418
5433
|
preparedPipeline = options.preparedPipeline;
|
|
5419
5434
|
if (!(preparedPipeline === undefined)) return [3 /*break*/, 2];
|
|
5420
5435
|
return [4 /*yield*/, preparePipeline(pipeline, tools, {
|
|
@@ -5423,9 +5438,9 @@
|
|
|
5423
5438
|
maxParallelCount: maxParallelCount,
|
|
5424
5439
|
})];
|
|
5425
5440
|
case 1:
|
|
5426
|
-
preparedPipeline =
|
|
5441
|
+
preparedPipeline = _g.sent();
|
|
5427
5442
|
setPreparedPipeline(preparedPipeline);
|
|
5428
|
-
|
|
5443
|
+
_g.label = 2;
|
|
5429
5444
|
case 2:
|
|
5430
5445
|
errors = [];
|
|
5431
5446
|
warnings = [];
|
|
@@ -5438,17 +5453,17 @@
|
|
|
5438
5453
|
promptExecutions: [],
|
|
5439
5454
|
};
|
|
5440
5455
|
isReturned = false;
|
|
5441
|
-
|
|
5456
|
+
_g.label = 3;
|
|
5442
5457
|
case 3:
|
|
5443
|
-
|
|
5444
|
-
|
|
5458
|
+
_g.trys.push([3, 9, 10, 11]);
|
|
5459
|
+
_a = __values(preparedPipeline.parameters.filter(function (_a) {
|
|
5445
5460
|
var isInput = _a.isInput;
|
|
5446
5461
|
return isInput;
|
|
5447
|
-
})),
|
|
5448
|
-
|
|
5462
|
+
})), _b = _a.next();
|
|
5463
|
+
_g.label = 4;
|
|
5449
5464
|
case 4:
|
|
5450
|
-
if (!!
|
|
5451
|
-
parameter =
|
|
5465
|
+
if (!!_b.done) return [3 /*break*/, 8];
|
|
5466
|
+
parameter = _b.value;
|
|
5452
5467
|
if (!(inputParameters[parameter.name] === undefined)) return [3 /*break*/, 7];
|
|
5453
5468
|
isReturned = true;
|
|
5454
5469
|
if (!(onProgress !== undefined)) return [3 /*break*/, 6];
|
|
@@ -5456,8 +5471,8 @@
|
|
|
5456
5471
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5457
5472
|
case 5:
|
|
5458
5473
|
// Note: Wait a short time to prevent race conditions
|
|
5459
|
-
|
|
5460
|
-
|
|
5474
|
+
_g.sent();
|
|
5475
|
+
_g.label = 6;
|
|
5461
5476
|
case 6: return [2 /*return*/, $asDeeplyFrozenSerializableJson("Unuccessful PipelineExecutorResult (with missing parameter {".concat(parameter.name, "}) PipelineExecutorResult"), {
|
|
5462
5477
|
isSuccessful: false,
|
|
5463
5478
|
errors: __spreadArray([
|
|
@@ -5470,24 +5485,24 @@
|
|
|
5470
5485
|
preparedPipeline: preparedPipeline,
|
|
5471
5486
|
})];
|
|
5472
5487
|
case 7:
|
|
5473
|
-
|
|
5488
|
+
_b = _a.next();
|
|
5474
5489
|
return [3 /*break*/, 4];
|
|
5475
5490
|
case 8: return [3 /*break*/, 11];
|
|
5476
5491
|
case 9:
|
|
5477
|
-
e_1_1 =
|
|
5492
|
+
e_1_1 = _g.sent();
|
|
5478
5493
|
e_1 = { error: e_1_1 };
|
|
5479
5494
|
return [3 /*break*/, 11];
|
|
5480
5495
|
case 10:
|
|
5481
5496
|
try {
|
|
5482
|
-
if (
|
|
5497
|
+
if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
|
|
5483
5498
|
}
|
|
5484
5499
|
finally { if (e_1) throw e_1.error; }
|
|
5485
5500
|
return [7 /*endfinally*/];
|
|
5486
5501
|
case 11:
|
|
5487
5502
|
_loop_1 = function (parameterName) {
|
|
5488
5503
|
var parameter;
|
|
5489
|
-
return __generator(this, function (
|
|
5490
|
-
switch (
|
|
5504
|
+
return __generator(this, function (_h) {
|
|
5505
|
+
switch (_h.label) {
|
|
5491
5506
|
case 0:
|
|
5492
5507
|
parameter = preparedPipeline.parameters.find(function (_a) {
|
|
5493
5508
|
var name = _a.name;
|
|
@@ -5504,8 +5519,8 @@
|
|
|
5504
5519
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5505
5520
|
case 2:
|
|
5506
5521
|
// Note: Wait a short time to prevent race conditions
|
|
5507
|
-
|
|
5508
|
-
|
|
5522
|
+
_h.sent();
|
|
5523
|
+
_h.label = 3;
|
|
5509
5524
|
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 "); }), {
|
|
5510
5525
|
isSuccessful: false,
|
|
5511
5526
|
errors: __spreadArray([
|
|
@@ -5521,39 +5536,39 @@
|
|
|
5521
5536
|
}
|
|
5522
5537
|
});
|
|
5523
5538
|
};
|
|
5524
|
-
|
|
5539
|
+
_g.label = 12;
|
|
5525
5540
|
case 12:
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5541
|
+
_g.trys.push([12, 17, 18, 19]);
|
|
5542
|
+
_c = __values(Object.keys(inputParameters)), _d = _c.next();
|
|
5543
|
+
_g.label = 13;
|
|
5529
5544
|
case 13:
|
|
5530
|
-
if (!!
|
|
5531
|
-
parameterName =
|
|
5545
|
+
if (!!_d.done) return [3 /*break*/, 16];
|
|
5546
|
+
parameterName = _d.value;
|
|
5532
5547
|
return [5 /*yield**/, _loop_1(parameterName)];
|
|
5533
5548
|
case 14:
|
|
5534
|
-
state_1 =
|
|
5549
|
+
state_1 = _g.sent();
|
|
5535
5550
|
if (typeof state_1 === "object")
|
|
5536
5551
|
return [2 /*return*/, state_1.value];
|
|
5537
|
-
|
|
5552
|
+
_g.label = 15;
|
|
5538
5553
|
case 15:
|
|
5539
|
-
|
|
5554
|
+
_d = _c.next();
|
|
5540
5555
|
return [3 /*break*/, 13];
|
|
5541
5556
|
case 16: return [3 /*break*/, 19];
|
|
5542
5557
|
case 17:
|
|
5543
|
-
e_2_1 =
|
|
5558
|
+
e_2_1 = _g.sent();
|
|
5544
5559
|
e_2 = { error: e_2_1 };
|
|
5545
5560
|
return [3 /*break*/, 19];
|
|
5546
5561
|
case 18:
|
|
5547
5562
|
try {
|
|
5548
|
-
if (
|
|
5563
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
5549
5564
|
}
|
|
5550
5565
|
finally { if (e_2) throw e_2.error; }
|
|
5551
5566
|
return [7 /*endfinally*/];
|
|
5552
5567
|
case 19:
|
|
5553
5568
|
parametersToPass = inputParameters;
|
|
5554
|
-
|
|
5569
|
+
_g.label = 20;
|
|
5555
5570
|
case 20:
|
|
5556
|
-
|
|
5571
|
+
_g.trys.push([20, 25, , 28]);
|
|
5557
5572
|
resovedParameterNames_1 = preparedPipeline.parameters
|
|
5558
5573
|
.filter(function (_a) {
|
|
5559
5574
|
var isInput = _a.isInput;
|
|
@@ -5568,8 +5583,8 @@
|
|
|
5568
5583
|
loopLimit = LOOP_LIMIT;
|
|
5569
5584
|
_loop_2 = function () {
|
|
5570
5585
|
var currentTask, work_1;
|
|
5571
|
-
return __generator(this, function (
|
|
5572
|
-
switch (
|
|
5586
|
+
return __generator(this, function (_j) {
|
|
5587
|
+
switch (_j.label) {
|
|
5573
5588
|
case 0:
|
|
5574
5589
|
if (loopLimit-- < 0) {
|
|
5575
5590
|
// Note: Really UnexpectedError not LimitReachedError - this should be catched during validatePipeline
|
|
@@ -5605,7 +5620,7 @@
|
|
|
5605
5620
|
if (!!currentTask) return [3 /*break*/, 3];
|
|
5606
5621
|
/* [๐คนโโ๏ธ] */ return [4 /*yield*/, Promise.race(resolving_1)];
|
|
5607
5622
|
case 2:
|
|
5608
|
-
/* [๐คนโโ๏ธ] */
|
|
5623
|
+
/* [๐คนโโ๏ธ] */ _j.sent();
|
|
5609
5624
|
return [3 /*break*/, 4];
|
|
5610
5625
|
case 3:
|
|
5611
5626
|
unresovedTasks_1 = unresovedTasks_1.filter(function (task) { return task !== currentTask; });
|
|
@@ -5630,24 +5645,24 @@
|
|
|
5630
5645
|
// <- Note: Errors are catched here [3]
|
|
5631
5646
|
// 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
|
|
5632
5647
|
resolving_1.push(work_1);
|
|
5633
|
-
|
|
5648
|
+
_j.label = 4;
|
|
5634
5649
|
case 4: return [2 /*return*/];
|
|
5635
5650
|
}
|
|
5636
5651
|
});
|
|
5637
5652
|
};
|
|
5638
|
-
|
|
5653
|
+
_g.label = 21;
|
|
5639
5654
|
case 21:
|
|
5640
5655
|
if (!(unresovedTasks_1.length > 0)) return [3 /*break*/, 23];
|
|
5641
5656
|
return [5 /*yield**/, _loop_2()];
|
|
5642
5657
|
case 22:
|
|
5643
|
-
|
|
5658
|
+
_g.sent();
|
|
5644
5659
|
return [3 /*break*/, 21];
|
|
5645
5660
|
case 23: return [4 /*yield*/, Promise.all(resolving_1)];
|
|
5646
5661
|
case 24:
|
|
5647
|
-
|
|
5662
|
+
_g.sent();
|
|
5648
5663
|
return [3 /*break*/, 28];
|
|
5649
5664
|
case 25:
|
|
5650
|
-
error_1 =
|
|
5665
|
+
error_1 = _g.sent();
|
|
5651
5666
|
if (!(error_1 instanceof Error)) {
|
|
5652
5667
|
throw error_1;
|
|
5653
5668
|
}
|
|
@@ -5667,8 +5682,8 @@
|
|
|
5667
5682
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5668
5683
|
case 26:
|
|
5669
5684
|
// Note: Wait a short time to prevent race conditions
|
|
5670
|
-
|
|
5671
|
-
|
|
5685
|
+
_g.sent();
|
|
5686
|
+
_g.label = 27;
|
|
5672
5687
|
case 27: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Unuccessful PipelineExecutorResult (with misc errors) PipelineExecutorResult', {
|
|
5673
5688
|
isSuccessful: false,
|
|
5674
5689
|
errors: __spreadArray([error_1], __read(errors), false).map(serializeError),
|
|
@@ -5695,8 +5710,8 @@
|
|
|
5695
5710
|
return [4 /*yield*/, waitasecond.forTime(IMMEDIATE_TIME)];
|
|
5696
5711
|
case 29:
|
|
5697
5712
|
// Note: Wait a short time to prevent race conditions
|
|
5698
|
-
|
|
5699
|
-
|
|
5713
|
+
_g.sent();
|
|
5714
|
+
_g.label = 30;
|
|
5700
5715
|
case 30: return [2 /*return*/, $asDeeplyFrozenSerializableJson('Successful PipelineExecutorResult', {
|
|
5701
5716
|
isSuccessful: true,
|
|
5702
5717
|
errors: errors.map(serializeError),
|
|
@@ -5723,7 +5738,7 @@
|
|
|
5723
5738
|
*/
|
|
5724
5739
|
function createPipelineExecutor(options) {
|
|
5725
5740
|
var _this = this;
|
|
5726
|
-
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 =
|
|
5741
|
+
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;
|
|
5727
5742
|
validatePipeline(pipeline);
|
|
5728
5743
|
var pipelineIdentification = (function () {
|
|
5729
5744
|
// Note: This is a ๐ implementation of [๐]
|
|
@@ -5763,6 +5778,9 @@
|
|
|
5763
5778
|
isVerbose: isVerbose,
|
|
5764
5779
|
isNotPreparedWarningSupressed: isNotPreparedWarningSupressed,
|
|
5765
5780
|
rootDirname: rootDirname,
|
|
5781
|
+
cacheDirname: cacheDirname,
|
|
5782
|
+
intermediateFilesStrategy: intermediateFilesStrategy,
|
|
5783
|
+
isAutoInstalled: isAutoInstalled,
|
|
5766
5784
|
})];
|
|
5767
5785
|
});
|
|
5768
5786
|
}); };
|