@promptbook/pdf 0.89.0-14 โ†’ 0.89.0-16

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 CHANGED
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.89.0-14';
29
+ const PROMPTBOOK_ENGINE_VERSION = '0.89.0-16';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [๐Ÿ’ž] Ignore a discrepancy between file name and entity name
@@ -89,6 +89,7 @@ const ADMIN_EMAIL = 'pavol@ptbk.io';
89
89
  * @public exported from `@promptbook/core`
90
90
  */
91
91
  const ADMIN_GITHUB_NAME = 'hejny';
92
+ // <- TODO: [๐ŸŠ] Pick the best claim
92
93
  /**
93
94
  * When the title is not provided, the default title is used
94
95
  *
@@ -161,7 +162,7 @@ const DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [๐Ÿคนโ€โ™‚๏ธ]
161
162
  */
162
163
  const DEFAULT_MAX_EXECUTION_ATTEMPTS = 10; // <- TODO: [๐Ÿคนโ€โ™‚๏ธ]
163
164
  // <- TODO: [๐Ÿ•] Make also `BOOKS_DIRNAME_ALTERNATIVES`
164
- // TODO: !!!!!! Just .promptbook dir, hardocode others
165
+ // TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
165
166
  /**
166
167
  * Where to store the temporary downloads
167
168
  *
@@ -901,44 +902,42 @@ class WrappedError extends Error {
901
902
  constructor(whatWasThrown) {
902
903
  const tag = `[๐Ÿคฎ]`;
903
904
  console.error(tag, whatWasThrown);
904
- super(spaceTrim$1((block) => `
905
- ${ /* Fixing tests !!! block(valueToString(whatWasThrown)) */block(`non-Error object was thrown`)}
906
-
907
- Note: Look for ${tag} in the console for more details
908
- !!! Note: \`WrappedError\` indicates that somewhere in the code non-Error object was thrown and it was wrapped
905
+ super(spaceTrim$1(`
906
+ Non-Error object was thrown
909
907
 
910
- Please report issue on ${ADMIN_EMAIL}
911
-
912
- `));
908
+ Note: Look for ${tag} in the console for more details
909
+ Please report issue on ${ADMIN_EMAIL}
910
+ `));
913
911
  this.name = 'WrappedError';
914
912
  Object.setPrototypeOf(this, WrappedError.prototype);
915
913
  }
916
914
  }
917
915
 
918
916
  /**
919
- * !!!@@@
917
+ * Helper used in catch blocks to assert that the error is an instance of `Error`
920
918
  *
921
- * @param whatWasThrown !!!@@@
922
- * @returns !!!@@@
919
+ * @param whatWasThrown Any object that was thrown
920
+ * @returns Nothing if the error is an instance of `Error`
921
+ * @throws `WrappedError` or `UnexpectedError` if the error is not standard
923
922
  *
924
923
  * @private within the repository
925
924
  */
926
925
  function assertsError(whatWasThrown) {
927
- // Case 1: !!!@@@
926
+ // Case 1: Handle error which was rethrown as `WrappedError`
928
927
  if (whatWasThrown instanceof WrappedError) {
929
928
  const wrappedError = whatWasThrown;
930
929
  throw wrappedError;
931
930
  }
932
- // Case 2: !!!@@@
931
+ // Case 2: Handle unexpected errors
933
932
  if (whatWasThrown instanceof UnexpectedError) {
934
933
  const unexpectedError = whatWasThrown;
935
934
  throw unexpectedError;
936
935
  }
937
- // Case 3: !!!@@@
936
+ // Case 3: Handle standard errors - keep them up to consumer
938
937
  if (whatWasThrown instanceof Error) {
939
938
  return;
940
939
  }
941
- // Case 4: !!!@@@
940
+ // Case 4: Handle non-standard errors - wrap them into `WrappedError` and throw
942
941
  throw new WrappedError(whatWasThrown);
943
942
  }
944
943
 
@@ -2095,7 +2094,7 @@ class PipelineExecutionError extends Error {
2095
2094
  }
2096
2095
  }
2097
2096
  /**
2098
- * TODO: !!!!!! Add id to all errors
2097
+ * TODO: [๐Ÿง ][๐ŸŒ‚] Add id to all errors
2099
2098
  */
2100
2099
 
2101
2100
  /**
@@ -2448,8 +2447,8 @@ function createTask(options) {
2448
2447
  updatedAt = new Date();
2449
2448
  errors.push(...executionResult.errors);
2450
2449
  warnings.push(...executionResult.warnings);
2451
- // <- TODO: !!! Only unique errors and warnings should be added (or filtered)
2452
- // TODO: [๐Ÿง ] !!! errors, warning, isSuccessful are redundant both in `ExecutionTask` and `ExecutionTask.currentValue`
2450
+ // <- TODO: [๐ŸŒ‚] Only unique errors and warnings should be added (or filtered)
2451
+ // TODO: [๐Ÿง ] !! errors, warning, isSuccessful are redundant both in `ExecutionTask` and `ExecutionTask.currentValue`
2453
2452
  // Also maybe move `ExecutionTask.currentValue.usage` -> `ExecutionTask.usage`
2454
2453
  // And delete `ExecutionTask.currentValue.preparedPipeline`
2455
2454
  assertsTaskSuccessful(executionResult);