@promptbook/cli 0.61.0-20 → 0.61.0-22

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
@@ -150,7 +150,7 @@ new Function("\n try {\n if (typeof WorkerGlobalScope !== 'undefined'
150
150
  /**
151
151
  * The version of the Promptbook library
152
152
  */
153
- var PROMPTBOOK_VERSION = '0.61.0-19';
153
+ var PROMPTBOOK_VERSION = '0.61.0-21';
154
154
  // TODO: !!!! List here all the versions and annotate + put into script
155
155
 
156
156
  /**
@@ -735,7 +735,7 @@ function forEachAsync(array, options, callbackfunction) {
735
735
  });
736
736
  }
737
737
 
738
- var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.61.0-19",parameters:[{name:"content",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledge",description:"The knowledge JSON object",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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> {content}",dependentParameterNames:["content"],resultingParameterName:"knowledge"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-19",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.61.0-19",parameters:[{name:"content",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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> {content}",dependentParameterNames:["content"],resultingParameterName:"keywords"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-19",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.61.0-19",parameters:[{name:"content",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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> {content}",expectations:{words:{min:1,max:8}},dependentParameterNames:["content"],resultingParameterName:"title"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-19",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.61.0-19",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}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",modelRequirements:{modelVariant:"CHAT",modelName:"gpt-4-turbo"},content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\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### Option `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Option `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### Option `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}",expectFormat:"JSON",dependentParameterNames:["availableModelNames","personaDescription"],resultingParameterName:"modelRequirements"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-19",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
738
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.61.0-21",parameters:[{name:"content",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledge",description:"The knowledge JSON object",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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> {content}",dependentParameterNames:["content"],resultingParameterName:"knowledge"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-21",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-from-markdown.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.ptbk.md",promptbookVersion:"0.61.0-21",parameters:[{name:"content",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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> {content}",dependentParameterNames:["content"],resultingParameterName:"keywords"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-21",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-keywords.ptbk.md"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.ptbk.md",promptbookVersion:"0.61.0-21",parameters:[{name:"content",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"knowledge",title:"Knowledge",modelRequirements:{modelVariant:"CHAT",modelName:"claude-3-opus-20240229"},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> {content}",expectations:{words:{min:1,max:8}},dependentParameterNames:["content"],resultingParameterName:"title"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-21",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-knowledge-title.ptbk.md"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.ptbk.md",promptbookVersion:"0.61.0-21",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}],promptTemplates:[{blockType:"PROMPT_TEMPLATE",name:"make-model-requirements",title:"Make modelRequirements",modelRequirements:{modelVariant:"CHAT",modelName:"gpt-4-turbo"},content:"You are experienced AI engineer, you need to create virtual assistant.\nWrite\n\n## Sample\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### Option `modelName`\n\nPick from the following models:\n\n- {availableModelNames}\n\n### Option `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### Option `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}",expectFormat:"JSON",dependentParameterNames:["availableModelNames","personaDescription"],resultingParameterName:"modelRequirements"}],knowledgeSources:[],knowledgePieces:[],personas:[],preparations:[{id:1,promptbookVersion:"0.61.0-21",modelUsage:{price:{value:0},input:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}},output:{tokensCount:{value:0},charactersCount:{value:0},wordsCount:{value:0},sentencesCount:{value:0},linesCount:{value:0},paragraphsCount:{value:0},pagesCount:{value:0}}}}],sourceFile:"./promptbook-collection/prepare-persona.ptbk.md"}];
739
739
 
740
740
  /**
741
741
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -1098,7 +1098,9 @@ function validatePipeline(pipeline) {
1098
1098
  return template.dependentParameterNames.every(function (name) { return resovedParameters.includes(name); });
1099
1099
  });
1100
1100
  if (currentlyResovedTemplates.length === 0) {
1101
- throw new PipelineLogicError(spaceTrim$1(function (block) { return "\n\n Can not resolve some parameters:\n Either you are using a parameter that is not defined, or there are some circular dependencies.\n\n Can not resolve:\n ".concat(block(unresovedTemplates
1101
+ throw new PipelineLogicError(
1102
+ // TODO: [🐎] DRY
1103
+ spaceTrim$1(function (block) { return "\n\n Can not resolve some parameters:\n Either you are using a parameter that is not defined, or there are some circular dependencies.\n\n Can not resolve:\n ".concat(block(unresovedTemplates
1102
1104
  .map(function (_a) {
1103
1105
  var resultingParameterName = _a.resultingParameterName, dependentParameterNames = _a.dependentParameterNames;
1104
1106
  return "- Parameter {".concat(resultingParameterName, "} which depends on ").concat(dependentParameterNames
@@ -1657,7 +1659,11 @@ function assertsExecutionSuccessful(executionResult) {
1657
1659
  throw errors[0];
1658
1660
  }
1659
1661
  else {
1660
- throw new PipelineExecutionError(spaceTrim$1(function (block) { return "\n Multiple errors occurred during promptnook execution\n\n ".concat(block(errors.map(function (error) { return '- ' + error.message; }).join('\n')), "\n "); }));
1662
+ throw new PipelineExecutionError(spaceTrim$1(function (block) { return "\n Multiple errors occurred during promptnook execution\n\n ".concat(block(errors
1663
+ .map(function (error, index) {
1664
+ return spaceTrim$1(function (block) { return "\n Error ".concat(index + 1, ":\n ").concat(block(error.stack || error.message), "\n "); });
1665
+ })
1666
+ .join('\n')), "\n "); }));
1661
1667
  }
1662
1668
  }
1663
1669
  /**
@@ -2905,7 +2911,34 @@ function createPipelineExecutor(options) {
2905
2911
  });
2906
2912
  });
2907
2913
  }
2908
- var executionReport, _a, _b, parameter, parametersToPass, resovedParameters_1, unresovedTemplates_1, resolving_1, loopLimit, _loop_1, error_1, usage_1, outputParameters, errors, _c, _d, parameter, usage;
2914
+ function filterJustOutputParameters() {
2915
+ var e_9, _a;
2916
+ var outputParameters = {};
2917
+ try {
2918
+ // Note: Filter ONLY output parameters
2919
+ for (var _b = __values(pipeline.parameters.filter(function (_a) {
2920
+ var isOutput = _a.isOutput;
2921
+ return isOutput;
2922
+ })), _c = _b.next(); !_c.done; _c = _b.next()) {
2923
+ var parameter = _c.value;
2924
+ if (parametersToPass[parameter.name] === undefined) {
2925
+ // [4]
2926
+ errors.push(new PipelineExecutionError("Parameter {".concat(parameter.name, "} should be an output parameter, but it was not be resolved")));
2927
+ continue;
2928
+ }
2929
+ outputParameters[parameter.name] = parametersToPass[parameter.name] || '';
2930
+ }
2931
+ }
2932
+ catch (e_9_1) { e_9 = { error: e_9_1 }; }
2933
+ finally {
2934
+ try {
2935
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
2936
+ }
2937
+ finally { if (e_9) throw e_9.error; }
2938
+ }
2939
+ return outputParameters;
2940
+ }
2941
+ var executionReport, _a, _b, parameter, errors, _loop_1, _c, _d, parameterName, state_1, parametersToPass, resovedParameterNames_1, unresovedTemplates_1, resolving_1, loopLimit, _loop_2, error_1, usage_1, outputParameters_1, usage, outputParameters;
2909
2942
  var e_1, _e, e_2, _f;
2910
2943
  return __generator(this, function (_g) {
2911
2944
  switch (_g.label) {
@@ -2930,9 +2963,12 @@ function createPipelineExecutor(options) {
2930
2963
  };
2931
2964
  try {
2932
2965
  // Note: Check that all input input parameters are defined
2933
- for (_a = __values(pipeline.parameters), _b = _a.next(); !_b.done; _b = _a.next()) {
2966
+ for (_a = __values(pipeline.parameters.filter(function (_a) {
2967
+ var isInput = _a.isInput;
2968
+ return isInput;
2969
+ })), _b = _a.next(); !_b.done; _b = _a.next()) {
2934
2970
  parameter = _b.value;
2935
- if (parameter.isInput && inputParameters[parameter.name] === undefined) {
2971
+ if (inputParameters[parameter.name] === undefined) {
2936
2972
  return [2 /*return*/, deepFreezeWithSameType({
2937
2973
  isSuccessful: false,
2938
2974
  errors: [
@@ -2953,11 +2989,49 @@ function createPipelineExecutor(options) {
2953
2989
  }
2954
2990
  finally { if (e_1) throw e_1.error; }
2955
2991
  }
2992
+ errors = [];
2993
+ _loop_1 = function (parameterName) {
2994
+ var parameter = pipeline.parameters.find(function (_a) {
2995
+ var name = _a.name;
2996
+ return name === parameterName;
2997
+ });
2998
+ if (parameter === undefined) {
2999
+ errors.push(new PipelineExecutionError("Extra parameter {".concat(parameterName, "} is passed as input parameter")));
3000
+ }
3001
+ else if (parameter.isInput === false) {
3002
+ return { value: deepFreezeWithSameType({
3003
+ isSuccessful: false,
3004
+ errors: [
3005
+ new PipelineExecutionError("Parameter {".concat(parameter.name, "} is passed as input parameter but is not input")),
3006
+ // <- TODO: !!!!! Test this error
3007
+ ],
3008
+ executionReport: executionReport,
3009
+ outputParameters: {},
3010
+ usage: ZERO_USAGE,
3011
+ }) };
3012
+ }
3013
+ };
3014
+ try {
3015
+ // Note: Check that no extra input parameters are passed
3016
+ for (_c = __values(Object.keys(inputParameters)), _d = _c.next(); !_d.done; _d = _c.next()) {
3017
+ parameterName = _d.value;
3018
+ state_1 = _loop_1(parameterName);
3019
+ if (typeof state_1 === "object")
3020
+ return [2 /*return*/, state_1.value];
3021
+ }
3022
+ }
3023
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
3024
+ finally {
3025
+ try {
3026
+ if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
3027
+ }
3028
+ finally { if (e_2) throw e_2.error; }
3029
+ }
2956
3030
  parametersToPass = inputParameters;
2957
3031
  _g.label = 3;
2958
3032
  case 3:
2959
3033
  _g.trys.push([3, 8, , 9]);
2960
- resovedParameters_1 = pipeline.parameters
3034
+ resovedParameterNames_1 = pipeline.parameters
2961
3035
  .filter(function (_a) {
2962
3036
  var isInput = _a.isInput;
2963
3037
  return isInput;
@@ -2969,7 +3043,7 @@ function createPipelineExecutor(options) {
2969
3043
  unresovedTemplates_1 = __spreadArray([], __read(pipeline.promptTemplates), false);
2970
3044
  resolving_1 = [];
2971
3045
  loopLimit = LOOP_LIMIT;
2972
- _loop_1 = function () {
3046
+ _loop_2 = function () {
2973
3047
  var currentTemplate, work_1;
2974
3048
  return __generator(this, function (_h) {
2975
3049
  switch (_h.label) {
@@ -2979,15 +3053,21 @@ function createPipelineExecutor(options) {
2979
3053
  throw new UnexpectedError('Loop limit reached during resolving parameters pipeline execution');
2980
3054
  }
2981
3055
  currentTemplate = unresovedTemplates_1.find(function (template) {
2982
- return template.dependentParameterNames.every(function (name) { return resovedParameters_1.includes(name); });
3056
+ return template.dependentParameterNames.every(function (name) {
3057
+ return __spreadArray(__spreadArray([], __read(resovedParameterNames_1), false), __read(RESERVED_PARAMETER_NAMES), false).includes(name);
3058
+ });
2983
3059
  });
2984
3060
  if (!(!currentTemplate && resolving_1.length === 0)) return [3 /*break*/, 1];
2985
- throw new UnexpectedError(spaceTrim$1(function (block) { return "\n Can not resolve some parameters\n\n Note: This should be catched in `validatePipeline`\n\n\n Unresolved parameters:\n ".concat(block(unresovedTemplates_1
3061
+ throw new UnexpectedError(
3062
+ // TODO: [🐎] DRY
3063
+ spaceTrim$1(function (block) { return "\n Can not resolve some parameters:\n\n Can not resolve:\n ".concat(block(unresovedTemplates_1
2986
3064
  .map(function (_a) {
2987
- var resultingParameterName = _a.resultingParameterName;
2988
- return "- {".concat(resultingParameterName, "}");
3065
+ var resultingParameterName = _a.resultingParameterName, dependentParameterNames = _a.dependentParameterNames;
3066
+ return "- Parameter {".concat(resultingParameterName, "} which depends on ").concat(dependentParameterNames
3067
+ .map(function (dependentParameterName) { return "{".concat(dependentParameterName, "}"); })
3068
+ .join(' and '));
2989
3069
  })
2990
- .join('\n')), "\n\n Resolved parameters:\n ").concat(block(resovedParameters_1.map(function (name) { return "- {".concat(name, "}"); }).join('\n')), "\n "); }));
3070
+ .join('\n')), "\n\n Resolved:\n ").concat(block(resovedParameterNames_1.map(function (name) { return "- Parameter {".concat(name, "}"); }).join('\n')), "\n\n Note: This should be catched in `validatePipeline`\n "); }));
2991
3071
  case 1:
2992
3072
  if (!!currentTemplate) return [3 /*break*/, 3];
2993
3073
  /* [5] */ return [4 /*yield*/, Promise.race(resolving_1)];
@@ -2998,7 +3078,7 @@ function createPipelineExecutor(options) {
2998
3078
  unresovedTemplates_1 = unresovedTemplates_1.filter(function (template) { return template !== currentTemplate; });
2999
3079
  work_1 = executeSingleTemplate(currentTemplate)
3000
3080
  .then(function () {
3001
- resovedParameters_1 = __spreadArray(__spreadArray([], __read(resovedParameters_1), false), [currentTemplate.resultingParameterName], false);
3081
+ resovedParameterNames_1 = __spreadArray(__spreadArray([], __read(resovedParameterNames_1), false), [currentTemplate.resultingParameterName], false);
3002
3082
  })
3003
3083
  .then(function () {
3004
3084
  resolving_1 = resolving_1.filter(function (w) { return w !== work_1; });
@@ -3012,7 +3092,7 @@ function createPipelineExecutor(options) {
3012
3092
  _g.label = 4;
3013
3093
  case 4:
3014
3094
  if (!(unresovedTemplates_1.length > 0)) return [3 /*break*/, 6];
3015
- return [5 /*yield**/, _loop_1()];
3095
+ return [5 /*yield**/, _loop_2()];
3016
3096
  case 5:
3017
3097
  _g.sent();
3018
3098
  return [3 /*break*/, 4];
@@ -3029,41 +3109,20 @@ function createPipelineExecutor(options) {
3029
3109
  var result = _a.result;
3030
3110
  return (result === null || result === void 0 ? void 0 : result.usage) || ZERO_USAGE;
3031
3111
  })), false));
3112
+ outputParameters_1 = filterJustOutputParameters();
3032
3113
  return [2 /*return*/, deepFreezeWithSameType({
3033
3114
  isSuccessful: false,
3034
- errors: [error_1],
3115
+ errors: __spreadArray([error_1], __read(errors), false),
3035
3116
  usage: usage_1,
3036
3117
  executionReport: executionReport,
3037
- outputParameters: parametersToPass,
3118
+ outputParameters: outputParameters_1,
3038
3119
  })];
3039
3120
  case 9:
3040
- outputParameters = {};
3041
- errors = [];
3042
- try {
3043
- // Note: Filter ONLY output parameters
3044
- for (_c = __values(pipeline.parameters.filter(function (_a) {
3045
- var isOutput = _a.isOutput;
3046
- return isOutput;
3047
- })), _d = _c.next(); !_d.done; _d = _c.next()) {
3048
- parameter = _d.value;
3049
- if (parametersToPass[parameter.name] === undefined) {
3050
- errors.push(new PipelineExecutionError("Parameter {".concat(parameter.name, "} is required as an output parameter but not set in the pipeline")));
3051
- continue;
3052
- }
3053
- outputParameters[parameter.name] = parametersToPass[parameter.name] || '';
3054
- }
3055
- }
3056
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
3057
- finally {
3058
- try {
3059
- if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
3060
- }
3061
- finally { if (e_2) throw e_2.error; }
3062
- }
3063
3121
  usage = addUsage.apply(void 0, __spreadArray([], __read(executionReport.promptExecutions.map(function (_a) {
3064
3122
  var result = _a.result;
3065
3123
  return (result === null || result === void 0 ? void 0 : result.usage) || ZERO_USAGE;
3066
3124
  })), false));
3125
+ outputParameters = filterJustOutputParameters();
3067
3126
  return [2 /*return*/, deepFreezeWithSameType({
3068
3127
  isSuccessful: true,
3069
3128
  errors: errors,
@@ -3085,6 +3144,7 @@ function createPipelineExecutor(options) {
3085
3144
  * Note: CreatePipelineExecutorOptions are just connected to PipelineExecutor so do not extract to types folder
3086
3145
  * TODO: [🧠][3] transparent = (report intermediate parameters) / opaque execution = (report only output parameters) progress reporting mode
3087
3146
  * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
3147
+ * TODO: [💷] !!!! `assertsExecutionSuccessful` should be the method of `PipelineExecutor` result
3088
3148
  */
3089
3149
 
3090
3150
  /**
@@ -7514,8 +7574,8 @@ function initializePrettifyCommand(program) {
7514
7574
  throw error_1;
7515
7575
  }
7516
7576
  console.info(colors.red("Prettify ".concat(error_1.name, " ").concat(filePath)));
7517
- console.error(colors.bgRed(error_1.name));
7518
- console.error(error_1);
7577
+ console.error(colors.bgRed(error_1.name /* <- 11:11 */));
7578
+ console.error(colors.red(error_1.stack || error_1.message));
7519
7579
  process.exit(1);
7520
7580
  return [3 /*break*/, 9];
7521
7581
  case 9: