@promptbook/markitdown 0.89.0-15 โ†’ 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-15';
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
  *
@@ -888,44 +889,42 @@ class WrappedError extends Error {
888
889
  constructor(whatWasThrown) {
889
890
  const tag = `[๐Ÿคฎ]`;
890
891
  console.error(tag, whatWasThrown);
891
- super(spaceTrim$1((block) => `
892
- ${ /* Fixing tests !!! block(valueToString(whatWasThrown)) */block(`non-Error object was thrown`)}
893
-
894
- Note: Look for ${tag} in the console for more details
895
- !!! Note: \`WrappedError\` indicates that somewhere in the code non-Error object was thrown and it was wrapped
892
+ super(spaceTrim$1(`
893
+ Non-Error object was thrown
896
894
 
897
- Please report issue on ${ADMIN_EMAIL}
898
-
899
- `));
895
+ Note: Look for ${tag} in the console for more details
896
+ Please report issue on ${ADMIN_EMAIL}
897
+ `));
900
898
  this.name = 'WrappedError';
901
899
  Object.setPrototypeOf(this, WrappedError.prototype);
902
900
  }
903
901
  }
904
902
 
905
903
  /**
906
- * !!!@@@
904
+ * Helper used in catch blocks to assert that the error is an instance of `Error`
907
905
  *
908
- * @param whatWasThrown !!!@@@
909
- * @returns !!!@@@
906
+ * @param whatWasThrown Any object that was thrown
907
+ * @returns Nothing if the error is an instance of `Error`
908
+ * @throws `WrappedError` or `UnexpectedError` if the error is not standard
910
909
  *
911
910
  * @private within the repository
912
911
  */
913
912
  function assertsError(whatWasThrown) {
914
- // Case 1: !!!@@@
913
+ // Case 1: Handle error which was rethrown as `WrappedError`
915
914
  if (whatWasThrown instanceof WrappedError) {
916
915
  const wrappedError = whatWasThrown;
917
916
  throw wrappedError;
918
917
  }
919
- // Case 2: !!!@@@
918
+ // Case 2: Handle unexpected errors
920
919
  if (whatWasThrown instanceof UnexpectedError) {
921
920
  const unexpectedError = whatWasThrown;
922
921
  throw unexpectedError;
923
922
  }
924
- // Case 3: !!!@@@
923
+ // Case 3: Handle standard errors - keep them up to consumer
925
924
  if (whatWasThrown instanceof Error) {
926
925
  return;
927
926
  }
928
- // Case 4: !!!@@@
927
+ // Case 4: Handle non-standard errors - wrap them into `WrappedError` and throw
929
928
  throw new WrappedError(whatWasThrown);
930
929
  }
931
930
 
@@ -2082,7 +2081,7 @@ class PipelineExecutionError extends Error {
2082
2081
  }
2083
2082
  }
2084
2083
  /**
2085
- * TODO: !!!!!! Add id to all errors
2084
+ * TODO: [๐Ÿง ][๐ŸŒ‚] Add id to all errors
2086
2085
  */
2087
2086
 
2088
2087
  /**
@@ -2435,8 +2434,8 @@ function createTask(options) {
2435
2434
  updatedAt = new Date();
2436
2435
  errors.push(...executionResult.errors);
2437
2436
  warnings.push(...executionResult.warnings);
2438
- // <- TODO: !!! Only unique errors and warnings should be added (or filtered)
2439
- // TODO: [๐Ÿง ] !!! errors, warning, isSuccessful are redundant both in `ExecutionTask` and `ExecutionTask.currentValue`
2437
+ // <- TODO: [๐ŸŒ‚] Only unique errors and warnings should be added (or filtered)
2438
+ // TODO: [๐Ÿง ] !! errors, warning, isSuccessful are redundant both in `ExecutionTask` and `ExecutionTask.currentValue`
2440
2439
  // Also maybe move `ExecutionTask.currentValue.usage` -> `ExecutionTask.usage`
2441
2440
  // And delete `ExecutionTask.currentValue.preparedPipeline`
2442
2441
  assertsTaskSuccessful(executionResult);