@promptbook/markdown-utils 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 +9 -10
- 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 +1 -2
- package/umd/index.umd.js +13 -11
- 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,13 +1,12 @@
|
|
|
1
1
|
import { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
|
-
import
|
|
2
|
+
import CryptoJS from 'crypto-js';
|
|
3
3
|
import { Subject } from 'rxjs';
|
|
4
4
|
import { forTime } from 'waitasecond';
|
|
5
5
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
6
6
|
import sha256 from 'crypto-js/sha256';
|
|
7
7
|
import { basename, join, dirname, isAbsolute } from 'path';
|
|
8
|
-
import { SHA256 } from 'crypto-js';
|
|
9
8
|
import { lookup, extension } from 'mime-types';
|
|
10
|
-
import
|
|
9
|
+
import papaparse from 'papaparse';
|
|
11
10
|
|
|
12
11
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
13
12
|
/**
|
|
@@ -23,7 +22,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
23
22
|
* @generated
|
|
24
23
|
* @see https://github.com/webgptorg/promptbook
|
|
25
24
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-117';
|
|
27
26
|
/**
|
|
28
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -3269,7 +3268,7 @@ class MissingToolsError extends Error {
|
|
|
3269
3268
|
* @private internal helper function
|
|
3270
3269
|
*/
|
|
3271
3270
|
function $randomToken(randomness) {
|
|
3272
|
-
return
|
|
3271
|
+
return CryptoJS.lib.WordArray.random(randomness).toString(CryptoJS.enc.Hex);
|
|
3273
3272
|
}
|
|
3274
3273
|
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3275
3274
|
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
@@ -5229,7 +5228,7 @@ function normalizeToKebabCase(text) {
|
|
|
5229
5228
|
* @public exported from `@promptbook/editable`
|
|
5230
5229
|
*/
|
|
5231
5230
|
function knowledgeSourceContentToName(knowledgeSourceContent) {
|
|
5232
|
-
const hash = SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
|
|
5231
|
+
const hash = CryptoJS.SHA256(hexEncoder.parse(JSON.stringify(knowledgeSourceContent)))
|
|
5233
5232
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
5234
5233
|
.toString( /* hex */)
|
|
5235
5234
|
.substring(0, 20);
|
|
@@ -6223,7 +6222,7 @@ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO:
|
|
|
6223
6222
|
console.warn('CSV string contains carriage return characters, but in the CSV settings the `newline` setting does not include them. Autohealing the CSV string.');
|
|
6224
6223
|
value = value.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
|
|
6225
6224
|
}
|
|
6226
|
-
const csv = parse(value, settings);
|
|
6225
|
+
const csv = papaparse.parse(value, settings);
|
|
6227
6226
|
return csv;
|
|
6228
6227
|
}
|
|
6229
6228
|
|
|
@@ -6308,10 +6307,10 @@ const CsvFormatParser = {
|
|
|
6308
6307
|
i > index ? { ...row, [outputParameterName]: PENDING_VALUE_PLACEHOLDER } : row,
|
|
6309
6308
|
);
|
|
6310
6309
|
*/
|
|
6311
|
-
await onProgress(unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6310
|
+
await onProgress(papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS }));
|
|
6312
6311
|
}
|
|
6313
6312
|
}
|
|
6314
|
-
return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6313
|
+
return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6315
6314
|
},
|
|
6316
6315
|
},
|
|
6317
6316
|
{
|
|
@@ -6339,7 +6338,7 @@ const CsvFormatParser = {
|
|
|
6339
6338
|
return /* not await */ mapCallback({ [key]: value }, index, array.length);
|
|
6340
6339
|
}));
|
|
6341
6340
|
}));
|
|
6342
|
-
return unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6341
|
+
return papaparse.unparse(mappedData, { ...settings, ...MANDATORY_CSV_SETTINGS });
|
|
6343
6342
|
},
|
|
6344
6343
|
},
|
|
6345
6344
|
],
|