@promptbook/core 0.74.0-11 → 0.74.0-13

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 CHANGED
@@ -152,7 +152,7 @@ Following is the documentation and blueprint of the Book language.
152
152
 
153
153
  File is designed to be easy to read and write. It is strict subset of markdown. It is designed to be understandable by both humans and machines and without specific knowledge of the language.
154
154
 
155
- It has file with `.ptbk.md` or `.book` extension with `UTF-8` non BOM encoding.
155
+ It has file with `.book.md` or `.book` extension with `UTF-8` non BOM encoding.
156
156
 
157
157
  As it is source code, it can leverage all the features of version control systems like git and does not suffer from the problems of binary formats, proprietary formats, or no-code solutions.
158
158
 
@@ -245,11 +245,6 @@ Or you can install them separately:
245
245
 
246
246
  ## 📚 Dictionary
247
247
 
248
-
249
-
250
-
251
-
252
-
253
248
  ### 📚 Dictionary
254
249
 
255
250
  The following glossary is used to clarify certain concepts:
@@ -265,8 +260,6 @@ The following glossary is used to clarify certain concepts:
265
260
  - **Retrieval-augmented generation** is a machine learning paradigm where a model generates text by retrieving relevant information from a large database of text. This approach combines the benefits of generative models and retrieval models.
266
261
  - **Longtail** refers to non-common or rare events, items, or entities that are not well-represented in the training data of machine learning models. Longtail items are often challenging for models to predict accurately.
267
262
 
268
-
269
-
270
263
  _Note: Thos section is not complete dictionary, more list of general AI / LLM terms that has connection with Promptbook_
271
264
 
272
265
  #### Promptbook core
