@promptbook/markitdown 0.105.0-8 → 0.105.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.
Files changed (114) hide show
  1. package/README.md +0 -4
  2. package/esm/index.es.js +13 -13
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/browser.index.d.ts +2 -0
  5. package/esm/typings/src/_packages/components.index.d.ts +20 -0
  6. package/esm/typings/src/_packages/core.index.d.ts +21 -11
  7. package/esm/typings/src/_packages/node.index.d.ts +2 -0
  8. package/esm/typings/src/_packages/openai.index.d.ts +4 -0
  9. package/esm/typings/src/_packages/types.index.d.ts +32 -2
  10. package/esm/typings/src/_packages/utils.index.d.ts +2 -0
  11. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +10 -1
  12. package/esm/typings/src/book-2.0/agent-source/parseTeamCommitment.d.ts +28 -0
  13. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +1 -1
  14. package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
  15. package/esm/typings/src/book-components/Chat/AgentChip/AgentChip.d.ts +67 -0
  16. package/esm/typings/src/book-components/Chat/AgentChip/index.d.ts +2 -0
  17. package/esm/typings/src/book-components/Chat/Chat/ChatMessageItem.d.ts +33 -1
  18. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +87 -6
  19. package/esm/typings/src/book-components/Chat/Chat/ChatSoundToggle.d.ts +23 -0
  20. package/esm/typings/src/book-components/Chat/Chat/ClockIcon.d.ts +9 -0
  21. package/esm/typings/src/book-components/Chat/LlmChat/FriendlyErrorMessage.d.ts +20 -0
  22. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +13 -0
  23. package/esm/typings/src/book-components/Chat/SourceChip/SourceChip.d.ts +35 -0
  24. package/esm/typings/src/book-components/Chat/SourceChip/index.d.ts +2 -0
  25. package/esm/typings/src/book-components/Chat/effects/ChatEffectsSystem.d.ts +14 -0
  26. package/esm/typings/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +18 -0
  27. package/esm/typings/src/book-components/Chat/effects/components/HeartsEffect.d.ts +18 -0
  28. package/esm/typings/src/book-components/Chat/effects/configs/defaultEffectConfigs.d.ts +7 -0
  29. package/esm/typings/src/book-components/Chat/effects/index.d.ts +18 -0
  30. package/esm/typings/src/book-components/Chat/effects/types/ChatEffect.d.ts +20 -0
  31. package/esm/typings/src/book-components/Chat/effects/types/ChatEffectConfig.d.ts +21 -0
  32. package/esm/typings/src/book-components/Chat/effects/types/ChatEffectType.d.ts +6 -0
  33. package/esm/typings/src/book-components/Chat/effects/types/ChatEffectsSystemProps.d.ts +32 -0
  34. package/esm/typings/src/book-components/Chat/effects/utils/detectEffects.d.ts +12 -0
  35. package/esm/typings/src/book-components/Chat/types/ChatMessage.d.ts +34 -6
  36. package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +8 -0
  37. package/esm/typings/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +12 -0
  38. package/esm/typings/src/book-components/Chat/utils/getToolCallChipletText.d.ts +40 -0
  39. package/esm/typings/src/book-components/Chat/utils/loadAgentProfile.d.ts +69 -0
  40. package/esm/typings/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +53 -0
  41. package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.d.ts +11 -0
  42. package/esm/typings/src/book-components/Chat/utils/resolveCitationUrl.test.d.ts +1 -0
  43. package/esm/typings/src/book-components/Chat/utils/toolCallParsing.d.ts +64 -0
  44. package/esm/typings/src/book-components/icons/EmailIcon.d.ts +15 -0
  45. package/esm/typings/src/commitments/TEAM/TEAM.d.ts +45 -0
  46. package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.d.ts +44 -0
  47. package/esm/typings/src/commitments/TEMPLATE/TEMPLATE.test.d.ts +1 -0
  48. package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +19 -1
  49. package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +22 -0
  50. package/esm/typings/src/commitments/USE_BROWSER/fetchUrlContentViaBrowser.d.ts +13 -0
  51. package/esm/typings/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +48 -0
  52. package/esm/typings/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +11 -0
  53. package/esm/typings/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +18 -0
  54. package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +46 -0
  55. package/esm/typings/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.test.d.ts +1 -0
  56. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +5 -0
  57. package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.test.d.ts +1 -0
  58. package/esm/typings/src/commitments/USE_TIME/USE_TIME.d.ts +6 -0
  59. package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
  60. package/esm/typings/src/commitments/_base/CommitmentDefinition.d.ts +6 -0
  61. package/esm/typings/src/commitments/_base/formatOptionalInstructionBlock.d.ts +6 -0
  62. package/esm/typings/src/commitments/_common/commitmentToolFunctions.d.ts +26 -0
  63. package/esm/typings/src/commitments/_common/getAllCommitmentDefinitions.d.ts +8 -0
  64. package/esm/typings/src/commitments/_common/getAllCommitmentTypes.d.ts +8 -0
  65. package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForBrowser.d.ts +9 -0
  66. package/esm/typings/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +13 -0
  67. package/esm/typings/src/commitments/_common/getAllCommitmentsToolTitles.d.ts +7 -0
  68. package/esm/typings/src/commitments/_common/getCommitmentDefinition.d.ts +10 -0
  69. package/esm/typings/src/commitments/_common/getGroupedCommitmentDefinitions.d.ts +17 -0
  70. package/esm/typings/src/commitments/_common/isCommitmentSupported.d.ts +9 -0
  71. package/esm/typings/src/commitments/index.d.ts +5 -58
  72. package/esm/typings/src/config.d.ts +6 -0
  73. package/esm/typings/src/constants.d.ts +129 -0
  74. package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +1 -0
  75. package/esm/typings/src/execution/AvailableModel.d.ts +5 -4
  76. package/esm/typings/src/execution/PromptResult.d.ts +2 -19
  77. package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
  78. package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +1 -0
  79. package/esm/typings/src/llm-providers/agent/Agent.d.ts +15 -1
  80. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +6 -1
  81. package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +5 -0
  82. package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +1 -0
  83. package/esm/typings/src/llm-providers/openai/OpenAiAgentExecutionTools.d.ts +43 -0
  84. package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +4 -2
  85. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +1 -1
  86. package/esm/typings/src/llm-providers/openai/createOpenAiAgentExecutionTools.d.ts +11 -0
  87. package/esm/typings/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +7 -0
  88. package/esm/typings/src/pipeline/prompt-notation.d.ts +27 -2
  89. package/esm/typings/src/pipeline/prompt-notation.test.d.ts +1 -1
  90. package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +1 -0
  91. package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -0
  92. package/esm/typings/src/scrapers/_common/register/$provideScriptingForNode.d.ts +1 -0
  93. package/esm/typings/src/search-engines/SearchEngine.d.ts +1 -1
  94. package/esm/typings/src/search-engines/bing/BingSearchEngine.d.ts +1 -1
  95. package/esm/typings/src/search-engines/dummy/DummySearchEngine.d.ts +1 -1
  96. package/esm/typings/src/search-engines/google/GoogleSearchEngine.d.ts +1 -1
  97. package/esm/typings/src/search-engines/serp/SerpSearchEngine.d.ts +1 -1
  98. package/esm/typings/src/speech-recognition/OpenAiSpeechRecognition.d.ts +3 -0
  99. package/esm/typings/src/types/ModelRequirements.d.ts +6 -0
  100. package/esm/typings/src/types/Prompt.d.ts +12 -0
  101. package/esm/typings/src/types/ToolCall.d.ts +37 -0
  102. package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -2
  103. package/esm/typings/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
  104. package/esm/typings/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  105. package/esm/typings/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
  106. package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +1 -3
  107. package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -2
  108. package/esm/typings/src/utils/misc/linguisticHash.d.ts +4 -1
  109. package/esm/typings/src/utils/parameters/templateParameters.d.ts +1 -2
  110. package/esm/typings/src/version.d.ts +1 -1
  111. package/esm/typings/src/wizard/wizard.d.ts +1 -4
  112. package/package.json +2 -2
  113. package/umd/index.umd.js +13 -13
  114. package/umd/index.umd.js.map +1 -1
