@promptbook/node 0.82.0-2 → 0.82.0

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/README.md CHANGED
@@ -23,10 +23,6 @@
23
23
 
24
24
 
25
25
 
26
- <blockquote style="color: #ff8811">
27
- <b>⚠ Warning:</b> This is a pre-release version of the library. It is not yet ready for production use. Please look at <a href="https://www.npmjs.com/package/@promptbook/core?activeTab=versions">latest stable release</a>.
28
- </blockquote>
29
-
30
26
  ## 📦 Package `@promptbook/node`
31
27
 
32
28
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -28,7 +28,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
28
28
  * @generated
29
29
  * @see https://github.com/webgptorg/promptbook
30
30
  */
31
- var PROMPTBOOK_ENGINE_VERSION = '0.82.0-1';
31
+ var PROMPTBOOK_ENGINE_VERSION = '0.82.0-3';
32
32
  /**
33
33
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
34
34
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -199,6 +199,12 @@ var ADMIN_GITHUB_NAME = 'hejny';
199
199
  * @public exported from `@promptbook/core`
200
200
  */
201
201
  var DEFAULT_BOOK_TITLE = "\u2728 Untitled Book";
202
+ /**
203
+ * When the title of task is not provided, the default title is used
204
+ *
205
+ * @public exported from `@promptbook/core`
206
+ */
207
+ var DEFAULT_TASK_TITLE = "Task";
202
208
  // <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
203
209
  /**
204
210
  * The maximum number of iterations for a loops
@@ -1824,11 +1830,17 @@ var ALL_ERRORS = __assign(__assign({}, PROMPTBOOK_ERRORS), COMMON_JAVASCRIPT_ERR
1824
1830
  * @public exported from `@promptbook/utils`
1825
1831
  */
1826
1832
  function deserializeError(error) {
1833
+ var name = error.name, stack = error.stack;
1834
+ var message = error.message;
1827
1835
  var ErrorClass = ALL_ERRORS[error.name];
1828
1836
  if (ErrorClass === undefined) {
1829
- return new Error("".concat(error.name, ": ").concat(error.message));
1837
+ ErrorClass = Error;
1838
+ message = "".concat(name, ": ").concat(message);
1839
+ }
1840
+ if (stack !== undefined && stack !== '') {
1841
+ message = spaceTrim(function (block) { return "\n ".concat(block(message), "\n\n Original stack trace:\n ").concat(block(stack || ''), "\n "); });
1830
1842
  }
1831
- return new ErrorClass(error.message);
1843
+ return new ErrorClass(message);
1832
1844
  }
1833
1845
 
1834
1846
  /**
@@ -9080,8 +9092,8 @@ function parsePipeline(pipelineString) {
9080
9092
  isSectionTypeSet: false,
9081
9093
  isTask: true,
9082
9094
  taskType: undefined /* <- Note: [🍙] Putting here placeholder to keep `taskType` on top at final JSON */,
9083
- name: getUniqueSectionName(section.title),
9084
- title: section.title,
9095
+ name: getUniqueSectionName(section.title || DEFAULT_TASK_TITLE),
9096
+ title: section.title || DEFAULT_TASK_TITLE,
9085
9097
  description: description_1,
9086
9098
  content: content,
9087
9099
  // <- TODO: [🍙] Some standard order of properties