@promptbook/node 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 +19 -20
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +6 -4
- package/esm/typings/src/_packages/types.index.d.ts +4 -0
- package/esm/typings/src/cli/cli-commands/login.d.ts +0 -1
- package/esm/typings/src/cli/common/$provideLlmToolsForCli.d.ts +16 -3
- package/esm/typings/src/config.d.ts +15 -19
- package/esm/typings/src/errors/PipelineExecutionError.d.ts +1 -1
- package/esm/typings/src/errors/assertsError.d.ts +4 -3
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizzardOrCli.d.ts +10 -1
- package/esm/typings/src/remote-server/socket-types/_subtypes/identificationToPromptbookToken.d.ts +11 -0
- package/esm/typings/src/remote-server/socket-types/_subtypes/promptbookTokenToIdentification.d.ts +10 -0
- package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +4 -1
- package/esm/typings/src/types/typeAliases.d.ts +12 -0
- package/package.json +9 -5
- package/umd/index.umd.js +19 -20
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -30,7 +30,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
30
30
|
* @generated
|
|
31
31
|
* @see https://github.com/webgptorg/promptbook
|
|
32
32
|
*/
|
|
33
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.89.0-
|
|
33
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.89.0-16';
|
|
34
34
|
/**
|
|
35
35
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
36
36
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -76,6 +76,7 @@ const ADMIN_EMAIL = 'pavol@ptbk.io';
|
|
|
76
76
|
* @public exported from `@promptbook/core`
|
|
77
77
|
*/
|
|
78
78
|
const ADMIN_GITHUB_NAME = 'hejny';
|
|
79
|
+
// <- TODO: [๐] Pick the best claim
|
|
79
80
|
/**
|
|
80
81
|
* When the title is not provided, the default title is used
|
|
81
82
|
*
|
|
@@ -160,7 +161,7 @@ const DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [๐คนโโ๏ธ]
|
|
|
160
161
|
*/
|
|
161
162
|
const DEFAULT_MAX_EXECUTION_ATTEMPTS = 10; // <- TODO: [๐คนโโ๏ธ]
|
|
162
163
|
// <- TODO: [๐] Make also `BOOKS_DIRNAME_ALTERNATIVES`
|
|
163
|
-
// TODO:
|
|
164
|
+
// TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
|
|
164
165
|
/**
|
|
165
166
|
* Where to store the temporary downloads
|
|
166
167
|
*
|
|
@@ -349,44 +350,42 @@ class WrappedError extends Error {
|
|
|
349
350
|
constructor(whatWasThrown) {
|
|
350
351
|
const tag = `[๐คฎ]`;
|
|
351
352
|
console.error(tag, whatWasThrown);
|
|
352
|
-
super(spaceTrim$1(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
Note: Look for ${tag} in the console for more details
|
|
356
|
-
!!! Note: \`WrappedError\` indicates that somewhere in the code non-Error object was thrown and it was wrapped
|
|
357
|
-
|
|
358
|
-
Please report issue on ${ADMIN_EMAIL}
|
|
353
|
+
super(spaceTrim$1(`
|
|
354
|
+
Non-Error object was thrown
|
|
359
355
|
|
|
360
|
-
|
|
356
|
+
Note: Look for ${tag} in the console for more details
|
|
357
|
+
Please report issue on ${ADMIN_EMAIL}
|
|
358
|
+
`));
|
|
361
359
|
this.name = 'WrappedError';
|
|
362
360
|
Object.setPrototypeOf(this, WrappedError.prototype);
|
|
363
361
|
}
|
|
364
362
|
}
|
|
365
363
|
|
|
366
364
|
/**
|
|
367
|
-
*
|
|
365
|
+
* Helper used in catch blocks to assert that the error is an instance of `Error`
|
|
368
366
|
*
|
|
369
|
-
* @param whatWasThrown
|
|
370
|
-
* @returns
|
|
367
|
+
* @param whatWasThrown Any object that was thrown
|
|
368
|
+
* @returns Nothing if the error is an instance of `Error`
|
|
369
|
+
* @throws `WrappedError` or `UnexpectedError` if the error is not standard
|
|
371
370
|
*
|
|
372
371
|
* @private within the repository
|
|
373
372
|
*/
|
|
374
373
|
function assertsError(whatWasThrown) {
|
|
375
|
-
// Case 1:
|
|
374
|
+
// Case 1: Handle error which was rethrown as `WrappedError`
|
|
376
375
|
if (whatWasThrown instanceof WrappedError) {
|
|
377
376
|
const wrappedError = whatWasThrown;
|
|
378
377
|
throw wrappedError;
|
|
379
378
|
}
|
|
380
|
-
// Case 2:
|
|
379
|
+
// Case 2: Handle unexpected errors
|
|
381
380
|
if (whatWasThrown instanceof UnexpectedError) {
|
|
382
381
|
const unexpectedError = whatWasThrown;
|
|
383
382
|
throw unexpectedError;
|
|
384
383
|
}
|
|
385
|
-
// Case 3:
|
|
384
|
+
// Case 3: Handle standard errors - keep them up to consumer
|
|
386
385
|
if (whatWasThrown instanceof Error) {
|
|
387
386
|
return;
|
|
388
387
|
}
|
|
389
|
-
// Case 4:
|
|
388
|
+
// Case 4: Handle non-standard errors - wrap them into `WrappedError` and throw
|
|
390
389
|
throw new WrappedError(whatWasThrown);
|
|
391
390
|
}
|
|
392
391
|
|
|
@@ -1708,7 +1707,7 @@ class PipelineExecutionError extends Error {
|
|
|
1708
1707
|
}
|
|
1709
1708
|
}
|
|
1710
1709
|
/**
|
|
1711
|
-
* TODO:
|
|
1710
|
+
* TODO: [๐ง ][๐] Add id to all errors
|
|
1712
1711
|
*/
|
|
1713
1712
|
|
|
1714
1713
|
/**
|
|
@@ -2020,8 +2019,8 @@ function createTask(options) {
|
|
|
2020
2019
|
updatedAt = new Date();
|
|
2021
2020
|
errors.push(...executionResult.errors);
|
|
2022
2021
|
warnings.push(...executionResult.warnings);
|
|
2023
|
-
// <- TODO:
|
|
2024
|
-
// TODO: [๐ง ]
|
|
2022
|
+
// <- TODO: [๐] Only unique errors and warnings should be added (or filtered)
|
|
2023
|
+
// TODO: [๐ง ] !! errors, warning, isSuccessful are redundant both in `ExecutionTask` and `ExecutionTask.currentValue`
|
|
2025
2024
|
// Also maybe move `ExecutionTask.currentValue.usage` -> `ExecutionTask.usage`
|
|
2026
2025
|
// And delete `ExecutionTask.currentValue.preparedPipeline`
|
|
2027
2026
|
assertsTaskSuccessful(executionResult);
|