@promptbook/pdf 0.75.4 → 0.75.6

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.
@@ -34,11 +34,12 @@ import { stringifyPipelineJson } from '../conversion/utils/stringifyPipelineJson
34
34
  import { validatePipeline } from '../conversion/validation/validatePipeline';
35
35
  import { CallbackInterfaceTools } from '../dialogs/callback/CallbackInterfaceTools';
36
36
  import type { CallbackInterfaceToolsOptions } from '../dialogs/callback/CallbackInterfaceToolsOptions';
37
+ import { BoilerplateError } from '../errors/0-BoilerplateError';
38
+ import { ERRORS } from '../errors/0-index';
37
39
  import { AbstractFormatError } from '../errors/AbstractFormatError';
38
40
  import { CollectionError } from '../errors/CollectionError';
39
41
  import { EnvironmentMismatchError } from '../errors/EnvironmentMismatchError';
40
42
  import { ExpectError } from '../errors/ExpectError';
41
- import { ERRORS } from '../errors/index';
42
43
  import { KnowledgeScrapeError } from '../errors/KnowledgeScrapeError';
43
44
  import { LimitReachedError } from '../errors/LimitReachedError';
44
45
  import { MissingToolsError } from '../errors/MissingToolsError';
@@ -147,11 +148,12 @@ export { stringifyPipelineJson };
147
148
  export { validatePipeline };
148
149
  export { CallbackInterfaceTools };
149
150
  export type { CallbackInterfaceToolsOptions };
151
+ export { BoilerplateError };
152
+ export { ERRORS };
150
153
  export { AbstractFormatError };
151
154
  export { CollectionError };
152
155
  export { EnvironmentMismatchError };
153
156
  export { ExpectError };
154
- export { ERRORS };
155
157
  export { KnowledgeScrapeError };
156
158
  export { LimitReachedError };
157
159
  export { MissingToolsError };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This error indicates @@@
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export declare class BoilerplateError extends Error {
7
+ readonly name = "BoilerplateError";
8
+ constructor(message: string);
9
+ }
10
+ /**
11
+ * TODO: @@@ Do not forget to add the error into `0-index.ts` ERRORS
12
+ */
@@ -1,7 +1,11 @@
1
+ import { CsvFormatError } from '../formats/csv/CsvFormatError';
2
+ import { AbstractFormatError } from './AbstractFormatError';
1
3
  import { CollectionError } from './CollectionError';
2
4
  import { EnvironmentMismatchError } from './EnvironmentMismatchError';
3
5
  import { ExpectError } from './ExpectError';
6
+ import { KnowledgeScrapeError } from './KnowledgeScrapeError';
4
7
  import { LimitReachedError } from './LimitReachedError';
8
+ import { MissingToolsError } from './MissingToolsError';
5
9
  import { NotFoundError } from './NotFoundError';
6
10
  import { NotYetImplementedError } from './NotYetImplementedError';
7
11
  import { ParseError } from './ParseError';
@@ -15,10 +19,14 @@ import { UnexpectedError } from './UnexpectedError';
15
19
  * @public exported from `@promptbook/core`
16
20
  */
