@promptbook/markitdown 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 +29 -7
  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 +2 -2
  55. package/umd/index.umd.js +31 -9
  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
@@ -24,7 +24,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
24
24
  * @generated
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- const PROMPTBOOK_ENGINE_VERSION = '0.104.0-1';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.104.0-11';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1262,13 +1262,14 @@ class UnexpectedError extends Error {
1262
1262
  *
1263
1263
  * @public exported from `@promptbook/utils`
1264
1264
  */
1265
- const $isRunningInNode = new Function(`
1265
+ function $isRunningInNode() {
1266
1266
  try {
1267
- return this === global;
1268
- } catch (e) {
1267
+ return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
1268
+ }
1269
+ catch (e) {
1269
1270
  return false;
1270
1271
  }
1271
- `);
1272
+ }
1272
1273
  /**
1273
1274
  * TODO: [🎺]
1274
1275
  */
@@ -3871,6 +3872,15 @@ function countUsage(llmTools) {
3871
3872
  return promptResult;
3872
3873
  };
3873
3874
  }
3875
+ if (llmTools.callImageGenerationModel !== undefined) {
3876
+ proxyTools.callImageGenerationModel = async (prompt) => {
3877
+ // console.info('[🚕] callImageGenerationModel through countTotalUsage');
3878
+ const promptResult = await llmTools.callImageGenerationModel(prompt);
3879
+ totalUsage = addUsage(totalUsage, promptResult.usage);
3880
+ spending.next(promptResult.usage);
3881
+ return promptResult;
3882
+ };
3883
+ }
3874
3884
  // <- Note: [🤖]
3875
3885
  return proxyTools;
3876
3886
  }
@@ -3879,7 +3889,7 @@ function countUsage(llmTools) {
3879
3889
  * TODO: [🧠] Is there some meaningfull way how to test this util
3880
3890
  * TODO: [🧠][🌯] Maybe a way how to hide ability to `get totalUsage`
3881
3891
  * > const [llmToolsWithUsage,getUsage] = countTotalUsage(llmTools);
3882
- * TODO: [👷‍♂️] @@@ Manual about construction of llmTools
3892
+ * TODO: [👷‍♂️] Write a comprehensive manual explaining the construction and usage of LLM tools in the Promptbook ecosystem
3883
3893
  */
3884
3894
 
3885
3895
  /**
@@ -3980,6 +3990,12 @@ class MultipleLlmExecutionTools {
3980
3990
  callEmbeddingModel(prompt) {
3981
3991
  return this.callCommonModel(prompt);
3982
3992
  }
3993
+ /**
3994
+ * Calls the best available embedding model
3995
+ */
3996
+ callImageGenerationModel(prompt) {
3997
+ return this.callCommonModel(prompt);
3998
+ }
3983
3999
  // <- Note: [🤖]
3984
4000
  /**
3985
4001
  * Calls the best available model
@@ -4006,6 +4022,11 @@ class MultipleLlmExecutionTools {
4006
4022
  continue llm;
4007
4023
  }
4008
4024
  return await llmExecutionTools.callEmbeddingModel(prompt);
4025
+ case 'IMAGE_GENERATION':
4026
+ if (llmExecutionTools.callImageGenerationModel === undefined) {
4027
+ continue llm;
4028
+ }
4029
+ return await llmExecutionTools.callImageGenerationModel(prompt);
4009
4030
  // <- case [🤖]:
4010
4031
  default:
4011
4032
  throw new UnexpectedError(`Unknown model variant "${prompt.modelRequirements.modelVariant}" in ${llmExecutionTools.title}`);
@@ -6140,8 +6161,9 @@ async function executeAttempts(options) {
6140
6161
  $ongoingTaskResult.$resultString = $ongoingTaskResult.$completionResult.content;
6141
6162
  break variant;
6142
6163
  case 'EMBEDDING':
6164
+ case 'IMAGE_GENERATION':
6143
6165
  throw new PipelineExecutionError(spaceTrim$1((block) => `
6144
- Embedding model can not be used in pipeline
6166
+ ${modelRequirements.modelVariant} model can not be used in pipeline
6145
6167
 
6146
6168
  This should be catched during parsing
6147
6169