@promptbook/wizard 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.
Files changed (59) hide show
  1. package/README.md +1 -0
  2. package/esm/index.es.js +343 -94
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/typings/src/_packages/components.index.d.ts +4 -0
  5. package/esm/typings/src/_packages/core.index.d.ts +24 -0
  6. package/esm/typings/src/_packages/types.index.d.ts +30 -0
  7. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.d.ts +30 -0
  8. package/esm/typings/src/book-2.0/agent-source/parseAgentSource.test.d.ts +1 -0
  9. package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +26 -0
  10. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +38 -0
  11. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +39 -0
  12. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/FrontendRAGService.d.ts +48 -0
  13. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +51 -0
  14. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/RAGService.d.ts +54 -0
  15. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/BaseKnowledgeProcessor.d.ts +45 -0
  16. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/PdfProcessor.d.ts +31 -0
  17. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/ProcessorFactory.d.ts +23 -0
  18. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/processors/TextProcessor.d.ts +18 -0
  19. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/types.d.ts +56 -0
  20. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/utils/ragHelper.d.ts +34 -0
  21. package/esm/typings/src/book-2.0/commitments/META_IMAGE/META_IMAGE.d.ts +44 -0
  22. package/esm/typings/src/book-2.0/commitments/META_LINK/META_LINK.d.ts +56 -0
  23. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +39 -0
  24. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +49 -0
  25. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +46 -0
  26. package/esm/typings/src/book-2.0/commitments/RULE/RULE.d.ts +44 -0
  27. package/esm/typings/src/book-2.0/commitments/SAMPLE/SAMPLE.d.ts +44 -0
  28. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +38 -0
  29. package/esm/typings/src/book-2.0/commitments/_base/BaseCommitmentDefinition.d.ts +52 -0
  30. package/esm/typings/src/book-2.0/commitments/_base/BookCommitment.d.ts +5 -0
  31. package/esm/typings/src/book-2.0/commitments/_base/CommitmentDefinition.d.ts +48 -0
  32. package/esm/typings/src/book-2.0/commitments/_base/NotYetImplementedCommitmentDefinition.d.ts +22 -0
  33. package/esm/typings/src/book-2.0/commitments/_base/createEmptyAgentModelRequirements.d.ts +19 -0
  34. package/esm/typings/src/book-2.0/commitments/_misc/AgentModelRequirements.d.ts +37 -0
  35. package/esm/typings/src/book-2.0/commitments/_misc/AgentSourceParseResult.d.ts +18 -0
  36. package/esm/typings/src/book-2.0/commitments/_misc/ParsedCommitment.d.ts +22 -0
  37. package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirements.d.ts +61 -0
  38. package/esm/typings/src/book-2.0/commitments/_misc/createAgentModelRequirementsWithCommitments.d.ts +35 -0
  39. package/esm/typings/src/book-2.0/commitments/_misc/createCommitmentRegex.d.ts +20 -0
  40. package/esm/typings/src/book-2.0/commitments/_misc/parseAgentSourceWithCommitments.d.ts +24 -0
  41. package/esm/typings/src/book-2.0/commitments/_misc/removeCommentsFromSystemMessage.d.ts +11 -0
  42. package/esm/typings/src/book-2.0/commitments/index.d.ts +56 -0
  43. package/esm/typings/src/book-2.0/utils/profileImageUtils.d.ts +39 -0
  44. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +26 -0
  45. package/esm/typings/src/execution/AvailableModel.d.ts +4 -0
  46. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +6 -1
  47. package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +0 -5
  48. package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  49. package/esm/typings/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  50. package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
  51. package/esm/typings/src/llm-providers/ollama/ollama-models.d.ts +1 -1
  52. package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
  53. package/esm/typings/src/pipeline/book-notation.d.ts +2 -1
  54. package/esm/typings/src/types/ModelRequirements.d.ts +0 -2
  55. package/esm/typings/src/types/typeAliases.d.ts +6 -0
  56. package/esm/typings/src/version.d.ts +1 -1
  57. package/package.json +2 -2
  58. package/umd/index.umd.js +343 -94
  59. 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
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '1.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.100.0-3';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.100.0-32';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1702,7 +1702,7 @@ function pricing(value) {
1702
1702
  /**
1703
1703
  * List of available Anthropic Claude models with pricing
1704
1704
  *
1705
- * Note: Done at 2025-05-06
1705
+ * Note: Synced with official API docs at 2025-08-20
1706
1706
  *
1707
1707
  * @see https://docs.anthropic.com/en/docs/models-overview
1708
1708
  * @public exported from `@promptbook/anthropic-claude`
@@ -1712,12 +1712,52 @@ const ANTHROPIC_CLAUDE_MODELS = exportJson({
1712
1712
  value: [
1713
1713
  {
1714
1714
  modelVariant: 'CHAT',
1715
- modelTitle: 'Claude 3.5 Sonnet',
1716
- modelName: 'claude-3-5-sonnet-20240620',
1717
- modelDescription: 'Latest Claude model with 200K token context window. Features state-of-the-art reasoning capabilities, sophisticated code generation, and enhanced multilingual understanding. Offers superior accuracy with 30% fewer hallucinations than Claude 3 Sonnet. Provides exceptional performance for complex enterprise applications while maintaining fast response times.',
1715
+ modelTitle: 'Claude Opus 4.1',
1716
+ modelName: 'claude-opus-4-1-20250805',
1717
+ 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.',
1718
1718
  pricing: {
1719
- prompt: pricing(`$2.50 / 1M tokens`),
1720
- output: pricing(`$12.50 / 1M tokens`),
1719
+ prompt: pricing(`$15.00 / 1M tokens`),
1720
+ output: pricing(`$75.00 / 1M tokens`),
1721
+ },
1722
+ },
1723
+ {
1724
+ modelVariant: 'CHAT',
1725
+ modelTitle: 'Claude Opus 4',
1726
+ modelName: 'claude-opus-4-20250514',
1727
+ 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.',
1728
+ pricing: {
1729
+ prompt: pricing(`$15.00 / 1M tokens`),
1730
+ output: pricing(`$75.00 / 1M tokens`),
1731
+ },
1732
+ },
1733
+ {
1734
+ modelVariant: 'CHAT',
1735
+ modelTitle: 'Claude Sonnet 4',
1736
+ modelName: 'claude-sonnet-4-20250514',
1737
+ 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.',
1738
+ pricing: {
1739
+ prompt: pricing(`$3.00 / 1M tokens`),
1740
+ output: pricing(`$15.00 / 1M tokens`),
1741
+ },
1742
+ },
1743
+ {
1744
+ modelVariant: 'CHAT',
1745
+ modelTitle: 'Claude Sonnet 3.7',
1746
+ modelName: 'claude-3-7-sonnet-20250219',
1747
+ 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.',
1748
+ pricing: {
1749
+ prompt: pricing(`$3.00 / 1M tokens`),
1750
+ output: pricing(`$15.00 / 1M tokens`),
1751
+ },
1752
+ },
1753
+ {
1754
+ modelVariant: 'CHAT',
1755
+ modelTitle: 'Claude Haiku 3.5',
1756
+ modelName: 'claude-3-5-haiku-20241022',
1757
+ 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.',
1758
+ pricing: {
1759
+ prompt: pricing(`$0.80 / 1M tokens`),
1760
+ output: pricing(`$4.00 / 1M tokens`),
1721
1761
  },
1722
1762
  },
1723
1763
  {
@@ -2423,8 +2463,7 @@ class AnthropicClaudeExecutionTools {
2423
2463
  const rawPromptContent = templateParameters(content, { ...parameters, modelName });
2424
2464
  const rawRequest = {
2425
2465
  model: modelRequirements.modelName || this.getDefaultChatModel().modelName,
2426
- max_tokens: modelRequirements.maxTokens || 4096,
2427
- // <- TODO: [🌾] Make some global max cap for maxTokens
2466
+ max_tokens: modelRequirements.maxTokens || 8192,
2428
2467
  temperature: modelRequirements.temperature,
2429
2468
  system: modelRequirements.systemMessage,
2430
2469
  messages: [
@@ -2483,59 +2522,6 @@ class AnthropicClaudeExecutionTools {
2483
2522
  },
2484
2523
  });
2485
2524
  }
2486
- /**
2487
- * Calls Anthropic Claude API to use a completion model.
2488
- */
2489
- async callCompletionModel(prompt) {
2490
- if (this.options.isVerbose) {
2491
- console.info('🖋 Anthropic Claude callCompletionModel call');
2492
- }
2493
- const { content, parameters, modelRequirements } = prompt;
2494
- if (modelRequirements.modelVariant !== 'COMPLETION') {
2495
- throw new PipelineExecutionError('Use callCompletionModel only for COMPLETION variant');
2496
- }
2497
- const client = await this.getClient();
2498
- const modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName;
2499
- const rawPromptContent = templateParameters(content, { ...parameters, modelName });
2500
- const rawRequest = {
2501
- model: modelName,
2502
- max_tokens_to_sample: modelRequirements.maxTokens || 2000,
2503
- temperature: modelRequirements.temperature,
2504
- prompt: rawPromptContent,
2505
- };
2506
- const start = $getCurrentDate();
2507
- const rawResponse = await this.limiter
2508
- .schedule(() => client.completions.create(rawRequest))
2509
- .catch((error) => {
2510
- if (this.options.isVerbose) {
2511
- console.info(colors.bgRed('error'), error);
2512
- }
2513
- throw error;
2514
- });
2515
- if (this.options.isVerbose) {
2516
- console.info(colors.bgWhite('rawResponse'), JSON.stringify(rawResponse, null, 4));
2517
- }
2518
- if (!rawResponse.completion) {
2519
- throw new PipelineExecutionError('No completion from Anthropic Claude');
2520
- }
2521
- const resultContent = rawResponse.completion;
2522
- const complete = $getCurrentDate();
2523
- const usage = computeAnthropicClaudeUsage(rawPromptContent, resultContent, rawResponse);
2524
- return exportJson({
2525
- name: 'promptResult',
2526
- message: `Result of \`AnthropicClaudeExecutionTools.callCompletionModel\``,
2527
- order: [],
2528
- value: {
2529
- content: resultContent,
2530
- modelName: rawResponse.model || modelName,
2531
- timing: { start, complete },
2532
- usage,
2533
- rawPromptContent,
2534
- rawRequest,
2535
- rawResponse,
2536
- },
2537
- });
2538
- }
2539
2525
  // <- Note: [🤖] callXxxModel
