@promptbook/markdown-utils 0.112.0-64 → 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/_packages/components.index.d.ts +0 -2
- package/esm/src/_packages/core.index.d.ts +2 -2
- package/esm/src/_packages/types.index.d.ts +0 -2
- 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/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +27 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +25 -0
- package/esm/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +10 -0
- package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +14 -0
- package/esm/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +43 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +0 -34
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -11
- package/esm/src/commitments/_common/toolRuntimeContext.d.ts +0 -6
- package/esm/src/config.d.ts +3 -3
- package/esm/src/formfactors/index.d.ts +2 -2
- package/esm/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +1 -1
- package/esm/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +1 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +0 -9
- package/esm/src/utils/files/getPromptbookTempPath.d.ts +24 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +38 -8
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +0 -2
- package/umd/src/_packages/core.index.d.ts +2 -2
- package/umd/src/_packages/types.index.d.ts +0 -2
- 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/book-2.0/book-language-documentation/BookLanguageDocumentationExample.d.ts +27 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageCommonPitfalls.d.ts +25 -0
- package/umd/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.d.ts +10 -0
- package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +14 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.d.ts +43 -0
- package/umd/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.test.d.ts +1 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +0 -34
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
- package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -11
- package/umd/src/commitments/_common/toolRuntimeContext.d.ts +0 -6
- package/umd/src/config.d.ts +3 -3
- package/umd/src/formfactors/index.d.ts +2 -2
- package/umd/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +1 -1
- package/umd/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +1 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +0 -9
- 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/src/{commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts → book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.test.d.ts} +0 -0
- /package/{umd/src/commitments/KNOWLEDGE/KNOWLEDGE.test.d.ts → esm/src/utils/files/getPromptbookTempPath.test.d.ts} +0 -0
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 { randomBytes } from 'crypto';
|
|
3
4
|
import { Subject } from 'rxjs';
|
|
4
5
|
import { forTime } from 'waitasecond';
|
|
5
6
|
import hexEncoder from 'crypto-js/enc-hex';
|
|
6
7
|
import sha256 from 'crypto-js/sha256';
|
|
7
|
-
import { basename, join, dirname, isAbsolute } from 'path';
|
|
8
8
|
import { SHA256 } from 'crypto-js';
|
|
9
9
|
import { lookup, extension } from 'mime-types';
|
|
10
10
|
import { parse, unparse } from 'papaparse';
|
|
@@ -23,7 +23,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
23
23
|
* @generated
|
|
24
24
|
* @see https://github.com/webgptorg/promptbook
|
|
25
25
|
*/
|
|
26
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
26
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-66';
|
|
27
27
|
/**
|
|
28
28
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
29
29
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1082,6 +1082,29 @@ function saturate(amount) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
// TODO: Maybe implement by mix+hsl
|
|
1084
1084
|
|
|
1085
|
+
/**
|
|
1086
|
+
* Relative directory name without the `./` prefix for Git ignore rules and glob patterns.
|
|
1087
|
+
*
|
|
1088
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1089
|
+
*/
|
|
1090
|
+
const PROMPTBOOK_TEMP_DIRECTORY_NAME = '.promptbook';
|
|
1091
|
+
/**
|
|
1092
|
+
* Builds one project-relative path inside the shared Promptbook working directory.
|
|
1093
|
+
*
|
|
1094
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1095
|
+
*/
|
|
1096
|
+
function getPromptbookTempPath(...pathSegments) {
|
|
1097
|
+
return `./${getPromptbookTempPosixPath(...pathSegments)}`;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Builds one POSIX path fragment inside the shared Promptbook working directory for globs and generated text files.
|
|
1101
|
+
*
|
|
1102
|
+
* @private internal utility for Promptbook-owned temp files
|
|
1103
|
+
*/
|
|
1104
|
+
function getPromptbookTempPosixPath(...pathSegments) {
|
|
1105
|
+
return posix.join(PROMPTBOOK_TEMP_DIRECTORY_NAME, ...pathSegments);
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1085
1108
|
/**
|
|
1086
1109
|
* Returns the same value that is passed as argument.
|
|
1087
1110
|
* No side effects.
|
|
@@ -1263,7 +1286,6 @@ const DEFAULT_MAX_PARALLEL_COUNT = 5; // <- TODO: [🤹♂️]
|
|
|
1263
1286
|
*/
|
|
1264
1287
|
const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹♂️]
|
|
1265
1288
|
// <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
|
|
1266
|
-
// TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
|
|
1267
1289
|
/**
|
|
1268
1290
|
* Where to store the temporary downloads
|
|
1269
1291
|
*
|
|
@@ -1271,7 +1293,15 @@ const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹♂️]
|
|
|
1271
1293
|
*
|
|
1272
1294
|
* @public exported from `@promptbook/core`
|
|
1273
1295
|
*/
|
|
1274
|
-
const DEFAULT_DOWNLOAD_CACHE_DIRNAME = '
|
|
1296
|
+
const DEFAULT_DOWNLOAD_CACHE_DIRNAME = getPromptbookTempPath('download-cache');
|
|
1297
|
+
/**
|
|
1298
|
+
* Where to store the cache of executions for promptbook CLI
|
|
1299
|
+
*
|
|
1300
|
+
* Note: When the folder does not exist, it is created recursively
|
|
1301
|
+
*
|
|
1302
|
+
* @public exported from `@promptbook/core`
|
|
1303
|
+
*/
|
|
1304
|
+
getPromptbookTempPath('execution-cache');
|
|
1275
1305
|
/**
|
|
1276
1306
|
* Where to store the scrape cache
|
|
1277
1307
|
*
|
|
@@ -1279,7 +1309,7 @@ const DEFAULT_DOWNLOAD_CACHE_DIRNAME = './.promptbook/download-cache';
|
|
|
1279
1309
|
*
|
|
1280
1310
|
* @public exported from `@promptbook/core`
|
|
1281
1311
|
*/
|
|
1282
|
-
const DEFAULT_SCRAPE_CACHE_DIRNAME = '
|
|
1312
|
+
const DEFAULT_SCRAPE_CACHE_DIRNAME = getPromptbookTempPath('scrape-cache');
|
|
1283
1313
|
// <- TODO: [🧜♂️]
|
|
1284
1314
|
/**
|
|
1285
1315
|
* Default settings for parsing and generating CSV files in Promptbook.
|