@promptbook/remote-server 0.104.0-1 → 0.104.0-3

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.
Files changed (31) hide show
  1. package/esm/index.es.js +20 -36
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/src/_packages/types.index.d.ts +8 -2
  4. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +6 -1
  5. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +5 -1
  6. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
  7. package/esm/typings/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +13 -0
  8. package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
  9. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +7 -11
  10. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +2 -2
  11. package/esm/typings/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +56 -0
  12. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +13 -7
  13. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -0
  14. package/esm/typings/src/commitments/DICTIONARY/DICTIONARY.d.ts +46 -0
  15. package/esm/typings/src/commitments/index.d.ts +2 -1
  16. package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +1 -1
  17. package/esm/typings/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +1 -1
  18. package/esm/typings/src/types/Message.d.ts +49 -0
  19. package/esm/typings/src/types/typeAliases.d.ts +12 -0
  20. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +4 -4
  21. package/esm/typings/src/utils/environment/$isRunningInBrowser.d.ts +1 -1
  22. package/esm/typings/src/utils/environment/$isRunningInJest.d.ts +1 -1
  23. package/esm/typings/src/utils/environment/$isRunningInNode.d.ts +1 -1
  24. package/esm/typings/src/utils/environment/$isRunningInWebWorker.d.ts +1 -1
  25. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
  26. package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -2
  27. package/esm/typings/src/utils/random/$randomBase58.d.ts +12 -0
  28. package/esm/typings/src/version.d.ts +1 -1
  29. package/package.json +2 -2
  30. package/umd/index.umd.js +24 -40
  31. package/umd/index.umd.js.map +1 -1
package/umd/index.umd.js CHANGED
@@ -47,7 +47,7 @@
47
47
  * @generated
48
48
  * @see https://github.com/webgptorg/promptbook
49
49
  */
50
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-1';
50
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-3';
51
51
  /**
52
52
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
53
53
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1195,13 +1195,14 @@
1195
1195
  *
1196
1196
  * @public exported from `@promptbook/utils`
1197
1197
  */
1198
- const $isRunningInNode = new Function(`
1199
- try {
1200
- return this === global;
1201
- } catch (e) {
1202
- return false;
1198
+ function $isRunningInNode() {
1199
+ try {
1200
+ return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
1201
+ }
1202
+ catch (e) {
1203
+ return false;
1204
+ }
1203
1205
  }
1204
- `);
1205
1206
  /**
1206
1207
  * TODO: [🎺]
1207
1208
  */
@@ -7666,13 +7667,14 @@
7666
7667
  *
7667
7668
  * @public exported from `@promptbook/utils`
7668
7669
  */
7669
- const $isRunningInBrowser = new Function(`
7670
- try {
7671
- return this === window;
7672
- } catch (e) {
7673
- return false;
7670
+ function $isRunningInBrowser() {
7671
+ try {
7672
+ return typeof window !== 'undefined' && typeof window.document !== 'undefined';
7673
+ }
7674
+ catch (e) {
7675
+ return false;
7676
+ }
7674
7677
  }
7675
- `);
7676
7678
  /**
7677
7679
  * TODO: [🎺]
7678
7680
  */
@@ -7684,17 +7686,17 @@
7684
7686
  *
7685
7687
  * @public exported from `@promptbook/utils`
7686
7688
  */
7687
- const $isRunningInWebWorker = new Function(`
7688
- try {
7689
- if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
7690
- return true;
7691
- } else {
7689
+ function $isRunningInWebWorker() {
7690
+ try {
7691
+ // Note: Check for importScripts which is specific to workers
7692
+ // and not available in the main browser thread
7693
+ return (typeof self !== 'undefined' &&
7694
+ typeof self.importScripts === 'function');
7695
+ }
7696
+ catch (e) {
7692
7697
  return false;
7693
7698
  }
7694
- } catch (e) {
7695
- return false;
7696
7699
  }
7697
- `);
7698
7700
  /**
7699
7701
  * TODO: [🎺]
7700
7702
  */
@@ -7826,7 +7828,7 @@
7826
7828
  ${i + 1}) **${title}** \`${className}\` from \`${packageName}\`
7827
7829
  ${morePieces.join('; ')}
7828
7830
  `);
7829
- if ($isRunningInNode) {
7831
+ if ($isRunningInNode()) {
7830
7832
  if (isInstalled && isFullyConfigured) {
7831
7833
  providerMessage = colors__default["default"].green(providerMessage);
7832
7834
  }
@@ -7990,24 +7992,6 @@
7990
7992
  * TODO: [🌺] Use some intermediate util splitWords
7991
7993
  */
7992
7994
 
7993
- /**
7994
- * Detects if the code is running in jest environment
7995
- *
7996
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
7997
- *
7998
- * @public exported from `@promptbook/utils`
7999
- */
8000
- new Function(`
8001
- try {
8002
- return process.env.JEST_WORKER_ID !== undefined;
8003
- } catch (e) {
8004
- return false;
8005
- }
8006
- `);
8007
- /**
8008
- * TODO: [🎺]
8009
- */
8010
-
8011
7995
  /**
8012
7996
  * Makes first letter of a string lowercase
8013
7997
  *