@promptbook/website-crawler 0.114.0-1 → 0.114.0-3

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 (58) hide show
  1. package/README.md +16 -15
  2. package/esm/index.es.js +44 -4
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
  5. package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
  6. package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
  7. package/esm/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
  8. package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
  9. package/esm/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
  10. package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
  11. package/esm/src/cli/cli-commands/coder/ping.d.ts +10 -0
  12. package/esm/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
  13. package/esm/src/cli/cli-commands/coder.d.ts +1 -0
  14. package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
  15. package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
  16. package/esm/src/cli/common/loadPromptsModule.d.ts +16 -0
  17. package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
  18. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
  19. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
  20. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
  21. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
  22. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
  23. package/esm/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
  24. package/esm/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
  25. package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
  26. package/esm/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
  27. package/esm/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
  28. package/esm/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
  29. package/esm/src/version.d.ts +1 -1
  30. package/package.json +2 -2
  31. package/umd/index.umd.js +52 -10
  32. package/umd/index.umd.js.map +1 -1
  33. package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
  34. package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
  35. package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
  36. package/umd/src/book-components/Chat/utils/$provideServerDomWindow.d.ts +11 -0
  37. package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
  38. package/umd/src/cli/cli-commands/agents-server/buildAgentsServer/createAgentsServerRuntimeEnvironment.d.ts +7 -0
  39. package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
  40. package/umd/src/cli/cli-commands/coder/ping.d.ts +10 -0
  41. package/umd/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
  42. package/umd/src/cli/cli-commands/coder.d.ts +1 -0
  43. package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +34 -0
  44. package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.test.d.ts +1 -0
  45. package/umd/src/cli/common/loadPromptsModule.d.ts +16 -0
  46. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +1 -1
  47. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +1 -1
  48. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +1 -1
  49. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsToolBuilder.d.ts +1 -1
  50. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsStreamRunner.d.ts +1 -1
  51. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsToolRunner.d.ts +1 -1
  52. package/umd/src/llm-providers/openai/OpenAiCompatibleNonChatPromptCaller.d.ts +1 -1
  53. package/umd/src/llm-providers/openai/OpenAiCompatibleRequestManager.d.ts +1 -1
  54. package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +1 -1
  55. package/umd/src/llm-providers/openai/utils/loadOpenAiAgentsModule.d.ts +203 -0
  56. package/umd/src/llm-providers/openai/utils/uploadFilesToOpenAi.d.ts +1 -1
  57. package/umd/src/utils/misc/createLazyModuleLoader.d.ts +14 -0
  58. package/umd/src/version.d.ts +1 -1
package/README.md CHANGED
@@ -504,26 +504,27 @@ ptbk coder verify
504
504
  | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------ | ---- | ----- | ------------------------------------------------------------------------ |
505
505
  | `ptbk coder init` | Creates `prompts/`, `prompts/done/`, the project-generic template files materialized in `prompts/templates/` (currently `common.md`), and a starter `AGENTS.md`; ensures `.env` contains `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, and `CODING_AGENT_GIT_SIGNING_KEY`; adds helper coder scripts to `package.json`; ensures `.gitignore` contains `/.promptbook`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
506
506
  | `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root. |
507
- | `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled. |
507
+ | `ptbk coder run` | Picks the next ready prompt, can run tests before coding to stop or repair pre-existing failures, appends optional context, runs it through the selected coding agent, can optionally verify each attempt with a shell test command and feed failing output back for retries, then marks success or failure, commits the result, and pushes only when `--auto-push` is enabled. |
508
508
  | `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <xlow | low | medium | high | xhigh | extreme>` ranges from a very benevolent scan to a very aggressive sweep. |
509
509
  | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
510
510
 
511
511
  #### Most useful `ptbk coder run` flags
512
512
 
513
- | Flag | Purpose |
514
- | -------------------------- | -------------------------------------------------------------------------------------------------- |
515
- | `--harness <name>` | Selects the coding harness. |
516
- | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
517
- | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
518
- | `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
519
- | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
520
- | `--no-auto` | Waits for user confirmation before each prompt instead of running automatically through the queue. |
521
- | `--ignore-git-changes` | Disables the clean-working-tree guard. |
522
- | `--priority <n>` | Runs only prompts at or above the given priority. |
523
- | `--dry-run` | Prints which prompts are ready instead of executing them. |
524
- | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
525
- | `--auto-push` | Pushes each successful coding-agent commit to the configured remote. |
526
- | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
513
+ | Flag | Purpose |
514
+ | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
515
+ | `--harness <name>` | Selects the coding harness. |
516
+ | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
517
+ | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
518
+ | `--test <command>` | Runs a verification command after each prompt attempt and feeds failing output back for retries. |
519
+ | `--test-before <mode>` | Runs tests before coding: `no` (default), `yes-and-fail` (stop with results), or `yes-and-fix` (create one repair prompt first); defaults to `npm test` when enabled without `--test`. |
520
+ | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
521
+ | `--no-auto` | Waits for user confirmation before each prompt instead of running automatically through the queue. |
522
+ | `--ignore-git-changes` | Disables the clean-working-tree guard. |
523
+ | `--priority <n>` | Runs only prompts at or above the given priority. |
524
+ | `--dry-run` | Prints which prompts are ready instead of executing them. |
525
+ | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
526
+ | `--auto-push` | Pushes each successful coding-agent commit to the configured remote. |
527
+ | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
527
528
 
528
529
  #### Typical usage pattern
529
530
 
package/esm/index.es.js CHANGED
@@ -1,6 +1,4 @@
1
1
  import { spaceTrim as spaceTrim$1 } from 'spacetrim';
