@promptbook/website-crawler 0.112.0-65 โ 0.112.0-66
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 +35 -5
- package/esm/index.es.js.map +1 -1
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/esm/src/avatars/visuals/minecraft2AvatarVisual.d.ts +7 -0
- package/esm/src/avatars/visuals/minecraftAvatarVisualShared.d.ts +48 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/esm/src/config.d.ts +3 -3
- package/esm/src/utils/files/getPromptbookTempPath.d.ts +24 -0
- package/esm/src/utils/files/getPromptbookTempPath.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +38 -8
- package/umd/index.umd.js.map +1 -1
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +1 -1
- package/umd/src/avatars/visuals/minecraft2AvatarVisual.d.ts +7 -0
- package/umd/src/avatars/visuals/minecraftAvatarVisualShared.d.ts +48 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/umd/src/config.d.ts +3 -3
- package/umd/src/utils/files/getPromptbookTempPath.d.ts +24 -0
- package/umd/src/utils/files/getPromptbookTempPath.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
package/esm/index.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
|
+
import { posix, basename, join, dirname, isAbsolute } from 'path';
|
|
2
3
|
import { Readability } from '@mozilla/readability';
|
|
3
4
|
import { JSDOM } from 'jsdom';
|
|
4
5
|
import { SHA256 } from 'crypto-js';
|
|
5
6
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
6
7
|
import { mkdir, rm } from 'fs/promises';
|
|
7
|
-
import { basename, join, dirname, isAbsolute } from 'path';
|
|
8
8
|
import { randomBytes } from 'crypto';
|
|
9
9
|
import { Subject } from 'rxjs';
|
|
10
10
|
import { forTime } from 'waitasecond';
|
|
@@ -27,7 +27,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
27
27
|
* @generated
|
|
28
28
|
* @see https://github.com/webgptorg/promptbook
|
|
29
29
|
*/
|
|
30
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
30
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-66';
|
|
31
31
|
/**
|
|
32
32
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
33
33
|
* Note: [๐] Ignore a discrepancy between file name and entity name
|
|
@@ -990,6 +990,29 @@ function saturate(amount) {
|
|
|
990
990
|
}
|
|
991
991
|
// TODO: Maybe implement by mix+hsl
|
|
992
992
|
|
|
993
|
+
/**
|
|
994
|
+
* Relative directory name without the `./` prefix for Git ignore rules and glob patterns.
|
|
995
|
+
*
|
|
996
|
+
* @private internal utility for Promptbook-owned temp files
|
|
997
|
+
*/
|
|
998
|
+
const PROMPTBOOK_TEMP_DIRECTORY_NAME = '.promptbook';
|
|
999
|
+
/**
|
|
1000
|
+
* Builds one project-relative path inside the shared Promptbook working directory.
|
|
1001
|
+
*
|
|
1002
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1003
|
+
*/
|
|
1004
|
+
function getPromptbookTempPath(...pathSegments) {
|
|
1005
|
+
return `./${getPromptbookTempPosixPath(...pathSegments)}`;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Builds one POSIX path fragment inside the shared Promptbook working directory for globs and generated text files.
|
|
1009
|
+
*
|
|
1010
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1011
|
+
*/
|
|
1012
|
+
function getPromptbookTempPosixPath(...pathSegments) {
|
|
1013
|
+
return posix.join(PROMPTBOOK_TEMP_DIRECTORY_NAME, ...pathSegments);
|
|
1014
|
+
}
|
|
1015
|
+
|
|
993
1016
|
/**
|
|
994
1017
|
* Returns the same value that is passed as argument.
|
|
995
1018
|
* No side effects.
|
|
@@ -1165,7 +1188,6 @@ const DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [๐คนโโ๏ธ]
|
|
|
1165
1188
|
*/
|
|
1166
1189
|
const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [๐คนโโ๏ธ]
|
|
1167
1190
|
// <- TODO: [๐] Make also `AGENTS_DIRNAME_ALTERNATIVES`
|
|
1168
|
-
// TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
|
|
1169
1191
|
/**
|
|
1170
1192
|
* Where to store the temporary downloads
|
|
1171
1193
|
*
|
|
@@ -1173,7 +1195,15 @@ const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [๐คนโโ๏ธ]
|
|
|
1173
1195
|
*
|
|
1174
1196
|
* @public exported from `@promptbook/core`
|
|
1175
1197
|
*/
|
|
1176
|
-
const DEFAULT_DOWNLOAD_CACHE_DIRNAME = '
|
|
1198
|
+
const DEFAULT_DOWNLOAD_CACHE_DIRNAME = getPromptbookTempPath('download-cache');
|
|
1199
|
+
/**
|
|
1200
|
+
* Where to store the cache of executions for promptbook CLI
|
|
1201
|
+
*
|
|
1202
|
+
* Note: When the folder does not exist, it is created recursively
|
|
1203
|
+
*
|
|
1204
|
+
* @public exported from `@promptbook/core`
|
|
1205
|
+
*/
|
|
1206
|
+
getPromptbookTempPath('execution-cache');
|
|
1177
1207
|
/**
|
|
1178
1208
|
* Where to store the scrape cache
|
|
1179
1209
|
*
|
|
@@ -1181,7 +1211,7 @@ const DEFAULT_DOWNLOAD_CACHE_DIRNAME = './.promptbook/download-cache';
|
|
|
1181
1211
|
*
|
|
1182
1212
|
* @public exported from `@promptbook/core`
|
|
1183
1213
|
*/
|
|
1184
|
-
const DEFAULT_SCRAPE_CACHE_DIRNAME = '
|
|
1214
|
+
const DEFAULT_SCRAPE_CACHE_DIRNAME = getPromptbookTempPath('scrape-cache');
|
|
1185
1215
|
// <- TODO: [๐งโโ๏ธ]
|
|
1186
1216
|
/**
|
|
1187
1217
|
* Default settings for parsing and generating CSV files in Promptbook.
|