@promptbook/cli 0.68.0 → 0.70.0-0

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
@@ -20,7 +20,7 @@ import OpenAI from 'openai';
20
20
  /**
21
21
  * The version of the Promptbook library
22
22
  */
23
- var PROMPTBOOK_VERSION = '0.68.0-5';
23
+ var PROMPTBOOK_VERSION = '0.69.0-0';
24
24
  // TODO: !!!! List here all the versions and annotate + put into script
25
25
 
26
26
  /*! *****************************************************************************
@@ -1040,7 +1040,7 @@ function forEachAsync(array, options, callbackfunction) {
1040
1040
  });
1041
1041
  }
1042
1042
 
1043
- var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.68.0-5",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",promptbookVersion:"0.68.0-5",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",promptbookVersion:"0.68.0-5",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",promptbookVersion:"0.68.0-5",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## 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- 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"}];
1043
+ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.ptbk.md",promptbookVersion:"0.69.0-0",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",promptbookVersion:"0.69.0-0",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",promptbookVersion:"0.69.0-0",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",promptbookVersion:"0.69.0-0",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## 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- 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"}];
1044
1044
 
1045
1045
  /**
1046
1046
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -5041,6 +5041,76 @@ var expectCommandParser = {
5041
5041
  },
5042
5042
  };
5043
5043
 
5044
+ /**
5045
+ * @@@
5046
+ *
5047
+ * @param text @@@
5048
+ * @returns @@@
5049
+ * @example 'HELLO_WORLD'
5050
+ * @example 'I_LOVE_PROMPTBOOK'
5051
+ * @public exported from `@promptbook/utils`
5052
+ */
5053
+ function normalizeTo_SCREAMING_CASE(text) {
5054
+ var e_1, _a;
5055
+ var charType;
5056
+ var lastCharType = 'OTHER';
5057
+ var normalizedName = '';
5058
+ try {
5059
+ for (var text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {
5060
+ var char = text_1_1.value;
5061
+ var normalizedChar = void 0;
5062
+ if (/^[a-z]$/.test(char)) {
5063
+ charType = 'LOWERCASE';
5064
+ normalizedChar = char.toUpperCase();
5065
+ }
5066
+ else if (/^[A-Z]$/.test(char)) {
5067
+ charType = 'UPPERCASE';
5068
+ normalizedChar = char;
5069
+ }
5070
+ else if (/^[0-9]$/.test(char)) {
5071
+ charType = 'NUMBER';
5072
+ normalizedChar = char;
5073
+ }
5074
+ else if (/^\/$/.test(char)) {
5075
+ charType = 'SLASH';
5076
+ normalizedChar = char;
5077
+ }
5078
+ else {
5079
+ charType = 'OTHER';
5080
+ normalizedChar = '_';
5081
+ }
5082
+ if (charType !== lastCharType &&
5083
+ !(lastCharType === 'UPPERCASE' && charType === 'LOWERCASE') &&
5084
+ !(lastCharType === 'NUMBER') &&
5085
+ !(charType === 'NUMBER')) {
5086
+ normalizedName += '_';
5087
+ }
5088
+ normalizedName += normalizedChar;
5089
+ lastCharType = charType;
5090
+ }
5091
+ }
5092
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
5093
+ finally {
5094
+ try {
5095
+ if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);
5096
+ }
5097
+ finally { if (e_1) throw e_1.error; }
5098
+ }
5099
+ normalizedName = normalizedName.replace(/_+/g, '_');
5100
+ normalizedName = normalizedName.replace(/_?\/_?/g, '/');
5101
+ normalizedName = normalizedName.replace(/^_/, '');
5102
+ normalizedName = normalizedName.replace(/_$/, '');
5103
+ return normalizedName;
5104
+ }
5105
+ /**
5106
+ * TODO: Tests
5107
+ * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: 'Moje tabule' })).toEqual('/VtG7sR9rRJqwNEdM2/Moje tabule');
5108
+ * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: 'ěščřžžýáíúů' })).toEqual('/VtG7sR9rRJqwNEdM2/escrzyaieuu');
5109
+ * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: ' ahoj ' })).toEqual('/VtG7sR9rRJqwNEdM2/ahoj');
5110
+ * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: ' ahoj_ahojAhoj ahoj ' })).toEqual('/VtG7sR9rRJqwNEdM2/ahoj-ahoj-ahoj-ahoj');
5111
+ * TODO: [🌺] Use some intermediate util splitWords
5112
+ */
5113
+
5044
5114
  /**
5045
5115
  * Parses the foreach command
5046
5116
  *
@@ -5078,17 +5148,59 @@ var foreachCommandParser = {
5078
5148
  'FOREACH List Line -> `{customer}`',
5079
5149
  'FOR List Line -> `{customer}`',
5080
5150
  'EACH List Line -> `{customer}`',
5081
- // <- TODO: [🍭] More
5151
+ // <- TODO: [🍭] !!!!!! More
5082
5152
  ],
5083
5153
  /**
5084
5154
  * Parses the FOREACH command
5085
5155
  */
