@promptbook/pdf 0.112.0-114 → 0.112.0-117
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/esm/index.es.js +10 -11
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +2 -0
- package/esm/src/_packages/node.index.d.ts +10 -0
- package/esm/src/book-3.0/CliAgent.d.ts +8 -15
- package/esm/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/esm/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/esm/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -30
- package/esm/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -3
- package/umd/index.umd.js +14 -12
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +2 -0
- package/umd/src/_packages/node.index.d.ts +10 -0
- package/umd/src/book-3.0/CliAgent.d.ts +8 -15
- package/umd/src/book-3.0/agentFolderPaths.d.ts +30 -0
- package/umd/src/book-components/BookEditor/BookEditorBrowserConfig.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorForClient.d.ts +7 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +9 -0
- package/umd/src/cli/cli-commands/agent-folder/agentProjectPaths.d.ts +2 -30
- package/umd/src/scrapers/website/utils/createShowdownConverter.d.ts +2 -2
- 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
|
|
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
|
|
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-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-117';
|
|
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
|
|
@@ -1900,7 +1899,7 @@ async function getScraperIntermediateSource(source, options) {
|
|
|
1900
1899
|
const { filename: sourceFilename, url } = source;
|
|
1901
1900
|
const { rootDirname, cacheDirname, intermediateFilesStrategy, extension, isVerbose } = options;
|
|
1902
1901
|
// TODO: [👬] DRY
|
|
1903
|
-
const hash = SHA256(
|
|
1902
|
+
const hash = CryptoJS.SHA256(
|
|
1904
1903
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
1905
1904
|
hexEncoder.parse(sourceFilename || url || 'untitled'))
|
|
1906
1905
|
.toString( /* hex */)
|
|
@@ -3635,7 +3634,7 @@ class MissingToolsError extends Error {
|
|
|
3635
3634
|
* @private internal helper function
|
|
3636
3635
|
*/
|
|
3637
3636
|
function $randomToken(randomness) {
|
|
3638
|
-
return
|
|
3637
|
+
return CryptoJS.lib.WordArray.random(randomness).toString(CryptoJS.enc.Hex);
|
|
3639
3638
|
}
|
|
3640
3639
|
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3641
3640
|
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
@@ -5252,7 +5251,7 @@ function $registeredScrapersMessage(availableScrapers) {
|
|
|
5252
5251
|
* @public exported from `@promptbook/editable`
|
|
5253
5252
|
*/
|
|
5254
5253
|
function knowledgeSourceContentToName(knowledgeSourceContent) {
|
|
5255
|
-
const hash = SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
|
|
5254
|
+
const hash = CryptoJS.SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
|
|
5256
5255
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
5257
5256
|
.toString( /* hex */)
|
|
5258
5257
|
.substring(0, 20);
|
|
@@ -6167,7 +6166,7 @@ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO:
|
|
|
6167
6166
|
console.warn('CSV string contains carriage return characters, but in the CSV settings the `newline` setting does not include them. Autohealing the CSV string.');
|
|
6168
6167
|
value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
6169
6168
|
}
|
|
6170
|
-
const csv = parse(value, settings);
|
|
6169
|
+
const csv = papaparse.parse(value, settings);
|
|
6171
6170
|
return csv;
|
|
6172
6171
|
}
|
|
6173
6172
|
|
|
@@ -6252,10 +6251,10 @@ const CsvFormatParser = {
|
|
|
6252
6251
|
i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
|
|
6253
6252
|
);
|
|
6254
6253
|
*/
|
|
6255
|
-
await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6254
|
+
await onProgress(papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6256
6255
|
}
|
|
6257
6256
|
}
|
|
6258
|
-
return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6257
|
+
return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6259
6258
|
},
|
|
6260
6259
|
},
|
|
6261
6260
|
{
|
|
@@ -6283,7 +6282,7 @@ const CsvFormatParser = {
|
|
|
6283
6282
|
return /* not await */ mapCallback({ [key]: value }, index, array.length);
|
|
6284
6283
|
}));
|
|
6285
6284
|
}));
|
|
6286
|
-
return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6285
|
+
return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6287
6286
|
},
|
|
6288
6287
|
},
|
|
6289
6288
|
],
|