2540
2526
  /**
2541
2527
  * Get the model that should be used as default
@@ -2557,7 +2543,7 @@ class AnthropicClaudeExecutionTools {
2557
2543
  * Default model for chat variant.
2558
2544
  */
2559
2545
  getDefaultChatModel() {
2560
- return this.getDefaultModel('claude-3-5-sonnet');
2546
+ return this.getDefaultModel('claude-sonnet-4-20250514');
2561
2547
  }
2562
2548
  }
2563
2549
  /**
@@ -2700,7 +2686,7 @@ const _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
2700
2686
  /**
2701
2687
  * List of available OpenAI models with pricing
2702
2688
  *
2703
- * Note: Done at 2025-05-06
2689
+ * Note: Synced with official API docs at 2025-08-20
2704
2690
  *
2705
2691
  * @see https://platform.openai.com/docs/models/
2706
2692
  * @see https://openai.com/api/pricing/
@@ -2709,6 +2695,138 @@ const _AzureOpenAiMetadataRegistration = $llmToolsMetadataRegister.register({
2709
2695
  const OPENAI_MODELS = exportJson({
2710
2696
  name: 'OPENAI_MODELS',
2711
2697
  value: [
2698
+ /**/
2699
+ {
2700
+ modelVariant: 'CHAT',
2701
+ modelTitle: 'gpt-5',
2702
+ modelName: 'gpt-5',
2703
+ 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.",
2704
+ pricing: {
2705
+ prompt: pricing(`$1.25 / 1M tokens`),
2706
+ output: pricing(`$10.00 / 1M tokens`),
2707
+ },
2708
+ },
2709
+ /**/
2710
+ /**/
2711
+ {
2712
+ modelVariant: 'CHAT',
2713
+ modelTitle: 'gpt-5-mini',
2714
+ modelName: 'gpt-5-mini',
2715
+ 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.",
2716
+ pricing: {
2717
+ prompt: pricing(`$0.25 / 1M tokens`),
2718
+ output: pricing(`$2.00 / 1M tokens`),
2719
+ },
2720
+ },
2721
+ /**/
2722
+ /**/
2723
+ {
2724
+ modelVariant: 'CHAT',
2725
+ modelTitle: 'gpt-5-nano',
2726
+ modelName: 'gpt-5-nano',
2727
+ 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.",
2728
+ pricing: {
2729
+ prompt: pricing(`$0.05 / 1M tokens`),
2730
+ output: pricing(`$0.40 / 1M tokens`),
2731
+ },
2732
+ },
2733
+ /**/
2734
+ /**/
2735
+ {
2736
+ modelVariant: 'CHAT',
2737
+ modelTitle: 'gpt-4.1',
2738
+ modelName: 'gpt-4.1',
2739
+ 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.",
2740
+ pricing: {
2741
+ prompt: pricing(`$3.00 / 1M tokens`),
2742
+ output: pricing(`$12.00 / 1M tokens`),
2743
+ },
2744
+ },
2745
+ /**/
2746
+ /**/
2747
+ {
2748
+ modelVariant: 'CHAT',
2749
+ modelTitle: 'gpt-4.1-mini',
2750
+ modelName: 'gpt-4.1-mini',
2751
+ 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.",
2752
+ pricing: {
2753
+ prompt: pricing(`$0.80 / 1M tokens`),
2754
+ output: pricing(`$3.20 / 1M tokens`),
2755
+ },
2756
+ },
2757
+ /**/
2758
+ /**/
2759
+ {
2760
+ modelVariant: 'CHAT',
2761
+ modelTitle: 'gpt-4.1-nano',
2762
+ modelName: 'gpt-4.1-nano',
2763
+ 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.",
2764
+ pricing: {
2765
+ prompt: pricing(`$0.20 / 1M tokens`),
2766
+ output: pricing(`$0.80 / 1M tokens`),
2767
+ },
2768
+ },
2769
+ /**/
2770
+ /**/
2771
+ {
2772
+ modelVariant: 'CHAT',
2773
+ modelTitle: 'o3',
2774
+ modelName: 'o3',
2775
+ 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.",
2776
+ pricing: {
2777
+ prompt: pricing(`$15.00 / 1M tokens`),
2778
+ output: pricing(`$60.00 / 1M tokens`),
2779
+ },
2780
+ },
2781
+ /**/
2782
+ /**/
2783
+ {
2784
+ modelVariant: 'CHAT',
2785
+ modelTitle: 'o3-pro',
2786
+ modelName: 'o3-pro',
2787
+ 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.",
2788
+ pricing: {
2789
+ prompt: pricing(`$30.00 / 1M tokens`),
2790
+ output: pricing(`$120.00 / 1M tokens`),
2791
+ },
2792
+ },
2793
+ /**/
2794
+ /**/
2795
+ {
2796
+ modelVariant: 'CHAT',
2797
+ modelTitle: 'o4-mini',
2798
+ modelName: 'o4-mini',
2799
+ 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.",
2800
+ pricing: {
2801
+ prompt: pricing(`$4.00 / 1M tokens`),
2802
+ output: pricing(`$16.00 / 1M tokens`),
2803
+ },
2804
+ },
2805
+ /**/
2806
+ /**/
2807
+ {
2808
+ modelVariant: 'CHAT',
2809
+ modelTitle: 'o3-deep-research',
2810
+ modelName: 'o3-deep-research',
2811
+ 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.",
2812
+ pricing: {
2813
+ prompt: pricing(`$25.00 / 1M tokens`),
2814
+ output: pricing(`$100.00 / 1M tokens`),
2815
+ },
2816
+ },
2817
+ /**/
2818
+ /**/
2819
+ {
2820
+ modelVariant: 'CHAT',
2821
+ modelTitle: 'o4-mini-deep-research',
2822
+ modelName: 'o4-mini-deep-research',
2823
+ 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.",
2824
+ pricing: {
2825
+ prompt: pricing(`$12.00 / 1M tokens`),
2826
+ output: pricing(`$48.00 / 1M tokens`),
2827
+ },
2828
+ },
2829
+ /**/
2712
2830
  /*/
2713
2831
  {
2714
2832
  modelTitle: 'dall-e-3',
@@ -3229,7 +3347,6 @@ class AzureOpenAiExecutionTools {
3229
3347
  const modelName = prompt.modelRequirements.modelName || this.options.deploymentName;
3230
3348
  const modelSettings = {
3231
3349
  maxTokens: modelRequirements.maxTokens,
3232
- // <- TODO: [🌾] Make some global max cap for maxTokens
3233
3350
  temperature: modelRequirements.temperature,
3234
3351
  user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
3235
3352
  // <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
@@ -3335,8 +3452,7 @@ class AzureOpenAiExecutionTools {
3335
3452
  try {
3336
3453
  const modelName = prompt.modelRequirements.modelName || this.options.deploymentName;
3337
3454
  const modelSettings = {
3338
- maxTokens: modelRequirements.maxTokens || 2000,
3339
- // <- TODO: [🌾] Make some global max cap for maxTokens
3455
+ maxTokens: modelRequirements.maxTokens,
3340
3456
  temperature: modelRequirements.temperature,
3341
3457
  user: (_a = this.options.userId) === null || _a === void 0 ? void 0 : _a.toString(),
3342
3458
  // <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
@@ -3720,7 +3836,7 @@ function createExecutionToolsFromVercelProvider(options) {
3720
3836
  /**
3721
3837
  * List of available Deepseek models with descriptions
3722
3838
  *
3723
- * Note: Done at 2025-05-06
3839
+ * Note: Synced with official API docs at 2025-08-20
3724
3840
  *
3725
3841
  * @see https://www.deepseek.com/models
3726
3842
  * @public exported from `@promptbook/deepseek`
@@ -3730,12 +3846,32 @@ const DEEPSEEK_MODELS = exportJson({
3730
3846
  value: [
3731
3847
  {
3732
3848
  modelVariant: 'CHAT',
3733
- modelTitle: 'Deepseek Chat Pro',
3734
- modelName: 'deepseek-chat-pro',
3735
- modelDescription: 'Latest flagship general-purpose model with 256K context window. Enhanced from base Chat model with 40% improvement on complex reasoning tasks and specialized domain knowledge. Features advanced prompt optimization and improved contextual memory. Ideal for enterprise applications requiring highest quality responses.',
3849
+ modelTitle: 'DeepSeek V3',
3850
+ modelName: 'deepseek-chat',
3851
+ 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.',
3736
3852
  pricing: {
3737
- prompt: pricing(`$1.20 / 1M tokens`),
3738
- output: pricing(`$2.40 / 1M tokens`),
3853
+ prompt: pricing(`$0.14 / 1M tokens`),
3854
+ output: pricing(`$0.28 / 1M tokens`),
3855
+ },
3856
+ },
3857
+ {
3858
+ modelVariant: 'CHAT',
3859
+ modelTitle: 'DeepSeek R1',
3860
+ modelName: 'deepseek-reasoner',
3861
+ 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.',
3862
+ pricing: {
3863
+ prompt: pricing(`$0.55 / 1M tokens`),
3864
+ output: pricing(`$2.19 / 1M tokens`),
3865
+ },
3866
+ },
3867
+ {
3868
+ modelVariant: 'CHAT',
3869
+ modelTitle: 'DeepSeek Coder V2',
3870
+ modelName: 'deepseek-coder',
3871
+ 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.',
3872
+ pricing: {
3873
+ prompt: pricing(`$0.14 / 1M tokens`),
3874
+ output: pricing(`$0.28 / 1M tokens`),
3739
3875
  },
3740
3876
  },
3741
3877
  {
@@ -3969,7 +4105,7 @@ const _GoogleMetadataRegistration = $llmToolsMetadataRegister.register({
3969
4105
  /**
3970
4106
  * List of available Google models with descriptions
3971
4107
  *
3972
- * Note: Done at 2025-05-06
4108
+ * Note: Synced with official API docs at 2025-08-20
3973
4109
  *
3974
4110
  * @see https://ai.google.dev/models/gemini
3975
4111
  * @public exported from `@promptbook/google`
@@ -3980,11 +4116,51 @@ const GOOGLE_MODELS = exportJson({
3980
4116
  {
3981
4117
  modelVariant: 'CHAT',
3982
4118
  modelTitle: 'Gemini 2.5 Pro',
3983
- modelName: 'gemini-2.5-pro-preview-03-25',
3984
- modelDescription: 'Latest advanced multimodal model with 1M token context window. Features exceptional reasoning across complex tasks, sophisticated function calling, and advanced image analysis (16MP resolution). Demonstrates superior performance in math, coding, and knowledge-intensive tasks with 30% improvement over Gemini 1.5 Pro. Ideal for enterprise applications requiring deep contextual understanding.',
4119
+ modelName: 'gemini-2.5-pro',
4120
+ 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.',
3985
4121
  pricing: {
3986
- prompt: pricing(`$8.00 / 1M tokens`),
3987
- output: pricing(`$24.00 / 1M tokens`),
4122
+ prompt: pricing(`$7.00 / 1M tokens`),
4123
+ output: pricing(`$21.00 / 1M tokens`),
4124
+ },
4125
+ },
4126
+ {
4127
+ modelVariant: 'CHAT',
4128
+ modelTitle: 'Gemini 2.5 Flash',
4129
+ modelName: 'gemini-2.5-flash',
4130
+ 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.',
4131
+ pricing: {
4132
+ prompt: pricing(`$0.35 / 1M tokens`),
4133
+ output: pricing(`$1.05 / 1M tokens`),
4134
+ },
4135
+ },
4136
+ {
4137
+ modelVariant: 'CHAT',
4138
+ modelTitle: 'Gemini 2.5 Flash Lite',
4139
+ modelName: 'gemini-2.5-flash-lite',
4140
+ 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.',
4141
+ pricing: {
4142
+ prompt: pricing(`$0.20 / 1M tokens`),
4143
+ output: pricing(`$0.60 / 1M tokens`),
4144
+ },
4145
+ },
4146
+ {
4147
+ modelVariant: 'CHAT',
4148
+ modelTitle: 'Gemini 2.0 Flash',
4149
+ modelName: 'gemini-2.0-flash',
4150
+ 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.',
4151
+ pricing: {
4152
+ prompt: pricing(`$0.25 / 1M tokens`),
4153
+ output: pricing(`$0.75 / 1M tokens`),
4154
+ },
4155
+ },
4156
+ {
4157
+ modelVariant: 'CHAT',
4158
+ modelTitle: 'Gemini 2.0 Flash Lite',
4159
+ modelName: 'gemini-2.0-flash-lite',
4160
+ 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.',
4161
+ pricing: {
4162
+ prompt: pricing(`$0.15 / 1M tokens`),
4163
+ output: pricing(`$0.45 / 1M tokens`),
3988
4164
  },
3989
4165
  },
3990
4166
  {
@@ -4425,7 +4601,6 @@ class OpenAiCompatibleExecutionTools {
4425
4601
  const modelSettings = {
4426
4602
  model: modelName,
4427
4603
  max_tokens: modelRequirements.maxTokens,
4428
- // <- TODO: [🌾] Make some global max cap for maxTokens
4429
4604
  temperature: modelRequirements.temperature,
4430
4605
  // <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
4431
4606
  // <- Note: [🧆]
@@ -4521,8 +4696,7 @@ class OpenAiCompatibleExecutionTools {
4521
4696
  const modelName = modelRequirements.modelName || this.getDefaultCompletionModel().modelName;
4522
4697
  const modelSettings = {
4523
4698
  model: modelName,
4524
- max_tokens: modelRequirements.maxTokens || 2000,
4525
- // <- TODO: [🌾] Make some global max cap for maxTokens
4699
+ max_tokens: modelRequirements.maxTokens,
4526
4700
  temperature: modelRequirements.temperature,
4527
4701
  // <- TODO: [🈁] Use `seed` here AND/OR use is `isDeterministic` for entire execution tools
4528
4702
  // <- Note: [🧆]
@@ -4671,7 +4845,7 @@ class OpenAiCompatibleExecutionTools {
4671
4845
  /**
4672
4846
  * List of available models in Ollama library
4673
4847
  *
4674
- * Note: Done at 2025-05-19
4848
+ * Note: Synced with official API docs at 2025-08-20
4675
4849
  *
4676
4850
  * @see https://ollama.com/library
4677
4851
  * @public exported from `@promptbook/ollama`
@@ -4679,6 +4853,24 @@ class OpenAiCompatibleExecutionTools {
4679
4853
  const OLLAMA_MODELS = exportJson({
4680
4854
  name: 'OLLAMA_MODELS',
4681
4855
  value: [
4856
+ {
4857
+ modelVariant: 'CHAT',
4858
+ modelTitle: 'llama3.3',
4859
+ modelName: 'llama3.3',
4860
+ 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.',
4861
+ },
4862
+ {
4863
+ modelVariant: 'CHAT',
4864
+ modelTitle: 'llama3.2',
4865
+ modelName: 'llama3.2',
4866
+ 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.',
4867
+ },
4868
+ {
4869
+ modelVariant: 'CHAT',
4870
+ modelTitle: 'llama3.1',
4871
+ modelName: 'llama3.1',
4872
+ 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.',
4873
+ },
4682
4874
  {
4683
4875
  modelVariant: 'CHAT',
4684
4876
  modelTitle: 'llama3',
@@ -5173,7 +5365,7 @@ class OpenAiExecutionTools extends OpenAiCompatibleExecutionTools {
5173
5365
  * Default model for chat variant.
5174
5366
  */