17
21
  export declare const ERRORS: {
18
- readonly ExpectError: typeof ExpectError;
22
+ readonly AbstractFormatError: typeof AbstractFormatError;
23
+ readonly CsvFormatError: typeof CsvFormatError;
19
24
  readonly CollectionError: typeof CollectionError;
20
25
  readonly EnvironmentMismatchError: typeof EnvironmentMismatchError;
26
+ readonly ExpectError: typeof ExpectError;
27
+ readonly KnowledgeScrapeError: typeof KnowledgeScrapeError;
21
28
  readonly LimitReachedError: typeof LimitReachedError;
29
+ readonly MissingToolsError: typeof MissingToolsError;
22
30
  readonly NotFoundError: typeof NotFoundError;
23
31
  readonly NotYetImplementedError: typeof NotYetImplementedError;
24
32
  readonly ParseError: typeof ParseError;
@@ -29,4 +37,4 @@ export declare const ERRORS: {
29
37
  };
30
38
  /**
31
39
  * Note: [💞] Ignore a discrepancy between file name and entity name
32
- */
40
+ */
@@ -1,4 +1,4 @@
1
- import type { ERRORS } from '../index';
1
+ import type { ERRORS } from '../0-index';
2
2
  /**
3
3
  * Represents a serialized error or custom Promptbook error
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/pdf",
3
- "version": "0.75.4",
3
+ "version": "0.75.6",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "--note-0": " <- [🐊]",
6
6
  "private": false,
@@ -54,7 +54,7 @@
54
54
  "module": "./esm/index.es.js",
55
55
  "typings": "./esm/typings/src/_packages/pdf.index.d.ts",
56
56
  "peerDependencies": {
57
- "@promptbook/core": "0.75.4"
57
+ "@promptbook/core": "0.75.6"
58
58
  },
59
59
  "dependencies": {
60
60
  "crypto-js": "4.2.0",
package/umd/index.umd.js CHANGED
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * @see https://github.com/webgptorg/promptbook
24
24
  */
25
- var PROMPTBOOK_ENGINE_VERSION = '0.75.3';
25
+ var PROMPTBOOK_ENGINE_VERSION = '0.75.5';
26
26
  /**
27
27
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
28
28
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1799,6 +1799,42 @@
1799
1799
  return PipelineExecutionError;
1800
1800
  }(Error));
1801
1801
 
1802
+ /**
1803
+ * This error indicates problems parsing the format value
1804
+ *
1805
+ * For example, when the format value is not a valid JSON or CSV
1806
+ * This is not thrown directly but in extended classes
1807
+ *
1808
+ * @public exported from `@promptbook/core`
1809
+ */
1810
+ var AbstractFormatError = /** @class */ (function (_super) {
1811
+ __extends(AbstractFormatError, _super);
1812
+ // Note: To allow instanceof do not put here error `name`
1813
+ // public readonly name = 'AbstractFormatError';
1814
+ function AbstractFormatError(message) {
1815
+ var _this = _super.call(this, message) || this;
1816
+ Object.setPrototypeOf(_this, AbstractFormatError.prototype);
1817
+ return _this;
1818
+ }
1819
+ return AbstractFormatError;
1820
+ }(Error));
1821
+
1822
+ /**
1823
+ * This error indicates problem with parsing of CSV
1824
+ *
1825
+ * @public exported from `@promptbook/core`
1826
+ */
1827
+ var CsvFormatError = /** @class */ (function (_super) {
1828
+ __extends(CsvFormatError, _super);
1829
+ function CsvFormatError(message) {
1830
+ var _this = _super.call(this, message) || this;
1831
+ _this.name = 'CsvFormatError';
1832
+ Object.setPrototypeOf(_this, CsvFormatError.prototype);
1833
+ return _this;
1834
+ }
1835
+ return CsvFormatError;
1836
+ }(AbstractFormatError));
1837
+
1802
1838
  /**
1803
1839
  * This error indicates that the pipeline collection cannot be propperly loaded
1804
1840
  *
@@ -1850,6 +1886,22 @@
1850
1886
  return ExpectError;
1851
1887
  }(Error));
1852
1888
 
1889
+ /**
1890
+ * This error indicates that the promptbook can not retrieve knowledge from external sources
1891
+ *
1892
+ * @public exported from `@promptbook/core`
1893
+ */
1894
+ var KnowledgeScrapeError = /** @class */ (function (_super) {
1895
+ __extends(KnowledgeScrapeError, _super);
1896
+ function KnowledgeScrapeError(message) {
1897
+ var _this = _super.call(this, message) || this;
1898
+ _this.name = 'KnowledgeScrapeError';
1899
+ Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
1900
+ return _this;
1901
+ }
1902
+ return KnowledgeScrapeError;
1903
+ }(Error));
1904
+
1853
1905
  /**
1854
1906
  * This error type indicates that some limit was reached
1855
1907
  *
@@ -1872,10 +1924,14 @@
1872
1924
  * @public exported from `@promptbook/core`
1873
1925
  */
1874
1926
  var ERRORS = {
1875
- ExpectError: ExpectError,
1927
+ AbstractFormatError: AbstractFormatError,
1928
+ CsvFormatError: CsvFormatError,
1876
1929
  CollectionError: CollectionError,
1877
1930
  EnvironmentMismatchError: EnvironmentMismatchError,
1931
+ ExpectError: ExpectError,
1932
+ KnowledgeScrapeError: KnowledgeScrapeError,
1878
1933
  LimitReachedError: LimitReachedError,
1934
+ MissingToolsError: MissingToolsError,
1879
1935
  NotFoundError: NotFoundError,
1880
1936
  NotYetImplementedError: NotYetImplementedError,
1881
1937
  ParseError: ParseError,
@@ -2676,22 +2732,6 @@
2676
2732
  * TODO: [🏢] !! Check validity of `temperature` in pipeline
2677
2733
  */
2678
2734
 
2679
- /**
2680
- * This error indicates that the promptbook can not retrieve knowledge from external sources
2681
- *
2682
- * @public exported from `@promptbook/core`
2683
- */
2684
- var KnowledgeScrapeError = /** @class */ (function (_super) {
2685
- __extends(KnowledgeScrapeError, _super);
2686
- function KnowledgeScrapeError(message) {
2687
- var _this = _super.call(this, message) || this;
2688
- _this.name = 'KnowledgeScrapeError';
2689
- Object.setPrototypeOf(_this, KnowledgeScrapeError.prototype);
2690
- return _this;
2691
- }
2692
- return KnowledgeScrapeError;
2693
- }(Error));
2694
-
2695
2735
  /**
2696
2736
  * @@@
2697
2737
  *
@@ -3711,42 +3751,6 @@
3711
3751
  return union;
3712
3752
  }
3713
3753
 
3714
- /**
3715
- * This error indicates problems parsing the format value
3716
- *
3717
- * For example, when the format value is not a valid JSON or CSV
3718
- * This is not thrown directly but in extended classes
3719
- *
3720
- * @public exported from `@promptbook/core`
3721
- */
3722
- var AbstractFormatError = /** @class */ (function (_super) {
3723
- __extends(AbstractFormatError, _super);
3724
- // Note: To allow instanceof do not put here error `name`
3725
- // public readonly name = 'AbstractFormatError';
3726
- function AbstractFormatError(message) {
3727
- var _this = _super.call(this, message) || this;
3728
- Object.setPrototypeOf(_this, AbstractFormatError.prototype);
3729
- return _this;
3730
- }
3731
- return AbstractFormatError;
3732
- }(Error));
3733
-
3734
- /**
3735
- * This error indicates problem with parsing of CSV
3736
- *
3737
- * @public exported from `@promptbook/core`
3738
- */
3739
- var CsvFormatError = /** @class */ (function (_super) {
3740
- __extends(CsvFormatError, _super);
3741
- function CsvFormatError(message) {
3742
- var _this = _super.call(this, message) || this;
3743
- _this.name = 'CsvFormatError';
3744
- Object.setPrototypeOf(_this, CsvFormatError.prototype);
3745
- return _this;
3746
- }
3747
- return CsvFormatError;
3748
- }(AbstractFormatError));
3749
-
3750
3754
  /**
3751
3755
  * @@@
3752
3756
  *
@@ -3787,7 +3791,7 @@
3787
3791
  case 0:
3788
3792
  csv = papaparse.parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3789
3793
  if (csv.errors.length !== 0) {
3790
- throw new CsvFormatError(spaceTrim__default["default"](function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
3794
+ throw new CsvFormatError(spaceTrim__default["default"](function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV setings:\n ").concat(block(JSON.stringify(__assign(__assign({}, settings), MANDATORY_CSV_SETTINGS), null, 2)), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
3791
3795
  }
3792
3796
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, index) { return __awaiter(_this, void 0, void 0, function () {
3793
3797
  var _a, _b;
@@ -3825,7 +3829,7 @@
3825
3829
  case 0:
3826
3830
  csv = papaparse.parse(value, __assign(__assign({}, settings), MANDATORY_CSV_SETTINGS));
3827
3831
  if (csv.errors.length !== 0) {
3828
- throw new CsvFormatError(spaceTrim__default["default"](function (block) { return "\n CSV parsing error\n\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n "); }));
3832
+ throw new CsvFormatError(spaceTrim__default["default"](function (block) { return "\n CSV parsing error\n\n Error(s) from CSV parsing:\n ".concat(block(csv.errors.map(function (error) { return error.message; }).join('\n\n')), "\n\n The CSV setings:\n ").concat(block(JSON.stringify(__assign(__assign({}, settings), MANDATORY_CSV_SETTINGS), null, 2)), "\n\n The CSV data:\n ").concat(block(value), "\n "); }));
3829
3833
  }
3830
3834
  return [4 /*yield*/, Promise.all(csv.data.map(function (row, rowIndex) { return __awaiter(_this, void 0, void 0, function () {
3831
3835
  var _this = this;