@promptbook/editable 0.112.0-13 → 0.112.0-15

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 (31) hide show
  1. package/esm/index.es.js +39 -39
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/cli/cli-commands/coder/{find-fresh-emoji-tag.d.ts → find-fresh-emoji-tags.d.ts} +1 -1
  4. package/esm/src/cli/cli-commands/coder.d.ts +1 -1
  5. package/esm/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +1 -1
  6. package/esm/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  7. package/esm/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  8. package/esm/src/llm-providers/google/google-models.d.ts +1 -1
  9. package/esm/src/llm-providers/openai/openai-models.d.ts +1 -1
  10. package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -2
  11. package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -2
  12. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -2
  13. package/esm/src/scripting/javascript/postprocessing-functions.d.ts +1 -1
  14. package/esm/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -2
  15. package/esm/src/version.d.ts +1 -1
  16. package/package.json +2 -2
  17. package/umd/index.umd.js +49 -50
  18. package/umd/index.umd.js.map +1 -1
  19. package/umd/src/cli/cli-commands/coder/{find-fresh-emoji-tag.d.ts → find-fresh-emoji-tags.d.ts} +1 -1
  20. package/umd/src/cli/cli-commands/coder.d.ts +1 -1
  21. package/umd/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +1 -1
  22. package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  23. package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  24. package/umd/src/llm-providers/google/google-models.d.ts +1 -1
  25. package/umd/src/llm-providers/openai/openai-models.d.ts +1 -1
  26. package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -2
  27. package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -2
  28. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -2
  29. package/umd/src/scripting/javascript/postprocessing-functions.d.ts +1 -1
  30. package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -2
  31. package/umd/src/version.d.ts +1 -1
package/esm/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import spaceTrim$2, { spaceTrim as spaceTrim$1 } from 'spacetrim';
1
+ import { spaceTrim as spaceTrim$1 } from 'spacetrim';
2
2
  import { parse, unparse } from 'papaparse';
3
3
  import { SHA256 } from 'crypto-js';
4
4
  import hexEncoder from 'crypto-js/enc-hex';
@@ -17,7 +17,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
17
17
  * @generated
18
18
  * @see https://github.com/webgptorg/promptbook
19
19
  */
20
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-13';
20
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-15';
21
21
  /**
22
22
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
23
23
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1041,7 +1041,7 @@ parseInt(process.env.API_REQUEST_TIMEOUT || '90000');
1041
1041
  function getErrorReportUrl(error) {
1042
1042
  const report = {
1043
1043
  title: `🐜 Error report from ${NAME}`,
1044
- body: spaceTrim$2((block) => `
1044
+ body: spaceTrim$1((block) => `
1045
1045
 
1046
1046
 
1047
1047
  \`${error.name || 'Error'}\` has occurred in the [${NAME}], please look into it @${ADMIN_GITHUB_NAME}.
@@ -1503,7 +1503,7 @@ const expectCommandParser = {
1503
1503
  /**
1504
1504
  * Description of the FORMAT command
1505
1505
  */
