@promptbook/legacy-documents 0.100.0-3 → 0.100.0-32
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/README.md +1 -0
- package/esm/index.es.js +42 -5
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +4 -0
- package/esm/typings/src/_packages/core.index.d.ts +24 -0
- package/esm/typings/src/_packages/types.index.d.ts +30 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +30 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSource.test.d.ts +1 -0
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +26 -0
- package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/FrontendRAGService.d.ts +48 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +51 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/RAGService.d.ts +54 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/BaseKnowledgeProcessor.d.ts +45 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/PdfProcessor.d.ts +31 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/ProcessorFactory.d.ts +23 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/TextProcessor.d.ts +18 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/types.d.ts +56 -0
- package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/utils/ragHelper.d.ts +34 -0
- package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +56 -0
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +39 -0
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +49 -0
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +46 -0
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +44 -0
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +52 -0
- package/esm/typings/src/book-2.0/commitments/_base/BookCommitment.d.ts +5 -0
- package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +48 -0
- package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +22 -0
- package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +19 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +37 -0
- package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +18 -0
- package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +22 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirements.d.ts +61 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirementsWithCommitments.d.ts +35 -0
- package/esm/typings/src/book-2.0/commitments/_misc/createCommitmentRegex.d.ts +20 -0
- package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +24 -0
- package/esm/typings/src/book-2.0/commitments/_misc/removeCommentsFromSystemMessage.d.ts +11 -0
- package/esm/typings/src/book-2.0/commitments/index.d.ts +56 -0
- package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +39 -0
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +26 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +4 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +6 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -5
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/ollama/ollama-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/pipeline/book-notation.d.ts +2 -1
- package/esm/typings/src/types/ModelRequirements.d.ts +0 -2
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +42 -5
- package/umd/index.umd.js.map +1 -1
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Write AI applications using plain human language across multiple models and plat
|
|
|
18
18
|
|
|
19
19
|
## 🌟 New Features
|
|
20
20
|
|
|
21
|
+
- 🚀 **GPT-5 Support** - Now includes OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window
|
|
21
22
|
- 💡 VS Code support for `.book` files with syntax highlighting and IntelliSense
|
|
22
23
|
- 🐳 Official Docker image (`hejny/promptbook`) for seamless containerized usage
|
|
23
24
|
- 🔥 Native support for OpenAI `o3-mini`, GPT-4 and other leading LLMs
|
package/esm/index.es.js
CHANGED
|
@@ -28,7 +28,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
28
28
|
* @generated
|
|
29
29
|
* @see https://github.com/webgptorg/promptbook
|
|
30
30
|
*/
|
|
31
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-
|
|
31
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-32';
|
|
32
32
|
/**
|
|
33
33
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
34
34
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -1026,7 +1026,23 @@ async function getScraperIntermediateSource(source, options) {
|
|
|
1026
1026
|
.join('/') +
|
|
1027
1027
|
'.' +
|
|
1028
1028
|
extension;
|
|
1029
|
-
|
|
1029
|
+
// Note: Try to create cache directory, but don't fail if filesystem has issues
|
|
1030
|
+
try {
|
|
1031
|
+
await mkdir(dirname(cacheFilename), { recursive: true });
|
|
1032
|
+
}
|
|
1033
|
+
catch (error) {
|
|
1034
|
+
// Note: If we can't create cache directory, continue without it
|
|
1035
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
1036
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
1037
|
+
error.message.includes('read-only') ||
|
|
1038
|
+
error.message.includes('EACCES') ||
|
|
1039
|
+
error.message.includes('EPERM') ||
|
|
1040
|
+
error.message.includes('ENOENT'))) ;
|
|
1041
|
+
else {
|
|
1042
|
+
// Re-throw other unexpected errors
|
|
1043
|
+
throw error;
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1030
1046
|
let isDestroyed = true;
|
|
1031
1047
|
const fileHandler = {
|
|
1032
1048
|
filename: cacheFilename,
|
|
@@ -3648,7 +3664,23 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
3648
3664
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
3649
3665
|
const rootDirname = join(process.cwd(), DEFAULT_DOWNLOAD_CACHE_DIRNAME);
|
|
3650
3666
|
const filepath = join(...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), `${basename.substring(0, MAX_FILENAME_LENGTH)}.${mimeTypeToExtension(mimeType)}`);
|
|
3651
|
-
|
|
3667
|
+
// Note: Try to create cache directory, but don't fail if filesystem has issues
|
|
3668
|
+
try {
|
|
3669
|
+
await tools.fs.mkdir(dirname(join(rootDirname, filepath)), { recursive: true });
|
|
3670
|
+
}
|
|
3671
|
+
catch (error) {
|
|
3672
|
+
// Note: If we can't create cache directory, we'll handle it when trying to write the file
|
|
3673
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
3674
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
3675
|
+
error.message.includes('read-only') ||
|
|
3676
|
+
error.message.includes('EACCES') ||
|
|
3677
|
+
error.message.includes('EPERM') ||
|
|
3678
|
+
error.message.includes('ENOENT'))) ;
|
|
3679
|
+
else {
|
|
3680
|
+
// Re-throw other unexpected errors
|
|
3681
|
+
throw error;
|
|
3682
|
+
}
|
|
3683
|
+
}
|
|
3652
3684
|
const fileContent = Buffer.from(await response.arrayBuffer());
|
|
3653
3685
|
if (fileContent.length > DEFAULT_MAX_FILE_SIZE /* <- TODO: Allow to pass different value to remote server */) {
|
|
3654
3686
|
throw new LimitReachedError(`File is too large (${Math.round(fileContent.length / 1024 / 1024)}MB). Maximum allowed size is ${Math.round(DEFAULT_MAX_FILE_SIZE / 1024 / 1024)}MB.`);
|
|
@@ -3663,7 +3695,8 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
3663
3695
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
3664
3696
|
error.message.includes('read-only') ||
|
|
3665
3697
|
error.message.includes('EACCES') ||
|
|
3666
|
-
error.message.includes('EPERM')
|
|
3698
|
+
error.message.includes('EPERM') ||
|
|
3699
|
+
error.message.includes('ENOENT'))) {
|
|
3667
3700
|
// Return a handler that works directly with the downloaded content
|
|
3668
3701
|
return {
|
|
3669
3702
|
source: name,
|
|
@@ -5074,7 +5107,7 @@ function validatePromptResult(options) {
|
|
|
5074
5107
|
*/
|
|
5075
5108
|
async function executeAttempts(options) {
|
|
5076
5109
|
const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
|
|
5077
|
-
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, } = options;
|
|
5110
|
+
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
|
|
5078
5111
|
const $ongoingTaskResult = {
|
|
5079
5112
|
$result: null,
|
|
5080
5113
|
$resultString: null,
|
|
@@ -5318,6 +5351,10 @@ async function executeAttempts(options) {
|
|
|
5318
5351
|
result: $ongoingTaskResult.$resultString,
|
|
5319
5352
|
error: error,
|
|
5320
5353
|
});
|
|
5354
|
+
// Report failed attempt
|
|
5355
|
+
onProgress({
|
|
5356
|
+
errors: [error],
|
|
5357
|
+
});
|
|
5321
5358
|
}
|
|
5322
5359
|
finally {
|
|
5323
5360
|
if (!isJokerAttempt &&
|