@promptbook/core 0.92.0-28 → 0.92.0-29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/esm/index.es.js CHANGED
@@ -27,7 +27,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
27
27
  * @generated
28
28
  * @see https://github.com/webgptorg/promptbook
29
29
  */
30
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-28';
30
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-29';
31
31
  /**
32
32
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
33
33
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -9777,13 +9777,16 @@ function addAutoGeneratedSection(content, options) {
9777
9777
  */
9778
9778
  function renderPromptbookMermaid(pipelineJson, options) {
9779
9779
  const { linkTask = () => null } = options || {};
9780
+ const MERMAID_PREFIX = 'mermaid_';
9781
+ const KNOWLEDGE_NAME = MERMAID_PREFIX + 'knowledge';
9782
+ const RESERVED_NAME = MERMAID_PREFIX + 'reserved';
9780
9783
  const parameterNameToTaskName = (parameterName) => {
9781
9784
  if (parameterName === 'knowledge') {
9782
- return 'knowledge';
9785
+ return KNOWLEDGE_NAME;
9783
9786
  // <- TODO: !!!! Check that this works
9784
9787
  }
9785
9788
  else if (RESERVED_PARAMETER_NAMES.includes(parameterName)) {
9786
- return 'reserved';
9789
+ return RESERVED_NAME;
9787
9790
  }
9788
9791
  const parameter = pipelineJson.parameters.find((parameter) => parameter.name === parameterName);
9789
9792
  if (!parameter) {
@@ -9791,13 +9794,13 @@ function renderPromptbookMermaid(pipelineJson, options) {
9791
9794
  // <- TODO: !!6 This causes problems when {knowledge} and other reserved parameters are used
9792
9795
  }
9793
9796
  if (parameter.isInput) {
9794
- return 'input';
9797
+ return MERMAID_PREFIX + 'input';
9795
9798
  }
9796
9799
  const task = pipelineJson.tasks.find((task) => task.resultingParameterName === parameterName);
9797
9800
  if (!task) {
9798
9801
  throw new Error(`Could not find task for {${parameterName}}`);
9799
9802
  }
9800
- return task.name || normalizeTo_camelCase('task-' + titleToName(task.title));
9803
+ return MERMAID_PREFIX + (task.name || normalizeTo_camelCase('task-' + titleToName(task.title)));
9801
9804
  };
9802
9805
  const promptbookMermaid = spaceTrim$1((block) => `
9803
9806
 
@@ -9809,8 +9812,8 @@ function renderPromptbookMermaid(pipelineJson, options) {
9809
9812
  direction TB
9810
9813
 
9811
9814
  input((Input)):::input
9812
- other((Other)):::other
9813
- knowledge((Knowledgebase)):::knowledge
9815
+ ${RESERVED_NAME}((Other)):::${RESERVED_NAME}
9816
+ ${KNOWLEDGE_NAME}((Knowledgebase)):::${KNOWLEDGE_NAME}
9814
9817
  ${block(pipelineJson.tasks
9815
9818
  .flatMap(({ title, dependentParameterNames, resultingParameterName }) => [
9816
9819
  `${parameterNameToTaskName(resultingParameterName)}("${title}")`,