@promptbook/pdf 0.77.0 → 0.77.1
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 +37 -8
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +2 -2
- package/esm/typings/src/cli/test/ptbk.d.ts +1 -1
- package/esm/typings/src/errors/0-index.d.ts +46 -1
- package/esm/typings/src/errors/utils/ErrorJson.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.test.d.ts +1 -0
- package/package.json +2 -2
- package/umd/index.umd.js +37 -8
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -20,7 +20,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
20
20
|
*
|
|
21
21
|
* @see https://github.com/webgptorg/promptbook
|
|
22
22
|
*/
|
|
23
|
-
var PROMPTBOOK_ENGINE_VERSION = '0.77.0
|
|
23
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.77.0';
|
|
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
|
|
@@ -1941,7 +1941,7 @@ var LimitReachedError = /** @class */ (function (_super) {
|
|
|
1941
1941
|
*
|
|
1942
1942
|
* @public exported from `@promptbook/core`
|
|
1943
1943
|
*/
|
|
1944
|
-
var
|
|
1944
|
+
var PROMPTBOOK_ERRORS = {
|
|
1945
1945
|
AbstractFormatError: AbstractFormatError,
|
|
1946
1946
|
CsvFormatError: CsvFormatError,
|
|
1947
1947
|
CollectionError: CollectionError,
|
|
@@ -1959,6 +1959,35 @@ var ERRORS = {
|
|
|
1959
1959
|
UnexpectedError: UnexpectedError,
|
|
1960
1960
|
// TODO: [🪑]> VersionMismatchError,
|
|
1961
1961
|
};
|
|
1962
|
+
/**
|
|
1963
|
+
* Index of all javascript errors
|
|
1964
|
+
*
|
|
1965
|
+
* @private for internal usage
|
|
1966
|
+
*/
|
|
1967
|
+
var COMMON_JAVASCRIPT_ERRORS = {
|
|
1968
|
+
Error: Error,
|
|
1969
|
+
EvalError: EvalError,
|
|
1970
|
+
RangeError: RangeError,
|
|
1971
|
+
ReferenceError: ReferenceError,
|
|
1972
|
+
SyntaxError: SyntaxError,
|
|
1973
|
+
TypeError: TypeError,
|
|
1974
|
+
URIError: URIError,
|
|
1975
|
+
AggregateError: AggregateError,
|
|
1976
|
+
/*
|
|
1977
|
+
Note: Not widely supported
|
|
1978
|
+
> InternalError,
|
|
1979
|
+
> ModuleError,
|
|
1980
|
+
> HeapError,
|
|
1981
|
+
> WebAssemblyCompileError,
|
|
1982
|
+
> WebAssemblyRuntimeError,
|
|
1983
|
+
*/
|
|
1984
|
+
};
|
|
1985
|
+
/**
|
|
1986
|
+
* Index of all errors
|
|
1987
|
+
*
|
|
1988
|
+
* @private for internal usage
|
|
1989
|
+
*/
|
|
1990
|
+
var ALL_ERRORS = __assign(__assign({}, PROMPTBOOK_ERRORS), COMMON_JAVASCRIPT_ERRORS);
|
|
1962
1991
|
/**
|
|
1963
1992
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1964
1993
|
*/
|
|
@@ -1969,11 +1998,11 @@ var ERRORS = {
|
|
|
1969
1998
|
* @public exported from `@promptbook/utils`
|
|
1970
1999
|
*/
|
|
1971
2000
|
function deserializeError(error) {
|
|
1972
|
-
|
|
1973
|
-
|
|
2001
|
+
var ErrorClass = ALL_ERRORS[error.name];
|
|
2002
|
+
if (ErrorClass === undefined) {
|
|
2003
|
+
return new Error("".concat(error.name, ": ").concat(error.message));
|
|
1974
2004
|
}
|
|
1975
|
-
|
|
1976
|
-
return new CustomError(error.message);
|
|
2005
|
+
return new ErrorClass(error.message);
|
|
1977
2006
|
}
|
|
1978
2007
|
|
|
1979
2008
|
/**
|
|
@@ -2047,8 +2076,8 @@ function isPipelinePrepared(pipeline) {
|
|
|
2047
2076
|
*/
|
|
2048
2077
|
function serializeError(error) {
|
|
2049
2078
|
var name = error.name, message = error.message, stack = error.stack;
|
|
2050
|
-
if (!
|
|
2051
|
-
|
|
2079
|
+
if (!Object.keys(ALL_ERRORS).includes(name)) {
|
|
2080
|
+
console.error(spaceTrim$1(function (block) { return "\n \n Cannot serialize error with name \"".concat(name, "\"\n\n ").concat(block(stack || message), "\n \n "); }));
|
|
2052
2081
|
}
|
|
2053
2082
|
return {
|
|
2054
2083
|
name: name,
|