2
- import { Readability } from '@mozilla/readability';
3
- import { JSDOM } from 'jsdom';
4
2
  import CryptoJS from 'crypto-js';
5
3
  import { Subject } from 'rxjs';
6
4
  import { forTime } from 'waitasecond';
@@ -26,7 +24,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
26
24
  * @generated
27
25
  * @see https://github.com/webgptorg/promptbook
28
26
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.114.0-1';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.114.0-3';
30
28
  /**
31
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1601,6 +1599,31 @@ class KnowledgeScrapeError extends Error {
1601
1599
  }
1602
1600
  }
1603
1601
 
1602
+ /**
1603
+ * Creates a loader which imports one module on the first call and reuses the very same module afterwards
1604
+ *
1605
+ * Note: [🐌] Heavy third-party dependencies are imported lazily to keep the startup of the Promptbook CLI fast.
1606
+ * A statically imported dependency is loaded every single time the bundle is loaded, even when the running
1607
+ * command never touches it. A lazily imported dependency is loaded only when the feature is really used.
1608
+ *
1609
+ * @example
1610
+ * const loadJsdomModule = createLazyModuleLoader(() => import('jsdom'));
1611
+ * const { JSDOM } = await loadJsdomModule();
1612
+ *
1613
+ * @private internal utility of Promptbook
1614
+ */
1615
+ function createLazyModuleLoader(importModule) {
1616
+ let importedModulePromise = null;
1617
+ return function loadModule() {
1618
+ if (importedModulePromise === null) {
1619
+ importedModulePromise = importModule();
1620
+ }
1621
+ return importedModulePromise;
1622
+ };
1623
+ }
1624
+ // Note: [🐌] Do not convert the lazy `import(...)` calls back to static `import` statements, it would bring back the
1625
+ // slow startup of the `ptbk` CLI utility
1626
+
1604
1627
  var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book",formfactorName:"GENERIC",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge from Markdown\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book`\n- INPUT PARAMETER `{knowledgeContent}` Markdown document content\n- OUTPUT PARAMETER `{knowledgePieces}` The knowledge JSON object\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}\n```\n\n`-> {knowledgePieces}`\n"}],sourceFile:"./books/prepare-knowledge-from-markdown.book"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Keywords\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-keywords.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{keywords}` Keywords separated by comma\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}\n```\n\n`-> {keywords}`\n"}],sourceFile:"./books/prepare-knowledge-keywords.book"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge-piece Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-title.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{title}` The title of the document\n\n## Knowledge\n\n- EXPECT MIN 1 WORD\n- EXPECT MAX 8 WORDS\n\n```markdown\nYou are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-knowledge-title.book"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book",formfactorName:"GENERIC",parameters:[{name:"availableModels",description:"List of available model names together with their descriptions as JSON",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelsRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n```json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n```\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n```json\n{availableModels}\n```\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelsRequirements",format:"JSON",dependentParameterNames:["availableModels","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book`\n- INPUT PARAMETER `{availableModels}` List of available model names together with their descriptions as JSON\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelsRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n\\`\\`\\`json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n\\`\\`\\`json\n{availableModels}\n\\`\\`\\`\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}\n```\n\n`-> {modelsRequirements}`\n"}],sourceFile:"./books/prepare-persona.book"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book",formfactorName:"GENERIC",parameters:[{name:"book",description:"The book to prepare the title for",isInput:true,isOutput:false},{name:"title",description:"Best title for the book",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-title",title:"Make title",content:"Make best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}",resultingParameterName:"title",expectations:{words:{min:1,max:8},lines:{min:1,max:1}},dependentParameterNames:["book"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-title.book`\n- INPUT PARAMETER `{book}` The book to prepare the title for\n- OUTPUT PARAMETER `{title}` Best title for the book\n\n## Make title\n\n- EXPECT MIN 1 Word\n- EXPECT MAX 8 Words\n- EXPECT EXACTLY 1 Line\n\n```markdown\nMake best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book"}];
1605
1628
 
1606
1629
  /**
@@ -8497,7 +8520,23 @@ function createShowdownConverter() {
8497
8520
  });
8498
8521
  }
8499
8522
 
8500
- // TODO: [🏳‍🌈] Finally take pick of .json vs .ts
8523
+ /**
8524
+ * Loads `jsdom` on demand
8525
+ *
8526
+ * Note: [🐌] `jsdom` is by far the heaviest dependency of Promptbook, loading it eagerly would slow down every single
8527
+ * run of the `ptbk` CLI utility even when no website is scraped
8528
+ *
8529
+ * @private internal utility of `WebsiteScraper`
8530
+ */
8531
+ const loadJsdomModule = createLazyModuleLoader(() => import('jsdom'));
8532
+ /**
8533
+ * Loads `@mozilla/readability` on demand
8534
+ *
8535
+ * Note: [🐌] Loaded lazily to keep the startup of the `ptbk` CLI utility fast
8536
+ *
8537
+ * @private internal utility of `WebsiteScraper`
8538
+ */
8539
+ const loadReadabilityModule = createLazyModuleLoader(() => import('@mozilla/readability'));
8501
8540
  /**
8502
8541
  * Scraper for websites
8503
8542
  *
@@ -8533,6 +8572,7 @@ class WebsiteScraper {
8533
8572
  if (this.tools.fs === undefined) {
8534
8573
  throw new EnvironmentMismatchError('Can not scrape websites without filesystem tools');
8535
8574
  }
8575
+ const [{ JSDOM }, { Readability }] = await Promise.all([loadJsdomModule(), loadReadabilityModule()]);
8536
8576
  const jsdom = new JSDOM(await source.asText(), {
8537
8577
  url: source.url,
8538
8578
  });