@promptbook/node 0.73.0 → 0.74.0-2

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.
Files changed (35) hide show
  1. package/README.md +130 -3
  2. package/esm/index.es.js +230 -353
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/anthropic-claude.index.d.ts +2 -2
  5. package/esm/typings/src/_packages/azure-openai.index.d.ts +2 -2
  6. package/esm/typings/src/_packages/browser.index.d.ts +2 -2
  7. package/esm/typings/src/_packages/cli.index.d.ts +2 -2
  8. package/esm/typings/src/_packages/core.index.d.ts +2 -2
  9. package/esm/typings/src/_packages/documents.index.d.ts +2 -2
  10. package/esm/typings/src/_packages/execute-javascript.index.d.ts +2 -2
  11. package/esm/typings/src/_packages/fake-llm.index.d.ts +2 -2
  12. package/esm/typings/src/_packages/langtail.index.d.ts +2 -2
  13. package/esm/typings/src/_packages/legacy-documents.index.d.ts +2 -2
  14. package/esm/typings/src/_packages/markdown-utils.index.d.ts +2 -2
  15. package/esm/typings/src/_packages/node.index.d.ts +2 -2
  16. package/esm/typings/src/_packages/openai.index.d.ts +2 -2
  17. package/esm/typings/src/_packages/pdf.index.d.ts +2 -2
  18. package/esm/typings/src/_packages/remote-client.index.d.ts +2 -2
  19. package/esm/typings/src/_packages/remote-server.index.d.ts +2 -2
  20. package/esm/typings/src/_packages/utils.index.d.ts +2 -2
  21. package/esm/typings/src/_packages/website-crawler.index.d.ts +2 -2
  22. package/esm/typings/src/cli/cli-commands/make.d.ts +0 -1
  23. package/esm/typings/src/cli/cli-commands/run.d.ts +13 -0
  24. package/esm/typings/src/cli/promptbookCli.d.ts +1 -0
  25. package/esm/typings/src/cli/test/ptbk.d.ts +4 -1
  26. package/esm/typings/src/commands/{PROMPTBOOK_VERSION/PromptbookVersionCommand.d.ts → BOOK_VERSION/BookVersionCommand.d.ts} +4 -4
  27. package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +9 -0
  28. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +1 -1
  29. package/esm/typings/src/commands/index.d.ts +1 -1
  30. package/esm/typings/src/version.d.ts +13 -2
  31. package/package.json +2 -2
  32. package/umd/index.umd.js +231 -353
  33. package/umd/index.umd.js.map +1 -1
  34. package/esm/typings/src/commands/PROMPTBOOK_VERSION/promptbookVersionCommandParser.d.ts +0 -9
  35. /package/esm/typings/src/commands/{PROMPTBOOK_VERSION/promptbookVersionCommand.test.d.ts → BOOK_VERSION/bookVersionCommand.test.d.ts} +0 -0
package/umd/index.umd.js CHANGED
@@ -33,10 +33,20 @@
33
33
 
34
34
  // ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
35
35
  /**
36
- * The version of the Promptbook library
36
+ * The version of the Book language
37
+ *
38
+ * @see https://github.com/webgptorg/book
39
+ */
40
+ var BOOK_LANGUAGE_VERSION = '1.0.0';
41
+ /**
42
+ * The version of the Promptbook engine
43
+ *
44
+ * @see https://github.com/webgptorg/promptbook
45
+ */
46
+ var PROMPTBOOK_ENGINE_VERSION = '0.74.0-1';
47
+ /**
48
+ * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
37
49
  */
38
- var PROMPTBOOK_VERSION = '0.72.0';
39
- // TODO: [main] !!!! List here all the versions and annotate + put into script
40
50
 
41
51
  /*! *****************************************************************************
42
52
  Copyright (c) Microsoft Corporation.
@@ -460,12 +470,6 @@
460
470
  * @public exported from `@promptbook/core`
461
471
  */
462
472
  var DEFAULT_IS_VERBOSE = false;