1506
- description: spaceTrim$2(`
1506
+ description: spaceTrim$1(`
1507
1507
  Expect command describes the desired output of the task *(after post-processing)*
1508
1508
  It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs or some other shape of the output.
1509
1509
  `),
@@ -1577,7 +1577,7 @@ const expectCommandParser = {
1577
1577
  }
1578
1578
  catch (error) {
1579
1579
  assertsError(error);
1580
- throw new ParseError(spaceTrim$2((block) => `
1580
+ throw new ParseError(spaceTrim$1((block) => `
1581
1581
  Invalid FORMAT command
1582
1582
  ${block(error.message)}:
1583
1583
  `));
@@ -1729,7 +1729,7 @@ const CsvFormatParser = {
1729
1729
  const { value, outputParameterName, settings, mapCallback, onProgress } = options;
1730
1730
  const csv = csvParse(value, settings);
1731
1731
  if (csv.errors.length !== 0) {
1732
- throw new CsvFormatError(spaceTrim$2((block) => `
1732
+ throw new CsvFormatError(spaceTrim$1((block) => `
1733
1733
  CSV parsing error
1734
1734
 
1735
1735
  Error(s) from CSV parsing:
@@ -1774,7 +1774,7 @@ const CsvFormatParser = {
1774
1774
  const { value, settings, mapCallback, onProgress } = options;
1775
1775
  const csv = csvParse(value, settings);
1776
1776
  if (csv.errors.length !== 0) {
1777
- throw new CsvFormatError(spaceTrim$2((block) => `
1777
+ throw new CsvFormatError(spaceTrim$1((block) => `
1778
1778
  CSV parsing error
1779
1779
 
1780
1780
  Error(s) from CSV parsing:
@@ -2119,7 +2119,7 @@ function checkSerializableAsJson(options) {
2119
2119
  }
2120
2120
  else if (typeof value === 'object') {
2121
2121
  if (value instanceof Date) {
2122
- throw new UnexpectedError(spaceTrim$2((block) => `
2122
+ throw new UnexpectedError(spaceTrim$1((block) => `
2123
2123
  \`${name}\` is Date
2124
2124
 
2125
2125
  Use \`string_date_iso8601\` instead
@@ -2138,7 +2138,7 @@ function checkSerializableAsJson(options) {
2138
2138
  throw new UnexpectedError(`${name} is RegExp`);
2139
2139
  }
2140
2140
  else if (value instanceof Error) {
2141
- throw new UnexpectedError(spaceTrim$2((block) => `
2141
+ throw new UnexpectedError(spaceTrim$1((block) => `
2142
2142
  \`${name}\` is unserialized Error
2143
2143
 
2144
2144
  Use function \`serializeError\`
@@ -2161,7 +2161,7 @@ function checkSerializableAsJson(options) {
2161
2161
  }
2162
2162
  catch (error) {
2163
2163
  assertsError(error);
2164
- throw new UnexpectedError(spaceTrim$2((block) => `
2164
+ throw new UnexpectedError(spaceTrim$1((block) => `
2165
2165
  \`${name}\` is not serializable
2166
2166
 
2167
2167
  ${block(error.stack || error.message)}
@@ -2193,7 +2193,7 @@ function checkSerializableAsJson(options) {
2193
2193
  }
2194
2194
  }
2195
2195
  else {
2196
- throw new UnexpectedError(spaceTrim$2((block) => `
2196
+ throw new UnexpectedError(spaceTrim$1((block) => `
2197
2197
  \`${name}\` is unknown type
2198
2198
 
2199
2199
  Additional message for \`${name}\`:
@@ -2723,7 +2723,7 @@ function validateParameterName(parameterName) {
2723
2723
  if (!(error instanceof ParseError)) {
2724
2724
  throw error;
2725
2725
  }
2726
- throw new ParseError(spaceTrim$2((block) => `
2726
+ throw new ParseError(spaceTrim$1((block) => `
2727
2727
  ${block(error.message)}
2728
2728
 
2729
2729
  Tried to validate parameter name:
@@ -2782,7 +2782,7 @@ const foreachCommandParser = {
2782
2782
  const assignSign = args[3];
2783
2783
  const formatDefinition = FORMAT_DEFINITIONS.find((formatDefinition) => [formatDefinition.formatName, ...(formatDefinition.aliases || [])].includes(formatName));
2784
2784
  if (formatDefinition === undefined) {
2785
- throw new ParseError(spaceTrim$2((block) => `
2785
+ throw new ParseError(spaceTrim$1((block) => `
2786
2786
  Unsupported format "${formatName}"
2787
2787
 
2788
2788
  Available formats:
@@ -2794,7 +2794,7 @@ const foreachCommandParser = {
2794
2794
  }
2795
2795
  const subvalueParser = formatDefinition.subvalueParsers.find((subvalueParser) => [subvalueParser.subvalueName, ...(subvalueParser.aliases || [])].includes(subformatName));
2796
2796
  if (subvalueParser === undefined) {
2797
- throw new ParseError(spaceTrim$2((block) => `
2797
+ throw new ParseError(spaceTrim$1((block) => `
2798
2798
  Unsupported subformat name "${subformatName}" for format "${formatName}"
2799
2799
 
2800
2800
  Available subformat names for format "${formatDefinition.formatName}":
@@ -2842,7 +2842,7 @@ const foreachCommandParser = {
2842
2842
  outputSubparameterName = 'newLine';
2843
2843
  }
2844
2844
  else {
2845
- throw new ParseError(spaceTrim$2(`
2845
+ throw new ParseError(spaceTrim$1(`
2846
2846
  FOREACH ${formatName} ${subformatName} must specify output subparameter
2847
2847
 
2848
2848
  Correct example:
@@ -2918,7 +2918,7 @@ const formatCommandParser = {
2918
2918
  /**
2919
2919
  * Description of the FORMAT command
2920
2920
  */
2921
- description: spaceTrim$2(`
2921
+ description: spaceTrim$1(`
2922
2922
  Format command describes the desired output of the task (after post-processing)
2923
2923
  It can set limits for the maximum/minimum length of the output, measured in characters, words, sentences, paragraphs or some other shape of the output.
2924
2924
  `),
@@ -3290,7 +3290,7 @@ const formfactorCommandParser = {
3290
3290
  const formfactorNameCandidate = args[0].toUpperCase();
3291
3291
  const formfactor = FORMFACTOR_DEFINITIONS.find((definition) => [definition.name, ...{ aliasNames: [], ...definition }.aliasNames].includes(formfactorNameCandidate));
3292
3292
  if (formfactor === undefined) {
3293
- throw new ParseError(spaceTrim$2((block) => `
3293
+ throw new ParseError(spaceTrim$1((block) => `
3294
3294
  Unknown formfactor name "${formfactorNameCandidate}"
3295
3295
 
3296
3296
  Available formfactors:
@@ -3309,7 +3309,7 @@ const formfactorCommandParser = {
3309
3309
  */
3310
3310
  $applyToPipelineJson(command, $pipelineJson) {
3311
3311
  if ($pipelineJson.formfactorName !== undefined && $pipelineJson.formfactorName !== command.formfactorName) {
3312
- throw new ParseError(spaceTrim$2(`
3312
+ throw new ParseError(spaceTrim$1(`
3313
3313
  Redefinition of \`FORMFACTOR\` in the pipeline head
3314
3314
 
3315
3315
  You have used:
@@ -3613,7 +3613,7 @@ const knowledgeCommandParser = {
3613
3613
  */
3614
3614
  parse(input) {
3615
3615
  const { args } = input;
3616
- const knowledgeSourceContent = spaceTrim$2(args[0] || '');
3616
+ const knowledgeSourceContent = spaceTrim$1(args[0] || '');
3617
3617
  if (knowledgeSourceContent === '') {
3618
3618
  throw new ParseError(`Source is not defined`);
3619
3619
  }
@@ -3712,7 +3712,7 @@ const modelCommandParser = {
3712
3712
  */
3713
3713
  parse(input) {
3714
3714
  const { args, normalized } = input;
3715
- const availableVariantsMessage = spaceTrim$2((block) => `
3715
+ const availableVariantsMessage = spaceTrim$1((block) => `
3716
3716
  Available variants are:
3717
3717
  ${block(MODEL_VARIANTS.map((variantName) => `- ${variantName}${variantName !== 'EMBEDDING' ? '' : ' (Not available in pipeline)'}`).join('\n'))}
3718
3718
  `);
@@ -3734,14 +3734,14 @@ const modelCommandParser = {
3734
3734
  // <- Note: [🤖]
3735
3735
  }
3736
3736
  else if (normalized.startsWith('MODEL_VARIANT_EMBED')) {
3737
- spaceTrim$2((block) => `
3737
+ spaceTrim$1((block) => `
3738
3738
  Embedding model can not be used in pipeline
3739
3739
 
3740
3740
  ${block(availableVariantsMessage)}
3741
3741
  `);
3742
3742
  }
3743
3743
  else {
3744
- throw new ParseError(spaceTrim$2((block) => `
3744
+ throw new ParseError(spaceTrim$1((block) => `
3745
3745
  Unknown model variant in command:
3746
3746
 
3747
3747
  ${block(availableVariantsMessage)}
@@ -3756,7 +3756,7 @@ const modelCommandParser = {
3756
3756
  };
3757
3757
  }
3758
3758
  else {
3759
- throw new ParseError(spaceTrim$2((block) => `
3759
+ throw new ParseError(spaceTrim$1((block) => `
3760
3760
  Unknown model key in command.
3761
3761
 
3762
3762
  Supported model keys are:
@@ -3783,7 +3783,7 @@ const modelCommandParser = {
3783
3783
  // <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
3784
3784
  }
3785
3785
  else {
3786
- throw new ParseError(spaceTrim$2(`
3786
+ throw new ParseError(spaceTrim$1(`
3787
3787
  Redefinition of \`MODEL ${command.key}\` in the pipeline head
3788
3788
 
3789
3789
  You have used:
@@ -3811,7 +3811,7 @@ const modelCommandParser = {
3811
3811
  // <- TODO: [🏮] Some standard way how to transform errors into warnings and how to handle non-critical fails during the tasks
3812
3812
  }
3813
3813
  else {
3814
- throw new ParseError(spaceTrim$2(`
3814
+ throw new ParseError(spaceTrim$1(`
3815
3815
  Redefinition of MODEL \`${command.key}\` in the task "${$taskJson.title || $taskJson.name}"
3816
3816
 
3817
3817
  You have used:
@@ -3821,7 +3821,7 @@ const modelCommandParser = {
3821
3821
  }
3822
3822
  }
3823
3823
  if (command.value === ($pipelineJson.defaultModelRequirements || {})[command.key]) {
3824
- console.log(spaceTrim$2(`
3824
+ console.log(spaceTrim$1(`
3825
3825
  Setting MODEL \`${command.key}\` in the task "${$taskJson.title || $taskJson.name}" to the same value as in the pipeline head
3826
3826
 
3827
3827
  In pipeline head:
@@ -3904,7 +3904,7 @@ const parameterCommandParser = {
3904
3904
  // <- TODO: When [🥶] fixed, change to:
3905
3905
  // > const parameterDescriptionRaw = rawArgs.split(parameterNameRaw).join('').trim();
3906
3906
  if (parameterDescriptionRaw && parameterDescriptionRaw.match(/\{(?<embeddedParameterName>[a-z0-9_]+)\}/im)) {
3907
- throw new ParseError(spaceTrim$2((block) => `
3907
+ throw new ParseError(spaceTrim$1((block) => `
3908
3908
  Parameter \`{${parameterNameRaw}}\` can not contain another parameter in description
3909
3909
 
3910
3910
  The description:
@@ -4086,7 +4086,7 @@ function $applyToTaskJson(command, $taskJson, $pipelineJson) {
4086
4086
  persona.description = personaDescription;
4087
4087
  return;
4088
4088
  }
4089
- console.warn(spaceTrim$2(`
4089
+ console.warn(spaceTrim$1(`
4090
4090
 
4091
4091
  Persona "${personaName}" is defined multiple times with different description:
4092
4092
 
@@ -4097,7 +4097,7 @@ function $applyToTaskJson(command, $taskJson, $pipelineJson) {
4097
4097
  ${personaDescription}
4098
4098
 
4099
4099
  `));
4100
- persona.description += spaceTrim$2('\n\n' + personaDescription);
4100
+ persona.description += spaceTrim$1('\n\n' + personaDescription);
4101
4101
  }
4102
4102
 
4103
4103
  /**
@@ -4319,7 +4319,7 @@ const sectionCommandParser = {
4319
4319
  normalized = normalized.split('DIALOGUE').join('DIALOG');
4320
4320
  const taskTypes = SectionTypes.filter((sectionType) => normalized.includes(sectionType.split('_TASK').join('')));
4321
4321
  if (taskTypes.length !== 1) {
4322
- throw new ParseError(spaceTrim$2((block) => `
4322
+ throw new ParseError(spaceTrim$1((block) => `
4323
4323
  Unknown section type "${normalized}"
4324
4324
 
4325
4325
  Supported section types are:
@@ -4339,7 +4339,7 @@ const sectionCommandParser = {
4339
4339
  */
4340
4340
  $applyToTaskJson(command, $taskJson, $pipelineJson) {
4341
4341
  if ($taskJson.isSectionTypeSet === true) {
4342
- throw new ParseError(spaceTrim$2(`
4342
+ throw new ParseError(spaceTrim$1(`
4343
4343
  Section type is already defined in the section.
4344
4344
  It can be defined only once.
4345
4345
  `));
@@ -5013,7 +5013,7 @@ function removeMarkdownComments(content) {
5013
5013
  */
5014
5014
  function isFlatPipeline(pipelineString) {
5015
5015
  pipelineString = removeMarkdownComments(pipelineString);
5016
- pipelineString = spaceTrim$2(pipelineString);
5016
+ pipelineString = spaceTrim$1(pipelineString);
5017
5017
  const isMarkdownBeginningWithHeadline = pipelineString.startsWith('# ');
5018
5018
  //const isLastLineReturnStatement = pipelineString.split(/\r?\n/).pop()!.split('`').join('').startsWith('->');
5019
5019
  const isBacktickBlockUsed = pipelineString.includes('```');
@@ -5039,7 +5039,7 @@ function deflatePipeline(pipelineString) {
5039
5039
  if (!isFlatPipeline(pipelineString)) {
5040
5040
  return pipelineString;
5041
5041
  }
5042
- pipelineString = spaceTrim$2(pipelineString);
5042
+ pipelineString = spaceTrim$1(pipelineString);
5043
5043
  const pipelineStringLines = pipelineString.split(/\r?\n/);
5044
5044
  const potentialReturnStatement = pipelineStringLines.pop();
5045
5045
  let returnStatement;
@@ -5052,19 +5052,19 @@ function deflatePipeline(pipelineString) {
5052
5052
  returnStatement = `-> {${DEFAULT_BOOK_OUTPUT_PARAMETER_NAME}}`;
5053
5053
  pipelineStringLines.push(potentialReturnStatement);
5054
5054
  }
5055
- const prompt = spaceTrim$2(pipelineStringLines.join('\n'));
5055
+ const prompt = spaceTrim$1(pipelineStringLines.join('\n'));
5056
5056
  let quotedPrompt;
5057
5057
  if (prompt.split(/\r?\n/).length <= 1) {
5058
5058
  quotedPrompt = `> ${prompt}`;
5059
5059
  }
5060
5060
  else {
5061
- quotedPrompt = spaceTrim$2((block) => `
5061
+ quotedPrompt = spaceTrim$1((block) => `
5062
5062
  \`\`\`
5063
5063
  ${block(prompt.split('`').join('\\`'))}
5064
5064
  \`\`\`
5065
5065
  `);
5066
5066
  }
5067
- pipelineString = validatePipelineString(spaceTrim$2((block) => `
5067
+ pipelineString = validatePipelineString(spaceTrim$1((block) => `
5068
5068
  # ${DEFAULT_BOOK_TITLE}
5069
5069
 
5070
5070
  ## Prompt
@@ -5132,7 +5132,7 @@ function addPipelineCommand(options) {
5132
5132
  );
5133
5133
  */
5134
5134
  }
5135
- return spaceTrim$2(newLines.join('\n'));
5135
+ return spaceTrim$1(newLines.join('\n'));
5136
5136
  }
5137
5137
  /**
5138
5138
  * TODO: [🧠] What is the better solution - `- xxx`, - `- xxx` or preserve (see also next TODO)
@@ -5174,7 +5174,7 @@ function removePipelineCommand(options) {
5174
5174
  }
5175
5175
  newLines.push(line);
5176
5176
  }
5177
- const newPipeline = spaceTrim$2(newLines.join('\n'));
5177
+ const newPipeline = spaceTrim$1(newLines.join('\n'));
5178
5178
  return newPipeline;
5179
5179
  }
5180
5180
 
@@ -5277,7 +5277,7 @@ function isSerializableAsJson(value) {
5277
5277
  */
5278
5278
  function stringifyPipelineJson(pipeline) {
5279
5279
  if (!isSerializableAsJson(pipeline)) {
5280
- throw new UnexpectedError(spaceTrim$2(`
5280
+ throw new UnexpectedError(spaceTrim$1(`
5281
5281
  Cannot stringify the pipeline, because it is not serializable as JSON
5282
5282
 
5283
5283
  There can be multiple reasons: