@promptbook/node 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
@@ -45,7 +45,7 @@
45
45
  * @generated
46
46
  * @see https://github.com/webgptorg/promptbook
47
47
  */
48
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-1';
48
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-3';
49
49
  /**
50
50
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
51
51
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -10828,13 +10828,14 @@
10828
10828
  *
10829
10829
  * @public exported from `@promptbook/utils`
10830
10830
  */
10831
- const $isRunningInNode = new Function(`
10832
- try {
10833
- return this === global;
10834
- } catch (e) {
10835
- return false;
10831
+ function $isRunningInNode() {
10832
+ try {
10833
+ return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
10834
+ }
10835
+ catch (e) {
10836
+ return false;
10837
+ }
10836
10838
  }
10837
- `);
10838
10839
  /**
10839
10840
  * TODO: [🎺]
10840
10841
  */
@@ -11395,7 +11396,7 @@
11395
11396
  ${i + 1}) **${title}** \`${className}\` from \`${packageName}\`
11396
11397
  ${morePieces.join('; ')}
11397
11398
  `);
11398
- if ($isRunningInNode) {
11399
+ if ($isRunningInNode()) {
11399
11400
  if (isInstalled && isFullyConfigured) {
11400
11401
  providerMessage = colors__default["default"].green(providerMessage);
11401
11402
  }
@@ -11499,13 +11500,14 @@
11499
11500
  *
11500
11501
  * @public exported from `@promptbook/utils`
11501
11502
  */
11502
- const $isRunningInBrowser = new Function(`
11503
- try {
11504
- return this === window;
11505
- } catch (e) {
11506
- return false;
11503
+ function $isRunningInBrowser() {
11504
+ try {
11505
+ return typeof window !== 'undefined' && typeof window.document !== 'undefined';
11506
+ }
11507
+ catch (e) {
11508
+ return false;
11509
+ }
11507
11510
  }
11508
- `);
11509
11511
  /**
11510
11512
  * TODO: [🎺]
11511
11513
  */
@@ -11517,17 +11519,17 @@
11517
11519
  *
11518
11520
  * @public exported from `@promptbook/utils`
11519
11521
  */
11520
- const $isRunningInWebWorker = new Function(`
11521
- try {
11522
- if (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope) {
11523
- return true;
11524
- } else {
11522
+ function $isRunningInWebWorker() {
11523
+ try {
11524
+ // Note: Check for importScripts which is specific to workers
11525
+ // and not available in the main browser thread
11526
+ return (typeof self !== 'undefined' &&
11527
+ typeof self.importScripts === 'function');
11528
+ }
11529
+ catch (e) {
11525
11530
  return false;
11526
11531
  }
11527
- } catch (e) {
11528
- return false;
11529
11532
  }
11530
- `);
11531
11533
  /**
11532
11534
  * TODO: [🎺]
11533
11535
  */
@@ -11682,24 +11684,6 @@
11682
11684
  * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
11683
11685
  */
11684
11686
 
11685
- /**
11686
- * Detects if the code is running in jest environment
11687
- *
11688
- * Note: `$` is used to indicate that this function is not a pure function - it looks at the global object to determine the environment
11689
- *
11690
- * @public exported from `@promptbook/utils`
11691
- */
11692
- new Function(`
11693
- try {
11694
- return process.env.JEST_WORKER_ID !== undefined;
11695
- } catch (e) {
11696
- return false;
11697
- }
11698
- `);
11699
- /**
11700
- * TODO: [🎺]
11701
- */
11702
-
11703
11687
  /**
11704
11688
  * Makes first letter of a string lowercase
11705
11689
  *