@promptbook/cli 0.77.0 → 0.77.1
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 +1 -1
- package/esm/index.es.js +119 -59
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -2
- package/esm/typings/src/cli/test/ptbk.d.ts +1 -1
- package/esm/typings/src/errors/0-index.d.ts +46 -1
- package/esm/typings/src/errors/utils/ErrorJson.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.test.d.ts +1 -0
- package/package.json +1 -1
- package/umd/index.umd.js +119 -59
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -92,7 +92,7 @@ There is also a javascript and json format available.
|
|
|
92
92
|
## Prettify
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
|
-
npx ptbk prettify promptbook/**/*.book.md
|
|
95
|
+
npx ptbk prettify 'promptbook/**/*.book.md'
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
This will prettify all promptbooks in `promptbook` directory and adds Mermaid graphs to them.
|
package/esm/index.es.js
CHANGED
|
@@ -37,7 +37,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
37
37
|
*
|
|
38
38
|
* @see https://github.com/webgptorg/promptbook
|
|
39
39
|
*/
|
|
40
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.77.0
|
|
40
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.77.0';
|
|
41
41
|
/**
|
|
42
42
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
43
43
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3623,7 +3623,7 @@ var LimitReachedError = /** @class */ (function (_super) {
|
|
|
3623
3623
|
*
|
|
3624
3624
|
* @public exported from `@promptbook/core`
|
|
3625
3625
|
*/
|
|
3626
|
-
var
|
|
3626
|
+
var PROMPTBOOK_ERRORS = {
|
|
3627
3627
|
AbstractFormatError: AbstractFormatError,
|
|
3628
3628
|
CsvFormatError: CsvFormatError,
|
|
3629
3629
|
CollectionError: CollectionError,
|
|
@@ -3641,6 +3641,35 @@ var ERRORS = {
|
|
|
3641
3641
|
UnexpectedError: UnexpectedError,
|
|
3642
3642
|
// TODO: [🪑]> VersionMismatchError,
|
|
3643
3643
|
};
|
|
3644
|
+
/**
|
|
3645
|
+
* Index of all javascript errors
|
|
3646
|
+
*
|
|
3647
|
+
* @private for internal usage
|
|
3648
|
+
*/
|
|
3649
|
+
var COMMON_JAVASCRIPT_ERRORS = {
|
|
3650
|
+
Error: Error,
|
|
3651
|
+
EvalError: EvalError,
|
|
3652
|
+
RangeError: RangeError,
|
|
3653
|
+
ReferenceError: ReferenceError,
|
|
3654
|
+
SyntaxError: SyntaxError,
|
|
3655
|
+
TypeError: TypeError,
|
|
3656
|
+
URIError: URIError,
|
|
3657
|
+
AggregateError: AggregateError,
|
|
3658
|
+
/*
|
|
3659
|
+
Note: Not widely supported
|
|
3660
|
+
> InternalError,
|
|
3661
|
+
> ModuleError,
|
|
3662
|
+
> HeapError,
|
|
3663
|
+
> WebAssemblyCompileError,
|
|
3664
|
+
> WebAssemblyRuntimeError,
|
|
3665
|
+
*/
|
|
3666
|
+
};
|
|
3667
|
+
/**
|
|
3668
|
+
* Index of all errors
|
|
3669
|
+
*
|
|
3670
|
+
* @private for internal usage
|
|
3671
|
+
*/
|
|
3672
|
+
var ALL_ERRORS = __assign(__assign({}, PROMPTBOOK_ERRORS), COMMON_JAVASCRIPT_ERRORS);
|
|
3644
3673
|
/**
|
|
3645
3674
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3646
3675
|
*/
|
|
@@ -3651,11 +3680,11 @@ var ERRORS = {
|
|
|
3651
3680
|
* @public exported from `@promptbook/utils`
|
|
3652
3681
|
*/
|
|
3653
3682
|
function deserializeError(error) {
|
|
3654
|
-
|
|
3655
|
-
|
|
3683
|
+
var ErrorClass = ALL_ERRORS[error.name];
|
|
3684
|
+
if (ErrorClass === undefined) {
|
|
3685
|
+
return new Error("".concat(error.name, ": ").concat(error.message));
|
|
3656
3686
|
}
|
|
3657
|
-
|
|
3658
|
-
return new CustomError(error.message);
|
|
3687
|
+
return new ErrorClass(error.message);
|
|
3659
3688
|
}
|
|
3660
3689
|
|
|
3661
3690
|
/**
|
|
@@ -3729,8 +3758,8 @@ function isPipelinePrepared(pipeline) {
|
|
|
3729
3758
|
*/
|
|
3730
3759
|
function serializeError(error) {
|
|
3731
3760
|
var name = error.name, message = error.message, stack = error.stack;
|
|
3732
|
-
if (!
|
|
3733
|
-
|
|
3761
|
+
if (!Object.keys(ALL_ERRORS).includes(name)) {
|
|
3762
|
+
console.error(spaceTrim$1(function (block) { return "\n \n Cannot serialize error with name \"".concat(name, "\"\n\n ").concat(block(stack || message), "\n \n "); }));
|
|
3734
3763
|
}
|
|
3735
3764
|
return {
|
|
3736
3765
|
name: name,
|
|
@@ -9043,7 +9072,7 @@ function removeContentComments(content) {
|
|
|
9043
9072
|
* @public exported from `@promptbook/core`
|
|
9044
9073
|
*/
|
|
9045
9074
|
function pipelineStringToJsonSync(pipelineString) {
|
|
9046
|
-
var e_1, _a, e_2, _b, e_3, _c, e_4, _d;
|
|
9075
|
+
var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e;
|
|
9047
9076
|
var $pipelineJson = {
|
|
9048
9077
|
title: undefined /* <- Note: [🍙] Putting here placeholder to keep `title` on top at final JSON */,
|
|
9049
9078
|
pipelineUrl: undefined /* <- Note: Putting here placeholder to keep `pipelineUrl` on top at final JSON */,
|
|
@@ -9072,7 +9101,7 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9072
9101
|
// =============================================================
|
|
9073
9102
|
// Note: 1️⃣ Parsing of the markdown into object
|
|
9074
9103
|
if (pipelineString.startsWith('#!')) {
|
|
9075
|
-
var
|
|
9104
|
+
var _f = __read(pipelineString.split('\n')), shebangLine_1 = _f[0], restLines = _f.slice(1);
|
|
9076
9105
|
if (!(shebangLine_1 || '').includes('ptbk')) {
|
|
9077
9106
|
throw new ParseError(spaceTrim(function (block) { return "\n It seems that you try to parse a book file which has non-standard shebang line for book files:\n Shebang line must contain 'ptbk'\n\n You have:\n ".concat(block(shebangLine_1 || '(empty line)'), "\n\n It should look like this:\n #!/usr/bin/env ptbk\n\n ").concat(block(getPipelineIdentification()), "\n "); }));
|
|
9078
9107
|
}
|
|
@@ -9082,7 +9111,7 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9082
9111
|
pipelineString = flattenMarkdown(pipelineString) /* <- Note: [🥞] */;
|
|
9083
9112
|
pipelineString = pipelineString.replaceAll(/`\{(?<parameterName>[a-z0-9_]+)\}`/gi, '{$<parameterName>}');
|
|
9084
9113
|
pipelineString = pipelineString.replaceAll(/`->\s+\{(?<parameterName>[a-z0-9_]+)\}`/gi, '-> {$<parameterName>}');
|
|
9085
|
-
var
|
|
9114
|
+
var _g = __read(splitMarkdownIntoSections(pipelineString).map(parseMarkdownSection)), pipelineHead = _g[0], pipelineSections = _g.slice(1); /* <- Note: [🥞] */
|
|
9086
9115
|
if (pipelineHead === undefined) {
|
|
9087
9116
|
throw new UnexpectedError(spaceTrim(function (block) { return "\n Pipeline head is not defined\n\n ".concat(block(getPipelineIdentification()), "\n\n This should never happen, because the pipeline already flattened\n "); }));
|
|
9088
9117
|
}
|
|
@@ -9173,11 +9202,41 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9173
9202
|
}
|
|
9174
9203
|
finally { if (e_1) throw e_1.error; }
|
|
9175
9204
|
}
|
|
9205
|
+
// =============================================================
|
|
9206
|
+
// Note: 4️⃣ Prepare unique section names with indexes when needed
|
|
9207
|
+
var sectionCounts = {};
|
|
9208
|
+
try {
|
|
9209
|
+
for (var pipelineSections_1 = __values(pipelineSections), pipelineSections_1_1 = pipelineSections_1.next(); !pipelineSections_1_1.done; pipelineSections_1_1 = pipelineSections_1.next()) {
|
|
9210
|
+
var section = pipelineSections_1_1.value;
|
|
9211
|
+
var name_1 = titleToName(section.title);
|
|
9212
|
+
if (sectionCounts[name_1] === undefined) {
|
|
9213
|
+
sectionCounts[name_1] = { count: 0, currentIndex: 0 };
|
|
9214
|
+
}
|
|
9215
|
+
sectionCounts[name_1].count++;
|
|
9216
|
+
}
|
|
9217
|
+
}
|
|
9218
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
9219
|
+
finally {
|
|
9220
|
+
try {
|
|
9221
|
+
if (pipelineSections_1_1 && !pipelineSections_1_1.done && (_b = pipelineSections_1.return)) _b.call(pipelineSections_1);
|
|
9222
|
+
}
|
|
9223
|
+
finally { if (e_2) throw e_2.error; }
|
|
9224
|
+
}
|
|
9225
|
+
var getUniqueSectionName = function (title) {
|
|
9226
|
+
var name = titleToName(title);
|
|
9227
|
+
var count = sectionCounts[name];
|
|
9228
|
+
if (count.count === 1) {
|
|
9229
|
+
return name;
|
|
9230
|
+
}
|
|
9231
|
+
var nameWithSuffix = "".concat(name, "-").concat(count.currentIndex);
|
|
9232
|
+
count.currentIndex++;
|
|
9233
|
+
return nameWithSuffix;
|
|
9234
|
+
};
|
|
9176
9235
|
var _loop_2 = function (section) {
|
|
9177
|
-
var
|
|
9236
|
+
var e_6, _m, e_7, _o;
|
|
9178
9237
|
// TODO: Parse section's description (the content out of the codeblock and lists)
|
|
9179
9238
|
var listItems_2 = extractAllListItemsFromMarkdown(section.content);
|
|
9180
|
-
var
|
|
9239
|
+
var _p = extractOneBlockFromMarkdown(section.content), language = _p.language, content = _p.content;
|
|
9181
9240
|
// TODO: [🎾][1] DRY description
|
|
9182
9241
|
var description_1 = section.content;
|
|
9183
9242
|
// Note: Remove codeblocks - TODO: [🎾]
|
|
@@ -9193,7 +9252,7 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9193
9252
|
isSectionTypeSet: false,
|
|
9194
9253
|
isTask: true,
|
|
9195
9254
|
taskType: undefined /* <- Note: [🍙] Putting here placeholder to keep `taskType` on top at final JSON */,
|
|
9196
|
-
name:
|
|
9255
|
+
name: getUniqueSectionName(section.title),
|
|
9197
9256
|
title: section.title,
|
|
9198
9257
|
description: description_1,
|
|
9199
9258
|
content: content,
|
|
@@ -9241,17 +9300,17 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9241
9300
|
};
|
|
9242
9301
|
try {
|
|
9243
9302
|
// TODO [♓️] List commands and before apply order them to achieve order-agnostic commands
|
|
9244
|
-
for (var commands_1 = (
|
|
9245
|
-
var
|
|
9303
|
+
for (var commands_1 = (e_6 = void 0, __values(commands)), commands_1_1 = commands_1.next(); !commands_1_1.done; commands_1_1 = commands_1.next()) {
|
|
9304
|
+
var _q = commands_1_1.value, listItem = _q.listItem, command = _q.command;
|
|
9246
9305
|
_loop_4(listItem, command);
|
|
9247
9306
|
}
|
|
9248
9307
|
}
|
|
9249
|
-
catch (
|
|
9308
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
9250
9309
|
finally {
|
|
9251
9310
|
try {
|
|
9252
|
-
if (commands_1_1 && !commands_1_1.done && (
|
|
9311
|
+
if (commands_1_1 && !commands_1_1.done && (_m = commands_1.return)) _m.call(commands_1);
|
|
9253
9312
|
}
|
|
9254
|
-
finally { if (
|
|
9313
|
+
finally { if (e_6) throw e_6.error; }
|
|
9255
9314
|
}
|
|
9256
9315
|
// TODO: [🍧] Should be done in SECTION command
|
|
9257
9316
|
if ($taskJson.taskType === 'SCRIPT_TASK') {
|
|
@@ -9265,8 +9324,8 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9265
9324
|
}
|
|
9266
9325
|
$taskJson.dependentParameterNames = Array.from(extractParameterNamesFromTask($taskJson));
|
|
9267
9326
|
try {
|
|
9268
|
-
for (var
|
|
9269
|
-
var parameterName =
|
|
9327
|
+
for (var _r = (e_7 = void 0, __values($taskJson.dependentParameterNames)), _s = _r.next(); !_s.done; _s = _r.next()) {
|
|
9328
|
+
var parameterName = _s.value;
|
|
9270
9329
|
// TODO: [🧠] This definition should be made first in the task
|
|
9271
9330
|
defineParam({
|
|
9272
9331
|
parameterName: parameterName,
|
|
@@ -9277,12 +9336,12 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9277
9336
|
});
|
|
9278
9337
|
}
|
|
9279
9338
|
}
|
|
9280
|
-
catch (
|
|
9339
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
9281
9340
|
finally {
|
|
9282
9341
|
try {
|
|
9283
|
-
if (
|
|
9342
|
+
if (_s && !_s.done && (_o = _r.return)) _o.call(_r);
|
|
9284
9343
|
}
|
|
9285
|
-
finally { if (
|
|
9344
|
+
finally { if (e_7) throw e_7.error; }
|
|
9286
9345
|
}
|
|
9287
9346
|
/*
|
|
9288
9347
|
// TODO: [🍧] This should be checked in `MODEL` command + better error message
|
|
@@ -9311,21 +9370,21 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9311
9370
|
};
|
|
9312
9371
|
try {
|
|
9313
9372
|
// =============================================================
|
|
9314
|
-
// Note:
|
|
9315
|
-
for (var
|
|
9316
|
-
var section =
|
|
9373
|
+
// Note: 5️⃣ Process each section of the pipeline
|
|
9374
|
+
for (var pipelineSections_2 = __values(pipelineSections), pipelineSections_2_1 = pipelineSections_2.next(); !pipelineSections_2_1.done; pipelineSections_2_1 = pipelineSections_2.next()) {
|
|
9375
|
+
var section = pipelineSections_2_1.value;
|
|
9317
9376
|
_loop_2(section);
|
|
9318
9377
|
}
|
|
9319
9378
|
}
|
|
9320
|
-
catch (
|
|
9379
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
9321
9380
|
finally {
|
|
9322
9381
|
try {
|
|
9323
|
-
if (
|
|
9382
|
+
if (pipelineSections_2_1 && !pipelineSections_2_1.done && (_c = pipelineSections_2.return)) _c.call(pipelineSections_2);
|
|
9324
9383
|
}
|
|
9325
|
-
finally { if (
|
|
9384
|
+
finally { if (e_3) throw e_3.error; }
|
|
9326
9385
|
}
|
|
9327
9386
|
// =============================================================
|
|
9328
|
-
// Note:
|
|
9387
|
+
// Note: 6️⃣ Mark parameters as INPUT if not explicitly set
|
|
9329
9388
|
if ($pipelineJson.parameters.every(function (parameter) { return !parameter.isInput; })) {
|
|
9330
9389
|
var _loop_3 = function (parameter) {
|
|
9331
9390
|
var isThisParameterResulting = $pipelineJson.tasks.some(function (task) { return task.resultingParameterName === parameter.name; });
|
|
@@ -9334,42 +9393,42 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9334
9393
|
}
|
|
9335
9394
|
};
|
|
9336
9395
|
try {
|
|
9337
|
-
for (var
|
|
9338
|
-
var parameter =
|
|
9396
|
+
for (var _h = __values($pipelineJson.parameters), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
9397
|
+
var parameter = _j.value;
|
|
9339
9398
|
_loop_3(parameter);
|
|
9340
9399
|
}
|
|
9341
9400
|
}
|
|
9342
|
-
catch (
|
|
9401
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
9343
9402
|
finally {
|
|
9344
9403
|
try {
|
|
9345
|
-
if (
|
|
9404
|
+
if (_j && !_j.done && (_d = _h.return)) _d.call(_h);
|
|
9346
9405
|
}
|
|
9347
|
-
finally { if (
|
|
9406
|
+
finally { if (e_4) throw e_4.error; }
|
|
9348
9407
|
}
|
|
9349
9408
|
}
|
|
9350
9409
|
// =============================================================
|
|
9351
|
-
// Note:
|
|
9410
|
+
// Note: 7️⃣ Mark all non-INPUT parameters as OUTPUT if any OUTPUT is not set
|
|
9352
9411
|
if ($pipelineJson.parameters.every(function (parameter) { return !parameter.isOutput; })) {
|
|
9353
9412
|
try {
|
|
9354
|
-
for (var
|
|
9355
|
-
var parameter =
|
|
9413
|
+
for (var _k = __values($pipelineJson.parameters), _l = _k.next(); !_l.done; _l = _k.next()) {
|
|
9414
|
+
var parameter = _l.value;
|
|
9356
9415
|
if (!parameter.isInput) {
|
|
9357
9416
|
parameter.isOutput = true;
|
|
9358
9417
|
}
|
|
9359
9418
|
}
|
|
9360
9419
|
}
|
|
9361
|
-
catch (
|
|
9420
|
+
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
9362
9421
|
finally {
|
|
9363
9422
|
try {
|
|
9364
|
-
if (
|
|
9423
|
+
if (_l && !_l.done && (_e = _k.return)) _e.call(_k);
|
|
9365
9424
|
}
|
|
9366
|
-
finally { if (
|
|
9425
|
+
finally { if (e_5) throw e_5.error; }
|
|
9367
9426
|
}
|
|
9368
9427
|
}
|
|
9369
9428
|
// =============================================================
|
|
9370
|
-
// Note:
|
|
9429
|
+
// Note: 8️⃣ Cleanup of undefined values
|
|
9371
9430
|
$pipelineJson.tasks.forEach(function (tasks) {
|
|
9372
|
-
var
|
|
9431
|
+
var e_8, _a;
|
|
9373
9432
|
try {
|
|
9374
9433
|
for (var _b = __values(Object.entries(tasks)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9375
9434
|
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
@@ -9378,16 +9437,16 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9378
9437
|
}
|
|
9379
9438
|
}
|
|
9380
9439
|
}
|
|
9381
|
-
catch (
|
|
9440
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
9382
9441
|
finally {
|
|
9383
9442
|
try {
|
|
9384
9443
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
9385
9444
|
}
|
|
9386
|
-
finally { if (
|
|
9445
|
+
finally { if (e_8) throw e_8.error; }
|
|
9387
9446
|
}
|
|
9388
9447
|
});
|
|
9389
9448
|
$pipelineJson.parameters.forEach(function (parameter) {
|
|
9390
|
-
var
|
|
9449
|
+
var e_9, _a;
|
|
9391
9450
|
try {
|
|
9392
9451
|
for (var _b = __values(Object.entries(parameter)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9393
9452
|
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
@@ -9396,12 +9455,12 @@ function pipelineStringToJsonSync(pipelineString) {
|
|
|
9396
9455
|
}
|
|
9397
9456
|
}
|
|
9398
9457
|
}
|
|
9399
|
-
catch (
|
|
9458
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
9400
9459
|
finally {
|
|
9401
9460
|
try {
|
|
9402
9461
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
9403
9462
|
}
|
|
9404
|
-
finally { if (
|
|
9463
|
+
finally { if (e_9) throw e_9.error; }
|
|
9405
9464
|
}
|
|
9406
9465
|
});
|
|
9407
9466
|
// =============================================================
|
|
@@ -10981,18 +11040,19 @@ function addAutoGeneratedSection(content, options) {
|
|
|
10981
11040
|
var warningLine = "<!-- ".concat(GENERATOR_WARNING, " -->");
|
|
10982
11041
|
var sectionRegex = new RegExp("<!--".concat(sectionName, "-->([\\s\\S]*?)<!--/").concat(sectionName, "-->"), 'g');
|
|
10983
11042
|
var sectionMatch = content.match(sectionRegex);
|
|
11043
|
+
var contentToInsert = spaceTrim(function (block) { return "\n <!--".concat(sectionName, "-->\n ").concat(block(warningLine), "\n ").concat(block(sectionContent), "\n <!--/").concat(sectionName, "-->\n "); });
|
|
10984
11044
|
if (sectionMatch) {
|
|
10985
|
-
return content.replace(sectionRegex,
|
|
11045
|
+
return content.replace(sectionRegex, contentToInsert);
|
|
10986
11046
|
}
|
|
11047
|
+
// Note: Following is the case when the section is not found in the file so we add it there
|
|
10987
11048
|
var placeForSection = removeContentComments(content).match(/^##.*$/im);
|
|
10988
|
-
if (
|
|
10989
|
-
|
|
10990
|
-
|
|
10991
|
-
"No place where to put the section <!--".concat(sectionName, "-->"));
|
|
10992
|
-
// <- [🚞]
|
|
11049
|
+
if (placeForSection !== null) {
|
|
11050
|
+
var _a = __read(placeForSection, 1), heading_1 = _a[0];
|
|
11051
|
+
return content.replace(heading_1, spaceTrim(function (block) { return "\n ".concat(block(contentToInsert), "\n \n ").concat(block(heading_1), "\n "); }));
|
|
10993
11052
|
}
|
|
10994
|
-
|
|
10995
|
-
|
|
11053
|
+
console.warn("No place where to put the section <!--".concat(sectionName, "-->, using the end of the file"));
|
|
11054
|
+
// <- TODO: [🚎] Some better way how to get warnings from pipeline parsing / logic
|
|
11055
|
+
return spaceTrim(function (block) { return "\n ".concat(block(content), "\n \n ").concat(block(contentToInsert), "\n "); });
|
|
10996
11056
|
}
|
|
10997
11057
|
/**
|
|
10998
11058
|
* TODO: [🏛] This can be part of markdown builder
|
|
@@ -11020,7 +11080,7 @@ function renderPromptbookMermaid(pipelineJson, options) {
|
|
|
11020
11080
|
if (!task) {
|
|
11021
11081
|
throw new Error("Could not find task for {".concat(parameterName, "}"));
|
|
11022
11082
|
}
|
|
11023
|
-
return normalizeTo_camelCase('task-' + titleToName(task.title));
|
|
11083
|
+
return task.name || normalizeTo_camelCase('task-' + titleToName(task.title));
|
|
11024
11084
|
};
|
|
11025
11085
|
var promptbookMermaid = spaceTrim(function (block) { return "\n\n %% \uD83D\uDD2E Tip: Open this on GitHub or in the VSCode website to see the Mermaid graph visually\n\n flowchart LR\n subgraph \"".concat(pipelineJson.title, "\"\n\n direction TB\n\n input((Input)):::input\n ").concat(block(pipelineJson.tasks
|
|
11026
11086
|
.flatMap(function (_a) {
|
|
@@ -11083,7 +11143,7 @@ function prettifyPipelineString(pipelineString, options) {
|
|
|
11083
11143
|
return { href: "#".concat(task.name), title: task.title };
|
|
11084
11144
|
},
|
|
11085
11145
|
});
|
|
11086
|
-
promptbookMermaidBlock = spaceTrim(function (block) { return "\n
|
|
11146
|
+
promptbookMermaidBlock = spaceTrim(function (block) { return "\n ```mermaid\n ".concat(block(promptbookMermaid_1), "\n ```\n "); });
|
|
11087
11147
|
pipelineString = addAutoGeneratedSection(pipelineString, {
|
|
11088
11148
|
sectionName: 'Graph',
|
|
11089
11149
|
sectionContent: promptbookMermaidBlock,
|