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