5175
5367
  getDefaultChatModel() {
5176
- return this.getDefaultModel('gpt-4-turbo');
5368
+ return this.getDefaultModel('gpt-5');
5177
5369
  }
5178
5370
  /**
5179
5371
  * Default model for completion variant.
@@ -5241,8 +5433,6 @@ class OpenAiAssistantExecutionTools extends OpenAiExecutionTools {
5241
5433
  const modelName = modelRequirements.modelName || this.getDefaultChatModel().modelName;
5242
5434
  const modelSettings = {
5243
5435
  model: modelName,
5244
- max_tokens: modelRequirements.maxTokens,
5245
- // <- TODO: [🌾] Make some global max cap for maxTokens
5246
5436
 
5247
5437
  temperature: modelRequirements.temperature,
5248
5438
 
@@ -5963,7 +6153,23 @@ async function getScraperIntermediateSource(source, options) {
5963
6153
  .join('/') +
5964
6154
  '.' +
5965
6155
  extension;
5966
- await mkdir(dirname(cacheFilename), { recursive: true });
6156
+ // Note: Try to create cache directory, but don't fail if filesystem has issues
6157
+ try {
6158
+ await mkdir(dirname(cacheFilename), { recursive: true });
6159
+ }
6160
+ catch (error) {
6161
+ // Note: If we can't create cache directory, continue without it
6162
+ // This handles read-only filesystems, permission issues, and missing parent directories
6163
+ if (error instanceof Error && (error.message.includes('EROFS') ||
6164
+ error.message.includes('read-only') ||
6165
+ error.message.includes('EACCES') ||
6166
+ error.message.includes('EPERM') ||
6167
+ error.message.includes('ENOENT'))) ;
6168
+ else {
6169
+ // Re-throw other unexpected errors
6170
+ throw error;
6171
+ }
6172
+ }
5967
6173
  let isDestroyed = true;
5968
6174
  const fileHandler = {
5969
6175
  filename: cacheFilename,
@@ -7727,7 +7933,23 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
7727
7933
  // <- TODO: [🥬] Encapsulate sha256 to some private utility function
7728
7934
  const rootDirname = join(process.cwd(), DEFAULT_DOWNLOAD_CACHE_DIRNAME);
7729
7935
  const filepath = join(...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), `${basename.substring(0, MAX_FILENAME_LENGTH)}.${mimeTypeToExtension(mimeType)}`);
7730
- await tools.fs.mkdir(dirname(join(rootDirname, filepath)), { recursive: true });
7936
+ // Note: Try to create cache directory, but don't fail if filesystem has issues
7937
+ try {
7938
+ await tools.fs.mkdir(dirname(join(rootDirname, filepath)), { recursive: true });
7939
+ }
7940
+ catch (error) {
7941
+ // Note: If we can't create cache directory, we'll handle it when trying to write the file
7942
+ // This handles read-only filesystems, permission issues, and missing parent directories
7943
+ if (error instanceof Error && (error.message.includes('EROFS') ||
7944
+ error.message.includes('read-only') ||
7945
+ error.message.includes('EACCES') ||
7946
+ error.message.includes('EPERM') ||
7947
+ error.message.includes('ENOENT'))) ;
7948
+ else {
7949
+ // Re-throw other unexpected errors
7950
+ throw error;
7951
+ }
7952
+ }
7731
7953
  const fileContent = Buffer.from(await response.arrayBuffer());
7732
7954
  if (fileContent.length > DEFAULT_MAX_FILE_SIZE /* <- TODO: Allow to pass different value to remote server */) {
7733
7955
  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.`);
@@ -7742,7 +7964,8 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
7742
7964
  if (error instanceof Error && (error.message.includes('EROFS') ||
7743
7965
  error.message.includes('read-only') ||
7744
7966
  error.message.includes('EACCES') ||
7745
- error.message.includes('EPERM'))) {
7967
+ error.message.includes('EPERM') ||
7968
+ error.message.includes('ENOENT'))) {
7746
7969
  // Return a handler that works directly with the downloaded content
7747
7970
  return {
7748
7971
  source: name,
@@ -8887,7 +9110,7 @@ function validatePromptResult(options) {
8887
9110
  */
8888
9111
  async function executeAttempts(options) {
8889
9112
  const { jokerParameterNames, priority, maxAttempts, // <- Note: [💂]
8890
- preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, } = options;
9113
+ preparedContent, parameters, task, preparedPipeline, tools, $executionReport, pipelineIdentification, maxExecutionAttempts, onProgress, } = options;
8891
9114
  const $ongoingTaskResult = {
8892
9115
  $result: null,
8893
9116
  $resultString: null,
@@ -9131,6 +9354,10 @@ async function executeAttempts(options) {
9131
9354
  result: $ongoingTaskResult.$resultString,
9132
9355
  error: error,
9133
9356
  });
9357
+ // Report failed attempt
9358
+ onProgress({
9359
+ errors: [error],
9360
+ });
9134
9361
  }
9135
9362
  finally {
9136
9363
  if (!isJokerAttempt &&
@@ -10849,7 +11076,8 @@ class MarkitdownScraper {
10849
11076
  if (error instanceof Error && (error.message.includes('EROFS') ||
10850
11077
  error.message.includes('read-only') ||
10851
11078
  error.message.includes('EACCES') ||
10852
- error.message.includes('EPERM'))) ;
11079
+ error.message.includes('EPERM') ||
11080
+ error.message.includes('ENOENT'))) ;
10853
11081
  else {
10854
11082
  // Re-throw other unexpected errors
10855
11083
  throw error;
@@ -11152,7 +11380,8 @@ class WebsiteScraper {
11152
11380
  if (error instanceof Error && (error.message.includes('EROFS') ||
11153
11381
  error.message.includes('read-only') ||
11154
11382
  error.message.includes('EACCES') ||
11155
- error.message.includes('EPERM'))) ;
11383
+ error.message.includes('EPERM') ||
11384
+ error.message.includes('ENOENT'))) ;
11156
11385
  else {
11157
11386
  // Re-throw other unexpected errors
11158
11387
  throw error;
@@ -11898,8 +12127,27 @@ class FileCacheStorage {
11898
12127
  throw new UnexpectedError(`The "${key}" you want to store in JSON file is not serializable as JSON`);
11899
12128
  }
11900
12129
  const fileContent = stringifyPipelineJson(value);
11901
- await mkdir(dirname(filename), { recursive: true }); // <- [0]
11902
- await writeFile(filename, fileContent, 'utf-8');
12130
+ // Note: Try to create cache directory and write file, but don't fail if filesystem is read-only or has permission issues
12131
+ try {
12132
+ await mkdir(dirname(filename), { recursive: true }); // <- [0]
12133
+ await writeFile(filename, fileContent, 'utf-8');
12134
+ }
12135
+ catch (error) {
12136
+ // Note: If we can't write to cache, silently ignore the error
12137
+ // This handles read-only filesystems, permission issues, and missing parent directories
12138
+ if (error instanceof Error && (error.message.includes('EROFS') ||
12139
+ error.message.includes('read-only') ||
12140
+ error.message.includes('EACCES') ||
12141
+ error.message.includes('EPERM') ||
12142
+ error.message.includes('ENOENT'))) {
12143
+ // Silently ignore filesystem errors - caching is optional
12144
+ return;
12145
+ }
12146
+ else {
12147
+ // Re-throw other unexpected errors
12148
+ throw error;
12149
+ }
12150
+ }
11903
12151
  }
11904
12152
  /**
11905
12153
  * Removes the key/value pair with the given key from the storage, if a key/value pair with the given key exists.
@@ -16779,7 +17027,8 @@ async function $getCompiledBook(tools, pipelineSource, options) {
16779
17027
  if (error instanceof Error && (error.message.includes('EROFS') ||
16780
17028
  error.message.includes('read-only') ||
16781
17029
  error.message.includes('EACCES') ||
16782
- error.message.includes('EPERM'))) ;
17030
+ error.message.includes('EPERM') ||
17031
+ error.message.includes('ENOENT'))) ;
16783
17032
  else {
16784
17033
  // Re-throw other unexpected errors
16785
17034
  throw error;