463
- /**
464
- * @@@
465
- *
466
- * @public exported from `@promptbook/core`
467
- */
468
- var DEFAULT_IS_AUTO_INSTALLED = false;
469
473
  /**
470
474
  * @@@
471
475
  *
@@ -870,6 +874,188 @@
870
874
  },
871
875
  });
872
876
 
877
+ /**
878
+ * @@@
879
+ *
880
+ * @public exported from `@promptbook/utils`
881
+ */
882
+ function deepClone(objectValue) {
883
+ return JSON.parse(JSON.stringify(objectValue));
884
+ /*
885
+ TODO: [🧠] Is there a better implementation?
886
+ > const propertyNames = Object.getOwnPropertyNames(objectValue);
887
+ > for (const propertyName of propertyNames) {
888
+ > const value = (objectValue as really_any)[propertyName];
889
+ > if (value && typeof value === 'object') {
890
+ > deepClone(value);
891
+ > }
892
+ > }
893
+ > return Object.assign({}, objectValue);
894
+ */
895
+ }
896
+ /**
897
+ * TODO: [🧠] Is there a way how to meaningfully test this utility
898
+ */
899
+
900
+ /**
901
+ * Function `addUsage` will add multiple usages into one
902
+ *
903
+ * Note: If you provide 0 values, it returns ZERO_USAGE
904
+ *
905
+ * @public exported from `@promptbook/core`
906
+ */
907
+ function addUsage() {
908
+ var usageItems = [];
909
+ for (var _i = 0; _i < arguments.length; _i++) {
910
+ usageItems[_i] = arguments[_i];
911
+ }
912
+ return usageItems.reduce(function (acc, item) {
913
+ var e_1, _a, e_2, _b;
914
+ var _c;
915
+ acc.price.value += ((_c = item.price) === null || _c === void 0 ? void 0 : _c.value) || 0;
916
+ try {
917
+ for (var _d = __values(Object.keys(acc.input)), _e = _d.next(); !_e.done; _e = _d.next()) {
918
+ var key = _e.value;
919
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
920
+ //@ts-ignore
921
+ if (item.input[key]) {
922
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
923
+ //@ts-ignore
924
+ acc.input[key].value += item.input[key].value || 0;
925
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
926
+ //@ts-ignore
927
+ if (item.input[key].isUncertain) {
928
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
929
+ //@ts-ignore
930
+ acc.input[key].isUncertain = true;
931
+ }
932
+ }
933
+ }
934
+ }
935
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
936
+ finally {
937
+ try {
938
+ if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
939
+ }
940
+ finally { if (e_1) throw e_1.error; }
941
+ }
942
+ try {
943
+ for (var _f = __values(Object.keys(acc.output)), _g = _f.next(); !_g.done; _g = _f.next()) {
944
+ var key = _g.value;
945
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
946
+ //@ts-ignore
947
+ if (item.output[key]) {
948
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
949
+ //@ts-ignore
950
+ acc.output[key].value += item.output[key].value || 0;
951
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
952
+ //@ts-ignore
953
+ if (item.output[key].isUncertain) {
954
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
955
+ //@ts-ignore
956
+ acc.output[key].isUncertain = true;
957
+ }
958
+ }
959
+ }
960
+ }
961
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
962
+ finally {
963
+ try {
964
+ if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
965
+ }
966
+ finally { if (e_2) throw e_2.error; }
967
+ }
968
+ return acc;
969
+ }, deepClone(ZERO_USAGE));
970
+ }
971
+
972
+ /**
973
+ * Intercepts LLM tools and counts total usage of the tools
974
+ *
975
+ * @param llmTools LLM tools to be intercepted with usage counting
976
+ * @returns LLM tools with same functionality with added total cost counting
977
+ * @public exported from `@promptbook/core`
978
+ */
979
+ function countTotalUsage(llmTools) {
980
+ var _this = this;
981
+ var totalUsage = ZERO_USAGE;
982
+ var proxyTools = {
983
+ get title() {
984
+ // TODO: [🧠] Maybe put here some suffix
985
+ return llmTools.title;
986
+ },
987
+ get description() {
988
+ // TODO: [🧠] Maybe put here some suffix
989
+ return llmTools.description;
990
+ },
991
+ checkConfiguration: function () {
992
+ return __awaiter(this, void 0, void 0, function () {
993
+ return __generator(this, function (_a) {
994
+ return [2 /*return*/, /* not await */ llmTools.checkConfiguration()];
995
+ });
996
+ });
997
+ },
998
+ listModels: function () {
999
+ return /* not await */ llmTools.listModels();
1000
+ },
1001
+ getTotalUsage: function () {
1002
+ // <- Note: [🥫] Not using getter `get totalUsage` but `getTotalUsage` to allow this object to be proxied
1003
+ return totalUsage;
1004
+ },
1005
+ };
1006
+ if (llmTools.callChatModel !== undefined) {
1007
+ proxyTools.callChatModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
1008
+ var promptResult;
1009
+ return __generator(this, function (_a) {
1010
+ switch (_a.label) {
1011
+ case 0: return [4 /*yield*/, llmTools.callChatModel(prompt)];
1012
+ case 1:
1013
+ promptResult = _a.sent();
1014
+ totalUsage = addUsage(totalUsage, promptResult.usage);
1015
+ return [2 /*return*/, promptResult];
1016
+ }
1017
+ });
1018
+ }); };
1019
+ }
1020
+ if (llmTools.callCompletionModel !== undefined) {
1021
+ proxyTools.callCompletionModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
1022
+ var promptResult;
1023
+ return __generator(this, function (_a) {
1024
+ switch (_a.label) {
1025
+ case 0: return [4 /*yield*/, llmTools.callCompletionModel(prompt)];
1026
+ case 1:
1027
+ promptResult = _a.sent();
1028
+ totalUsage = addUsage(totalUsage, promptResult.usage);
1029
+ return [2 /*return*/, promptResult];
1030
+ }
1031
+ });
1032
+ }); };
1033
+ }
1034
+ if (llmTools.callEmbeddingModel !== undefined) {
1035
+ proxyTools.callEmbeddingModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
1036
+ var promptResult;
1037
+ return __generator(this, function (_a) {
1038
+ switch (_a.label) {
1039
+ case 0: return [4 /*yield*/, llmTools.callEmbeddingModel(prompt)];
1040
+ case 1:
1041
+ promptResult = _a.sent();
1042
+ totalUsage = addUsage(totalUsage, promptResult.usage);
1043
+ return [2 /*return*/, promptResult];
1044
+ }
1045
+ });
1046
+ }); };
1047
+ }
1048
+ // <- Note: [🤖]
1049
+ return proxyTools;
1050
+ }
1051
+ /**
1052
+ * TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
1053
+ * TODO: [🧠] Is there some meaningfull way how to test this util
1054
+ * TODO: [🧠][🌯] Maybe a way how to hide ability to `get totalUsage`
1055
+ * > const [llmToolsWithUsage,getUsage] = countTotalUsage(llmTools);
1056
+ * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
1057
+ */
1058
+
873
1059
  /**
874
1060
  * This error indicates errors during the execution of the pipeline
875
1061
  *
@@ -1178,188 +1364,6 @@
1178
1364
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
1179
1365
  */
1180
1366
 
