@promptbook/cli 0.100.0-2 → 0.100.0-20
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 +77 -10
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/core.index.d.ts +24 -0
- package/esm/typings/src/_packages/types.index.d.ts +28 -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 +30 -0
- package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +31 -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 +43 -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 +36 -0
- package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +48 -0
- package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +31 -0
- package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +41 -0
- package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +38 -0
- package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +36 -0
- package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +36 -0
- package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +30 -0
- package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +42 -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 +37 -0
- package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +14 -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/pipeline/book-notation.d.ts +2 -1
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/wizard.d.ts +14 -4
- package/package.json +1 -1
- package/umd/index.umd.js +77 -10
- 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
|
@@ -47,7 +47,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
|
47
47
|
* @generated
|
|
48
48
|
* @see https://github.com/webgptorg/promptbook
|
|
49
49
|
*/
|
|
50
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-
|
|
50
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.100.0-20';
|
|
51
51
|
/**
|
|
52
52
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
53
53
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2198,8 +2198,27 @@ class FileCacheStorage {
|
|
|
2198
2198
|
throw new UnexpectedError(`The "${key}" you want to store in JSON file is not serializable as JSON`);
|
|
2199
2199
|
}
|
|
2200
2200
|
const fileContent = stringifyPipelineJson(value);
|
|
2201
|
-
|
|
2202
|
-
|
|
2201
|
+
// Note: Try to create cache directory and write file, but don't fail if filesystem is read-only or has permission issues
|
|
2202
|
+
try {
|
|
2203
|
+
await mkdir(dirname(filename), { recursive: true }); // <- [0]
|
|
2204
|
+
await writeFile(filename, fileContent, 'utf-8');
|
|
2205
|
+
}
|
|
2206
|
+
catch (error) {
|
|
2207
|
+
// Note: If we can't write to cache, silently ignore the error
|
|
2208
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
2209
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
2210
|
+
error.message.includes('read-only') ||
|
|
2211
|
+
error.message.includes('EACCES') ||
|
|
2212
|
+
error.message.includes('EPERM') ||
|
|
2213
|
+
error.message.includes('ENOENT'))) {
|
|
2214
|
+
// Silently ignore filesystem errors - caching is optional
|
|
2215
|
+
return;
|
|
2216
|
+
}
|
|
2217
|
+
else {
|
|
2218
|
+
// Re-throw other unexpected errors
|
|
2219
|
+
throw error;
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2203
2222
|
}
|
|
2204
2223
|
/**
|
|
2205
2224
|
* Removes the key/value pair with the given key from the storage, if a key/value pair with the given key exists.
|
|
@@ -7706,7 +7725,23 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
7706
7725
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
7707
7726
|
const rootDirname = join(process.cwd(), DEFAULT_DOWNLOAD_CACHE_DIRNAME);
|
|
7708
7727
|
const filepath = join(...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), `${basename.substring(0, MAX_FILENAME_LENGTH)}.${mimeTypeToExtension(mimeType)}`);
|
|
7709
|
-
|
|
7728
|
+
// Note: Try to create cache directory, but don't fail if filesystem has issues
|
|
7729
|
+
try {
|
|
7730
|
+
await tools.fs.mkdir(dirname(join(rootDirname, filepath)), { recursive: true });
|
|
7731
|
+
}
|
|
7732
|
+
catch (error) {
|
|
7733
|
+
// Note: If we can't create cache directory, we'll handle it when trying to write the file
|
|
7734
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
7735
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
7736
|
+
error.message.includes('read-only') ||
|
|
7737
|
+
error.message.includes('EACCES') ||
|
|
7738
|
+
error.message.includes('EPERM') ||
|
|
7739
|
+
error.message.includes('ENOENT'))) ;
|
|
7740
|
+
else {
|
|
7741
|
+
// Re-throw other unexpected errors
|
|
7742
|
+
throw error;
|
|
7743
|
+
}
|
|
7744
|
+
}
|
|
7710
7745
|
const fileContent = Buffer.from(await response.arrayBuffer());
|
|
7711
7746
|
if (fileContent.length > DEFAULT_MAX_FILE_SIZE /* <- TODO: Allow to pass different value to remote server */) {
|
|
7712
7747
|
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.`);
|
|
@@ -7721,7 +7756,8 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
7721
7756
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
7722
7757
|
error.message.includes('read-only') ||
|
|
7723
7758
|
error.message.includes('EACCES') ||
|
|
7724
|
-
error.message.includes('EPERM')
|
|
7759
|
+
error.message.includes('EPERM') ||
|
|
7760
|
+
error.message.includes('ENOENT'))) {
|
|
7725
7761
|
// Return a handler that works directly with the downloaded content
|
|
7726
7762
|
return {
|
|
7727
7763
|
source: name,
|
|
@@ -13367,7 +13403,8 @@ async function $getCompiledBook(tools, pipelineSource, options) {
|
|
|
13367
13403
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
13368
13404
|
error.message.includes('read-only') ||
|
|
13369
13405
|
error.message.includes('EACCES') ||
|
|
13370
|
-
error.message.includes('EPERM')
|
|
13406
|
+
error.message.includes('EPERM') ||
|
|
13407
|
+
error.message.includes('ENOENT'))) ;
|
|
13371
13408
|
else {
|
|
13372
13409
|
// Re-throw other unexpected errors
|
|
13373
13410
|
throw error;
|
|
@@ -15862,6 +15899,18 @@ const _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
|
15862
15899
|
const OPENAI_MODELS = exportJson({
|
|
15863
15900
|
name: 'OPENAI_MODELS',
|
|
15864
15901
|
value: [
|
|
15902
|
+
/**/
|
|
15903
|
+
{
|
|
15904
|
+
modelVariant: 'CHAT',
|
|
15905
|
+
modelTitle: 'gpt-5',
|
|
15906
|
+
modelName: 'gpt-5',
|
|
15907
|
+
modelDescription: "OpenAI's most advanced language model with unprecedented reasoning capabilities and 200K context window. Features revolutionary improvements in complex problem-solving, scientific reasoning, and creative tasks. Demonstrates human-level performance across diverse domains with enhanced safety measures and alignment. Represents the next generation of AI with superior understanding, nuanced responses, and advanced multimodal capabilities.",
|
|
15908
|
+
pricing: {
|
|
15909
|
+
prompt: pricing(`$10.00 / 1M tokens`),
|
|
15910
|
+
output: pricing(`$30.00 / 1M tokens`),
|
|
15911
|
+
},
|
|
15912
|
+
},
|
|
15913
|
+
/**/
|
|
15865
15914
|
/*/
|
|
15866
15915
|
{
|
|
15867
15916
|
modelTitle: 'dall-e-3',
|
|
@@ -18268,7 +18317,7 @@ class OpenAiExecutionTools extends OpenAiCompatibleExecutionTools {
|
|
|
18268
18317
|
* Default model for chat variant.
|
|
18269
18318
|
*/
|
|
18270
18319
|
getDefaultChatModel() {
|
|
18271
|
-
return this.getDefaultModel('gpt-
|
|
18320
|
+
return this.getDefaultModel('gpt-5');
|
|
18272
18321
|
}
|
|
18273
18322
|
/**
|
|
18274
18323
|
* Default model for completion variant.
|
|
@@ -18667,7 +18716,23 @@ async function getScraperIntermediateSource(source, options) {
|
|
|
18667
18716
|
.join('/') +
|
|
18668
18717
|
'.' +
|
|
18669
18718
|
extension;
|
|
18670
|
-
|
|
18719
|
+
// Note: Try to create cache directory, but don't fail if filesystem has issues
|
|
18720
|
+
try {
|
|
18721
|
+
await mkdir(dirname(cacheFilename), { recursive: true });
|
|
18722
|
+
}
|
|
18723
|
+
catch (error) {
|
|
18724
|
+
// Note: If we can't create cache directory, continue without it
|
|
18725
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
18726
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
18727
|
+
error.message.includes('read-only') ||
|
|
18728
|
+
error.message.includes('EACCES') ||
|
|
18729
|
+
error.message.includes('EPERM') ||
|
|
18730
|
+
error.message.includes('ENOENT'))) ;
|
|
18731
|
+
else {
|
|
18732
|
+
// Re-throw other unexpected errors
|
|
18733
|
+
throw error;
|
|
18734
|
+
}
|
|
18735
|
+
}
|
|
18671
18736
|
let isDestroyed = true;
|
|
18672
18737
|
const fileHandler = {
|
|
18673
18738
|
filename: cacheFilename,
|
|
@@ -19527,7 +19592,8 @@ class MarkitdownScraper {
|
|
|
19527
19592
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
19528
19593
|
error.message.includes('read-only') ||
|
|
19529
19594
|
error.message.includes('EACCES') ||
|
|
19530
|
-
error.message.includes('EPERM')
|
|
19595
|
+
error.message.includes('EPERM') ||
|
|
19596
|
+
error.message.includes('ENOENT'))) ;
|
|
19531
19597
|
else {
|
|
19532
19598
|
// Re-throw other unexpected errors
|
|
19533
19599
|
throw error;
|
|
@@ -19830,7 +19896,8 @@ class WebsiteScraper {
|
|
|
19830
19896
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
19831
19897
|
error.message.includes('read-only') ||
|
|
19832
19898
|
error.message.includes('EACCES') ||
|
|
19833
|
-
error.message.includes('EPERM')
|
|
19899
|
+
error.message.includes('EPERM') ||
|
|
19900
|
+
error.message.includes('ENOENT'))) ;
|
|
19834
19901
|
else {
|
|
19835
19902
|
// Re-throw other unexpected errors
|
|
19836
19903
|
throw error;
|