package/README.md CHANGED
@@ -27,10 +27,6 @@ Turn your company's scattered knowledge into AI ready Books
27
27
 
28
28
 
29
29
 
30
- <blockquote style="color: #ff8811">
31
- <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>.
32
- </blockquote>
33
-
34
30
  ## 📦 Package `@promptbook/markitdown`
35
31
 
36
32
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
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.105.0-8';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.105.0';
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
@@ -1636,7 +1636,7 @@ function isValidFilePath(filename) {
1636
1636
  if (typeof filename !== 'string') {
1637
1637
  return false;
1638
1638
  }
1639
- if (filename.split('\n').length > 1) {
1639
+ if (filename.split(/\r?\n/).length > 1) {
1640
1640
  return false;
1641
1641
  }
1642
1642
  // Normalize slashes early so heuristics can detect path-like inputs
@@ -1838,7 +1838,7 @@ function isValidEmail(email) {
1838
1838
  if (typeof email !== 'string') {
1839
1839
  return false;
1840
1840
  }
1841
- if (email.split('\n').length > 1) {
1841
+ if (email.split(/\r?\n/).length > 1) {
1842
1842
  return false;
1843
1843
  }
1844
1844
  return /^.+@.+\..+$/.test(email);
@@ -4815,7 +4815,7 @@ async function prepareKnowledgePieces(knowledgeSources, tools, options) {
4815
4815
 
4816
4816
  The source:
4817
4817
  ${block(knowledgeSource.knowledgeSourceContent
4818
- .split('\n')
4818
+ .split(/\r?\n/)
4819
4819
  .map((line) => `> ${line}`)
4820
4820
  .join('\n'))}
4821
4821
 
@@ -4831,7 +4831,7 @@ async function prepareKnowledgePieces(knowledgeSources, tools, options) {
4831
4831
 
4832
4832
  The source:
4833
4833
  > ${block(knowledgeSource.knowledgeSourceContent
4834
- .split('\n')
4834
+ .split(/\r?\n/)
4835
4835
  .map((line) => `> ${line}`)
4836
4836
  .join('\n'))}
4837
4837
 
@@ -5532,7 +5532,7 @@ const TextFormatParser = {
5532
5532
  subvalueName: 'LINE',
5533
5533
  async mapValues(options) {
5534
5534
  const { value, mapCallback, onProgress } = options;
5535
- const lines = value.split('\n');
5535
+ const lines = value.split(/\r?\n/);
5536
5536
  const mappedLines = await Promise.all(lines.map((lineContent, lineNumber, array) =>
5537
5537
  // TODO: [🧠] Maybe option to skip empty line
5538
5538
  /* not await */ mapCallback({
@@ -5737,7 +5737,7 @@ function templateParameters(template, parameters) {
5737
5737
  parameterValue = parameterValue.replace(/[{}]/g, '\\$&');
5738
5738
  if (parameterValue.includes('\n') && /^\s*\W{0,3}\s*$/.test(precol)) {
5739
5739
  parameterValue = parameterValue
5740
- .split('\n')
5740
+ .split(/\r?\n/)
5741
5741
  .map((line, index) => (index === 0 ? line : `${precol}${line}`))
5742
5742
  .join('\n');
5743
5743
  }
@@ -5773,7 +5773,7 @@ function templateParameters(template, parameters) {
5773
5773
  */
5774
5774
  function extractAllBlocksFromMarkdown(markdown) {
5775
5775
  const codeBlocks = [];
5776
- const lines = markdown.split('\n');
5776
+ const lines = markdown.split(/\r?\n/);
5777
5777
  // Note: [0] Ensure that the last block notated by gt > will be closed
5778
5778
  lines.push('');
5779
5779
  let currentCodeBlock = null;
@@ -5908,7 +5908,7 @@ function countLines(text) {
5908
5908
  }
5909
5909
  text = text.replace('\r\n', '\n');
5910
5910
  text = text.replace('\r', '\n');
5911
- const lines = text.split('\n');
5911
+ const lines = text.split(/\r?\n/);
5912
5912
  return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
5913
5913
  }
5914
5914
  /**
@@ -6383,13 +6383,13 @@ async function executeAttempts(options) {
6383
6383
  return `
6384
6384
  Attempt ${failure.attemptIndex + 1}:
6385
6385
  Error ${((_a = failure.error) === null || _a === void 0 ? void 0 : _a.name) || ''}:
6386
- ${block((_b = failure.error) === null || _b === void 0 ? void 0 : _b.message.split('\n').map((line) => `> ${line}`).join('\n'))}
6386
+ ${block((_b = failure.error) === null || _b === void 0 ? void 0 : _b.message.split(/\r?\n/).map((line) => `> ${line}`).join('\n'))}
6387
6387
 
6388
6388
  Result:
6389
6389
  ${block(failure.result === null
6390
6390
  ? 'null'
6391
6391
  : spaceTrim$1(failure.result)
6392
- .split('\n')
6392
+ .split(/\r?\n/)
6393
6393
  .map((line) => `> ${line}`)
6394
6394
  .join('\n'))}
6395
6395
  `;
@@ -6404,7 +6404,7 @@ async function executeAttempts(options) {
6404
6404
 
6405
6405
  The Prompt:
6406
6406
  ${block((((_a = $ongoingTaskResult.$prompt) === null || _a === void 0 ? void 0 : _a.content) || '')
6407
- .split('\n')
6407
+ .split(/\r?\n/)
6408
6408
  .map((line) => `> ${line}`)
6409
6409
  .join('\n'))}
6410
6410
 
@@ -7075,7 +7075,7 @@ async function executePipeline(options) {
7075
7075
  ${block(pipelineIdentification)}
7076
7076
 
7077
7077
  ${block(JSON.stringify(newOngoingResult, null, 4)
7078
- .split('\n')
7078
+ .split(/\r?\n/)
7079
7079
  .map((line) => `> ${line}`)
7080
7080
  .join('\n'))}
7081
7081
  `));