5086
5156
  parse: function (input) {
5087
- var args = input.args;
5088
- keepUnused(args);
5089
- // <- TODO: [🍭] Implement
5157
+ var args = input.args, rawArgs = input.rawArgs;
5158
+ var formatName = normalizeTo_SCREAMING_CASE(args[0] || '');
5159
+ var cellName = normalizeTo_SCREAMING_CASE(args[1] || '');
5160
+ var assignSign = args[2];
5161
+ var parameter = args[3];
5162
+ if (![
5163
+ 'LIST',
5164
+ 'CSV',
5165
+ // <- TODO: [🏢] Unhardcode formats
5166
+ ].includes(formatName)) {
5167
+ console.info({ args: args, formatName: formatName });
5168
+ throw new Error("Unsupported format \"".concat(formatName, "\""));
5169
+ // <- TODO: [🏢] List all supported format names
5170
+ }
5171
+ if (![
5172
+ 'LINE',
5173
+ 'ROW',
5174
+ 'COLUMN',
5175
+ 'CELL',
5176
+ // <- TODO: [🏢] Unhardcode format cekks
5177
+ ].includes(cellName)) {
5178
+ console.info({ args: args, cellName: cellName });
5179
+ throw new Error("Format ".concat(formatName, " does not support cell \"").concat(cellName, "\""));
5180
+ // <- TODO: [🏢] List all supported cell names for the format
5181
+ }
5182
+ if (assignSign !== '->') {
5183
+ console.info({ args: args, assignSign: assignSign });
5184
+ throw new Error("FOREACH command must have '->' to assign the value to the parameter");
5185
+ }
5186
+ var parameterNames = extractParameterNames(parameter || rawArgs);
5187
+ if (parameterNames.size !== 1) {
5188
+ console.info({ args: args, parameter: parameter, rawArgs: rawArgs });
5189
+ throw new Error("FOREACH command contain exactly one parameter, but found ".concat(parameterNames.size));
5190
+ }
5191
+ var parameterName = parameterNames.values().next().value;
5192
+ if (typeof parameterName !== 'string'
5193
+ // <- TODO: !!!!!! Replace with propper parameter name validation
5194
+ ) {
5195
+ console.info({ args: args, parameterName: parameterName });
5196
+ throw new Error("Invalid parameter name");
5197
+ // <- TODO: !!!!!! Better error (with rules and precise error) from validateParameterName
5198
+ }
5090
5199
  return {
5091
5200
  type: 'FOREACH',
5201
+ formatName: formatName,
5202
+ cellName: cellName,
5203
+ parameterName: parameterName,
5092
5204
  };
5093
5205
  },
5094
5206
  /**
@@ -5098,7 +5210,7 @@ var foreachCommandParser = {
5098
5210
  */
5099
5211
  $applyToTemplateJson: function (command, $templateJson, $pipelineJson) {
5100
5212
  keepUnused(command, $templateJson, $pipelineJson);
5101
- // <- TODO: [🍭] Implement
5213
+ // <- TODO: [🍭] !!!!!! Implement
5102
5214
  },
5103
5215
  /**
5104
5216
  * Converts the FOREACH command back to string
@@ -5108,7 +5220,7 @@ var foreachCommandParser = {
5108
5220
  stringify: function (command) {
5109
5221
  keepUnused(command);
5110
5222
  return "";
5111
- // <- TODO: [🍭] Implement
5223
+ // <- TODO: [🍭] !!!!!! Implement
5112
5224
  },
5113
5225
  /**
5114
5226
  * Reads the FOREACH command from the `TemplateJson`
@@ -5118,11 +5230,12 @@ var foreachCommandParser = {
5118
5230
  takeFromTemplateJson: function ($templateJson) {
5119
5231
  keepUnused($templateJson);
5120
5232
  return [];
5121
- // <- TODO: [🍭] Implement
5233
+ // <- TODO: [🍭] !!!!!! Implement
5122
5234
  },
5123
5235
  };
5124
5236
  /**
5125
- * TODO: [🍭] Make .ptbk.md file with examples of the FOREACH command and also with wrong parsing and logic
5237
+ * TODO: !!!!!! Comment console logs
5238
+ * TODO: [🍭] !!!!!! Make .ptbk.md file with examples of the FOREACH command and also with wrong parsing and logic
5126
5239
  */
5127
5240
 
