@promptbook/markitdown 0.85.0-9 → 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.
@@ -6,7 +6,7 @@ import type { PipelineCollection } from '../PipelineCollection';
6
6
  /**
7
7
  * Options for `createCollectionFromDirectory` function
8
8
  *
9
- * Note: `rootDirname` is not needed because it is the folder in which `.book.md` file is located
9
+ * Note: `rootDirname` is not needed because it is the folder in which `.book` or `.book.md` file is located
10
10
  * This is not same as `path` which is the first argument of `createCollectionFromDirectory` - it can be a subfolder
11
11
  */
12
12
  type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions, 'rootDirname'> & {
@@ -51,13 +51,13 @@ type CreatePipelineCollectionFromDirectoryOptions = Omit<PrepareAndScrapeOptions
51
51
  *
52
52
  * Note: Works only in Node.js environment because it reads the file system
53
53
  *
54
- * @param path - path to the directory with pipelines
54
+ * @param rootPath - path to the directory with pipelines
55
55
  * @param tools - Execution tools to be used for pipeline preparation if needed - If not provided, `$provideExecutionToolsForNode` will be used
56
56
  * @param options - Options for the collection creation
57
57
  * @returns PipelineCollection
58
58
  * @public exported from `@promptbook/node`
59
59
  */
60
- export declare function createCollectionFromDirectory(path: string_dirname, tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
60
+ export declare function createCollectionFromDirectory(rootPath: string_dirname, tools?: Pick<ExecutionTools, 'llm' | 'fs' | 'scrapers'>, options?: CreatePipelineCollectionFromDirectoryOptions): Promise<PipelineCollection>;
61
61
  export {};
62
62
  /**
63
63
  * TODO: [🖇] What about symlinks? Maybe option isSymlinksFollowed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/markitdown",
3
- "version": "0.85.0-9",
3
+ "version": "0.85.0",
4
4
  "description": "It's time for a paradigm shift. The future of software in plain English, French or Latin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -42,12 +42,12 @@
42
42
  "bugs": {
43
43
  "url": "https://github.com/webgptorg/promptbook/issues"
44
44
  },
45
- "homepage": "https://www.npmjs.com/package/@promptbook/core",
45
+ "homepage": "https://ptbk.io/",
46
46
  "main": "./umd/index.umd.js",
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/markitdown.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.85.0-9"
50
+ "@promptbook/core": "0.85.0"
51
51
  },
52
52
  "dependencies": {
53
53
  "crypto": "^1.0.1",
package/umd/index.umd.js CHANGED
@@ -25,7 +25,7 @@
25
25
  * @generated
26
26
  * @see https://github.com/webgptorg/promptbook
27
27
  */
28
- var PROMPTBOOK_ENGINE_VERSION = '0.85.0-8';
28
+ var PROMPTBOOK_ENGINE_VERSION = '0.85.0-16';
29
29
  /**
30
30
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
31
31
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1637,57 +1637,6 @@
1637
1637
  return true;
1638
1638
  }
1639
1639
 
1640
- /**
1641
- * Checks if an URL is reserved for private networks or localhost.
1642
- *
1643
- * Note: There are two simmilar functions:
1644
- * - `isUrlOnPrivateNetwork` which tests full URL
1645
- * - `isHostnameOnPrivateNetwork` *(this one)* which tests just hostname
1646
- *
1647
- * @public exported from `@promptbook/utils`
1648
- */
1649
- function isHostnameOnPrivateNetwork(hostname) {
1650
- if (hostname === 'example.com' ||
1651
- hostname === 'localhost' ||
1652
- hostname.endsWith('.localhost') ||
1653
- hostname.endsWith('.local') ||
1654
- hostname.endsWith('.test') ||
1655
- hostname === '127.0.0.1' ||
1656
- hostname === '::1') {
1657
- return true;
1658
- }
1659
- if (hostname.includes(':')) {
1660
- // IPv6
1661
- var ipParts = hostname.split(':');
1662
- return ipParts[0] === 'fc00' || ipParts[0] === 'fd00' || ipParts[0] === 'fe80';
1663
- }
1664
- else {
1665
- // IPv4
1666
- var ipParts = hostname.split('.').map(function (part) { return Number.parseInt(part, 10); });
1667
- return (ipParts[0] === 10 ||
1668
- (ipParts[0] === 172 && ipParts[1] >= 16 && ipParts[1] <= 31) ||
1669
- (ipParts[0] === 192 && ipParts[1] === 168));
1670
- }
1671
- }
1672
-
1673
- /**
1674
- * Checks if an IP address or hostname is reserved for private networks or localhost.
1675
- *
1676
- * Note: There are two simmilar functions:
1677
- * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
1678
- * - `isHostnameOnPrivateNetwork` which tests just hostname
1679
- *
1680
- * @param {string} ipAddress - The IP address to check.
1681
- * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
1682
- * @public exported from `@promptbook/utils`
1683
- */
1684
- function isUrlOnPrivateNetwork(url) {
1685
- if (typeof url === 'string') {
1686
- url = new URL(url);
1687
- }
1688
- return isHostnameOnPrivateNetwork(url.hostname);
1689
- }
1690
-
1691
1640
  /**
1692
1641
  * Tests if given string is valid pipeline URL URL.
1693
1642
  *
@@ -1701,16 +1650,19 @@
1701
1650
  if (!isValidUrl(url)) {
1702
1651
  return false;
1703
1652
  }
1704
- if (!url.startsWith('https://')) {
1653
+ if (!url.startsWith('https://') && !url.startsWith('http://') /* <- Note: [👣] */) {
1705
1654
  return false;
1706
1655
  }
1707
1656
  if (url.includes('#')) {
1708
1657
  // TODO: [🐠]
1709
1658
  return false;
1710
1659
  }
1660
+ /*
1661
+ Note: [👣][🧠] Is it secure to allow pipeline URLs on private and unsecured networks?
1711
1662
  if (isUrlOnPrivateNetwork(url)) {
1712
1663
  return false;
1713
1664
  }
1665
+ */
1714
1666
  return true;
1715
1667
  }
1716
1668
  /**