@promptbook/markitdown 0.85.0-8 → 0.85.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.
package/README.md CHANGED
@@ -24,10 +24,6 @@
24
24
 
25
25
 
26
26
 
27
- <blockquote style="color: #ff8811">
28
- <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>.
29
- </blockquote>
30
-
31
27
  ## 📦 Package `@promptbook/markitdown`
32
28
 
33
29
  - Promptbooks are [divided into several](#-packages) packages, all are published from [single monorepo](https://github.com/webgptorg/promptbook).
package/esm/index.es.js CHANGED
@@ -26,7 +26,7 @@ var BOOK_LANGUAGE_VERSION = '1.0.0';
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- var PROMPTBOOK_ENGINE_VERSION = '0.85.0-7';
29
+ var PROMPTBOOK_ENGINE_VERSION = '0.85.0-16';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1638,57 +1638,6 @@ function isValidPromptbookVersion(version) {
1638
1638
  return true;
1639
1639
  }
1640
1640
 
1641
- /**
1642
- * Checks if an URL is reserved for private networks or localhost.
1643
- *
1644
- * Note: There are two simmilar functions:
1645
- * - `isUrlOnPrivateNetwork` which tests full URL
1646
- * - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
1647
- *
1648
- * @public exported from `@promptbook/utils`
1649
- */
1650
- function isHostnameOnPrivateNetwork(hostname) {
1651
- if (hostname === 'example.com' ||
1652
- hostname === 'localhost' ||
1653
- hostname.endsWith('.localhost') ||
1654
- hostname.endsWith('.local') ||
1655
- hostname.endsWith('.test') ||
1656
- hostname === '127.0.0.1' ||
1657
- hostname === '::1') {
1658
- return true;
1659
- }
1660
- if (hostname.includes(':')) {
1661
- // IPv6
1662
- var ipParts = hostname.split(':');
1663
- return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
1664
- }
1665
- else {
1666
- // IPv4
1667
- var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
1668
- return (ipParts[0] === 10 ||
1669
- (ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
1670
- (ipParts[0] === 192 && ipParts[1] === 168));
1671
- }
1672
- }
1673
-
1674
- /**
1675
- * Checks if an IP address or hostname is reserved for private networks or localhost.
1676
- *
1677
- * Note: There are two simmilar functions:
1678
- * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
1679
- * - `isHostnameOnPrivateNetwork` which tests just hostname
1680
- *
1681
- * @param {string} ipAddress - The IP address to check.
1682
- * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
1683
- * @public exported from `@promptbook/utils`
1684
- */
1685
- function isUrlOnPrivateNetwork(url) {
1686
- if (typeof url === 'string') {
1687
- url = new URL(url);
1688
- }
1689
- return isHostnameOnPrivateNetwork(url.hostname);
1690
- }
1691
-
1692
1641
  /**
1693
1642
  * Tests if given string is valid pipeline URL URL.
1694
1643
  *
@@ -1702,16 +1651,19 @@ function isValidPipelineUrl(url) {
1702
1651
  if (!isValidUrl(url)) {
1703
1652
  return false;
1704
1653
  }
1705
- if (!url.startsWith('https://')) {
1654
+ if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
1706
1655
  return false;
1707
1656
  }
1708
1657
  if (url.includes('#')) {
1709
1658
  // TODO: [🐠]
1710
1659
  return false;
1711
1660
  }
1661
+ /*
1662
+ Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
1712
1663
  if (isUrlOnPrivateNetwork(url)) {
1713
1664
  return false;
1714
1665
  }
1666
+ */
1715
1667
  return true;
1716
1668
  }
1717
1669
  /**
@@ -2514,18 +2466,16 @@ function assertsTaskSuccessful(executionResult) {
2514
2466
  */
2515
2467
  function createTask(options) {
2516
2468
  var taskType = options.taskType, taskProcessCallback = options.taskProcessCallback;
2517
- var taskId = "".concat(taskType.toLowerCase().substring(0, 4), "-").concat($randomToken(8 /* <- TODO: !!! To global config + Use Base58 to avoid simmilar char conflicts */));
2469
+ var taskId = "".concat(taskType.toLowerCase().substring(0, 4), "-").concat($randomToken(8 /* <- TODO: To global config + Use Base58 to avoid simmilar char conflicts */));
2518
2470
  var partialResultSubject = new BehaviorSubject({});
2519
2471
  var finalResultPromise = /* not await */ taskProcessCallback(function (newOngoingResult) {
2520
2472
  partialResultSubject.next(newOngoingResult);
2521
2473
  });
2522
2474
  finalResultPromise
2523
2475
  .catch(function (error) {
2524
- // console.error('!!!!! Task failed:', error);
2525
2476
  partialResultSubject.error(error);
2526
2477
  })
2527
2478
  .then(function (value) {
2528
- // console.error('!!!!! Task finished:', value);
2529
2479
  if (value) {
2530
2480
  try {
2531
2481
  assertsTaskSuccessful(value);
@@ -2547,9 +2497,7 @@ function createTask(options) {
2547
2497
  return [4 /*yield*/, finalResultPromise];
2548
2498
  case 1:
2549
2499
  finalResult = _b.sent();
2550
- console.error('!!!!! finalResult:', finalResult);
2551
2500
  if (isCrashedOnError) {
2552
- console.error('!!!!! isCrashedOnError:', finalResult);
2553
2501
  assertsTaskSuccessful(finalResult);
2554
2502
  }
2555
2503
  return [2 /*return*/, finalResult];