5128
5241
  /**
@@ -5475,6 +5588,7 @@ var parameterCommandParser = {
5475
5588
  isInput = false;
5476
5589
  isOutput = false;
5477
5590
  }
5591
+ // TODO: !!!!!! Add parameter name validation
5478
5592
  return {
5479
5593
  type: 'PARAMETER',
5480
5594
  parameterName: parameterName,
@@ -6227,76 +6341,6 @@ function removeMarkdownFormatting(str) {
6227
6341
  return str;
6228
6342
  }
6229
6343
 
6230
- /**
6231
- * @@@
6232
- *
6233
- * @param text @@@
6234
- * @returns @@@
6235
- * @example 'HELLO_WORLD'
6236
- * @example 'I_LOVE_PROMPTBOOK'
6237
- * @public exported from `@promptbook/utils`
6238
- */
6239
- function normalizeTo_SCREAMING_CASE(text) {
6240
- var e_1, _a;
6241
- var charType;
6242
- var lastCharType = 'OTHER';
6243
- var normalizedName = '';
6244
- try {
6245
- for (var text_1 = __values(text), text_1_1 = text_1.next(); !text_1_1.done; text_1_1 = text_1.next()) {
6246
- var char = text_1_1.value;
6247
- var normalizedChar = void 0;
6248
- if (/^[a-z]$/.test(char)) {
6249
- charType = 'LOWERCASE';
6250
- normalizedChar = char.toUpperCase();
6251
- }
6252
- else if (/^[A-Z]$/.test(char)) {
6253
- charType = 'UPPERCASE';
6254
- normalizedChar = char;
6255
- }
6256
- else if (/^[0-9]$/.test(char)) {
6257
- charType = 'NUMBER';
6258
- normalizedChar = char;
6259
- }
6260
- else if (/^\/$/.test(char)) {
6261
- charType = 'SLASH';
6262
- normalizedChar = char;
6263
- }
6264
- else {
6265
- charType = 'OTHER';
6266
- normalizedChar = '_';
6267
- }
6268
- if (charType !== lastCharType &&
6269
- !(lastCharType === 'UPPERCASE' && charType === 'LOWERCASE') &&
6270
- !(lastCharType === 'NUMBER') &&
6271
- !(charType === 'NUMBER')) {
6272
- normalizedName += '_';
6273
- }
6274
- normalizedName += normalizedChar;
6275
- lastCharType = charType;
6276
- }
6277
- }
6278
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
6279
- finally {
6280
- try {
6281
- if (text_1_1 && !text_1_1.done && (_a = text_1.return)) _a.call(text_1);
6282
- }
6283
- finally { if (e_1) throw e_1.error; }
6284
- }
6285
- normalizedName = normalizedName.replace(/_+/g, '_');
6286
- normalizedName = normalizedName.replace(/_?\/_?/g, '/');
6287
- normalizedName = normalizedName.replace(/^_/, '');
6288
- normalizedName = normalizedName.replace(/_$/, '');
6289
- return normalizedName;
6290
- }
6291
- /**
6292
- * TODO: Tests
6293
- * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: 'Moje tabule' })).toEqual('/VtG7sR9rRJqwNEdM2/Moje tabule');
6294
- * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: 'ěščřžžýáíúů' })).toEqual('/VtG7sR9rRJqwNEdM2/escrzyaieuu');
6295
- * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: ' ahoj ' })).toEqual('/VtG7sR9rRJqwNEdM2/ahoj');
6296
- * > expect(encodeRoutePath({ uriId: 'VtG7sR9rRJqwNEdM2', name: ' ahoj_ahojAhoj ahoj ' })).toEqual('/VtG7sR9rRJqwNEdM2/ahoj-ahoj-ahoj-ahoj');
6297
- * TODO: [🌺] Use some intermediate util splitWords
6298
- */
6299
-
6300
6344
  /**
6301
6345
  * Parses one line of ul/ol to command
6302
6346
  *
@@ -6309,6 +6353,7 @@ function parseCommand(raw, usagePlace) {
6309
6353
  if (raw.includes('\n') || raw.includes('\r')) {
6310
6354
  throw new ParseError('Command can not contain new line characters' /* <- TODO: [🚞] */);
6311
6355
  }
6356
+ // TODO: Unit test all this processing and parsing
6312
6357
  var normalized = raw.trim();
6313
6358
  normalized = normalized.split('`').join('');
6314
6359
  normalized = normalized.split('"').join('');
@@ -6364,7 +6409,7 @@ function parseCommand(raw, usagePlace) {
6364
6409
  // Arg1 Arg2 Arg3 | FOO
6365
6410
  {
6366
6411
  var commandNameRaw = items.slice(-1).join('_');
6367
- var args = items.slice(0, -1);
6412
+ var args = items.slice(0, -1); // <- Note: This is probbably not correct
6368
6413
  var rawArgs = raw.substring(0, raw.length - commandNameRaw.length).trim();
6369
6414
  var command = parseCommandVariant({ usagePlace: usagePlace, raw: raw, rawArgs: rawArgs, normalized: normalized, args: args, commandNameRaw: commandNameRaw });
6370
6415
  if (command !== null) {