@promptbook/markdown-utils 0.104.0-1 → 0.104.0-11

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 (57) hide show
  1. package/esm/index.es.js +24 -3
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/typings/servers.d.ts +8 -0
  4. package/esm/typings/src/_packages/core.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/types.index.d.ts +16 -2
  6. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +29 -1
  7. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +6 -6
  8. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.closed.test.d.ts +1 -0
  9. package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -3
  10. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +5 -1
  11. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +5 -0
  12. package/esm/typings/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +13 -0
  13. package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
  14. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +9 -13
  15. package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +3 -3
  16. package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +1 -1
  17. package/esm/typings/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +56 -0
  18. package/esm/typings/src/book-components/icons/AboutIcon.d.ts +1 -1
  19. package/esm/typings/src/book-components/icons/AttachmentIcon.d.ts +1 -1
  20. package/esm/typings/src/book-components/icons/CameraIcon.d.ts +1 -1
  21. package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +1 -1
  22. package/esm/typings/src/book-components/icons/MenuIcon.d.ts +1 -1
  23. package/esm/typings/src/book-components/icons/SaveIcon.d.ts +1 -1
  24. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +22 -12
  25. package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +27 -15
  26. package/esm/typings/src/commitments/DICTIONARY/DICTIONARY.d.ts +46 -0
  27. package/esm/typings/src/commitments/index.d.ts +2 -1
  28. package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -1
  29. package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +6 -2
  30. package/esm/typings/src/llm-providers/agent/Agent.d.ts +6 -1
  31. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +1 -1
  32. package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +1 -1
  33. package/esm/typings/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +1 -1
  34. package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -0
  35. package/esm/typings/src/remote-server/ui/ServerApp.d.ts +1 -1
  36. package/esm/typings/src/search-engines/SearchEngine.d.ts +9 -0
  37. package/esm/typings/src/search-engines/SearchResult.d.ts +18 -0
  38. package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +15 -0
  39. package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +15 -0
  40. package/esm/typings/src/types/Message.d.ts +49 -0
  41. package/esm/typings/src/types/ModelRequirements.d.ts +38 -14
  42. package/esm/typings/src/types/typeAliases.d.ts +23 -1
  43. package/esm/typings/src/utils/color/utils/colorToDataUrl.d.ts +2 -1
  44. package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +4 -4
  45. package/esm/typings/src/utils/environment/$isRunningInBrowser.d.ts +1 -1
  46. package/esm/typings/src/utils/environment/$isRunningInJest.d.ts +1 -1
  47. package/esm/typings/src/utils/environment/$isRunningInNode.d.ts +1 -1
  48. package/esm/typings/src/utils/environment/$isRunningInWebWorker.d.ts +1 -1
  49. package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +2 -2
  50. package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -2
  51. package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +3 -2
  52. package/esm/typings/src/utils/random/$randomBase58.d.ts +12 -0
  53. package/esm/typings/src/version.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/umd/index.umd.js +24 -3
  56. package/umd/index.umd.js.map +1 -1
  57. package/esm/typings/src/book-2.0/utils/generateGravatarUrl.d.ts +0 -10
package/esm/index.es.js CHANGED
@@ -23,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-1';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-11';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -3545,6 +3545,15 @@ function countUsage(llmTools) {
3545
3545
  return promptResult;
3546
3546
  };
3547
3547
  }
3548
+ if (llmTools.callImageGenerationModel !== undefined) {
3549
+ proxyTools.callImageGenerationModel = async (prompt) => {
3550
+ // console.info('[🚕] callImageGenerationModel through countTotalUsage');
3551
+ const promptResult = await llmTools.callImageGenerationModel(prompt);
3552
+ totalUsage = addUsage(totalUsage, promptResult.usage);
3553
+ spending.next(promptResult.usage);
3554
+ return promptResult;
3555
+ };
3556
+ }
3548
3557
  // <- Note: [🤖]
3549
3558
  return proxyTools;
3550
3559
  }
@@ -3553,7 +3562,7 @@ function countUsage(llmTools) {
3553
3562
  * TODO: [🧠] Is there some meaningfull way how to test this util
3554
3563
  * TODO: [🧠][🌯] Maybe a way how to hide ability to `get totalUsage`
3555
3564
  * > const [llmToolsWithUsage,getUsage] = countTotalUsage(llmTools);
3556
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
3565
+ * TODO: [👷‍♂️] Write a comprehensive manual explaining the construction and usage of LLM tools in the Promptbook ecosystem
3557
3566
  */
3558
3567
 
3559
3568
  /**
@@ -3654,6 +3663,12 @@ class MultipleLlmExecutionTools {
3654
3663
  callEmbeddingModel(prompt) {
3655
3664
  return this.callCommonModel(prompt);
3656
3665
  }
3666
+ /**
3667
+ * Calls the best available embedding model
3668
+ */
3669
+ callImageGenerationModel(prompt) {
3670
+ return this.callCommonModel(prompt);
3671
+ }
3657
3672
  // <- Note: [🤖]
3658
3673
  /**
3659
3674
  * Calls the best available model
@@ -3680,6 +3695,11 @@ class MultipleLlmExecutionTools {
3680
3695
  continue llm;
3681
3696
  }
3682
3697
  return await llmExecutionTools.callEmbeddingModel(prompt);
3698
+ case 'IMAGE_GENERATION':
3699
+ if (llmExecutionTools.callImageGenerationModel === undefined) {
3700
+ continue llm;
3701
+ }
3702
+ return await llmExecutionTools.callImageGenerationModel(prompt);
3683
3703
  // <- case [🤖]:
3684
3704
  default:
3685
3705
  throw new UnexpectedError(`Unknown model variant "${prompt.modelRequirements.modelVariant}" in ${llmExecutionTools.title}`);
@@ -6107,8 +6127,9 @@ async function executeAttempts(options) {
6107
6127
  $ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
6108
6128
  break variant;
6109
6129
  case 'EMBEDDING':
6130
+ case 'IMAGE_GENERATION':
6110
6131
  throw new PipelineExecutionError(spaceTrim$2((block) => `
6111
- Embedding model can not be used in pipeline
6132
+ ${modelRequirements.modelVariant} model can not be used in pipeline
6112
6133
 
6113
6134
  This should be catched during parsing
6114
6135