@promptbook/remote-server 0.98.0-8 → 0.98.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
@@ -25,10 +25,6 @@ Write AI applications using plain human language across multiple models and plat
25
25
 
26
26
 
27
27
 
28
- <blockquote style="color: #ff8811">
29
- <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>.
30
- </blockquote>
31
-
32
28
  ## 📦 Package `@promptbook/remote-server`
33
29
 
34
30
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
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.98.0-8';
36
+ const PROMPTBOOK_ENGINE_VERSION = '0.98.0';
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
@@ -6366,6 +6366,46 @@ function createPipelineExecutor(options) {
6366
6366
  return pipelineExecutor;
6367
6367
  }
6368
6368
 
6369
+ /**
6370
+ * Detects if the code is running in a browser environment in main thread (Not in a web worker)
6371
+ *
6372
+ * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
6373
+ *
6374
+ * @public exported from `@promptbook/utils`
6375
+ */
6376
+ const $isRunningInBrowser = new Function(`
6377
+ try {
6378
+ return this === window;
6379
+ } catch (e) {
6380
+ return false;
6381
+ }
6382
+ `);
6383
+ /**
6384
+ * TODO: [🎺]
6385
+ */
6386
+
6387
+ /**
6388
+ * Detects if the code is running in a web worker
6389
+ *
6390
+ * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
6391
+ *
6392
+ * @public exported from `@promptbook/utils`
6393
+ */
6394
+ const $isRunningInWebWorker = new Function(`
6395
+ try {
6396
+ if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
6397
+ return true;
6398
+ } else {
6399
+ return false;
6400
+ }
6401
+ } catch (e) {
6402
+ return false;
6403
+ }
6404
+ `);
6405
+ /**
6406
+ * TODO: [🎺]
6407
+ */
6408
+
6369
6409
  /**
6370
6410
  * Register for LLM tools.
6371
6411
  *
@@ -6534,8 +6574,10 @@ function createLlmToolsFromConfiguration(configuration, options = {}) {
6534
6574
  .list()
6535
6575
  .find(({ packageName, className }) => llmConfiguration.packageName === packageName && llmConfiguration.className === className);
6536
6576
  if (registeredItem === undefined) {
6577
+ // console.log('$llmToolsRegister.list()', $llmToolsRegister.list());
6537
6578
  throw new Error(spaceTrim((block) => `
6538
6579
  There is no constructor for LLM provider \`${llmConfiguration.className}\` from \`${llmConfiguration.packageName}\`
6580
+ Running in ${!$isRunningInBrowser() ? '' : 'browser environment'}${!$isRunningInNode() ? '' : 'node environment'}${!$isRunningInWebWorker() ? '' : 'worker environment'}
6539
6581
 
6540
6582
  You have probably forgotten install and import the provider package.
6541
6583
  To fix this issue, you can:
@@ -6653,24 +6695,6 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
6653
6695
  * TODO: [🌺] Use some intermediate util splitWords
6654
6696
  */
6655
6697
 
6656
- /**
6657
- * Detects if the code is running in a browser environment in main thread (Not in a web worker)
6658
- *
6659
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
6660
- *
6661
- * @public exported from `@promptbook/utils`
6662
- */
6663
- new Function(`
6664
- try {
6665
- return this === window;
6666
- } catch (e) {
6667
- return false;
6668
- }
6669
- `);
6670
- /**
6671
- * TODO: [🎺]
6672
- */
6673
-
6674
6698
  /**
6675
6699
  * Detects if the code is running in jest environment
6676
6700
  *
@@ -6689,28 +6713,6 @@ new Function(`
6689
6713
  * TODO: [🎺]
6690
6714
  */
6691
6715
 
6692
- /**
6693
- * Detects if the code is running in a web worker
6694
- *
6695
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
6696
- *
6697
- * @public exported from `@promptbook/utils`
6698
- */
6699
- new Function(`
6700
- try {
6701
- if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
6702
- return true;
6703
- } else {
6704
- return false;
6705
- }
6706
- } catch (e) {
6707
- return false;
6708
- }
6709
- `);
6710
- /**
6711
- * TODO: [🎺]
6712
- */
6713
-
6714
6716
  /**
6715
6717
  * Makes first letter of a string uppercase
6716
6718
  *
@@ -8302,7 +8304,6 @@ function startRemoteServer(options) {
8302
8304
  catch (error) {
8303
8305
  assertsError(error);
8304
8306
  socket.emit('error', serializeError(error));
8305
- // <- TODO: [🚋] There is a problem with the remote server handling errors and sending them back to the client
8306
8307
  }
8307
8308
  finally {
8308
8309
  socket.disconnect();