1181
- /**
1182
- * @@@
1183
- *
1184
- * @public exported from `@promptbook/utils`
1185
- */
1186
- function deepClone(objectValue) {
1187
- return JSON.parse(JSON.stringify(objectValue));
1188
- /*
1189
- TODO: [🧠] Is there a better implementation?
1190
- > const propertyNames = Object.getOwnPropertyNames(objectValue);
1191
- > for (const propertyName of propertyNames) {
1192
- > const value = (objectValue as really_any)[propertyName];
1193
- > if (value && typeof value === 'object') {
1194
- > deepClone(value);
1195
- > }
1196
- > }
1197
- > return Object.assign({}, objectValue);
1198
- */
1199
- }
1200
- /**
1201
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1202
- */
1203
-
1204
- /**
1205
- * Function `addUsage` will add multiple usages into one
1206
- *
1207
- * Note: If you provide 0 values, it returns ZERO_USAGE
1208
- *
1209
- * @public exported from `@promptbook/core`
1210
- */
1211
- function addUsage() {
1212
- var usageItems = [];
1213
- for (var _i = 0; _i < arguments.length; _i++) {
1214
- usageItems[_i] = arguments[_i];
1215
- }
1216
- return usageItems.reduce(function (acc, item) {
1217
- var e_1, _a, e_2, _b;
1218
- var _c;
1219
- acc.price.value += ((_c = item.price) === null || _c === void 0 ? void 0 : _c.value) || 0;
1220
- try {
1221
- for (var _d = __values(Object.keys(acc.input)), _e = _d.next(); !_e.done; _e = _d.next()) {
1222
- var key = _e.value;
1223
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1224
- //@ts-ignore
1225
- if (item.input[key]) {
1226
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1227
- //@ts-ignore
1228
- acc.input[key].value += item.input[key].value || 0;
1229
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1230
- //@ts-ignore
1231
- if (item.input[key].isUncertain) {
1232
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1233
- //@ts-ignore
1234
- acc.input[key].isUncertain = true;
1235
- }
1236
- }
1237
- }
1238
- }
1239
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1240
- finally {
1241
- try {
1242
- if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
1243
- }
1244
- finally { if (e_1) throw e_1.error; }
1245
- }
1246
- try {
1247
- for (var _f = __values(Object.keys(acc.output)), _g = _f.next(); !_g.done; _g = _f.next()) {
1248
- var key = _g.value;
1249
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1250
- //@ts-ignore
1251
- if (item.output[key]) {
1252
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1253
- //@ts-ignore
1254
- acc.output[key].value += item.output[key].value || 0;
1255
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1256
- //@ts-ignore
1257
- if (item.output[key].isUncertain) {
1258
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1259
- //@ts-ignore
1260
- acc.output[key].isUncertain = true;
1261
- }
1262
- }
1263
- }
1264
- }
1265
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1266
- finally {
1267
- try {
1268
- if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
1269
- }
1270
- finally { if (e_2) throw e_2.error; }
1271
- }
1272
- return acc;
1273
- }, deepClone(ZERO_USAGE));
1274
- }
1275
-
1276
- /**
1277
- * Intercepts LLM tools and counts total usage of the tools
1278
- *
1279
- * @param llmTools LLM tools to be intercepted with usage counting
1280
- * @returns LLM tools with same functionality with added total cost counting
1281
- * @public exported from `@promptbook/core`
1282
- */
1283
- function countTotalUsage(llmTools) {
1284
- var _this = this;
1285
- var totalUsage = ZERO_USAGE;
1286
- var proxyTools = {
1287
- get title() {
1288
- // TODO: [🧠] Maybe put here some suffix
1289
- return llmTools.title;
1290
- },
1291
- get description() {
1292
- // TODO: [🧠] Maybe put here some suffix
1293
- return llmTools.description;
1294
- },
1295
- checkConfiguration: function () {
1296
- return __awaiter(this, void 0, void 0, function () {
1297
- return __generator(this, function (_a) {
1298
- return [2 /*return*/, /* not await */ llmTools.checkConfiguration()];
1299
- });
1300
- });
1301
- },
1302
- listModels: function () {
1303
- return /* not await */ llmTools.listModels();
1304
- },
1305
- getTotalUsage: function () {
1306
- // <- Note: [🥫] Not using getter `get totalUsage` but `getTotalUsage` to allow this object to be proxied
1307
- return totalUsage;
1308
- },
1309
- };
1310
- if (llmTools.callChatModel !== undefined) {
1311
- proxyTools.callChatModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
1312
- var promptResult;
1313
- return __generator(this, function (_a) {
1314
- switch (_a.label) {
1315
- case 0: return [4 /*yield*/, llmTools.callChatModel(prompt)];
1316
- case 1:
1317
- promptResult = _a.sent();
1318
- totalUsage = addUsage(totalUsage, promptResult.usage);
1319
- return [2 /*return*/, promptResult];
1320
- }
1321
- });
1322
- }); };
1323
- }
1324
- if (llmTools.callCompletionModel !== undefined) {
1325
- proxyTools.callCompletionModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
1326
- var promptResult;
1327
- return __generator(this, function (_a) {
1328
- switch (_a.label) {
1329
- case 0: return [4 /*yield*/, llmTools.callCompletionModel(prompt)];
1330
- case 1:
1331
- promptResult = _a.sent();
1332
- totalUsage = addUsage(totalUsage, promptResult.usage);
1333
- return [2 /*return*/, promptResult];
1334
- }
1335
- });
1336
- }); };
1337
- }
1338
- if (llmTools.callEmbeddingModel !== undefined) {
1339
- proxyTools.callEmbeddingModel = function (prompt) { return __awaiter(_this, void 0, void 0, function () {
1340
- var promptResult;
1341
- return __generator(this, function (_a) {
1342
- switch (_a.label) {
1343
- case 0: return [4 /*yield*/, llmTools.callEmbeddingModel(prompt)];
1344
- case 1:
1345
- promptResult = _a.sent();
1346
- totalUsage = addUsage(totalUsage, promptResult.usage);
1347
- return [2 /*return*/, promptResult];
1348
- }
1349
- });
1350
- }); };
1351
- }
1352
- // <- Note: [🤖]
1353
- return proxyTools;
1354
- }
1355
- /**
1356
- * TODO: [🧠][💸] Maybe make some common abstraction `interceptLlmTools` and use here (or use javascript Proxy?)
1357
- * TODO: [🧠] Is there some meaningfull way how to test this util
1358
- * TODO: [🧠][🌯] Maybe a way how to hide ability to `get totalUsage`
1359
- * > const [llmToolsWithUsage,getUsage] = countTotalUsage(llmTools);
1360
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
1361
- */
1362
-
1363
1367
  var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Title should be concise and clear\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",parameters:[{name:"availableModelNames",description:"List of available model names separated by comma (,)",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],templates:[{templateType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Example\n\n```json\n{\n\"modelName\": \"gpt-4o\",\n\"systemMessage\": \"You are experienced AI engineer and helpfull assistant.\",\n\"temperature\": 0.7\n}\n```\n\n## Instructions\n\n- Your output format is JSON object\n- Write just the JSON object, no other text should be present\n- It contains the following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelRequirements",format:"JSON",dependentParameterNames:["availableModelNames","personaDescription"]}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
1364
1368
 
1365
1369
  /**
@@ -1435,7 +1439,7 @@
1435
1439
  if ( /* version === '1.0.0' || */version === '2.0.0' || version === '3.0.0') {
1436
1440
  return false;
1437
1441
  }
1438
- // <- TODO: [main] !!! Check isValidPromptbookVersion against PROMPTBOOK_VERSIONS
1442
+ // <- TODO: [main] !!! Check isValidPromptbookVersion against PROMPTBOOK_ENGINE_VERSIONS
1439
1443
  return true;
1440
1444
  }
1441
1445
 
@@ -2400,23 +2404,6 @@
2400
2404
  return union;
2401
2405
  }
2402
2406
 
2403
- /**
2404
- * Just marks a place of place where should be something implemented
2405
- * No side effects.
2406
- *
2407
- * Note: It can be usefull suppressing eslint errors of unused variables
2408
- *
2409
- * @param value any values
2410
- * @returns void
2411
- * @private within the repository
2412
- */
2413
- function TODO_USE() {
2414
- var value = [];
2415
- for (var _i = 0; _i < arguments.length; _i++) {
2416
- value[_i] = arguments[_i];
2417
- }
2418
- }
2419
-
2420
2407
  /**
2421
2408
  * This error indicates problems parsing the format value
2422
2409
  *
@@ -2473,22 +2460,12 @@
2473
2460
  formatName: 'CSV',
2474
2461
  aliases: ['SPREADSHEET', 'TABLE'],
2475
2462
  isValid: function (value, settings, schema) {
2476
- // TODO: Implement CSV validation
2477
- TODO_USE(value /* <- TODO: Use value here */);
2478
- TODO_USE(settings /* <- TODO: Use settings here */);
2479
- TODO_USE(schema /* <- TODO: Use schema here */);
2480
2463
  return true;
2481
2464
  },
2482
2465
  canBeValid: function (partialValue, settings, schema) {
2483
- TODO_USE(partialValue /* <- TODO: Use partialValue here */);
2484
- TODO_USE(settings /* <- TODO: Use settings here */);
2485
- TODO_USE(schema /* <- TODO: Use schema here */);
2486
2466
  return true;
2487
2467
  },