@@ -327,8 +320,6 @@ _Note: Thos section is not complete dictionary, more list of general AI / LLM te
327
320
  - [👮 Agent adversary expectations](https://github.com/webgptorg/promptbook/discussions/39)
328
321
  - [view more](https://github.com/webgptorg/promptbook/discussions/categories/concepts)
329
322
 
330
-
331
-
332
323
  ### Terms specific to Promptbook TypeScript implementation
333
324
 
334
325
  - Anonymous mode
package/esm/index.es.js CHANGED
@@ -22,7 +22,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
22
22
  *
23
23
  * @see https://github.com/webgptorg/promptbook
24
24
  */
25
- var PROMPTBOOK_ENGINE_VERSION = '0.74.0-10';
25
+ var PROMPTBOOK_ENGINE_VERSION = '0.74.0-12';
26
26
  /**
27
27
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
28
28
  */
@@ -219,13 +219,13 @@ function capitalize(word) {
219
219
  /**
220
220
  * Converts promptbook in JSON format to string format
221
221
  *
222
- * @param pipelineJson Promptbook in JSON format (.ptbk.json)
223
- * @returns Promptbook in string format (.ptbk.md)
222
+ * @param pipelineJson Promptbook in JSON format (.book.json)
223
+ * @returns Promptbook in string format (.book.md)
224
224
  * @public exported from `@promptbook/core`
225
225
  */
226
226
  function pipelineJsonToString(pipelineJson) {
227
227
  var e_1, _a, e_2, _b, e_3, _c, e_4, _d, e_5, _e, e_6, _f;
228
- var title = pipelineJson.title, pipelineUrl = pipelineJson.pipelineUrl, promptbookVersion = pipelineJson.promptbookVersion, description = pipelineJson.description, parameters = pipelineJson.parameters, templates = pipelineJson.templates;
228
+ var title = pipelineJson.title, pipelineUrl = pipelineJson.pipelineUrl, bookVersion = pipelineJson.bookVersion, description = pipelineJson.description, parameters = pipelineJson.parameters, templates = pipelineJson.templates;
229
229
  var pipelineString = "# ".concat(title);
230
230
  if (description) {
231
231
  pipelineString += '\n\n';
@@ -235,8 +235,10 @@ function pipelineJsonToString(pipelineJson) {
235
235
  if (pipelineUrl) {
236
236
  commands.push("PIPELINE URL ".concat(pipelineUrl));
237
237
  }
238
- commands.push("PROMPTBOOK VERSION ".concat(promptbookVersion));
239
- // TODO: [main] !!! This increase size of the bundle and is probbably not necessary
238
+ if (bookVersion !== "undefined") {
239
+ commands.push("BOOK VERSION ".concat(bookVersion));
240
+ }
241
+ // TODO: [main] !!!!!! This increase size of the bundle and is probbably not necessary
240
242
  pipelineString = prettifyMarkdown(pipelineString);
241
243
  try {
242
244
  for (var _g = __values(parameters.filter(function (_a) {
@@ -416,7 +418,7 @@ function templateParameterJsonToString(templateParameterJson) {
416
418
  * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
417
419
  * TODO: [🏛] Maybe make some markdown builder
418
420
  * TODO: [🏛] Escape all
419
- * TODO: [🧠] Should be in generated .ptbk.md file GENERATOR_WARNING
421
+ * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
420
422
  */
421
423
 
422
424
  /**
@@ -992,7 +994,7 @@ function isValidPipelineUrl(url) {
992
994
  if (!url.startsWith('https://')) {
993
995
  return false;
994
996
  }
995
- if (!(url.endsWith('.book.md') || url.endsWith('.book') || url.endsWith('.ptbk.md') || url.endsWith('.ptbk'))) {
997
+ if (!(url.endsWith('.book.md') || url.endsWith('.book') || url.endsWith('.book.md') || url.endsWith('.ptbk'))) {
996
998
  return false;
997
999
  }
998
1000
  if (url.includes('#')) {
@@ -1061,9 +1063,9 @@ function validatePipelineCore(pipeline) {
1061
1063
  // <- Note: [🚲]
1062
1064
  throw new PipelineLogicError(spaceTrim$1(function (block) { return "\n Invalid promptbook URL \"".concat(pipeline.pipelineUrl, "\"\n\n ").concat(block(pipelineIdentification), "\n "); }));
1063
1065
  }
1064
- if (pipeline.promptbookVersion !== undefined && !isValidPromptbookVersion(pipeline.promptbookVersion)) {
1066
+ if (pipeline.bookVersion !== undefined && !isValidPromptbookVersion(pipeline.bookVersion)) {
1065
1067
  // <- Note: [🚲]
1066
- throw new PipelineLogicError(spaceTrim$1(function (block) { return "\n Invalid Promptbook Version \"".concat(pipeline.promptbookVersion, "\"\n\n ").concat(block(pipelineIdentification), "\n "); }));
1068
+ throw new PipelineLogicError(spaceTrim$1(function (block) { return "\n Invalid Promptbook Version \"".concat(pipeline.bookVersion, "\"\n\n ").concat(block(pipelineIdentification), "\n "); }));
1067
1069
  }
1068
1070
  // TODO: [🧠] Maybe do here some propper JSON-schema / ZOD checking
1069
1071
  if (!Array.isArray(pipeline.parameters)) {
@@ -2310,7 +2312,7 @@ function joinLlmExecutionTools() {
2310
2312
  * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
2311
2313
  */
2312
2314
 
2313
- 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"}];
2315
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book.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.book.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book.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.book.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book.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.book.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book.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.book.md"}];
2314
2316
 
2315
2317
  /**
2316
2318
  * This error indicates that the pipeline collection cannot be propperly loaded
@@ -3899,7 +3901,7 @@ function executeAttempts(options) {
3899
3901
  promptTitle: template.title,
3900
3902
  promptMessage: replaceParameters(template.description || '', parameters),
3901
3903
  defaultValue: replaceParameters(preparedContent, parameters),
3902
- // TODO: [🧠] !! Figure out how to define placeholder in .ptbk.md file
3904
+ // TODO: [🧠] !! Figure out how to define placeholder in .book.md file
3903
3905
  placeholder: undefined,
3904
3906
  priority: priority,
3905
3907
  }))];
@@ -4465,7 +4467,7 @@ function executePipeline(options) {
4465
4467
  pipelineUrl: preparedPipeline.pipelineUrl,
4466
4468
  title: preparedPipeline.title,
4467
4469
  promptbookUsedVersion: PROMPTBOOK_ENGINE_VERSION,
4468
- promptbookRequestedVersion: preparedPipeline.promptbookVersion,
4470
+ promptbookRequestedVersion: preparedPipeline.bookVersion,
4469
4471
  description: preparedPipeline.description,
4470
4472
  promptExecutions: [],
4471
4473
  };
@@ -4814,7 +4816,7 @@ function preparePersona(personaDescription, tools, options) {
4814
4816
  collection = createCollectionFromJson.apply(void 0, __spreadArray([], __read(PipelineCollection), false));
4815
4817
  _b = createPipelineExecutor;
4816
4818
  _c = {};
4817
- return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.ptbk.md')];
4819
+ return [4 /*yield*/, collection.getPipelineByUrl('https://promptbook.studio/promptbook/prepare-persona.book.md')];
4818
4820
  case 1:
4819
4821
  preparePersonaExecutor = _b.apply(void 0, [(_c.pipeline = _d.sent(),
4820
4822
  _c.tools = tools,
@@ -5571,12 +5573,12 @@ TODO: [🧊] This is how it can look in future
5571
5573
  */
5572
5574
  function clonePipeline(pipeline) {
5573
5575
  // Note: Not using spread operator (...) because @@@
5574
- var pipelineUrl = pipeline.pipelineUrl, sourceFile = pipeline.sourceFile, title = pipeline.title, promptbookVersion = pipeline.promptbookVersion, description = pipeline.description, parameters = pipeline.parameters, templates = pipeline.templates, knowledgeSources = pipeline.knowledgeSources, knowledgePieces = pipeline.knowledgePieces, personas = pipeline.personas, preparations = pipeline.preparations;
5576
+ var pipelineUrl = pipeline.pipelineUrl, sourceFile = pipeline.sourceFile, title = pipeline.title, bookVersion = pipeline.bookVersion, description = pipeline.description, parameters = pipeline.parameters, templates = pipeline.templates, knowledgeSources = pipeline.knowledgeSources, knowledgePieces = pipeline.knowledgePieces, personas = pipeline.personas, preparations = pipeline.preparations;
5575
5577
  return {
5576
5578
  pipelineUrl: pipelineUrl,
5577
5579
  sourceFile: sourceFile,
5578
5580
  title: title,
5579
- promptbookVersion: promptbookVersion,
5581
+ bookVersion: bookVersion,
5580
5582
  description: description,
5581
5583
  parameters: parameters,
5582
5584
  templates: templates,
@@ -5788,7 +5790,7 @@ var knowledgeCommandParser = {
5788
5790
  throw new ParseError("Source not valid");
5789
5791
  }
5790
5792
  if (sourceContent.startsWith('../') || sourceContent.startsWith('/') || /^[A-Z]:[\\/]+/i.test(sourceContent)) {
5791
- throw new ParseError("Source cannot be outside of the .ptbk.md folder");
5793
+ throw new ParseError("Source cannot be outside of the .book.md folder");
5792
5794
  }
5793
5795
  return {
5794
5796
  type: 'KNOWLEDGE',
@@ -6420,7 +6422,7 @@ function validateParameterName(parameterName) {
6420
6422
  /**
6421
6423
  * Parses the foreach command
6422
6424
  *
6423
- * Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.ptbk.md` file
6425
+ * Note: @@@ This command is used as foreach for new commands - it should NOT be used in any `.book.md` file
6424
6426
  *
6425
6427
  * @see `documentationUrl` for more details
6426
6428
  * @private within the commands folder
@@ -6570,7 +6572,7 @@ var foreachCommandParser = {
6570
6572
  },
6571
6573
  };
6572
6574
  /**
6573
- * TODO: [🍭] Make .ptbk.md file with examples of the FOREACH with wrong parsing and logic
6575
+ * TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
6574
6576
  */
6575
6577
 
6576
6578
  /**
@@ -7204,7 +7206,7 @@ var bookVersionCommandParser = {
7204
7206
  /**
7205
7207
  * Description of the BOOK_VERSION command
7206
7208
  */
7207
- description: "Which version of the Book language is the .ptbk.md using",
7209
+ description: "Which version of the Book language is the .book.md using",
7208
7210
  /**
7209
7211
  * Link to documentation
7210
7212
  */
@@ -7218,19 +7220,19 @@ var bookVersionCommandParser = {
7218
7220
  */
7219
7221
  parse: function (input) {
7220
7222
  var args = input.args;
7221
- var promptbookVersion = args.pop();
7222
- if (promptbookVersion === undefined) {
7223
+ var bookVersion = args.pop();
7224
+ if (bookVersion === undefined) {
7223
7225
  throw new ParseError("Version is required");
7224
7226
  }
7225
- if (!isValidPromptbookVersion(promptbookVersion)) {
7226
- throw new ParseError("Invalid Promptbook version \"".concat(promptbookVersion, "\""));
7227
+ if (!isValidPromptbookVersion(bookVersion)) {
7228
+ throw new ParseError("Invalid Promptbook version \"".concat(bookVersion, "\""));
7227
7229
  }
7228
7230
  if (args.length > 0 && !(((args.length === 1 && args[0]) || '').toUpperCase() === 'VERSION')) {
7229
7231
  throw new ParseError("Can not have more than one Promptbook version");
7230
7232
  }
7231
7233
  return {
7232
7234
  type: 'BOOK_VERSION',
7233
- promptbookVersion: promptbookVersion,
7235
+ bookVersion: bookVersion,
7234
7236
  };
7235
7237
  },
7236
7238
  /**
@@ -7240,7 +7242,7 @@ var bookVersionCommandParser = {
7240
7242
  */
7241
7243
  $applyToPipelineJson: function (command, $pipelineJson) {
7242
7244
  // TODO: Warn if the version is overridden
7243
- $pipelineJson.promptbookVersion = command.promptbookVersion;
7245
+ $pipelineJson.bookVersion = command.bookVersion;
7244
7246
  },
7245
7247
  /**
7246
7248
  * Converts the BOOK_VERSION command back to string
@@ -7293,9 +7295,9 @@ var urlCommandParser = {
7293
7295
  * Example usages of the URL command
7294
7296
  */
7295
7297
  examples: [
7296
- 'PIPELINE URL https://promptbook.studio/library/write-cv.ptbk.md',
7297
- 'URL https://promptbook.studio/library/write-cv.ptbk.md',
7298
- 'https://promptbook.studio/library/write-cv.ptbk.md',
7298
+ 'PIPELINE URL https://promptbook.studio/library/write-cv.book.md',
7299
+ 'URL https://promptbook.studio/library/write-cv.book.md',
7300
+ 'https://promptbook.studio/library/write-cv.book.md',
7299
7301
  ],
7300
7302
  /**
7301
7303
  * Parses the URL command
@@ -7496,7 +7498,7 @@ var instrumentCommandParser = {
7496
7498
  /**
7497
7499
  * Parses the boilerplate command
7498
7500
  *
7499
- * Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.ptbk.md` file
7501
+ * Note: @@@ This command is used as boilerplate for new commands - it should NOT be used in any `.book.md` file
7500
7502
  *
7501
7503
  * @see `documentationUrl` for more details
7502
7504
  * @private within the commands folder
@@ -7550,7 +7552,7 @@ var boilerplateCommandParser = {
7550
7552
  * Note: `$` is used to indicate that this function mutates given `pipelineJson`
7551
7553
  */
7552
7554
  $applyToPipelineJson: function (command, $pipelineJson) {
7553
- throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7555
+ throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .book.md file");
7554
7556
  },
7555
7557
  /**
7556
7558
  * Apply the BOILERPLATE command to the `pipelineJson`
@@ -7558,7 +7560,7 @@ var boilerplateCommandParser = {
7558
7560
  * Note: `$` is used to indicate that this function mutates given `templateJson`
7559
7561
  */
7560
7562
  $applyToTemplateJson: function (command, $templateJson, $pipelineJson) {
7561
- throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7563
+ throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .book.md file");
7562
7564
  },
7563
7565
  /**
7564
7566
  * Converts the BOILERPLATE command back to string
@@ -7574,7 +7576,7 @@ var boilerplateCommandParser = {
7574
7576
  * Note: This is used in `pipelineJsonToString` utility
7575
7577
  */
7576
7578
  takeFromPipelineJson: function (pipelineJson) {
7577
- throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7579
+ throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .book.md file");
7578
7580
  },
7579
7581
  /**
7580
7582
  * Reads the BOILERPLATE command from the `TemplateJson`
@@ -7582,7 +7584,7 @@ var boilerplateCommandParser = {
7582
7584
  * Note: This is used in `pipelineJsonToString` utility
7583
7585
  */
7584
7586
  takeFromTemplateJson: function ($templateJson) {
7585
- throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .ptbk.md file");
7587
+ throw new ParseError("BOILERPLATE command is only for testing purposes and should not be used in the .book.md file");
7586
7588
  },
7587
7589
  };
7588
7590
 
@@ -8058,8 +8060,8 @@ function titleToName(value) {
8058
8060
  * Note: This function does not validate logic of the pipeline only the parsing
8059
8061
  * Note: This function acts as compilation process
8060
8062
  *
8061
- * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
8062
- * @returns {Promptbook} compiled in JSON format (.ptbk.json)
8063
+ * @param pipelineString {Promptbook} in string markdown format (.book.md)
8064
+ * @returns {Promptbook} compiled in JSON format (.book.json)
8063
8065
  * @throws {ParseError} if the promptbook string is not valid
8064
8066
  * @public exported from `@promptbook/core`
8065
8067
  */
@@ -8068,7 +8070,7 @@ function pipelineStringToJsonSync(pipelineString) {
8068
8070
  var $pipelineJson = {
8069
8071
  title: undefined /* <- Note: [🍙] Putting here placeholder to keep `title` on top at final JSON */,
8070
8072
  pipelineUrl: undefined /* <- Note: Putting here placeholder to keep `pipelineUrl` on top at final JSON */,
8071
- promptbookVersion: undefined /* <- Note: By default no explicit version */,
8073
+ bookVersion: undefined /* <- Note: By default no explicit version */,
8072
8074
  description: undefined /* <- Note: [🍙] Putting here placeholder to keep `description` on top at final JSON */,
8073
8075
  parameters: [],
8074
8076
  templates: [],
@@ -8451,10 +8453,10 @@ function pipelineStringToJsonSync(pipelineString) {
8451
8453
  * Note: This function does not validate logic of the pipeline only the parsing
8452
8454
  * Note: This function acts as compilation process
8453
8455
  *
8454
- * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
8456
+ * @param pipelineString {Promptbook} in string markdown format (.book.md)
8455
8457
  * @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
8456
8458
  * @param options - Options and tools for the compilation
8457
- * @returns {Promptbook} compiled in JSON format (.ptbk.json)
8459
+ * @returns {Promptbook} compiled in JSON format (.book.json)
8458
8460
  * @throws {ParseError} if the promptbook string is not valid
8459
8461
  * @public exported from `@promptbook/core`
8460
8462
  */
@@ -8670,7 +8672,7 @@ function stringifyPipelineJson(pipeline) {
8670
8672
  return pipelineJsonStringified;
8671
8673
  }
8672
8674
  /**
8673
- * TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.ptbk.md
8675
+ * TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book.md
8674
8676
  * TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
8675
8677
  * TODO: [🧠] Maybe more elegant solution than replacing via regex
8676
8678
  * TODO: [🍙] Make some standard order of json properties