@promptbook/markitdown 0.112.0-115 → 0.112.0-118

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 (31) hide show
  1. package/esm/index.es.js +10 -11
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/_packages/components.index.d.ts +2 -0
  4. package/esm/src/_packages/node.index.d.ts +20 -0
  5. package/esm/src/book-3.0/BookNodeAgentSource.d.ts +1 -1
  6. package/esm/src/book-3.0/CliAgent.d.ts +15 -17
  7. package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
  8. package/esm/src/book-3.0/cliAgentEnv.d.ts +33 -0
  9. package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
  10. package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
  11. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
  12. package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -30
  13. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +2 -18
  14. package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
  15. package/esm/src/version.d.ts +1 -1
  16. package/package.json +2 -3
  17. package/umd/index.umd.js +14 -12
  18. package/umd/index.umd.js.map +1 -1
  19. package/umd/src/_packages/components.index.d.ts +2 -0
  20. package/umd/src/_packages/node.index.d.ts +20 -0
  21. package/umd/src/book-3.0/BookNodeAgentSource.d.ts +1 -1
  22. package/umd/src/book-3.0/CliAgent.d.ts +15 -17
  23. package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
  24. package/umd/src/book-3.0/cliAgentEnv.d.ts +33 -0
  25. package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
  26. package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
  27. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
  28. package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -30
  29. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +2 -18
  30. package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
  31. package/umd/src/version.d.ts +1 -1
package/esm/index.es.js CHANGED
@@ -1,14 +1,13 @@
1
1
  import { mkdir, rm, readFile } from 'fs/promises';
2
2
  import { spaceTrim as spaceTrim$1 } from 'spacetrim';
3
- import { SHA256 } from 'crypto-js';
3
+ import CryptoJS from 'crypto-js';
4
4
  import hexEncoder from 'crypto-js/enc-hex';
5
5
  import { basename, join, dirname, isAbsolute } from 'path';
6
- import { randomBytes } from 'crypto';
7
6
  import { Subject } from 'rxjs';
8
7
  import { forTime } from 'waitasecond';
9
8
  import sha256 from 'crypto-js/sha256';
10
9
  import { lookup, extension } from 'mime-types';
11
- import { parse, unparse } from 'papaparse';
10
+ import papaparse from 'papaparse';
12
11
 
13
12
  // ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
14
13
  /**
@@ -24,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
24
23
  * @generated
25
24
  * @see https://github.com/webgptorg/promptbook
26
25
  */
27
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-115';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-118';
28
27
  /**
29
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1886,7 +1885,7 @@ async function getScraperIntermediateSource(source, options) {
1886
1885
  const { filename: sourceFilename, url } = source;
1887
1886
  const { rootDirname, cacheDirname, intermediateFilesStrategy, extension, isVerbose } = options;
1888
1887
  // TODO: [👬] DRY
1889
- const hash = SHA256(
1888
+ const hash = CryptoJS.SHA256(
1890
1889
  // <- TODO: [🥬] Encapsulate sha256 to some private utility function
1891
1890
  hexEncoder.parse(sourceFilename || url || 'untitled'))
1892
1891
  .toString( /* hex */)
@@ -3621,7 +3620,7 @@ class MissingToolsError extends Error {
3621
3620
  * @private internal helper function
3622
3621
  */
3623
3622
  function $randomToken(randomness) {
3624
- return randomBytes(randomness).toString('hex');
3623
+ return CryptoJS.lib.WordArray.random(randomness).toString(CryptoJS.enc.Hex);
3625
3624
  }
3626
3625
  // TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
3627
3626
  // TODO: Maybe use nanoid instead https://github.com/ai/nanoid
@@ -5238,7 +5237,7 @@ function $registeredScrapersMessage(availableScrapers) {
5238
5237
  * @public exported from `@promptbook/editable`
5239
5238
  */
5240
5239
  function knowledgeSourceContentToName(knowledgeSourceContent) {
5241
- const hash = SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
5240
+ const hash = CryptoJS.SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
5242
5241
  // <- TODO: [🥬] Encapsulate sha256 to some private utility function
5243
5242
  .toString( /* hex */)
5244
5243
  .substring(0, 20);
@@ -6153,7 +6152,7 @@ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO:
6153
6152
  console.warn('CSV string contains carriage return characters, but in the CSV settings the `newline` setting does not include them. Autohealing the CSV string.');
6154
6153
  value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
6155
6154
  }
6156
- const csv = parse(value, settings);
6155
+ const csv = papaparse.parse(value, settings);
6157
6156
  return csv;
6158
6157
  }
6159
6158
 
@@ -6238,10 +6237,10 @@ const CsvFormatParser = {
6238
6237
  i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
6239
6238
  );
6240
6239
  */
6241
- await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
6240
+ await onProgress(papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
6242
6241
  }
6243
6242
  }
6244
- return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
6243
+ return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
6245
6244
  },
6246
6245
  },
6247
6246
  {
@@ -6269,7 +6268,7 @@ const CsvFormatParser = {
6269
6268
  return /* not await */ mapCallback({ [key]: value }, index, array.length);
6270
6269
  }));
6271
6270
  }));
6272
- return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
6271
+ return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
6273
6272
  },
6274
6273
  },
6275
6274
  ],