2488
2468
  heal: function (value, settings, schema) {
2489
- TODO_USE(value /* <- TODO: Use partialValue here */);
2490
- TODO_USE(settings /* <- TODO: Use settings here */);
2491
- TODO_USE(schema /* <- TODO: Use schema here */);
2492
2469
  throw new Error('Not implemented');
2493
2470
  },
2494
2471
  subvalueDefinitions: [
@@ -2607,20 +2584,12 @@
2607
2584
  formatName: 'JSON',
2608
2585
  mimeType: 'application/json',
2609
2586
  isValid: function (value, settings, schema) {
2610
- TODO_USE(schema /* <- TODO: Use schema here */);
2611
- TODO_USE(settings /* <- TODO: Use settings here */);
2612
2587
  return isValidJsonString(value);
2613
2588
  },
2614
2589
  canBeValid: function (partialValue, settings, schema) {
2615
- TODO_USE(partialValue /* <- TODO: Use partialValue here */);
2616
- TODO_USE(settings /* <- TODO: Use settings here */);
2617
- TODO_USE(schema /* <- TODO: Use schema here */);
2618
2590
  return true;
2619
2591
  },
2620
2592
  heal: function (value, settings, schema) {
2621
- TODO_USE(value /* <- TODO: Use partialValue here */);
2622
- TODO_USE(settings /* <- TODO: Use settings here */);
2623
- TODO_USE(schema /* <- TODO: Use schema here */);
2624
2593
  throw new Error('Not implemented');
2625
2594
  },
2626
2595
  subvalueDefinitions: [],
@@ -2702,21 +2671,12 @@
2702
2671
  formatName: 'XML',
2703
2672
  mimeType: 'application/xml',
2704
2673
  isValid: function (value, settings, schema) {
2705
- TODO_USE(value /* <- TODO: Use value here */);
2706
- TODO_USE(settings /* <- TODO: Use settings here */);
2707
- TODO_USE(schema /* <- TODO: Use schema here */);
2708
2674
  return true;
2709
2675
  },
2710
2676
  canBeValid: function (partialValue, settings, schema) {
2711
- TODO_USE(partialValue /* <- TODO: Use partialValue here */);
2712
- TODO_USE(settings /* <- TODO: Use settings here */);
2713
- TODO_USE(schema /* <- TODO: Use schema here */);
2714
2677
  return true;
2715
2678
  },
2716
2679
  heal: function (value, settings, schema) {
2717
- TODO_USE(value /* <- TODO: Use partialValue here */);
2718
- TODO_USE(settings /* <- TODO: Use settings here */);
2719
- TODO_USE(schema /* <- TODO: Use schema here */);
2720
2680
  throw new Error('Not implemented');
2721
2681
  },
2722
2682
  subvalueDefinitions: [],
@@ -2949,27 +2909,6 @@
2949
2909
  return [input];
2950
2910
  }
2951
2911
 
2952
- /**
2953
- * Just says that the variable is not used but should be kept
2954
- * No side effects.
2955
- *
2956
- * Note: It can be usefull for:
2957
- *
2958
- * 1) Suppressing eager optimization of unused imports
2959
- * 2) Suppressing eslint errors of unused variables in the tests
2960
- * 3) Keeping the type of the variable for type testing
2961
- *
2962
- * @param value any values
2963
- * @returns void
2964
- * @private within the repository
2965
- */
2966
- function keepUnused() {
2967
- var valuesToKeep = [];
2968
- for (var _i = 0; _i < arguments.length; _i++) {
2969
- valuesToKeep[_i] = arguments[_i];
2970
- }
2971
- }
2972
-
2973
2912
  /**
2974
2913
  * Replaces parameters in template with values from parameters object
2975
2914
  *
@@ -3724,7 +3663,6 @@
3724
3663
  $ongoingTemplateResult.$resultString = extractJsonBlock($ongoingTemplateResult.$resultString || '');
3725
3664
  }
3726
3665
  catch (error) {
3727
- keepUnused(error);
3728
3666
  throw new ExpectError(spaceTrim.spaceTrim(function (block) { return "\n Expected valid JSON string\n\n ".concat(block(
3729
3667
  /*<- Note: No need for `pipelineIdentification`, it will be catched and added later */ ''), "\n "); }));
3730
3668
  }
