@promptbook/remote-client 0.92.0-22 → 0.92.0-23

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 (26) hide show
  1. package/esm/index.es.js +25 -19
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/core.index.d.ts +6 -0
  4. package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +6 -6
  5. package/esm/typings/src/config.d.ts +29 -11
  6. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +12 -9
  7. package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +11 -8
  8. package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +8 -3
  9. package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +10 -8
  10. package/esm/typings/src/formats/_common/FormatParser.d.ts +5 -3
  11. package/esm/typings/src/formats/_common/FormatSubvalueParser.d.ts +31 -6
  12. package/esm/typings/src/formats/csv/utils/isValidCsvString.d.ts +1 -1
  13. package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +1 -1
  14. package/esm/typings/src/formats/xml/utils/isValidXmlString.d.ts +1 -1
  15. package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +4 -1
  16. package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +3 -3
  17. package/esm/typings/src/types/typeAliases.d.ts +9 -7
  18. package/esm/typings/src/utils/$Register.d.ts +8 -7
  19. package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +7 -7
  20. package/esm/typings/src/utils/serialization/clonePipeline.d.ts +4 -3
  21. package/esm/typings/src/utils/serialization/deepClone.d.ts +5 -1
  22. package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +3 -3
  23. package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +5 -4
  24. package/package.json +2 -2
  25. package/umd/index.umd.js +25 -19
  26. package/umd/index.umd.js.map +1 -1
package/esm/index.es.js CHANGED
@@ -20,7 +20,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
20
20
  * @generated
21
21
  * @see https://github.com/webgptorg/promptbook
22
22
  */
23
- const PROMPTBOOK_ENGINE_VERSION = '0.92.0-22';
23
+ const PROMPTBOOK_ENGINE_VERSION = '0.92.0-23';
24
24
  /**
25
25
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
26
26
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -361,7 +361,7 @@ const CONNECTION_TIMEOUT_MS = 7 * 1000;
361
361
  const CONNECTION_RETRIES_LIMIT = 5;
362
362
  // <- TODO: [🧜‍♂️]
363
363
  /**
364
- * @@@
364
+ * Default settings for parsing and generating CSV files in Promptbook.
365
365
  *
366
366
  * @public exported from `@promptbook/core`
367
367
  */
@@ -1856,7 +1856,7 @@ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO:
1856
1856
  * Function to check if a string is valid CSV
1857
1857
  *
1858
1858
  * @param value The string to check
1859
- * @returns True if the string is a valid CSV string, false otherwise
1859
+ * @returns `true` if the string is a valid CSV string, false otherwise
1860
1860
  *
1861
1861
  * @public exported from `@promptbook/utils`
1862
1862
  */
@@ -1913,14 +1913,15 @@ const CsvFormatParser = {
1913
1913
  `));
1914
1914
  }
1915
1915
  const mappedData = [];
1916
- for (let index = 0; index < csv.data.length; index++) {
1916
+ const length = csv.data.length;
1917
+ for (let index = 0; index < length; index++) {
1917
1918
  const row = csv.data[index];
1918
1919
  if (row[outputParameterName]) {
1919
1920
  throw new CsvFormatError(`Can not overwrite existing column "${outputParameterName}" in CSV row`);
1920
1921
  }
1921
1922
  const mappedRow = {
1922
1923
  ...row,
1923
- [outputParameterName]: await mapCallback(row, index),
1924
+ [outputParameterName]: await mapCallback(row, index, length),
1924
1925
  };
1925
1926
  mappedData.push(mappedRow);
1926
1927
  if (onProgress) {
@@ -1951,9 +1952,9 @@ const CsvFormatParser = {
1951
1952
  `));
1952
1953
  }
