@promptbook/remote-server 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 +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 +2 -2
- package/umd/index.umd.js +19 -20
- package/umd/index.umd.js.map +1 -1
package/esm/index.es.js
CHANGED
|
@@ -33,7 +33,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
33
33
|
* @generated
|
|
34
34
|
* @see https://github.com/webgptorg/promptbook
|
|
35
35
|
*/
|
|
36
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.89.0-
|
|
36
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.89.0-16';
|
|
37
37
|
/**
|
|
38
38
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
39
39
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -100,6 +100,7 @@ const ADMIN_GITHUB_NAME = 'hejny';
|
|
|
100
100
|
* @public exported from `@promptbook/core`
|
|
101
101
|
*/
|
|
102
102
|
const CLAIM = `It's time for a paradigm shift. The future of software in plain English, French or Latin`;
|
|
103
|
+
// <- TODO: [๐] Pick the best claim
|
|
103
104
|
/**
|
|
104
105
|
* When the title is not provided, the default title is used
|
|
105
106
|
*
|
|
@@ -172,7 +173,7 @@ const DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [๐คนโโ๏ธ]
|
|
|
172
173
|
*/
|
|
173
174
|
const DEFAULT_MAX_EXECUTION_ATTEMPTS = 10; // <- TODO: [๐คนโโ๏ธ]
|
|
174
175
|
// <- TODO: [๐] Make also `BOOKS_DIRNAME_ALTERNATIVES`
|
|
175
|
-
// TODO:
|
|
176
|
+
// TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
|
|
176
177
|
/**
|
|
177
178
|
* Where to store the temporary downloads
|
|
178
179
|
*
|
|
@@ -304,44 +305,42 @@ class WrappedError extends Error {
|
|
|
304
305
|
constructor(whatWasThrown) {
|
|
305
306
|
const tag = `[๐คฎ]`;
|
|
306
307
|
console.error(tag, whatWasThrown);
|
|
307
|
-
super(spaceTrim$1(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
Note: Look for ${tag} in the console for more details
|
|
311
|
-
!!! Note: \`WrappedError\` indicates that somewhere in the code non-Error object was thrown and it was wrapped
|
|
308
|
+
super(spaceTrim$1(`
|
|
309
|
+
Non-Error object was thrown
|
|
312
310
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
Note: Look for ${tag} in the console for more details
|
|
312
|
+
Please report issue on ${ADMIN_EMAIL}
|
|
313
|
+
`));
|
|
316
314
|
this.name = 'WrappedError';
|
|
317
315
|
Object.setPrototypeOf(this, WrappedError.prototype);
|
|
318
316
|
}
|
|
319
317
|
}
|
|
320
318
|
|
|
321
319
|
/**
|
|
322
|
-
*
|
|
320
|
+
* Helper used in catch blocks to assert that the error is an instance of `Error`
|
|
323
321
|
*
|
|
324
|
-
* @param whatWasThrown
|
|
325
|
-
* @returns
|
|
322
|
+
* @param whatWasThrown Any object that was thrown
|
|
323
|
+
* @returns Nothing if the error is an instance of `Error`
|
|
324
|
+
* @throws `WrappedError` or `UnexpectedError` if the error is not standard
|
|
326
325
|
*
|
|
327
326
|
* @private within the repository
|
|
328
327
|
*/
|
|
329
328
|
function assertsError(whatWasThrown) {
|
|
330
|
-
// Case 1:
|
|
329
|
+
// Case 1: Handle error which was rethrown as `WrappedError`
|
|
331
330
|
if (whatWasThrown instanceof WrappedError) {
|
|
332
331
|
const wrappedError = whatWasThrown;
|
|
333
332
|
throw wrappedError;
|
|
334
333
|
}
|
|
335
|
-
// Case 2:
|
|
334
|
+
// Case 2: Handle unexpected errors
|
|
336
335
|
if (whatWasThrown instanceof UnexpectedError) {
|
|
337
336
|
const unexpectedError = whatWasThrown;
|
|
338
337
|
throw unexpectedError;
|
|
339
338
|
}
|
|
340
|
-
// Case 3:
|
|
339
|
+
// Case 3: Handle standard errors - keep them up to consumer
|
|
341
340
|
if (whatWasThrown instanceof Error) {
|
|
342
341
|
return;
|
|
343
342
|
}
|
|
344
|
-
// Case 4:
|
|
343
|
+
// Case 4: Handle non-standard errors - wrap them into `WrappedError` and throw
|
|
345
344
|
throw new WrappedError(whatWasThrown);
|
|
346
345
|
}
|
|
347
346
|
|
|
@@ -420,7 +419,7 @@ class PipelineExecutionError extends Error {
|
|
|
420
419
|
}
|
|
421
420
|
}
|
|
422
421
|
/**
|
|
423
|
-
* TODO:
|
|
422
|
+
* TODO: [๐ง ][๐] Add id to all errors
|
|
424
423
|
*/
|
|
425
424
|
|
|
426
425
|
/**
|
|
@@ -1992,8 +1991,8 @@ function createTask(options) {
|
|
|
1992
1991
|
updatedAt = new Date();
|
|
1993
1992
|
errors.push(...executionResult.errors);
|
|
1994
1993
|
warnings.push(...executionResult.warnings);
|
|
1995
|
-
// <- TODO:
|
|
1996
|
-
// TODO: [๐ง ]
|
|
1994
|
+
// <- TODO: [๐] Only unique errors and warnings should be added (or filtered)
|
|
1995
|
+
// TODO: [๐ง ] !! errors, warning, isSuccessful are redundant both in `ExecutionTask` and `ExecutionTask.currentValue`
|
|
1997
1996
|
// Also maybe move `ExecutionTask.currentValue.usage` -> `ExecutionTask.usage`
|
|
1998
1997
|
// And delete `ExecutionTask.currentValue.preparedPipeline`
|
|
1999
1998
|
assertsTaskSuccessful(executionResult);
|