@@ -3902,7 +3840,6 @@
3902
3840
  function getContextForTemplate(template) {
3903
3841
  return __awaiter(this, void 0, void 0, function () {
3904
3842
  return __generator(this, function (_a) {
3905
- TODO_USE(template);
3906
3843
  return [2 /*return*/, RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: [🏍] Implement */];
3907
3844
  });
3908
3845
  });
@@ -3915,11 +3852,9 @@
3915
3852
  */
3916
3853
  function getKnowledgeForTemplate(options) {
3917
3854
  return __awaiter(this, void 0, void 0, function () {
3918
- var preparedPipeline, template;
3855
+ var preparedPipeline;
3919
3856
  return __generator(this, function (_a) {
3920
- preparedPipeline = options.preparedPipeline, template = options.template;
3921
- // TODO: [♨] Implement Better - use real index and keyword search from `template` and {examples}
3922
- TODO_USE(template);
3857
+ preparedPipeline = options.preparedPipeline, options.template;
3923
3858
  return [2 /*return*/, preparedPipeline.knowledgePieces.map(function (_a) {
3924
3859
  var content = _a.content;
3925
3860
  return "- ".concat(content);
@@ -3936,8 +3871,6 @@
3936
3871
  function getExamplesForTemplate(template) {
3937
3872
  return __awaiter(this, void 0, void 0, function () {
3938
3873
  return __generator(this, function (_a) {
3939
- // TODO: [♨] Implement Better - use real index and keyword search
3940
- TODO_USE(template);
3941
3874
  return [2 /*return*/, RESERVED_PARAMETER_MISSING_VALUE /* <- TODO: [♨] Implement */];
3942
3875
  });
3943
3876
  });
@@ -3956,13 +3889,13 @@
3956
3889
  switch (_b.label) {
3957
3890
  case 0:
3958
3891
  preparedPipeline = options.preparedPipeline, template = options.template, pipelineIdentification = options.pipelineIdentification;
3959
- return [4 /*yield*/, getContextForTemplate(template)];
3892
+ return [4 /*yield*/, getContextForTemplate()];
3960
3893
  case 1:
3961
3894
  context = _b.sent();
3962
3895
  return [4 /*yield*/, getKnowledgeForTemplate({ preparedPipeline: preparedPipeline, template: template })];
3963
3896
  case 2:
3964
3897
  knowledge = _b.sent();
3965
- return [4 /*yield*/, getExamplesForTemplate(template)];
3898
+ return [4 /*yield*/, getExamplesForTemplate()];
3966
3899
  case 3:
3967
3900
  examples = _b.sent();
3968
3901
  currentDate = new Date().toISOString();
@@ -4197,7 +4130,7 @@
4197
4130
  executionReport = {
4198
4131
  pipelineUrl: preparedPipeline.pipelineUrl,
4199
4132
  title: preparedPipeline.title,
4200
- promptbookUsedVersion: PROMPTBOOK_VERSION,
4133
+ promptbookUsedVersion: PROMPTBOOK_ENGINE_VERSION,
4201
4134
  promptbookRequestedVersion: preparedPipeline.promptbookVersion,
4202
4135
  description: preparedPipeline.description,
4203
4136
  promptExecutions: [],
@@ -5044,16 +4977,13 @@
5044
4977
  function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
5045
4978
  var _a;
5046
4979
  return __awaiter(this, void 0, void 0, function () {
5047
- var sourceContent, name, _b, _c, rootDirname, _d,
5048
- // <- TODO: process.cwd() if running in Node.js
5049
- isVerbose, url, response_1, mimeType, filename_1, fileExtension, mimeType;
4980
+ var sourceContent, name, _b, _c, rootDirname, url, response_1, mimeType, filename_1, fileExtension, mimeType;
5050
4981
  return __generator(this, function (_e) {
5051
4982
  switch (_e.label) {
5052
4983
  case 0:
5053
4984
  sourceContent = knowledgeSource.sourceContent;
5054
4985
  name = knowledgeSource.name;
5055
- _b = options || {}, _c = _b.rootDirname, rootDirname = _c === void 0 ? null : _c, _d = _b.isVerbose, isVerbose = _d === void 0 ? DEFAULT_IS_VERBOSE : _d;
5056
- TODO_USE(isVerbose);
4986
+ _b = options || {}, _c = _b.rootDirname, rootDirname = _c === void 0 ? null : _c, _b.isVerbose;
5057
4987
  if (!name) {
5058
4988
  name = sourceContentToName(sourceContent);
5059
4989
  }
@@ -5333,15 +5263,13 @@
5333
5263
  */
5334
5264
  function prepareTemplates(pipeline, tools, options) {
5335
5265
  return __awaiter(this, void 0, void 0, function () {
5336
- var _a, maxParallelCount, templates, parameters, knowledgePiecesCount, templatesPrepared;
5266
+ var _a, maxParallelCount, templates, knowledgePiecesCount, templatesPrepared;
5337
5267
  var _this = this;
5338
5268
  return __generator(this, function (_b) {
5339
5269
  switch (_b.label) {
5340
5270
  case 0:
5341
5271
  _a = options.maxParallelCount, maxParallelCount = _a === void 0 ? DEFAULT_MAX_PARALLEL_COUNT : _a;
5342
- templates = pipeline.templates, parameters = pipeline.parameters, knowledgePiecesCount = pipeline.knowledgePiecesCount;
5343
- // TODO: [main] !! Apply examples to each template (if missing and is for the template defined)
5344
- TODO_USE(parameters);
5272
+ templates = pipeline.templates, pipeline.parameters, knowledgePiecesCount = pipeline.knowledgePiecesCount;
5345
5273
  templatesPrepared = new Array(templates.length);
5346
5274
  return [4 /*yield*/, forEachAsync(templates, { maxParallelCount: maxParallelCount /* <- TODO: [🪂] When there are subtasks, this maximul limit can be broken */ }, function (template, index) { return __awaiter(_this, void 0, void 0, function () {
5347
5275
  var dependentParameterNames, preparedContent, preparedTemplate;
@@ -5411,7 +5339,7 @@
5411
5339
  currentPreparation = {
5412
5340
  id: 1,
5413
5341
  // TODO: [🍥]> date: $currentDate(),
5414
- promptbookVersion: PROMPTBOOK_VERSION,
5342
+ promptbookVersion: PROMPTBOOK_ENGINE_VERSION,
5415
5343
  usage: ZERO_USAGE,
5416
5344
  };
5417
5345
  preparations = [
@@ -5551,7 +5479,6 @@
5551
5479
  * Note: This is used in `pipelineJsonToString` utility
5552
5480
  */
5553
5481
  stringify: function (command) {
5554
- keepUnused(command);
5555
5482
  return "---"; // <- TODO: [🛋] Implement
5556
5483
  },
5557
5484
  /**
@@ -5560,7 +5487,6 @@
5560
5487
  * Note: This is used in `pipelineJsonToString` utility
5561
5488
  */
5562
5489
  takeFromPipelineJson: function (pipelineJson) {
5563
- keepUnused(pipelineJson);
5564
5490
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
5565
5491
  },
5566
5492
  };
@@ -5743,7 +5669,6 @@
5743
5669
  * Note: This is used in `pipelineJsonToString` utility
5744
5670
  */
5745
5671
  stringify: function (command) {
5746
- keepUnused(command);
5747
5672
  return "---"; // <- TODO: [🛋] Implement
5748
5673
  },
5749
5674
  /**
@@ -5752,7 +5677,6 @@
5752
5677
  * Note: This is used in `pipelineJsonToString` utility
5753
5678
  */
5754
5679
  takeFromTemplateJson: function ($templateJson) {
5755
- keepUnused($templateJson);
5756
5680
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
5757
5681
  },
5758
5682
  };
@@ -5984,7 +5908,6 @@
5984
5908
  * Note: This is used in `pipelineJsonToString` utility
5985
5909
  */
5986
5910
  stringify: function (command) {
5987
- keepUnused(command);
5988
5911
  return "---"; // <- TODO: [🛋] Implement
5989
5912
  },
5990
5913
  /**
@@ -5993,7 +5916,6 @@
5993
5916
  * Note: This is used in `pipelineJsonToString` utility
5994
5917
  */
5995
5918
  takeFromTemplateJson: function ($templateJson) {
5996
- keepUnused($templateJson);
5997
5919
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
5998
5920
  },
5999
5921
  };
@@ -6312,7 +6234,6 @@
6312
6234
  inputSubparameterNames: inputSubparameterNames,
6313
6235
  outputSubparameterName: outputSubparameterName,
6314
6236
  };
6315
- keepUnused($pipelineJson); // <- TODO: [🧠] Maybe register subparameter from foreach into parameters of the pipeline
6316
6237
  // Note: [🍭] FOREACH apply has some sideeffects on different places in codebase
6317
6238
  },
6318
6239
  /**
@@ -6321,7 +6242,6 @@
6321
6242
  * Note: This is used in `pipelineJsonToString` utility
6322
6243
  */
6323
6244
  stringify: function (command) {
6324
- keepUnused(command);
6325
6245
  return "---"; // <- TODO: [🛋] Implement
6326
6246
  },
6327
6247
  /**
@@ -6330,7 +6250,6 @@
6330
6250
  * Note: This is used in `pipelineJsonToString` utility
6331
6251
  */
6332
6252
  takeFromTemplateJson: function ($templateJson) {
6333
- keepUnused($templateJson);
6334
6253
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6335
6254
  },
6336
6255
  };
@@ -6398,7 +6317,6 @@
6398
6317
  * Note: This is used in `pipelineJsonToString` utility
6399
6318
  */
6400
6319
  stringify: function (command) {
6401
- keepUnused(command);
6402
6320
  return "---"; // <- TODO: [🛋] Implement
6403
6321
  },
6404
6322
  /**
@@ -6407,7 +6325,6 @@
6407
6325
  * Note: This is used in `pipelineJsonToString` utility
6408
6326
  */
6409
6327
  takeFromTemplateJson: function ($templateJson) {
6410
- keepUnused($templateJson);
6411
6328
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6412
6329
  },
6413
6330
  };
@@ -6470,7 +6387,6 @@
6470
6387
  * Note: This is used in `pipelineJsonToString` utility
6471
6388
  */
6472
6389
  stringify: function (command) {
6473
- keepUnused(command);
6474
6390
  return "---"; // <- TODO: [🛋] Implement
6475
6391
  },
6476
6392
  /**
@@ -6479,7 +6395,6 @@
6479
6395
  * Note: This is used in `pipelineJsonToString` utility
6480
6396
  */
6481
6397
  takeFromTemplateJson: function ($templateJson) {
6482
- keepUnused($templateJson);
6483
6398
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6484
6399
  },
6485
6400
  };
@@ -6615,7 +6530,6 @@
6615
6530
  * Note: This is used in `pipelineJsonToString` utility
6616
6531
  */
6617
6532
  stringify: function (command) {
6618
- keepUnused(command);
6619
6533
  return "---"; // <- TODO: [🛋] Implement
6620
6534
  },
6621
6535
  /**
@@ -6624,7 +6538,6 @@
6624
6538
  * Note: This is used in `pipelineJsonToString` utility
6625
6539
  */
6626
6540
  takeFromPipelineJson: function (pipelineJson) {
6627
- keepUnused(pipelineJson);
6628
6541
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6629
6542
  },
6630
6543
  /**
@@ -6633,7 +6546,6 @@
6633
6546
  * Note: This is used in `pipelineJsonToString` utility
6634
6547
  */
6635
6548
  takeFromTemplateJson: function ($templateJson) {
6636
- keepUnused($templateJson);
6637
6549
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6638
6550
  },
6639
6551
  };
@@ -6707,7 +6619,6 @@
6707
6619
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
6708
6620
  */
6709
6621
  $applyToPipelineJson: function (command, $pipelineJson) {
6710
- keepUnused(command, $pipelineJson);
6711
6622
  // Note: [🍣] Do nothing, its application is implemented separately in `pipelineStringToJsonSync`
6712
6623
  },
6713
6624
  /**
@@ -6716,7 +6627,6 @@
6716
6627
  * Note: `$` is used to indicate that this function mutates given `templateJson`
6717
6628
  */
6718
6629
  $applyToTemplateJson: function (command, $templateJson, $pipelineJson) {
6719
- keepUnused(command, $templateJson, $pipelineJson);
6720
6630
  // Note: [🍣] Do nothing, its application is implemented separately in `pipelineStringToJsonSync`
6721
6631
  },
6722
6632
  /**
@@ -6725,7 +6635,6 @@
6725
6635
  * Note: This is used in `pipelineJsonToString` utility
6726
6636
  */
6727
6637
  stringify: function (command) {
6728
- keepUnused(command);
6729
6638
  return "---"; // <- TODO: [🛋] Implement
6730
6639
  },
6731
6640
  /**
@@ -6734,7 +6643,6 @@
6734
6643
  * Note: This is used in `pipelineJsonToString` utility
6735
6644
  */
6736
6645
  takeFromPipelineJson: function (pipelineJson) {
6737
- keepUnused(pipelineJson);
6738
6646
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6739
6647
  },
6740
6648
  /**
@@ -6743,7 +6651,6 @@
6743
6651
  * Note: This is used in `pipelineJsonToString` utility
6744
6652
  */
6745
6653
  takeFromTemplateJson: function ($templateJson) {
6746
- keepUnused($templateJson);
6747
6654
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6748
6655
  },
6749
6656
  };
@@ -6815,7 +6722,6 @@
6815
6722
  * Note: This is used in `pipelineJsonToString` utility
6816
6723
  */
6817
6724
  stringify: function (command) {
6818
- keepUnused(command);
6819
6725
  return "---"; // <- TODO: [🛋] Implement
6820
6726
  },
6821
6727
  /**
@@ -6824,7 +6730,6 @@
6824
6730
  * Note: This is used in `pipelineJsonToString` utility
6825
6731
  */
6826
6732
  takeFromPipelineJson: function (pipelineJson) {
6827
- keepUnused(pipelineJson);
6828
6733
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6829
6734
  },
6830
6735
  /**
@@ -6833,7 +6738,6 @@
6833
6738
  * Note: This is used in `pipelineJsonToString` utility
6834
6739
  */
6835
6740
  takeFromTemplateJson: function ($templateJson) {
6836
- keepUnused($templateJson);
6837
6741
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6838
6742
  },
6839
6743
  };
@@ -6952,7 +6856,6 @@
6952
6856
  * Note: This is used in `pipelineJsonToString` utility
6953
6857
  */
6954
6858
  stringify: function (command) {
6955
- keepUnused(command);
6956
6859
  return "---"; // <- TODO: [🛋] Implement
6957
6860
  },
6958
6861
  /**
@@ -6961,42 +6864,41 @@
6961
6864
  * Note: This is used in `pipelineJsonToString` utility
6962
6865
  */
6963
6866
  takeFromTemplateJson: function ($templateJson) {
6964
- keepUnused($templateJson);
6965
6867
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
6966
6868
  },
6967
6869
  };
6968
6870
 
6969
6871
  /**
6970
- * Parses the PROMPTBOOK_VERSION command
6872
+ * Parses the BOOK_VERSION command
6971
6873
  *
6972
6874
  * @see `documentationUrl` for more details
6973
6875
  * @private within the commands folder
6974
6876
  */
6975
- var promptbookVersionCommandParser = {
6877
+ var bookVersionCommandParser = {
6976
6878
  /**
6977
6879
  * Name of the command
6978
6880
  */
6979
- name: 'PROMPTBOOK_VERSION',
6980
- aliasNames: ['PTBK_VERSION', 'PTBK_V', 'PTBKV'],
6881
+ name: 'BOOK_VERSION',
6882
+ aliasNames: ['PTBK_VERSION', 'PROMPTBOOK_VERSION', 'BOOK'],
6981
6883
  /**
6982
6884
  * BOILERPLATE command can be used in:
6983
6885
  */
6984
6886
  isUsedInPipelineHead: true,
6985
6887
  isUsedInPipelineTemplate: false,
6986
6888
  /**
6987
- * Description of the PROMPTBOOK_VERSION command
6889
+ * Description of the BOOK_VERSION command
6988
6890
  */
6989
- description: "Which version of the promptbook is the .ptbk.md using",
6891
+ description: "Which version of the Book language is the .ptbk.md using",
6990
6892
  /**
6991
6893
  * Link to documentation
6992
6894
  */
6993
6895
  documentationUrl: 'https://github.com/webgptorg/promptbook/discussions/69',
6994
6896
  /**
6995
- * Example usages of the PROMPTBOOK_VERSION command
6897
+ * Example usages of the BOOK_VERSION command
6996
6898
  */
6997
- examples: ["PROMPTBOOK VERSION ".concat(PROMPTBOOK_VERSION), "PTBKV ".concat(PROMPTBOOK_VERSION)],
6899
+ examples: ["BOOK VERSION ".concat(BOOK_LANGUAGE_VERSION), "BOOK ".concat(BOOK_LANGUAGE_VERSION)],
6998
6900
  /**
6999
- * Parses the PROMPTBOOK_VERSION command
6901
+ * Parses the BOOK_VERSION command
7000
6902
  */
7001
6903
  parse: function (input) {
7002
6904
  var args = input.args;
@@ -7007,16 +6909,16 @@
7007
6909
  if (!isValidPromptbookVersion(promptbookVersion)) {
7008
6910
  throw new ParseError("Invalid Promptbook version \"".concat(promptbookVersion, "\""));
7009
6911
  }
7010
- if (args.length > 0) {
6912
+ if (args.length > 0 && !(((args.length === 1 && args[0]) || '').toUpperCase() === 'VERSION')) {
7011
6913
  throw new ParseError("Can not have more than one Promptbook version");
7012
6914
  }
7013
6915
  return {
7014
- type: 'PROMPTBOOK_VERSION',
6916
+ type: 'BOOK_VERSION',
7015
6917
  promptbookVersion: promptbookVersion,
7016
6918
  };
7017
6919
  },
7018
6920
  /**
7019
- * Apply the PROMPTBOOK_VERSION command to the `pipelineJson`
6921
+ * Apply the BOOK_VERSION command to the `pipelineJson`
7020
6922
  *
7021
6923
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
7022
6924
  */
@@ -7025,21 +6927,19 @@
7025
6927
  $pipelineJson.promptbookVersion = command.promptbookVersion;
7026
6928
  },
7027
6929
  /**
7028
- * Converts the PROMPTBOOK_VERSION command back to string
6930
+ * Converts the BOOK_VERSION command back to string
7029
6931
  *
7030
6932
  * Note: This is used in `pipelineJsonToString` utility
7031
6933
  */
7032
6934
  stringify: function (command) {
7033
- keepUnused(command);
7034
6935
  return "---"; // <- TODO: [🛋] Implement
7035
6936
  },
7036
6937
  /**
7037
- * Reads the PROMPTBOOK_VERSION command from the `PipelineJson`
6938
+ * Reads the BOOK_VERSION command from the `PipelineJson`
7038
6939
  *
7039
6940
  * Note: This is used in `pipelineJsonToString` utility
7040
6941
  */
7041
6942
  takeFromPipelineJson: function (pipelineJson) {
7042
- keepUnused(pipelineJson);
7043
6943
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
7044
6944
  },
7045
6945
  };
@@ -7133,7 +7033,6 @@
7133
7033
  * Note: This is used in `pipelineJsonToString` utility
7134
7034
  */
7135
7035
  stringify: function (command) {
7136
- keepUnused(command);
7137
7036
  return "---"; // <- TODO: [🛋] Implement
7138
7037
  },
7139
7038
  /**
@@ -7142,7 +7041,6 @@
7142
7041
  * Note: This is used in `pipelineJsonToString` utility
7143
7042
  */
7144
7043
  takeFromPipelineJson: function (pipelineJson) {
7145
- keepUnused(pipelineJson);
7146
7044
  throw new NotYetImplementedError("[\uD83D\uDECB] Not implemented yet"); // <- TODO: [🛋] Implement
7147
7045
  },
7148
7046
  };
@@ -7179,8 +7077,7 @@
7179
7077
  * Parses the ACTION command
7180
7078
  */
7181
7079
  parse: function (input) {
7182
- var args = input.args;
7183
- TODO_USE(args);
7080
+ input.args;
7184
7081
  return {
7185
7082
  type: 'ACTION',
7186
7083
  };
@@ -7191,7 +7088,6 @@
7191
7088
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
7192
7089
  */
7193
7090
  $applyToPipelineJson: function (command, $pipelineJson) {
7194
- keepUnused(command, $pipelineJson);
7195
7091
  console.error(new NotYetImplementedError('[🛠] Actions are not implemented yet'));
7196
7092
  },
7197
7093
  /**
@@ -7200,7 +7096,6 @@
7200
7096
  * Note: This is used in `pipelineJsonToString` utility
7201
7097
  */
7202
7098
  stringify: function (command) {
7203
- keepUnused(command);
7204
7099
  throw new NotYetImplementedError('[🛠] Actions are not implemented yet');
7205
7100
  },
7206
7101
  /**
@@ -7209,7 +7104,6 @@
7209
7104
  * Note: This is used in `pipelineJsonToString` utility
7210
7105
  */
7211
7106
  takeFromPipelineJson: function (pipelineJson) {
7212
- keepUnused(pipelineJson);
7213
7107
  throw new NotYetImplementedError('[🛠] Actions are not implemented yet');
7214
7108
  },
7215
7109
  };
@@ -7249,9 +7143,7 @@
7249
7143
  * Parses the INSTRUMENT command
7250
7144
  */
7251
7145
  parse: function (input) {
7252
- var args = input.args;
7253
- // TODO: [🛠] Implement
7254
- TODO_USE(args);
7146
+ input.args;
7255
7147
  return {
7256
7148
  type: 'INSTRUMENT',
7257
7149
  };
@@ -7262,7 +7154,6 @@
7262
7154
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
7263
7155
  */
7264
7156
  $applyToPipelineJson: function (command, $pipelineJson) {
7265
- keepUnused(command, $pipelineJson);
7266
7157
  console.error(new NotYetImplementedError('[🛠] Instruments are not implemented yet'));
7267
7158
  },
7268
7159
  /**
@@ -7271,7 +7162,6 @@
7271
7162
  * Note: This is used in `pipelineJsonToString` utility
7272
7163
  */
7273
7164
  stringify: function (command) {
7274
- keepUnused(command);
7275
7165
  throw new NotYetImplementedError('[🛠] Instruments are not implemented yet');
7276
7166
  },
7277
7167
  /**
@@ -7280,7 +7170,6 @@
7280
7170
  * Note: This is used in `pipelineJsonToString` utility
7281
7171
  */
7282
7172
  takeFromPipelineJson: function (pipelineJson) {
7283
- keepUnused(pipelineJson);
7284
7173
  throw new NotYetImplementedError('[🛠] Instruments are not implemented yet');
7285
7174
  },
7286
7175
  };
@@ -7345,7 +7234,6 @@
7345
7234
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
7346
7235
  */
7347
7236
  $applyToPipelineJson: function (command, $pipelineJson) {
7348
- keepUnused(command, $pipelineJson);
7349
7237
  throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7350
7238
  },
7351
7239
  /**
@@ -7354,7 +7242,6 @@
7354
7242
  * Note: `$` is used to indicate that this function mutates given `templateJson`
7355
7243
  */
7356
7244
  $applyToTemplateJson: function (command, $templateJson, $pipelineJson) {
7357
- keepUnused(command, $templateJson, $pipelineJson);
7358
7245
  throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7359
7246
  },
7360
7247
  /**
@@ -7363,7 +7250,6 @@
7363
7250
  * Note: This is used in `pipelineJsonToString` utility
7364
7251
  */
7365
7252
  stringify: function (command) {
7366
- keepUnused(command);
7367
7253
  return "---"; // <- TODO: [🛋] Implement
7368
7254
  },
7369
7255
  /**
@@ -7372,7 +7258,6 @@
7372
7258
  * Note: This is used in `pipelineJsonToString` utility
7373
7259
  */
7374
7260
  takeFromPipelineJson: function (pipelineJson) {
7375
- keepUnused(pipelineJson);
7376
7261
  throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7377
7262
  },
7378
7263
  /**
@@ -7381,7 +7266,6 @@
7381
7266
  * Note: This is used in `pipelineJsonToString` utility
7382
7267
  */
7383
7268
  takeFromTemplateJson: function ($templateJson) {
7384
- keepUnused($templateJson);
7385
7269
  throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7386
7270
  },
7387
7271
  };
@@ -7399,7 +7283,7 @@
7399
7283
  modelCommandParser,
7400
7284
  parameterCommandParser,
7401
7285
  postprocessCommandParser,
7402
- promptbookVersionCommandParser,
7286
+ bookVersionCommandParser,
7403
7287
  urlCommandParser,
7404
7288
  knowledgeCommandParser,
7405
7289
  actionCommandParser,
@@ -7551,9 +7435,7 @@
7551
7435
  var _loop_1 = function (commandParser) {
7552
7436
  // <- Note: [🦦] Its strange that this type assertion is needed
7553
7437
  var name_1 = commandParser.name, isUsedInPipelineHead = commandParser.isUsedInPipelineHead, isUsedInPipelineTemplate = commandParser.isUsedInPipelineTemplate, aliasNames = commandParser.aliasNames, deprecatedNames = commandParser.deprecatedNames, parse = commandParser.parse;
7554
- if (just(false)) {
7555
- keepUnused( /* for better indentation */);
7556
- }
7438
+ if (just(false)) ;
7557
7439
  else if (usagePlace === 'PIPELINE_HEAD' && !isUsedInPipelineHead) {
7558
7440
  return "continue";
7559
7441
  }
@@ -8272,8 +8154,7 @@
8272
8154
  if (!$isRunningInNode()) {
8273
8155
  throw new EnvironmentMismatchError('Function `$provideFilesystemForNode` works only in Node.js environment');
8274
8156
  }
8275
- var _a = (options || {}).isVerbose, isVerbose = _a === void 0 ? DEFAULT_IS_VERBOSE : _a;
8276
- TODO_USE(isVerbose);
8157
+ (options || {}).isVerbose;
8277
8158
  return {
8278
8159
  stat: promises.stat,
8279
8160
  access: promises.access,
@@ -8519,7 +8400,7 @@
8519
8400
  */
8520
8401
  function $provideExecutablesForNode(options) {
8521
8402
  return __awaiter(this, void 0, void 0, function () {
8522
- var _a, _b, isAutoInstalled, _c, isVerbose;
8403
+ var _a;
8523
8404
  var _d;
8524
8405
  return __generator(this, function (_e) {
8525
8406
  switch (_e.label) {
@@ -8527,9 +8408,7 @@
8527
8408
  if (!$isRunningInNode()) {
8528
8409
  throw new EnvironmentMismatchError('Function `$getScrapersForNode` works only in Node.js environment');
8529
8410
  }
8530
- _a = options || {}, _b = _a.isAutoInstalled, isAutoInstalled = _b === void 0 ? DEFAULT_IS_AUTO_INSTALLED : _b, _c = _a.isVerbose, isVerbose = _c === void 0 ? DEFAULT_IS_VERBOSE : _c;
8531
- TODO_USE(isAutoInstalled); // <- TODO: [🔱][🧠] Auto-install the executables
8532
- TODO_USE(isVerbose);
8411
+ _a = options || {}, _a.isAutoInstalled, _a.isVerbose;
8533
8412
  _d = {};
8534
8413
  return [4 /*yield*/, locatePandoc()];
8535
8414
  case 1:
@@ -8786,7 +8665,7 @@
8786
8665
  */
8787
8666
  function $provideScrapersForNode(tools, options) {
8788
8667
  return __awaiter(this, void 0, void 0, function () {
8789
- var _a, _b, isAutoInstalled, _c, isVerbose, scrapers, _d, _e, scraperFactory, scraper, e_1_1;
8668
+ var _a, scrapers, _d, _e, scraperFactory, scraper, e_1_1;
8790
8669
  var e_1, _f;
8791
8670
  return __generator(this, function (_g) {
8792
8671
  switch (_g.label) {
@@ -8794,9 +8673,7 @@
8794
8673
  if (!$isRunningInNode()) {
8795
8674
  throw new EnvironmentMismatchError('Function `$getScrapersForNode` works only in Node.js environment');
8796
8675
  }
8797
- _a = options || {}, _b = _a.isAutoInstalled, isAutoInstalled = _b === void 0 ? DEFAULT_IS_AUTO_INSTALLED : _b, _c = _a.isVerbose, isVerbose = _c === void 0 ? DEFAULT_IS_VERBOSE : _c;
8798
- TODO_USE(isAutoInstalled);
8799
- TODO_USE(isVerbose);
8676
+ _a = options || {}, _a.isAutoInstalled, _a.isVerbose;
8800
8677
  scrapers = [];
8801
8678
  _g.label = 1;
8802
8679
  case 1:
@@ -10113,8 +9990,9 @@
10113
9990
  exports.$provideLlmToolsConfigurationFromEnv = $provideLlmToolsConfigurationFromEnv;
10114
9991
  exports.$provideLlmToolsFromEnv = $provideLlmToolsFromEnv;
10115
9992
  exports.$provideScrapersForNode = $provideScrapersForNode;
9993
+ exports.BOOK_LANGUAGE_VERSION = BOOK_LANGUAGE_VERSION;
10116
9994
  exports.FileCacheStorage = FileCacheStorage;
10117
- exports.PROMPTBOOK_VERSION = PROMPTBOOK_VERSION;
9995
+ exports.PROMPTBOOK_ENGINE_VERSION = PROMPTBOOK_ENGINE_VERSION;
10118
9996
  exports.createCollectionFromDirectory = createCollectionFromDirectory;
10119
9997
 
10120
9998
  Object.defineProperty(exports, '__esModule', { value: true });