1953
1954
  const mappedData = await Promise.all(csv.data.map(async (row, rowIndex) => {
1954
- return /* not await */ Promise.all(Object.entries(row).map(async ([key, value], columnIndex) => {
1955
+ return /* not await */ Promise.all(Object.entries(row).map(async ([key, value], columnIndex, array) => {
1955
1956
  const index = rowIndex * Object.keys(row).length + columnIndex;
1956
- return /* not await */ mapCallback({ [key]: value }, index);
1957
+ return /* not await */ mapCallback({ [key]: value }, index, array.length);
1957
1958
  }));
1958
1959
  }));
1959
1960
  return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
@@ -1973,7 +1974,7 @@ const CsvFormatParser = {
1973
1974
  * Function isValidJsonString will tell you if the string is valid JSON or not
1974
1975
  *
1975
1976
  * @param value The string to check
1976
- * @returns True if the string is a valid JSON string, false otherwise
1977
+ * @returns `true` if the string is a valid JSON string, false otherwise
1977
1978
  *
1978
1979
  * @public exported from `@promptbook/utils`
1979
1980
  */
@@ -2046,12 +2047,12 @@ const TextFormatParser = {
2046
2047
  async mapValues(options) {
2047
2048
  const { value, mapCallback, onProgress } = options;
2048
2049
  const lines = value.split('\n');
2049
- const mappedLines = await Promise.all(lines.map((lineContent, lineNumber) =>
2050
+ const mappedLines = await Promise.all(lines.map((lineContent, lineNumber, array) =>
2050
2051
  // TODO: [🧠] Maybe option to skip empty line
2051
2052
  /* not await */ mapCallback({
2052
2053
  lineContent,
2053
2054
  // TODO: [🧠] Maybe also put here `lineNumber`
2054
- }, lineNumber)));
2055
+ }, lineNumber, array.length)));
2055
2056
  return mappedLines.join('\n');
2056
2057
  },
2057
2058
  },
@@ -2072,7 +2073,7 @@ const TextFormatParser = {
2072
2073
  * Function to check if a string is valid XML
2073
2074
  *
2074
2075
  * @param value
2075
- * @returns True if the string is a valid XML string, false otherwise
2076
+ * @returns `true` if the string is a valid XML string, false otherwise
2076
2077
  *
2077
2078
  * @public exported from `@promptbook/utils`
2078
2079
  */
@@ -2369,8 +2370,12 @@ function checkSerializableAsJson(options) {
2369
2370
  */
2370
2371
 
2371
2372
  /**
2372
- * @@@
2373
+ * Creates a deep clone of the given object
2374
+ *
2375
+ * Note: This method only works for objects that are fully serializable to JSON and do not contain functions, Dates, or special types.
2373
2376
  *
2377
+ * @param objectValue The object to clone.
2378
+ * @returns A deep, writable clone of the input object.
2374
2379
  * @public exported from `@promptbook/utils`
2375
2380
  */
2376
2381
  function deepClone(objectValue) {
@@ -2561,11 +2566,12 @@ function removeQuotes(text) {
2561
2566
  }
2562
2567
 
2563
2568
  /**
2564
- * Function `validateParameterName` will @@@
2569
+ * Function `validateParameterName` will normalize and validate a parameter name for use in pipelines.
2570
+ * It removes diacritics, emojis, and quotes, normalizes to camelCase, and checks for reserved names and invalid characters.
2565
2571
  *
2566
- * @param parameterName @@@
2567
- * @returns @@@
2568
- * @throws {ParseError} @@@
2572
+ * @param parameterName The parameter name to validate and normalize.
2573
+ * @returns The validated and normalized parameter name.
2574
+ * @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
2569
2575
  * @private within the repository
2570
2576
  */
2571
2577
  function validateParameterName(parameterName) {
@@ -3739,10 +3745,10 @@ function $applyToTaskJson(command, $taskJson, $pipelineJson) {
3739
3745
  }
3740
3746
 
3741
3747
  /**
3742
- * @@@
3748
+ * Checks if the given value is a valid JavaScript identifier name.
3743
3749
  *
3744
- * @param javascriptName @@@
3745
- * @returns @@@
3750
+ * @param javascriptName The value to check for JavaScript identifier validity.
3751
+ * @returns `true` if the value is a valid JavaScript name, false otherwise.
3746
3752
  * @public exported from `@promptbook/utils`
3747
3753
  */
3748
3754
  function isValidJavascriptName(javascriptName) {