@promptbook/cli 0.100.0-3 → 0.100.0-31
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 +343 -94
- 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 +1 -1
- package/umd/index.umd.js +343 -94
- 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-31';
|
|
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.
|
|
@@ -6374,7 +6393,7 @@ function templateParameters(template, parameters) {
|
|
|
6374
6393
|
*/
|
|
6375
6394
|
async function executeAttempts(options) {
|
|
6376
6395
|
const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
|
|
6377
|
-
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, } = options;
|
|
6396
|
+
preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
|
|
6378
6397
|
const $ongoingTaskResult = {
|
|
6379
6398
|
$result: null,
|
|
6380
6399
|
$resultString: null,
|
|
@@ -6618,6 +6637,10 @@ async function executeAttempts(options) {
|
|
|
6618
6637
|
result: $ongoingTaskResult.$resultString,
|
|
6619
6638
|
error: error,
|
|
6620
6639
|
});
|
|
6640
|
+
// Report failed attempt
|
|
6641
|
+
onProgress({
|
|
6642
|
+
errors: [error],
|
|
6643
|
+
});
|
|
6621
6644
|
}
|
|
6622
6645
|
finally {
|
|
6623
6646
|
if (!isJokerAttempt &&
|
|
@@ -7706,7 +7729,23 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
7706
7729
|
// <- TODO: [🥬] Encapsulate sha256 to some private utility function
|
|
7707
7730
|
const rootDirname = join(process.cwd(), DEFAULT_DOWNLOAD_CACHE_DIRNAME);
|
|
7708
7731
|
const filepath = join(...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), `${basename.substring(0, MAX_FILENAME_LENGTH)}.${mimeTypeToExtension(mimeType)}`);
|
|
7709
|
-
|
|
7732
|
+
// Note: Try to create cache directory, but don't fail if filesystem has issues
|
|
7733
|
+
try {
|
|
7734
|
+
await tools.fs.mkdir(dirname(join(rootDirname, filepath)), { recursive: true });
|
|
7735
|
+
}
|
|
7736
|
+
catch (error) {
|
|
7737
|
+
// Note: If we can't create cache directory, we'll handle it when trying to write the file
|
|
7738
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
7739
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
7740
|
+
error.message.includes('read-only') ||
|
|
7741
|
+
error.message.includes('EACCES') ||
|
|
7742
|
+
error.message.includes('EPERM') ||
|
|
7743
|
+
error.message.includes('ENOENT'))) ;
|
|
7744
|
+
else {
|
|
7745
|
+
// Re-throw other unexpected errors
|
|
7746
|
+
throw error;
|
|
7747
|
+
}
|
|
7748
|
+
}
|
|
7710
7749
|
const fileContent = Buffer.from(await response.arrayBuffer());
|
|
7711
7750
|
if (fileContent.length > DEFAULT_MAX_FILE_SIZE /* <- TODO: Allow to pass different value to remote server */) {
|
|
7712
7751
|
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 +7760,8 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
7721
7760
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
7722
7761
|
error.message.includes('read-only') ||
|
|
7723
7762
|
error.message.includes('EACCES') ||
|
|
7724
|
-
error.message.includes('EPERM')
|
|
7763
|
+
error.message.includes('EPERM') ||
|
|
7764
|
+
error.message.includes('ENOENT'))) {
|
|
7725
7765
|
// Return a handler that works directly with the downloaded content
|
|
7726
7766
|
return {
|
|
7727
7767
|
source: name,
|
|
@@ -13367,7 +13407,8 @@ async function $getCompiledBook(tools, pipelineSource, options) {
|
|
|
13367
13407
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
13368
13408
|
error.message.includes('read-only') ||
|
|
13369
13409
|
error.message.includes('EACCES') ||
|
|
13370
|
-
error.message.includes('EPERM')
|
|
13410
|
+
error.message.includes('EPERM') ||
|
|
13411
|
+
error.message.includes('ENOENT'))) ;
|
|
13371
13412
|
else {
|
|
13372
13413
|
// Re-throw other unexpected errors
|
|
13373
13414
|
throw error;
|
|
@@ -15298,7 +15339,7 @@ function pricing(value) {
|
|
|
15298
15339
|
/**
|
|
15299
15340
|
* List of available Anthropic Claude models with pricing
|
|
15300
15341
|
*
|
|
15301
|
-
* Note:
|
|
15342
|
+
* Note: Synced with official API docs at 2025-08-20
|
|
15302
15343
|
*
|
|
15303
15344
|
* @see https://docs.anthropic.com/en/docs/models-overview
|
|
15304
15345
|
* @public exported from `@promptbook/anthropic-claude`
|
|
@@ -15308,12 +15349,52 @@ const ANTHROPIC_CLAUDE_MODELS = exportJson({
|
|
|
15308
15349
|
value: [
|
|
15309
15350
|
{
|
|
15310
15351
|
modelVariant: 'CHAT',
|
|
15311
|
-
modelTitle: 'Claude
|
|
15312
|
-
modelName: 'claude-
|
|
15313
|
-
modelDescription: '
|
|
15352
|
+
modelTitle: 'Claude Opus 4.1',
|
|
15353
|
+
modelName: 'claude-opus-4-1-20250805',
|
|
15354
|
+
modelDescription: 'Most powerful and capable Claude model with 200K token context window. Features superior reasoning capabilities, exceptional coding abilities, and advanced multimodal understanding. Sets new standards in complex reasoning and analytical tasks with enhanced safety measures. Ideal for the most demanding enterprise applications requiring maximum intelligence.',
|
|
15314
15355
|
pricing: {
|
|
15315
|
-
prompt: pricing(`$
|
|
15316
|
-
output: pricing(`$
|
|
15356
|
+
prompt: pricing(`$15.00 / 1M tokens`),
|
|
15357
|
+
output: pricing(`$75.00 / 1M tokens`),
|
|
15358
|
+
},
|
|
15359
|
+
},
|
|
15360
|
+
{
|
|
15361
|
+
modelVariant: 'CHAT',
|
|
15362
|
+
modelTitle: 'Claude Opus 4',
|
|
15363
|
+
modelName: 'claude-opus-4-20250514',
|
|
15364
|
+
modelDescription: 'Previous flagship Claude model with 200K token context window. Features very high intelligence and capability with exceptional performance across reasoning, coding, and creative tasks. Maintains strong safety guardrails while delivering sophisticated outputs for complex professional applications.',
|
|
15365
|
+
pricing: {
|
|
15366
|
+
prompt: pricing(`$15.00 / 1M tokens`),
|
|
15367
|
+
output: pricing(`$75.00 / 1M tokens`),
|
|
15368
|
+
},
|
|
15369
|
+
},
|
|
15370
|
+
{
|
|
15371
|
+
modelVariant: 'CHAT',
|
|
15372
|
+
modelTitle: 'Claude Sonnet 4',
|
|
15373
|
+
modelName: 'claude-sonnet-4-20250514',
|
|
15374
|
+
modelDescription: 'High-performance Claude model with exceptional reasoning capabilities and 200K token context window (1M context beta available). Features balanced intelligence and efficiency with enhanced multimodal understanding. Offers optimal performance for most enterprise applications requiring sophisticated AI capabilities.',
|
|
15375
|
+
pricing: {
|
|
15376
|
+
prompt: pricing(`$3.00 / 1M tokens`),
|
|
15377
|
+
output: pricing(`$15.00 / 1M tokens`),
|
|
15378
|
+
},
|
|
15379
|
+
},
|
|
15380
|
+
{
|
|
15381
|
+
modelVariant: 'CHAT',
|
|
15382
|
+
modelTitle: 'Claude Sonnet 3.7',
|
|
15383
|
+
modelName: 'claude-3-7-sonnet-20250219',
|
|
15384
|
+
modelDescription: 'High-performance Claude model with early extended thinking capabilities and 200K token context window. Features enhanced reasoning chains, improved factual accuracy, and toggleable extended thinking for complex problem-solving. Ideal for applications requiring deep analytical capabilities.',
|
|
15385
|
+
pricing: {
|
|
15386
|
+
prompt: pricing(`$3.00 / 1M tokens`),
|
|
15387
|
+
output: pricing(`$15.00 / 1M tokens`),
|
|
15388
|
+
},
|
|
15389
|
+
},
|
|
15390
|
+
{
|
|
15391
|
+
modelVariant: 'CHAT',
|
|
15392
|
+
modelTitle: 'Claude Haiku 3.5',
|
|
15393
|
+
modelName: 'claude-3-5-haiku-20241022',
|
|
15394
|
+
modelDescription: 'Fastest Claude model with 200K token context window optimized for intelligence at blazing speeds. Features enhanced reasoning and contextual understanding while maintaining sub-second response times. Perfect for real-time applications, customer-facing deployments, and high-throughput services.',
|
|
15395
|
+
pricing: {
|
|
15396
|
+
prompt: pricing(`$0.80 / 1M tokens`),
|
|
15397
|
+
output: pricing(`$4.00 / 1M tokens`),
|
|
15317
15398
|
},
|
|
15318
15399
|
},
|
|
15319
15400
|
{
|
|
@@ -15576,8 +15657,7 @@ class AnthropicClaudeExecutionTools {
|
|
|
15576
15657
|
const rawPromptContent = templateParameters(content, { ...parameters, modelName });
|
|
15577
15658
|
const rawRequest = {
|
|
15578
15659
|
model: modelRequirements.modelName || this.getDefaultChatModel().modelName,
|
|
15579
|
-
max_tokens: modelRequirements.maxTokens ||
|
|
15580
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
15660
|
+
max_tokens: modelRequirements.maxTokens || 8192,
|
|
15581
15661
|
temperature: modelRequirements.temperature,
|
|
15582
15662
|
system: modelRequirements.systemMessage,
|
|
15583
15663
|
messages: [
|
|
@@ -15636,59 +15716,6 @@ class AnthropicClaudeExecutionTools {
|
|
|
15636
15716
|
},
|
|
15637
15717
|
});
|
|
15638
15718
|
}
|
|
15639
|
-
/**
|
|
15640
|
-
* Calls Anthropic Claude API to use a completion model.
|
|
15641
|
-
*/
|
|
15642
|
-
async callCompletionModel(prompt) {
|
|
15643
|
-
if (this.options.isVerbose) {
|
|
15644
|
-
console.info('🖋 Anthropic Claude callCompletionModel call');
|
|
15645
|
-
}
|
|
15646
|
-
const { content, parameters, modelRequirements } = prompt;
|
|
15647
|
-
if (modelRequirements.modelVariant !== 'COMPLETION') {
|
|
15648
|
-
throw new PipelineExecutionError('Use callCompletionModel only for COMPLETION variant');
|
|
15649
|
-
}
|
|
15650
|
-
const client = await this.getClient();
|
|
15651
|
-
const modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName;
|
|
15652
|
-
const rawPromptContent = templateParameters(content, { ...parameters, modelName });
|
|
15653
|
-
const rawRequest = {
|
|
15654
|
-
model: modelName,
|
|
15655
|
-
max_tokens_to_sample: modelRequirements.maxTokens || 2000,
|
|
15656
|
-
temperature: modelRequirements.temperature,
|
|
15657
|
-
prompt: rawPromptContent,
|
|
15658
|
-
};
|
|
15659
|
-
const start = $getCurrentDate();
|
|
15660
|
-
const rawResponse = await this.limiter
|
|
15661
|
-
.schedule(() => client.completions.create(rawRequest))
|
|
15662
|
-
.catch((error) => {
|
|
15663
|
-
if (this.options.isVerbose) {
|
|
15664
|
-
console.info(colors.bgRed('error'), error);
|
|
15665
|
-
}
|
|
15666
|
-
throw error;
|
|
15667
|
-
});
|
|
15668
|
-
if (this.options.isVerbose) {
|
|
15669
|
-
console.info(colors.bgWhite('rawResponse'), JSON.stringify(rawResponse, null, 4));
|
|
15670
|
-
}
|
|
15671
|
-
if (!rawResponse.completion) {
|
|
15672
|
-
throw new PipelineExecutionError('No completion from Anthropic Claude');
|
|
15673
|
-
}
|
|
15674
|
-
const resultContent = rawResponse.completion;
|
|
15675
|
-
const complete = $getCurrentDate();
|
|
15676
|
-
const usage = computeAnthropicClaudeUsage(rawPromptContent, resultContent, rawResponse);
|
|
15677
|
-
return exportJson({
|
|
15678
|
-
name: 'promptResult',
|
|
15679
|
-
message: `Result of \`AnthropicClaudeExecutionTools.callCompletionModel\``,
|
|
15680
|
-
order: [],
|
|
15681
|
-
value: {
|
|
15682
|
-
content: resultContent,
|
|
15683
|
-
modelName: rawResponse.model || modelName,
|
|
15684
|
-
timing: { start, complete },
|
|
15685
|
-
usage,
|
|
15686
|
-
rawPromptContent,
|
|
15687
|
-
rawRequest,
|
|
15688
|
-
rawResponse,
|
|
15689
|
-
},
|
|
15690
|
-
});
|
|
15691
|
-
}
|
|
15692
15719
|
// <- Note: [🤖] callXxxModel
|
|
15693
15720
|
/**
|
|
15694
15721
|
* Get the model that should be used as default
|
|
@@ -15710,7 +15737,7 @@ class AnthropicClaudeExecutionTools {
|
|
|
15710
15737
|
* Default model for chat variant.
|
|
15711
15738
|
*/
|
|
15712
15739
|
getDefaultChatModel() {
|
|
15713
|
-
return this.getDefaultModel('claude-
|
|
15740
|
+
return this.getDefaultModel('claude-sonnet-4-20250514');
|
|
15714
15741
|
}
|
|
15715
15742
|
}
|
|
15716
15743
|
/**
|
|
@@ -15853,7 +15880,7 @@ const _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
|
15853
15880
|
/**
|
|
15854
15881
|
* List of available OpenAI models with pricing
|
|
15855
15882
|
*
|
|
15856
|
-
* Note:
|
|
15883
|
+
* Note: Synced with official API docs at 2025-08-20
|
|
15857
15884
|
*
|
|
15858
15885
|
* @see https://platform.openai.com/docs/models/
|
|
15859
15886
|
* @see https://openai.com/api/pricing/
|
|
@@ -15862,6 +15889,138 @@ const _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
|
15862
15889
|
const OPENAI_MODELS = exportJson({
|
|
15863
15890
|
name: 'OPENAI_MODELS',
|
|
15864
15891
|
value: [
|
|
15892
|
+
/**/
|
|
15893
|
+
{
|
|
15894
|
+
modelVariant: 'CHAT',
|
|
15895
|
+
modelTitle: 'gpt-5',
|
|
15896
|
+
modelName: 'gpt-5',
|
|
15897
|
+
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.",
|
|
15898
|
+
pricing: {
|
|
15899
|
+
prompt: pricing(`$1.25 / 1M tokens`),
|
|
15900
|
+
output: pricing(`$10.00 / 1M tokens`),
|
|
15901
|
+
},
|
|
15902
|
+
},
|
|
15903
|
+
/**/
|
|
15904
|
+
/**/
|
|
15905
|
+
{
|
|
15906
|
+
modelVariant: 'CHAT',
|
|
15907
|
+
modelTitle: 'gpt-5-mini',
|
|
15908
|
+
modelName: 'gpt-5-mini',
|
|
15909
|
+
modelDescription: "A faster, cost-efficient version of GPT-5 for well-defined tasks with 200K context window. Maintains core GPT-5 capabilities while offering 5x faster inference and significantly lower costs. Features enhanced instruction following and reduced latency for production applications requiring quick responses with high quality.",
|
|
15910
|
+
pricing: {
|
|
15911
|
+
prompt: pricing(`$0.25 / 1M tokens`),
|
|
15912
|
+
output: pricing(`$2.00 / 1M tokens`),
|
|
15913
|
+
},
|
|
15914
|
+
},
|
|
15915
|
+
/**/
|
|
15916
|
+
/**/
|
|
15917
|
+
{
|
|
15918
|
+
modelVariant: 'CHAT',
|
|
15919
|
+
modelTitle: 'gpt-5-nano',
|
|
15920
|
+
modelName: 'gpt-5-nano',
|
|
15921
|
+
modelDescription: "The fastest, most cost-efficient version of GPT-5 with 200K context window. Optimized for summarization, classification, and simple reasoning tasks. Features 10x faster inference than base GPT-5 while maintaining good quality for straightforward applications. Ideal for high-volume, cost-sensitive deployments.",
|
|
15922
|
+
pricing: {
|
|
15923
|
+
prompt: pricing(`$0.05 / 1M tokens`),
|
|
15924
|
+
output: pricing(`$0.40 / 1M tokens`),
|
|
15925
|
+
},
|
|
15926
|
+
},
|
|
15927
|
+
/**/
|
|
15928
|
+
/**/
|
|
15929
|
+
{
|
|
15930
|
+
modelVariant: 'CHAT',
|
|
15931
|
+
modelTitle: 'gpt-4.1',
|
|
15932
|
+
modelName: 'gpt-4.1',
|
|
15933
|
+
modelDescription: "Smartest non-reasoning model with 128K context window. Enhanced version of GPT-4 with improved instruction following, better factual accuracy, and reduced hallucinations. Features advanced function calling capabilities and superior performance on coding tasks. Ideal for applications requiring high intelligence without reasoning overhead.",
|
|
15934
|
+
pricing: {
|
|
15935
|
+
prompt: pricing(`$3.00 / 1M tokens`),
|
|
15936
|
+
output: pricing(`$12.00 / 1M tokens`),
|
|
15937
|
+
},
|
|
15938
|
+
},
|
|
15939
|
+
/**/
|
|
15940
|
+
/**/
|
|
15941
|
+
{
|
|
15942
|
+
modelVariant: 'CHAT',
|
|
15943
|
+
modelTitle: 'gpt-4.1-mini',
|
|
15944
|
+
modelName: 'gpt-4.1-mini',
|
|
15945
|
+
modelDescription: "Smaller, faster version of GPT-4.1 with 128K context window. Balances intelligence and efficiency with 3x faster inference than base GPT-4.1. Maintains strong capabilities across text generation, reasoning, and coding while offering better cost-performance ratio for most applications.",
|
|
15946
|
+
pricing: {
|
|
15947
|
+
prompt: pricing(`$0.80 / 1M tokens`),
|
|
15948
|
+
output: pricing(`$3.20 / 1M tokens`),
|
|
15949
|
+
},
|
|
15950
|
+
},
|
|
15951
|
+
/**/
|
|
15952
|
+
/**/
|
|
15953
|
+
{
|
|
15954
|
+
modelVariant: 'CHAT',
|
|
15955
|
+
modelTitle: 'gpt-4.1-nano',
|
|
15956
|
+
modelName: 'gpt-4.1-nano',
|
|
15957
|
+
modelDescription: "Fastest, most cost-efficient version of GPT-4.1 with 128K context window. Optimized for high-throughput applications requiring good quality at minimal cost. Features 5x faster inference than GPT-4.1 while maintaining adequate performance for most general-purpose tasks.",
|
|
15958
|
+
pricing: {
|
|
15959
|
+
prompt: pricing(`$0.20 / 1M tokens`),
|
|
15960
|
+
output: pricing(`$0.80 / 1M tokens`),
|
|
15961
|
+
},
|
|
15962
|
+
},
|
|
15963
|
+
/**/
|
|
15964
|
+
/**/
|
|
15965
|
+
{
|
|
15966
|
+
modelVariant: 'CHAT',
|
|
15967
|
+
modelTitle: 'o3',
|
|
15968
|
+
modelName: 'o3',
|
|
15969
|
+
modelDescription: "Advanced reasoning model with 128K context window specializing in complex logical, mathematical, and analytical tasks. Successor to o1 with enhanced step-by-step problem-solving capabilities and superior performance on STEM-focused problems. Ideal for professional applications requiring deep analytical thinking and precise reasoning.",
|
|
15970
|
+
pricing: {
|
|
15971
|
+
prompt: pricing(`$15.00 / 1M tokens`),
|
|
15972
|
+
output: pricing(`$60.00 / 1M tokens`),
|
|
15973
|
+
},
|
|
15974
|
+
},
|
|
15975
|
+
/**/
|
|
15976
|
+
/**/
|
|
15977
|
+
{
|
|
15978
|
+
modelVariant: 'CHAT',
|
|
15979
|
+
modelTitle: 'o3-pro',
|
|
15980
|
+
modelName: 'o3-pro',
|
|
15981
|
+
modelDescription: "Enhanced version of o3 with more compute allocated for better responses on the most challenging problems. Features extended reasoning time and improved accuracy on complex analytical tasks. Designed for applications where maximum reasoning quality is more important than response speed.",
|
|
15982
|
+
pricing: {
|
|
15983
|
+
prompt: pricing(`$30.00 / 1M tokens`),
|
|
15984
|
+
output: pricing(`$120.00 / 1M tokens`),
|
|
15985
|
+
},
|
|
15986
|
+
},
|
|
15987
|
+
/**/
|
|
15988
|
+
/**/
|
|
15989
|
+
{
|
|
15990
|
+
modelVariant: 'CHAT',
|
|
15991
|
+
modelTitle: 'o4-mini',
|
|
15992
|
+
modelName: 'o4-mini',
|
|
15993
|
+
modelDescription: "Fast, cost-efficient reasoning model with 128K context window. Successor to o1-mini with improved analytical capabilities while maintaining speed advantages. Features enhanced mathematical reasoning and logical problem-solving at significantly lower cost than full reasoning models.",
|
|
15994
|
+
pricing: {
|
|
15995
|
+
prompt: pricing(`$4.00 / 1M tokens`),
|
|
15996
|
+
output: pricing(`$16.00 / 1M tokens`),
|
|
15997
|
+
},
|
|
15998
|
+
},
|
|
15999
|
+
/**/
|
|
16000
|
+
/**/
|
|
16001
|
+
{
|
|
16002
|
+
modelVariant: 'CHAT',
|
|
16003
|
+
modelTitle: 'o3-deep-research',
|
|
16004
|
+
modelName: 'o3-deep-research',
|
|
16005
|
+
modelDescription: "Most powerful deep research model with 128K context window. Specialized for comprehensive research tasks, literature analysis, and complex information synthesis. Features advanced citation capabilities and enhanced factual accuracy for academic and professional research applications.",
|
|
16006
|
+
pricing: {
|
|
16007
|
+
prompt: pricing(`$25.00 / 1M tokens`),
|
|
16008
|
+
output: pricing(`$100.00 / 1M tokens`),
|
|
16009
|
+
},
|
|
16010
|
+
},
|
|
16011
|
+
/**/
|
|
16012
|
+
/**/
|
|
16013
|
+
{
|
|
16014
|
+
modelVariant: 'CHAT',
|
|
16015
|
+
modelTitle: 'o4-mini-deep-research',
|
|
16016
|
+
modelName: 'o4-mini-deep-research',
|
|
16017
|
+
modelDescription: "Faster, more affordable deep research model with 128K context window. Balances research capabilities with cost efficiency, offering good performance on literature review, fact-checking, and information synthesis tasks at a more accessible price point.",
|
|
16018
|
+
pricing: {
|
|
16019
|
+
prompt: pricing(`$12.00 / 1M tokens`),
|
|
16020
|
+
output: pricing(`$48.00 / 1M tokens`),
|
|
16021
|
+
},
|
|
16022
|
+
},
|
|
16023
|
+
/**/
|
|
15865
16024
|
/*/
|
|
15866
16025
|
{
|
|
15867
16026
|
modelTitle: 'dall-e-3',
|
|
@@ -16382,7 +16541,6 @@ class AzureOpenAiExecutionTools {
|
|
|
16382
16541
|
const modelName = prompt.modelRequirements.modelName || this.options.deploymentName;
|
|
16383
16542
|
const modelSettings = {
|
|
16384
16543
|
maxTokens: modelRequirements.maxTokens,
|
|
16385
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
16386
16544
|
temperature: modelRequirements.temperature,
|
|
16387
16545
|
user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
16388
16546
|
// <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
|
|
@@ -16488,8 +16646,7 @@ class AzureOpenAiExecutionTools {
|
|
|
16488
16646
|
try {
|
|
16489
16647
|
const modelName = prompt.modelRequirements.modelName || this.options.deploymentName;
|
|
16490
16648
|
const modelSettings = {
|
|
16491
|
-
maxTokens: modelRequirements.maxTokens
|
|
16492
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
16649
|
+
maxTokens: modelRequirements.maxTokens,
|
|
16493
16650
|
temperature: modelRequirements.temperature,
|
|
16494
16651
|
user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
16495
16652
|
// <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
|
|
@@ -16855,7 +17012,7 @@ function createExecutionToolsFromVercelProvider(options) {
|
|
|
16855
17012
|
/**
|
|
16856
17013
|
* List of available Deepseek models with descriptions
|
|
16857
17014
|
*
|
|
16858
|
-
* Note:
|
|
17015
|
+
* Note: Synced with official API docs at 2025-08-20
|
|
16859
17016
|
*
|
|
16860
17017
|
* @see https://www.deepseek.com/models
|
|
16861
17018
|
* @public exported from `@promptbook/deepseek`
|
|
@@ -16865,12 +17022,32 @@ const DEEPSEEK_MODELS = exportJson({
|
|
|
16865
17022
|
value: [
|
|
16866
17023
|
{
|
|
16867
17024
|
modelVariant: 'CHAT',
|
|
16868
|
-
modelTitle: '
|
|
16869
|
-
modelName: 'deepseek-chat
|
|
16870
|
-
modelDescription: 'Latest flagship general-purpose model with
|
|
17025
|
+
modelTitle: 'DeepSeek V3',
|
|
17026
|
+
modelName: 'deepseek-chat',
|
|
17027
|
+
modelDescription: 'Latest flagship general-purpose model with 128K context window. Features exceptional reasoning capabilities, advanced code generation, and strong performance across diverse domains. Offers competitive performance with leading models while maintaining cost efficiency. Ideal for complex reasoning, coding, and knowledge-intensive tasks.',
|
|
16871
17028
|
pricing: {
|
|
16872
|
-
prompt: pricing(`$
|
|
16873
|
-
output: pricing(`$
|
|
17029
|
+
prompt: pricing(`$0.14 / 1M tokens`),
|
|
17030
|
+
output: pricing(`$0.28 / 1M tokens`),
|
|
17031
|
+
},
|
|
17032
|
+
},
|
|
17033
|
+
{
|
|
17034
|
+
modelVariant: 'CHAT',
|
|
17035
|
+
modelTitle: 'DeepSeek R1',
|
|
17036
|
+
modelName: 'deepseek-reasoner',
|
|
17037
|
+
modelDescription: 'Advanced reasoning model with 128K context window specializing in complex problem-solving and analytical thinking. Features explicit reasoning chains, enhanced mathematical capabilities, and superior performance on STEM tasks. Designed for applications requiring deep analytical reasoning and step-by-step problem solving.',
|
|
17038
|
+
pricing: {
|
|
17039
|
+
prompt: pricing(`$0.55 / 1M tokens`),
|
|
17040
|
+
output: pricing(`$2.19 / 1M tokens`),
|
|
17041
|
+
},
|
|
17042
|
+
},
|
|
17043
|
+
{
|
|
17044
|
+
modelVariant: 'CHAT',
|
|
17045
|
+
modelTitle: 'DeepSeek Coder V2',
|
|
17046
|
+
modelName: 'deepseek-coder',
|
|
17047
|
+
modelDescription: 'Specialized coding model with 128K context window optimized for software development tasks. Features exceptional code generation, debugging, and refactoring capabilities across 40+ programming languages. Particularly strong in understanding complex codebases and implementing solutions based on natural language specifications.',
|
|
17048
|
+
pricing: {
|
|
17049
|
+
prompt: pricing(`$0.14 / 1M tokens`),
|
|
17050
|
+
output: pricing(`$0.28 / 1M tokens`),
|
|
16874
17051
|
},
|
|
16875
17052
|
},
|
|
16876
17053
|
{
|
|
@@ -17104,7 +17281,7 @@ const _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
|
|
|
17104
17281
|
/**
|
|
17105
17282
|
* List of available Google models with descriptions
|
|
17106
17283
|
*
|
|
17107
|
-
* Note:
|
|
17284
|
+
* Note: Synced with official API docs at 2025-08-20
|
|
17108
17285
|
*
|
|
17109
17286
|
* @see https://ai.google.dev/models/gemini
|
|
17110
17287
|
* @public exported from `@promptbook/google`
|
|
@@ -17115,11 +17292,51 @@ const GOOGLE_MODELS = exportJson({
|
|
|
17115
17292
|
{
|
|
17116
17293
|
modelVariant: 'CHAT',
|
|
17117
17294
|
modelTitle: 'Gemini 2.5 Pro',
|
|
17118
|
-
modelName: 'gemini-2.5-pro
|
|
17119
|
-
modelDescription: '
|
|
17295
|
+
modelName: 'gemini-2.5-pro',
|
|
17296
|
+
modelDescription: 'State-of-the-art thinking model with 1M token context window capable of reasoning over complex problems in code, math, and STEM. Features enhanced thinking capabilities, advanced multimodal understanding, and superior performance on analytical tasks. Ideal for complex enterprise applications requiring maximum intelligence and reasoning.',
|
|
17120
17297
|
pricing: {
|
|
17121
|
-
prompt: pricing(`$
|
|
17122
|
-
output: pricing(`$
|
|
17298
|
+
prompt: pricing(`$7.00 / 1M tokens`),
|
|
17299
|
+
output: pricing(`$21.00 / 1M tokens`),
|
|
17300
|
+
},
|
|
17301
|
+
},
|
|
17302
|
+
{
|
|
17303
|
+
modelVariant: 'CHAT',
|
|
17304
|
+
modelTitle: 'Gemini 2.5 Flash',
|
|
17305
|
+
modelName: 'gemini-2.5-flash',
|
|
17306
|
+
modelDescription: 'Best model in terms of price-performance with 1M token context window offering well-rounded capabilities. Features adaptive thinking, cost efficiency, and enhanced reasoning for large-scale processing. Ideal for low-latency, high-volume tasks that require thinking and agentic use cases.',
|
|
17307
|
+
pricing: {
|
|
17308
|
+
prompt: pricing(`$0.35 / 1M tokens`),
|
|
17309
|
+
output: pricing(`$1.05 / 1M tokens`),
|
|
17310
|
+
},
|
|
17311
|
+
},
|
|
17312
|
+
{
|
|
17313
|
+
modelVariant: 'CHAT',
|
|
17314
|
+
modelTitle: 'Gemini 2.5 Flash Lite',
|
|
17315
|
+
modelName: 'gemini-2.5-flash-lite',
|
|
17316
|
+
modelDescription: 'Cost-efficient Gemini 2.5 Flash model optimized for high throughput with 1M token context window. Features thinking capabilities while maintaining the most cost-efficient pricing. Perfect for real-time, low-latency use cases requiring good quality at scale.',
|
|
17317
|
+
pricing: {
|
|
17318
|
+
prompt: pricing(`$0.20 / 1M tokens`),
|
|
17319
|
+
output: pricing(`$0.60 / 1M tokens`),
|
|
17320
|
+
},
|
|
17321
|
+
},
|
|
17322
|
+
{
|
|
17323
|
+
modelVariant: 'CHAT',
|
|
17324
|
+
modelTitle: 'Gemini 2.0 Flash',
|
|
17325
|
+
modelName: 'gemini-2.0-flash',
|
|
17326
|
+
modelDescription: 'Next-generation model with 1M token context window delivering improved capabilities, superior speed, and realtime streaming. Features enhanced function calling, code execution, and search capabilities. Ideal for applications requiring cutting-edge AI capabilities with fast response times.',
|
|
17327
|
+
pricing: {
|
|
17328
|
+
prompt: pricing(`$0.25 / 1M tokens`),
|
|
17329
|
+
output: pricing(`$0.75 / 1M tokens`),
|
|
17330
|
+
},
|
|
17331
|
+
},
|
|
17332
|
+
{
|
|
17333
|
+
modelVariant: 'CHAT',
|
|
17334
|
+
modelTitle: 'Gemini 2.0 Flash Lite',
|
|
17335
|
+
modelName: 'gemini-2.0-flash-lite',
|
|
17336
|
+
modelDescription: 'Cost-efficient Gemini 2.0 Flash model optimized for low latency with 1M token context window. Balances performance and cost with enhanced efficiency for high-volume applications. Perfect for applications requiring good quality responses at minimal cost.',
|
|
17337
|
+
pricing: {
|
|
17338
|
+
prompt: pricing(`$0.15 / 1M tokens`),
|
|
17339
|
+
output: pricing(`$0.45 / 1M tokens`),
|
|
17123
17340
|
},
|
|
17124
17341
|
},
|
|
17125
17342
|
{
|
|
@@ -17520,7 +17737,6 @@ class OpenAiCompatibleExecutionTools {
|
|
|
17520
17737
|
const modelSettings = {
|
|
17521
17738
|
model: modelName,
|
|
17522
17739
|
max_tokens: modelRequirements.maxTokens,
|
|
17523
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
17524
17740
|
temperature: modelRequirements.temperature,
|
|
17525
17741
|
// <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
|
|
17526
17742
|
// <- Note: [🧆]
|
|
@@ -17616,8 +17832,7 @@ class OpenAiCompatibleExecutionTools {
|
|
|
17616
17832
|
const modelName = modelRequirements.modelName || this.getDefaultCompletionModel().modelName;
|
|
17617
17833
|
const modelSettings = {
|
|
17618
17834
|
model: modelName,
|
|
17619
|
-
max_tokens: modelRequirements.maxTokens
|
|
17620
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
17835
|
+
max_tokens: modelRequirements.maxTokens,
|
|
17621
17836
|
temperature: modelRequirements.temperature,
|
|
17622
17837
|
// <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
|
|
17623
17838
|
// <- Note: [🧆]
|
|
@@ -17766,7 +17981,7 @@ class OpenAiCompatibleExecutionTools {
|
|
|
17766
17981
|
/**
|
|
17767
17982
|
* List of available models in Ollama library
|
|
17768
17983
|
*
|
|
17769
|
-
* Note:
|
|
17984
|
+
* Note: Synced with official API docs at 2025-08-20
|
|
17770
17985
|
*
|
|
17771
17986
|
* @see https://ollama.com/library
|
|
17772
17987
|
* @public exported from `@promptbook/ollama`
|
|
@@ -17774,6 +17989,24 @@ class OpenAiCompatibleExecutionTools {
|
|
|
17774
17989
|
const OLLAMA_MODELS = exportJson({
|
|
17775
17990
|
name: 'OLLAMA_MODELS',
|
|
17776
17991
|
value: [
|
|
17992
|
+
{
|
|
17993
|
+
modelVariant: 'CHAT',
|
|
17994
|
+
modelTitle: 'llama3.3',
|
|
17995
|
+
modelName: 'llama3.3',
|
|
17996
|
+
modelDescription: 'Meta Llama 3.3 (70B parameters) with 128K context window. Latest generation foundation model with significantly enhanced reasoning, instruction following, and multilingual capabilities. Features improved performance on complex tasks and better factual accuracy compared to Llama 3.1.',
|
|
17997
|
+
},
|
|
17998
|
+
{
|
|
17999
|
+
modelVariant: 'CHAT',
|
|
18000
|
+
modelTitle: 'llama3.2',
|
|
18001
|
+
modelName: 'llama3.2',
|
|
18002
|
+
modelDescription: 'Meta Llama 3.2 (1B-90B parameters) with 128K context window. Enhanced model with improved reasoning capabilities, better instruction following, and multimodal support in larger variants. Features significant performance improvements over Llama 3.1 across diverse tasks.',
|
|
18003
|
+
},
|
|
18004
|
+
{
|
|
18005
|
+
modelVariant: 'CHAT',
|
|
18006
|
+
modelTitle: 'llama3.1',
|
|
18007
|
+
modelName: 'llama3.1',
|
|
18008
|
+
modelDescription: 'Meta Llama 3.1 (8B-405B parameters) with 128K context window. Advanced foundation model with enhanced reasoning, improved multilingual capabilities, and better performance on complex tasks. Features significant improvements in code generation and mathematical reasoning.',
|
|
18009
|
+
},
|
|
17777
18010
|
{
|
|
17778
18011
|
modelVariant: 'CHAT',
|
|
17779
18012
|
modelTitle: 'llama3',
|
|
@@ -18268,7 +18501,7 @@ class OpenAiExecutionTools extends OpenAiCompatibleExecutionTools {
|
|
|
18268
18501
|
* Default model for chat variant.
|
|
18269
18502
|
*/
|
|
18270
18503
|
getDefaultChatModel() {
|
|
18271
|
-
return this.getDefaultModel('gpt-
|
|
18504
|
+
return this.getDefaultModel('gpt-5');
|
|
18272
18505
|
}
|
|
18273
18506
|
/**
|
|
18274
18507
|
* Default model for completion variant.
|
|
@@ -18336,8 +18569,6 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
|
|
|
18336
18569
|
const modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName;
|
|
18337
18570
|
const modelSettings = {
|
|
18338
18571
|
model: modelName,
|
|
18339
|
-
max_tokens: modelRequirements.maxTokens,
|
|
18340
|
-
// <- TODO: [🌾] Make some global max cap for maxTokens
|
|
18341
18572
|
|
|
18342
18573
|
temperature: modelRequirements.temperature,
|
|
18343
18574
|
|
|
@@ -18667,7 +18898,23 @@ async function getScraperIntermediateSource(source, options) {
|
|
|
18667
18898
|
.join('/') +
|
|
18668
18899
|
'.' +
|
|
18669
18900
|
extension;
|
|
18670
|
-
|
|
18901
|
+
// Note: Try to create cache directory, but don't fail if filesystem has issues
|
|
18902
|
+
try {
|
|
18903
|
+
await mkdir(dirname(cacheFilename), { recursive: true });
|
|
18904
|
+
}
|
|
18905
|
+
catch (error) {
|
|
18906
|
+
// Note: If we can't create cache directory, continue without it
|
|
18907
|
+
// This handles read-only filesystems, permission issues, and missing parent directories
|
|
18908
|
+
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
18909
|
+
error.message.includes('read-only') ||
|
|
18910
|
+
error.message.includes('EACCES') ||
|
|
18911
|
+
error.message.includes('EPERM') ||
|
|
18912
|
+
error.message.includes('ENOENT'))) ;
|
|
18913
|
+
else {
|
|
18914
|
+
// Re-throw other unexpected errors
|
|
18915
|
+
throw error;
|
|
18916
|
+
}
|
|
18917
|
+
}
|
|
18671
18918
|
let isDestroyed = true;
|
|
18672
18919
|
const fileHandler = {
|
|
18673
18920
|
filename: cacheFilename,
|
|
@@ -19527,7 +19774,8 @@ class MarkitdownScraper {
|
|
|
19527
19774
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
19528
19775
|
error.message.includes('read-only') ||
|
|
19529
19776
|
error.message.includes('EACCES') ||
|
|
19530
|
-
error.message.includes('EPERM')
|
|
19777
|
+
error.message.includes('EPERM') ||
|
|
19778
|
+
error.message.includes('ENOENT'))) ;
|
|
19531
19779
|
else {
|
|
19532
19780
|
// Re-throw other unexpected errors
|
|
19533
19781
|
throw error;
|
|
@@ -19830,7 +20078,8 @@ class WebsiteScraper {
|
|
|
19830
20078
|
if (error instanceof Error && (error.message.includes('EROFS') ||
|
|
19831
20079
|
error.message.includes('read-only') ||
|
|
19832
20080
|
error.message.includes('EACCES') ||
|
|
19833
|
-
error.message.includes('EPERM')
|
|
20081
|
+
error.message.includes('EPERM') ||
|
|
20082
|
+
error.message.includes('ENOENT'))) ;
|
|
19834
20083
|
else {
|
|
19835
20084
|
// Re-throw other unexpected errors
|
|
19836
20085
|
throw error;
|