@promptbook/documents 0.112.0-65 → 0.112.0-69

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 (720) hide show
  1. package/README.md +3 -3
  2. package/esm/index.es.js +576 -540
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/_packages/core.index.d.ts +2 -0
  5. package/esm/src/avatars/AvatarOrImage.d.ts +2 -1
  6. package/esm/src/avatars/avatarRenderingUtils.d.ts +1 -1
  7. package/esm/src/avatars/renderAvatarVisual.d.ts +1 -2
  8. package/esm/src/avatars/types/AvatarDefinition.d.ts +2 -1
  9. package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +3 -2
  10. package/esm/src/avatars/visuals/minecraft2AvatarVisual.d.ts +7 -0
  11. package/esm/src/avatars/visuals/minecraftAvatarVisualShared.d.ts +48 -0
  12. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +5 -1
  13. package/esm/src/book-2.0/agent-source/AgentModelRequirements.d.ts +3 -2
  14. package/esm/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +1 -1
  15. package/esm/src/book-2.0/agent-source/computeAgentHash.d.ts +2 -2
  16. package/esm/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +4 -1
  17. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +1 -1
  18. package/esm/src/book-2.0/agent-source/createDefaultAgentName.d.ts +2 -2
  19. package/esm/src/book-2.0/agent-source/normalizeAgentName.d.ts +1 -1
  20. package/esm/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -1
  21. package/esm/src/book-2.0/agent-source/parseTeamCommitment.d.ts +1 -1
  22. package/esm/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +1 -1
  23. package/esm/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -1
  24. package/esm/src/book-3.0/Book.d.ts +33 -0
  25. package/esm/src/book-3.0/Book.test.d.ts +1 -0
  26. package/esm/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +1 -1
  27. package/esm/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +1 -1
  28. package/esm/src/book-components/BookEditor/BookEditor.d.ts +4 -1
  29. package/esm/src/book-components/BookEditor/BookEditorActionbar.d.ts +1 -1
  30. package/esm/src/book-components/Chat/AgentChip/AgentChip.d.ts +1 -1
  31. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +2 -2
  32. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
  33. package/esm/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +1 -1
  34. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +4 -4
  35. package/esm/src/book-components/Chat/Chat/ChatRatingModal.d.ts +1 -1
  36. package/esm/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +2 -2
  37. package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -2
  38. package/esm/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +2 -2
  39. package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +1 -1
  40. package/esm/src/book-components/Chat/Chat/resolveRunBrowserToolCallDetailsState.d.ts +1 -1
  41. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +1 -1
  42. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +1 -1
  43. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +1 -1
  44. package/esm/src/book-components/Chat/Chat/useChatToolCallModalState.d.ts +3 -3
  45. package/esm/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +2 -2
  46. package/esm/src/book-components/Chat/LlmChat/useLlmChatMessageHandler.d.ts +1 -1
  47. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -1
  48. package/esm/src/book-components/Chat/hooks/useChatRatings.d.ts +2 -2
  49. package/esm/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +2 -1
  50. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +6 -2
  51. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +5 -3
  52. package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +1 -1
  53. package/esm/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -1
  54. package/esm/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -1
  55. package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.d.ts +2 -2
  56. package/esm/src/book-components/Chat/utils/loadAgentProfile.d.ts +2 -1
  57. package/esm/src/book-components/Chat/utils/resolveCitationUrl.d.ts +1 -1
  58. package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +1 -1
  59. package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +1 -1
  60. package/esm/src/book-components/Qr/useQrCode.d.ts +1 -1
  61. package/esm/src/book-components/_common/react-utils/classNames.d.ts +1 -1
  62. package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  63. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +1 -1
  64. package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +1 -1
  65. package/esm/src/cli/common/$provideLlmToolsForCli.d.ts +1 -1
  66. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +3 -3
  67. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +1 -1
  68. package/esm/src/collection/pipeline-collection/PipelineCollection.d.ts +1 -1
  69. package/esm/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +1 -1
  70. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -1
  71. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +1 -1
  72. package/esm/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -1
  73. package/esm/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -1
  74. package/esm/src/commands/FOREACH/ForeachJson.d.ts +1 -1
  75. package/esm/src/commands/JOKER/JokerCommand.d.ts +1 -1
  76. package/esm/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -1
  77. package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +2 -2
  78. package/esm/src/commands/PARAMETER/ParameterCommand.d.ts +2 -2
  79. package/esm/src/commands/PERSONA/PersonaCommand.d.ts +2 -2
  80. package/esm/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -1
  81. package/esm/src/commands/_common/parseCommand.d.ts +1 -1
  82. package/esm/src/commands/_common/stringifyCommand.d.ts +1 -1
  83. package/esm/src/commands/_common/types/CommandParser.d.ts +2 -1
  84. package/esm/src/commitments/MEMORY/MEMORY.d.ts +2 -2
  85. package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +1 -1
  86. package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +1 -1
  87. package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +1 -1
  88. package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +1 -1
  89. package/esm/src/commitments/TEAM/TEAM.d.ts +2 -2
  90. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +2 -2
  91. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +1 -1
  92. package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +1 -1
  93. package/esm/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +1 -1
  94. package/esm/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +1 -1
  95. package/esm/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +1 -1
  96. package/esm/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +2 -2
  97. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +2 -2
  98. package/esm/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +1 -1
  99. package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +2 -2
  100. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +2 -2
  101. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +1 -1
  102. package/esm/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +1 -1
  103. package/esm/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +1 -1
  104. package/esm/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +1 -1
  105. package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +2 -2
  106. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +2 -2
  107. package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +1 -1
  108. package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +2 -2
  109. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +1 -1
  110. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +2 -2
  111. package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +1 -1
  112. package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +1 -1
  113. package/esm/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +2 -2
  114. package/esm/src/commitments/WALLET/WALLET.d.ts +2 -2
  115. package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +1 -1
  116. package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +1 -1
  117. package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +1 -1
  118. package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +1 -1
  119. package/esm/src/commitments/_base/BaseCommitmentDefinition.d.ts +2 -2
  120. package/esm/src/commitments/_base/CommitmentDefinition.d.ts +2 -2
  121. package/esm/src/commitments/_common/commitmentToolFunctions.d.ts +2 -2
  122. package/esm/src/commitments/_common/createSerpSearchToolFunction.d.ts +1 -1
  123. package/esm/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +1 -1
  124. package/esm/src/commitments/_common/getAllCommitmentsToolTitles.d.ts +1 -1
  125. package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.d.ts +1 -1
  126. package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +1 -1
  127. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +1 -1
  128. package/esm/src/config.d.ts +8 -4
  129. package/esm/src/conversion/archive/loadArchive.d.ts +1 -1
  130. package/esm/src/conversion/archive/saveArchive.d.ts +1 -1
  131. package/esm/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +1 -1
  132. package/esm/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -1
  133. package/esm/src/errors/PipelineExecutionError.d.ts +1 -1
  134. package/esm/src/errors/utils/ErrorJson.d.ts +1 -1
  135. package/esm/src/executables/apps/locateLibreoffice.d.ts +1 -1
  136. package/esm/src/executables/apps/locatePandoc.d.ts +1 -1
  137. package/esm/src/executables/apps/locateVscode.d.ts +1 -1
  138. package/esm/src/executables/browsers/locateBrowser.d.ts +1 -1
  139. package/esm/src/executables/browsers/locateChrome.d.ts +1 -1
  140. package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +1 -1
  141. package/esm/src/executables/browsers/locateEdge.d.ts +1 -1
  142. package/esm/src/executables/browsers/locateFirefox.d.ts +1 -1
  143. package/esm/src/executables/browsers/locateInternetExplorer.d.ts +1 -1
  144. package/esm/src/executables/browsers/locateSafari.d.ts +1 -1
  145. package/esm/src/executables/locateApp.d.ts +1 -1
  146. package/esm/src/executables/platforms/locateAppOnLinux.d.ts +1 -1
  147. package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +1 -1
  148. package/esm/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
  149. package/esm/src/execution/AbstractTaskResult.d.ts +1 -1
  150. package/esm/src/execution/AvailableModel.d.ts +5 -1
  151. package/esm/src/execution/CommonToolsOptions.d.ts +1 -1
  152. package/esm/src/execution/Executables.d.ts +1 -1
  153. package/esm/src/execution/ExecutionTask.d.ts +3 -2
  154. package/esm/src/execution/LlmExecutionTools.d.ts +2 -1
  155. package/esm/src/execution/PipelineExecutor.d.ts +1 -1
  156. package/esm/src/execution/PipelineExecutorResult.d.ts +2 -2
  157. package/esm/src/execution/PromptResult.d.ts +3 -1
  158. package/esm/src/execution/PromptbookFetch.d.ts +1 -1
  159. package/esm/src/execution/ScriptExecutionTools.d.ts +2 -2
  160. package/esm/src/execution/UncertainNumber.d.ts +2 -2
  161. package/esm/src/execution/UserInterfaceTools.d.ts +1 -2
  162. package/esm/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
  163. package/esm/src/execution/createPipelineExecutor/20-executeTask.d.ts +1 -1
  164. package/esm/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +2 -1
  165. package/esm/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +1 -1
  166. package/esm/src/execution/createPipelineExecutor/getContextForTask.d.ts +2 -2
  167. package/esm/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +2 -2
  168. package/esm/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +3 -1
  169. package/esm/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +1 -2
  170. package/esm/src/execution/execution-report/ExecutionReportJson.d.ts +3 -3
  171. package/esm/src/execution/execution-report/ExecutionReportStringOptions.d.ts +1 -1
  172. package/esm/src/execution/utils/usageToHuman.d.ts +1 -1
  173. package/esm/src/execution/utils/validatePromptResult.d.ts +1 -1
  174. package/esm/src/file-security-checkers/FileSecurityCheckResult.d.ts +2 -1
  175. package/esm/src/file-security-checkers/FileSecurityChecker.d.ts +3 -1
  176. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -1
  177. package/esm/src/formats/_common/FormatParser.d.ts +2 -2
  178. package/esm/src/formats/_common/FormatSubvalueParser.d.ts +2 -3
  179. package/esm/src/formats/csv/utils/csvParse.d.ts +1 -1
  180. package/esm/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +2 -3
  181. package/esm/src/import-plugins/FileImportPlugin.d.ts +1 -1
  182. package/esm/src/llm-providers/_common/register/$provideEnvFilename.d.ts +1 -1
  183. package/esm/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -2
  184. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
  185. package/esm/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +1 -1
  186. package/esm/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +2 -1
  187. package/esm/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +3 -1
  188. package/esm/src/llm-providers/_common/utils/assertUniqueModels.d.ts +1 -1
  189. package/esm/src/llm-providers/_common/utils/cache/CacheItem.d.ts +2 -2
  190. package/esm/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +2 -1
  191. package/esm/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +2 -1
  192. package/esm/src/llm-providers/agent/Agent.d.ts +6 -2
  193. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +3 -1
  194. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +2 -2
  195. package/esm/src/llm-providers/agent/RemoteAgentOptions.d.ts +1 -1
  196. package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -1
  197. package/esm/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  198. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +2 -1
  199. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +2 -3
  200. package/esm/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  201. package/esm/src/llm-providers/google/google-models.d.ts +1 -1
  202. package/esm/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
  203. package/esm/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -1
  204. package/esm/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -1
  205. package/esm/src/llm-providers/ollama/OllamaExecutionTools.d.ts +2 -1
  206. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +3 -2
  207. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +1 -1
  208. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +3 -1
  209. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +1 -1
  210. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +3 -1
  211. package/esm/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -1
  212. package/esm/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +2 -2
  213. package/esm/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +3 -1
  214. package/esm/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.d.ts +1 -1
  215. package/esm/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +2 -1
  216. package/esm/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +2 -1
  217. package/esm/src/other/templates/getBookTemplates.d.ts +1 -1
  218. package/esm/src/personas/preparePersona.d.ts +1 -1
  219. package/esm/src/pipeline/PipelineJson/CommonTaskJson.d.ts +4 -8
  220. package/esm/src/pipeline/PipelineJson/Expectations.d.ts +1 -2
  221. package/esm/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +4 -6
  222. package/esm/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +3 -3
  223. package/esm/src/pipeline/PipelineJson/ParameterJson.d.ts +2 -3
  224. package/esm/src/pipeline/PipelineJson/PersonaJson.d.ts +3 -3
  225. package/esm/src/pipeline/PipelineJson/PipelineJson.d.ts +6 -9
  226. package/esm/src/pipeline/PipelineJson/PreparationJson.d.ts +1 -1
  227. package/esm/src/pipeline/PipelineJson/PromptTaskJson.d.ts +1 -1
  228. package/esm/src/pipeline/prompt-notation.d.ts +1 -1
  229. package/esm/src/postprocessing/utils/extractBlock.d.ts +1 -1
  230. package/esm/src/postprocessing/utils/extractJsonBlock.d.ts +1 -2
  231. package/esm/src/prepare/PrepareAndScrapeOptions.d.ts +1 -1
  232. package/esm/src/remote-server/socket-types/_subtypes/Identification.d.ts +2 -2
  233. package/esm/src/remote-server/socket-types/_subtypes/identificationToPromptbookToken.d.ts +1 -1
  234. package/esm/src/remote-server/socket-types/_subtypes/promptbookTokenToIdentification.d.ts +1 -1
  235. package/esm/src/remote-server/startAgentServer.d.ts +1 -1
  236. package/esm/src/remote-server/types/RemoteClientOptions.d.ts +1 -1
  237. package/esm/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
  238. package/esm/src/scrapers/_common/Scraper.d.ts +4 -4
  239. package/esm/src/scrapers/_common/ScraperIntermediateSource.d.ts +1 -1
  240. package/esm/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +1 -1
  241. package/esm/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +3 -1
  242. package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -1
  243. package/esm/src/scrapers/website/WebsiteScraper.d.ts +2 -3
  244. package/esm/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +2 -2
  245. package/esm/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +2 -2
  246. package/esm/src/search-engines/SearchEngine.d.ts +2 -1
  247. package/esm/src/search-engines/SearchResult.d.ts +1 -1
  248. package/esm/src/search-engines/bing/BingSearchEngine.d.ts +2 -1
  249. package/esm/src/search-engines/dummy/DummySearchEngine.d.ts +2 -1
  250. package/esm/src/search-engines/google/GoogleSearchEngine.d.ts +2 -1
  251. package/esm/src/search-engines/serp/SerpSearchEngine.d.ts +2 -1
  252. package/esm/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +1 -1
  253. package/esm/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +1 -1
  254. package/esm/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +1 -1
  255. package/esm/src/transpilers/_common/BookTranspiler.d.ts +4 -2
  256. package/esm/src/transpilers/_common/createTranspiledTeamRuntimeSection.d.ts +1 -1
  257. package/esm/src/transpilers/_common/formatUsedToolFunctions.d.ts +1 -1
  258. package/esm/src/transpilers/agent-os/AgentOsTranspiler.d.ts +1 -1
  259. package/esm/src/transpilers/anthropic-claude-managed/AnthropicClaudeManagedTranspiler.d.ts +1 -1
  260. package/esm/src/transpilers/anthropic-claude-sdk/AnthropicClaudeSdkTranspiler.d.ts +1 -1
  261. package/esm/src/transpilers/e2b/E2BTranspiler.d.ts +1 -1
  262. package/esm/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +1 -1
  263. package/esm/src/transpilers/openai-agents/OpenAiAgentsTranspiler.d.ts +1 -1
  264. package/esm/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +1 -1
  265. package/esm/src/types/LlmCall.d.ts +1 -1
  266. package/esm/src/types/LlmToolDefinition.d.ts +2 -1
  267. package/esm/src/types/Message.d.ts +4 -3
  268. package/esm/src/types/ModelRequirements.d.ts +4 -2
  269. package/esm/src/types/Prompt.d.ts +7 -12
  270. package/esm/src/types/SpeechRecognition.d.ts +1 -1
  271. package/esm/src/types/ToolCall.d.ts +1 -1
  272. package/esm/src/types/string_email.d.ts +1 -1
  273. package/esm/src/types/string_host.d.ts +1 -1
  274. package/esm/src/types/string_person_fullname.d.ts +1 -1
  275. package/esm/src/types/string_token.d.ts +1 -1
  276. package/esm/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -1
  277. package/esm/src/utils/color/Color.d.ts +2 -1
  278. package/esm/src/utils/color/internal-utils/hslToRgb.d.ts +2 -3
  279. package/esm/src/utils/color/internal-utils/rgbToHsl.d.ts +2 -3
  280. package/esm/src/utils/color/operators/darken.d.ts +1 -1
  281. package/esm/src/utils/color/operators/grayscale.d.ts +1 -1
  282. package/esm/src/utils/color/operators/lighten.d.ts +1 -1
  283. package/esm/src/utils/color/operators/mixWithColor.d.ts +1 -1
  284. package/esm/src/utils/color/operators/saturate.d.ts +1 -1
  285. package/esm/src/utils/color/parsers/parseHexColor.d.ts +1 -1
  286. package/esm/src/utils/color/parsers/parseHslColor.d.ts +1 -1
  287. package/esm/src/utils/color/parsers/parseRgbColor.d.ts +1 -1
  288. package/esm/src/utils/color/utils/colorToDataUrl.d.ts +3 -1
  289. package/esm/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +1 -1
  290. package/esm/src/utils/editable/types/PipelineEditableSerialized.d.ts +1 -1
  291. package/esm/src/utils/editable/utils/renamePipelineParameter.d.ts +1 -1
  292. package/esm/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
  293. package/esm/src/utils/files/$induceFileDownload.d.ts +1 -1
  294. package/esm/src/utils/files/ObjectUrl.d.ts +2 -1
  295. package/esm/src/utils/files/extensionToMimeType.d.ts +2 -2
  296. package/esm/src/utils/files/getFileExtension.d.ts +2 -2
  297. package/esm/src/utils/files/isDirectoryExisting.d.ts +1 -1
  298. package/esm/src/utils/files/isFileExisting.d.ts +1 -1
  299. package/esm/src/utils/files/listAllFiles.d.ts +1 -1
  300. package/esm/src/utils/files/mimeTypeToExtension.d.ts +2 -2
  301. package/esm/src/utils/filesystem/promptbookTemporaryPath.d.ts +27 -0
  302. package/esm/src/utils/filesystem/promptbookTemporaryPath.test.d.ts +1 -0
  303. package/esm/src/utils/knowledge/inlineKnowledgeSource.d.ts +3 -1
  304. package/esm/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
  305. package/esm/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  306. package/esm/src/utils/markdown/createMarkdownTable.d.ts +1 -2
  307. package/esm/src/utils/markdown/escapeMarkdownBlock.d.ts +1 -1
  308. package/esm/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
  309. package/esm/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
  310. package/esm/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  311. package/esm/src/utils/markdown/flattenMarkdown.d.ts +1 -1
  312. package/esm/src/utils/markdown/humanizeAiText.d.ts +1 -1
  313. package/esm/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
  314. package/esm/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  315. package/esm/src/utils/markdown/humanizeAiTextQuotes.d.ts +1 -1
  316. package/esm/src/utils/markdown/humanizeAiTextSources.d.ts +1 -1
  317. package/esm/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
  318. package/esm/src/utils/markdown/parseMarkdownSection.d.ts +1 -1
  319. package/esm/src/utils/markdown/prettifyMarkdown.d.ts +1 -1
  320. package/esm/src/utils/markdown/promptbookifyAiText.d.ts +1 -1
  321. package/esm/src/utils/markdown/removeMarkdownComments.d.ts +1 -2
  322. package/esm/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -1
  323. package/esm/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -1
  324. package/esm/src/utils/misc/$Register.d.ts +1 -1
  325. package/esm/src/utils/misc/$getCurrentDate.d.ts +1 -1
  326. package/esm/src/utils/misc/aboutPromptbookInformation.d.ts +1 -1
  327. package/esm/src/utils/misc/computeHash.d.ts +2 -2
  328. package/esm/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -1
  329. package/esm/src/utils/normalization/suffixUrl.d.ts +1 -1
  330. package/esm/src/utils/organization/keepImported.d.ts +1 -1
  331. package/esm/src/utils/parameters/extractParameterNames.d.ts +2 -2
  332. package/esm/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -1
  333. package/esm/src/utils/parameters/numberToString.d.ts +1 -1
  334. package/esm/src/utils/parameters/templateParameters.d.ts +2 -1
  335. package/esm/src/utils/parameters/valueToString.d.ts +1 -1
  336. package/esm/src/utils/random/$generateBookBoilerplate.d.ts +1 -1
  337. package/esm/src/utils/random/$randomAgentPersona.d.ts +1 -1
  338. package/esm/src/utils/random/$randomAgentRule.d.ts +1 -1
  339. package/esm/src/utils/random/$randomFullnameWithColor.d.ts +1 -1
  340. package/esm/src/utils/random/$randomSeed.d.ts +1 -1
  341. package/esm/src/utils/random/$randomToken.d.ts +1 -1
  342. package/esm/src/utils/random/NamePool.d.ts +1 -1
  343. package/esm/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  344. package/esm/src/utils/serialization/serializeToPromptbookJavascript.d.ts +1 -1
  345. package/esm/src/utils/toolCalls/mergeToolCalls.d.ts +1 -1
  346. package/esm/src/utils/validators/email/isValidEmail.d.ts +1 -1
  347. package/esm/src/utils/validators/filePath/isRootPath.d.ts +1 -2
  348. package/esm/src/utils/validators/filePath/isValidFilePath.d.ts +1 -1
  349. package/esm/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -1
  350. package/esm/src/utils/validators/parameterName/validateParameterName.d.ts +1 -1
  351. package/esm/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +1 -1
  352. package/esm/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +1 -1
  353. package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +2 -2
  354. package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +1 -1
  355. package/esm/src/utils/validators/url/isValidPipelineUrl.d.ts +1 -1
  356. package/esm/src/utils/validators/url/isValidUrl.d.ts +1 -1
  357. package/esm/src/utils/validators/uuid/isValidUuid.d.ts +1 -1
  358. package/esm/src/version.d.ts +1 -1
  359. package/esm/src/wizard/$getCompiledBook.d.ts +2 -1
  360. package/esm/src/wizard/wizard.d.ts +4 -1
  361. package/package.json +2 -2
  362. package/umd/index.umd.js +578 -542
  363. package/umd/index.umd.js.map +1 -1
  364. package/umd/src/_packages/core.index.d.ts +2 -0
  365. package/umd/src/avatars/AvatarOrImage.d.ts +2 -1
  366. package/umd/src/avatars/avatarRenderingUtils.d.ts +1 -1
  367. package/umd/src/avatars/renderAvatarVisual.d.ts +1 -2
  368. package/umd/src/avatars/types/AvatarDefinition.d.ts +2 -1
  369. package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +3 -2
  370. package/umd/src/avatars/visuals/minecraft2AvatarVisual.d.ts +7 -0
  371. package/umd/src/avatars/visuals/minecraftAvatarVisualShared.d.ts +48 -0
  372. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +5 -1
  373. package/umd/src/book-2.0/agent-source/AgentModelRequirements.d.ts +3 -2
  374. package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +1 -1
  375. package/umd/src/book-2.0/agent-source/computeAgentHash.d.ts +2 -2
  376. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +4 -1
  377. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +1 -1
  378. package/umd/src/book-2.0/agent-source/createDefaultAgentName.d.ts +2 -2
  379. package/umd/src/book-2.0/agent-source/normalizeAgentName.d.ts +1 -1
  380. package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -1
  381. package/umd/src/book-2.0/agent-source/parseTeamCommitment.d.ts +1 -1
  382. package/umd/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.d.ts +1 -1
  383. package/umd/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -1
  384. package/umd/src/book-3.0/Book.d.ts +33 -0
  385. package/umd/src/book-3.0/Book.test.d.ts +1 -0
  386. package/umd/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +1 -1
  387. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +1 -1
  388. package/umd/src/book-components/BookEditor/BookEditor.d.ts +4 -1
  389. package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +1 -1
  390. package/umd/src/book-components/Chat/AgentChip/AgentChip.d.ts +1 -1
  391. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +2 -2
  392. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +1 -1
  393. package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +1 -1
  394. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +4 -4
  395. package/umd/src/book-components/Chat/Chat/ChatRatingModal.d.ts +1 -1
  396. package/umd/src/book-components/Chat/Chat/ChatToolCallModalContent.d.ts +2 -2
  397. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +2 -2
  398. package/umd/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +2 -2
  399. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +1 -1
  400. package/umd/src/book-components/Chat/Chat/resolveRunBrowserToolCallDetailsState.d.ts +1 -1
  401. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +1 -1
  402. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +1 -1
  403. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +1 -1
  404. package/umd/src/book-components/Chat/Chat/useChatToolCallModalState.d.ts +3 -3
  405. package/umd/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +2 -2
  406. package/umd/src/book-components/Chat/LlmChat/useLlmChatMessageHandler.d.ts +1 -1
  407. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -1
  408. package/umd/src/book-components/Chat/hooks/useChatRatings.d.ts +2 -2
  409. package/umd/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +2 -1
  410. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +6 -2
  411. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +5 -3
  412. package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +1 -1
  413. package/umd/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -1
  414. package/umd/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -1
  415. package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.d.ts +2 -2
  416. package/umd/src/book-components/Chat/utils/loadAgentProfile.d.ts +2 -1
  417. package/umd/src/book-components/Chat/utils/resolveCitationUrl.d.ts +1 -1
  418. package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +1 -1
  419. package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +1 -1
  420. package/umd/src/book-components/Qr/useQrCode.d.ts +1 -1
  421. package/umd/src/book-components/_common/react-utils/classNames.d.ts +1 -1
  422. package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  423. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +1 -1
  424. package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +1 -1
  425. package/umd/src/cli/common/$provideLlmToolsForCli.d.ts +1 -1
  426. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +3 -3
  427. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +1 -1
  428. package/umd/src/collection/pipeline-collection/PipelineCollection.d.ts +1 -1
  429. package/umd/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +1 -1
  430. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -1
  431. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +1 -1
  432. package/umd/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -1
  433. package/umd/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -1
  434. package/umd/src/commands/FOREACH/ForeachJson.d.ts +1 -1
  435. package/umd/src/commands/JOKER/JokerCommand.d.ts +1 -1
  436. package/umd/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -1
  437. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +2 -2
  438. package/umd/src/commands/PARAMETER/ParameterCommand.d.ts +2 -2
  439. package/umd/src/commands/PERSONA/PersonaCommand.d.ts +2 -2
  440. package/umd/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -1
  441. package/umd/src/commands/_common/parseCommand.d.ts +1 -1
  442. package/umd/src/commands/_common/stringifyCommand.d.ts +1 -1
  443. package/umd/src/commands/_common/types/CommandParser.d.ts +2 -1
  444. package/umd/src/commitments/MEMORY/MEMORY.d.ts +2 -2
  445. package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +1 -1
  446. package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +1 -1
  447. package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +1 -1
  448. package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +1 -1
  449. package/umd/src/commitments/TEAM/TEAM.d.ts +2 -2
  450. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +2 -2
  451. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +1 -1
  452. package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +1 -1
  453. package/umd/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +1 -1
  454. package/umd/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +1 -1
  455. package/umd/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +1 -1
  456. package/umd/src/commitments/USE_DEEPSEARCH/USE_DEEPSEARCH.d.ts +2 -2
  457. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +2 -2
  458. package/umd/src/commitments/USE_EMAIL/resolveSendEmailToolForNode.d.ts +1 -1
  459. package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +2 -2
  460. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +2 -2
  461. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +1 -1
  462. package/umd/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +1 -1
  463. package/umd/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +1 -1
  464. package/umd/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +1 -1
  465. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +2 -2
  466. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +2 -2
  467. package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +1 -1
  468. package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +2 -2
  469. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +1 -1
  470. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +2 -2
  471. package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +1 -1
  472. package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +1 -1
  473. package/umd/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +2 -2
  474. package/umd/src/commitments/WALLET/WALLET.d.ts +2 -2
  475. package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +1 -1
  476. package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +1 -1
  477. package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +1 -1
  478. package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +1 -1
  479. package/umd/src/commitments/_base/BaseCommitmentDefinition.d.ts +2 -2
  480. package/umd/src/commitments/_base/CommitmentDefinition.d.ts +2 -2
  481. package/umd/src/commitments/_common/commitmentToolFunctions.d.ts +2 -2
  482. package/umd/src/commitments/_common/createSerpSearchToolFunction.d.ts +1 -1
  483. package/umd/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +1 -1
  484. package/umd/src/commitments/_common/getAllCommitmentsToolTitles.d.ts +1 -1
  485. package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.d.ts +1 -1
  486. package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +1 -1
  487. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +1 -1
  488. package/umd/src/config.d.ts +8 -4
  489. package/umd/src/conversion/archive/loadArchive.d.ts +1 -1
  490. package/umd/src/conversion/archive/saveArchive.d.ts +1 -1
  491. package/umd/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +1 -1
  492. package/umd/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -1
  493. package/umd/src/errors/PipelineExecutionError.d.ts +1 -1
  494. package/umd/src/errors/utils/ErrorJson.d.ts +1 -1
  495. package/umd/src/executables/apps/locateLibreoffice.d.ts +1 -1
  496. package/umd/src/executables/apps/locatePandoc.d.ts +1 -1
  497. package/umd/src/executables/apps/locateVscode.d.ts +1 -1
  498. package/umd/src/executables/browsers/locateBrowser.d.ts +1 -1
  499. package/umd/src/executables/browsers/locateChrome.d.ts +1 -1
  500. package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +1 -1
  501. package/umd/src/executables/browsers/locateEdge.d.ts +1 -1
  502. package/umd/src/executables/browsers/locateFirefox.d.ts +1 -1
  503. package/umd/src/executables/browsers/locateInternetExplorer.d.ts +1 -1
  504. package/umd/src/executables/browsers/locateSafari.d.ts +1 -1
  505. package/umd/src/executables/locateApp.d.ts +1 -1
  506. package/umd/src/executables/platforms/locateAppOnLinux.d.ts +1 -1
  507. package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +1 -1
  508. package/umd/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
  509. package/umd/src/execution/AbstractTaskResult.d.ts +1 -1
  510. package/umd/src/execution/AvailableModel.d.ts +5 -1
  511. package/umd/src/execution/CommonToolsOptions.d.ts +1 -1
  512. package/umd/src/execution/Executables.d.ts +1 -1
  513. package/umd/src/execution/ExecutionTask.d.ts +3 -2
  514. package/umd/src/execution/LlmExecutionTools.d.ts +2 -1
  515. package/umd/src/execution/PipelineExecutor.d.ts +1 -1
  516. package/umd/src/execution/PipelineExecutorResult.d.ts +2 -2
  517. package/umd/src/execution/PromptResult.d.ts +3 -1
  518. package/umd/src/execution/PromptbookFetch.d.ts +1 -1
  519. package/umd/src/execution/ScriptExecutionTools.d.ts +2 -2
  520. package/umd/src/execution/UncertainNumber.d.ts +2 -2
  521. package/umd/src/execution/UserInterfaceTools.d.ts +1 -2
  522. package/umd/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
  523. package/umd/src/execution/createPipelineExecutor/20-executeTask.d.ts +1 -1
  524. package/umd/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +2 -1
  525. package/umd/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +1 -1
  526. package/umd/src/execution/createPipelineExecutor/getContextForTask.d.ts +2 -2
  527. package/umd/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +2 -2
  528. package/umd/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +3 -1
  529. package/umd/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +1 -2
  530. package/umd/src/execution/execution-report/ExecutionReportJson.d.ts +3 -3
  531. package/umd/src/execution/execution-report/ExecutionReportStringOptions.d.ts +1 -1
  532. package/umd/src/execution/utils/usageToHuman.d.ts +1 -1
  533. package/umd/src/execution/utils/validatePromptResult.d.ts +1 -1
  534. package/umd/src/file-security-checkers/FileSecurityCheckResult.d.ts +2 -1
  535. package/umd/src/file-security-checkers/FileSecurityChecker.d.ts +3 -1
  536. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -1
  537. package/umd/src/formats/_common/FormatParser.d.ts +2 -2
  538. package/umd/src/formats/_common/FormatSubvalueParser.d.ts +2 -3
  539. package/umd/src/formats/csv/utils/csvParse.d.ts +1 -1
  540. package/umd/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +2 -3
  541. package/umd/src/import-plugins/FileImportPlugin.d.ts +1 -1
  542. package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +1 -1
  543. package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -2
  544. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
  545. package/umd/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +1 -1
  546. package/umd/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +2 -1
  547. package/umd/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +3 -1
  548. package/umd/src/llm-providers/_common/utils/assertUniqueModels.d.ts +1 -1
  549. package/umd/src/llm-providers/_common/utils/cache/CacheItem.d.ts +2 -2
  550. package/umd/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +2 -1
  551. package/umd/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +2 -1
  552. package/umd/src/llm-providers/agent/Agent.d.ts +6 -2
  553. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +3 -1
  554. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +2 -2
  555. package/umd/src/llm-providers/agent/RemoteAgentOptions.d.ts +1 -1
  556. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -1
  557. package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
  558. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +2 -1
  559. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +2 -3
  560. package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -1
  561. package/umd/src/llm-providers/google/google-models.d.ts +1 -1
  562. package/umd/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
  563. package/umd/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -1
  564. package/umd/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -1
  565. package/umd/src/llm-providers/ollama/OllamaExecutionTools.d.ts +2 -1
  566. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +3 -2
  567. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionToolsOptions.d.ts +1 -1
  568. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +3 -1
  569. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +1 -1
  570. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +3 -1
  571. package/umd/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -1
  572. package/umd/src/llm-providers/openai/OpenAiVectorStoreHandler.d.ts +2 -2
  573. package/umd/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +3 -1
  574. package/umd/src/llm-providers/openai/utils/OpenAiCompatibleUnsupportedParameterRetrier.d.ts +1 -1
  575. package/umd/src/llm-providers/openai/utils/callOpenAiCompatibleChatModel.d.ts +2 -1
  576. package/umd/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +2 -1
  577. package/umd/src/other/templates/getBookTemplates.d.ts +1 -1
  578. package/umd/src/personas/preparePersona.d.ts +1 -1
  579. package/umd/src/pipeline/PipelineJson/CommonTaskJson.d.ts +4 -8
  580. package/umd/src/pipeline/PipelineJson/Expectations.d.ts +1 -2
  581. package/umd/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +4 -6
  582. package/umd/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +3 -3
  583. package/umd/src/pipeline/PipelineJson/ParameterJson.d.ts +2 -3
  584. package/umd/src/pipeline/PipelineJson/PersonaJson.d.ts +3 -3
  585. package/umd/src/pipeline/PipelineJson/PipelineJson.d.ts +6 -9
  586. package/umd/src/pipeline/PipelineJson/PreparationJson.d.ts +1 -1
  587. package/umd/src/pipeline/PipelineJson/PromptTaskJson.d.ts +1 -1
  588. package/umd/src/pipeline/prompt-notation.d.ts +1 -1
  589. package/umd/src/postprocessing/utils/extractBlock.d.ts +1 -1
  590. package/umd/src/postprocessing/utils/extractJsonBlock.d.ts +1 -2
  591. package/umd/src/prepare/PrepareAndScrapeOptions.d.ts +1 -1
  592. package/umd/src/remote-server/socket-types/_subtypes/Identification.d.ts +2 -2
  593. package/umd/src/remote-server/socket-types/_subtypes/identificationToPromptbookToken.d.ts +1 -1
  594. package/umd/src/remote-server/socket-types/_subtypes/promptbookTokenToIdentification.d.ts +1 -1
  595. package/umd/src/remote-server/startAgentServer.d.ts +1 -1
  596. package/umd/src/remote-server/types/RemoteClientOptions.d.ts +1 -1
  597. package/umd/src/remote-server/types/RemoteServerOptions.d.ts +2 -1
  598. package/umd/src/scrapers/_common/Scraper.d.ts +4 -4
  599. package/umd/src/scrapers/_common/ScraperIntermediateSource.d.ts +1 -1
  600. package/umd/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +1 -1
  601. package/umd/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +3 -1
  602. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -1
  603. package/umd/src/scrapers/website/WebsiteScraper.d.ts +2 -3
  604. package/umd/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +2 -2
  605. package/umd/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +2 -2
  606. package/umd/src/search-engines/SearchEngine.d.ts +2 -1
  607. package/umd/src/search-engines/SearchResult.d.ts +1 -1
  608. package/umd/src/search-engines/bing/BingSearchEngine.d.ts +2 -1
  609. package/umd/src/search-engines/dummy/DummySearchEngine.d.ts +2 -1
  610. package/umd/src/search-engines/google/GoogleSearchEngine.d.ts +2 -1
  611. package/umd/src/search-engines/serp/SerpSearchEngine.d.ts +2 -1
  612. package/umd/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +1 -1
  613. package/umd/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +1 -1
  614. package/umd/src/storage/local-storage/utils/IndexedDbStorageOptions.d.ts +1 -1
  615. package/umd/src/transpilers/_common/BookTranspiler.d.ts +4 -2
  616. package/umd/src/transpilers/_common/createTranspiledTeamRuntimeSection.d.ts +1 -1
  617. package/umd/src/transpilers/_common/formatUsedToolFunctions.d.ts +1 -1
  618. package/umd/src/transpilers/agent-os/AgentOsTranspiler.d.ts +1 -1
  619. package/umd/src/transpilers/anthropic-claude-managed/AnthropicClaudeManagedTranspiler.d.ts +1 -1
  620. package/umd/src/transpilers/anthropic-claude-sdk/AnthropicClaudeSdkTranspiler.d.ts +1 -1
  621. package/umd/src/transpilers/e2b/E2BTranspiler.d.ts +1 -1
  622. package/umd/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +1 -1
  623. package/umd/src/transpilers/openai-agents/OpenAiAgentsTranspiler.d.ts +1 -1
  624. package/umd/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +1 -1
  625. package/umd/src/types/LlmCall.d.ts +1 -1
  626. package/umd/src/types/LlmToolDefinition.d.ts +2 -1
  627. package/umd/src/types/Message.d.ts +4 -3
  628. package/umd/src/types/ModelRequirements.d.ts +4 -2
  629. package/umd/src/types/Prompt.d.ts +7 -12
  630. package/umd/src/types/SpeechRecognition.d.ts +1 -1
  631. package/umd/src/types/ToolCall.d.ts +1 -1
  632. package/umd/src/types/string_email.d.ts +1 -1
  633. package/umd/src/types/string_host.d.ts +1 -1
  634. package/umd/src/types/string_person_fullname.d.ts +1 -1
  635. package/umd/src/types/string_token.d.ts +1 -1
  636. package/umd/src/utils/agents/resolveAgentAvatarImageUrl.d.ts +2 -1
  637. package/umd/src/utils/color/Color.d.ts +2 -1
  638. package/umd/src/utils/color/internal-utils/hslToRgb.d.ts +2 -3
  639. package/umd/src/utils/color/internal-utils/rgbToHsl.d.ts +2 -3
  640. package/umd/src/utils/color/operators/darken.d.ts +1 -1
  641. package/umd/src/utils/color/operators/grayscale.d.ts +1 -1
  642. package/umd/src/utils/color/operators/lighten.d.ts +1 -1
  643. package/umd/src/utils/color/operators/mixWithColor.d.ts +1 -1
  644. package/umd/src/utils/color/operators/saturate.d.ts +1 -1
  645. package/umd/src/utils/color/parsers/parseHexColor.d.ts +1 -1
  646. package/umd/src/utils/color/parsers/parseHslColor.d.ts +1 -1
  647. package/umd/src/utils/color/parsers/parseRgbColor.d.ts +1 -1
  648. package/umd/src/utils/color/utils/colorToDataUrl.d.ts +3 -1
  649. package/umd/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +1 -1
  650. package/umd/src/utils/editable/types/PipelineEditableSerialized.d.ts +1 -1
  651. package/umd/src/utils/editable/utils/renamePipelineParameter.d.ts +1 -1
  652. package/umd/src/utils/editable/utils/stringifyPipelineJson.d.ts +1 -1
  653. package/umd/src/utils/files/$induceFileDownload.d.ts +1 -1
  654. package/umd/src/utils/files/ObjectUrl.d.ts +2 -1
  655. package/umd/src/utils/files/extensionToMimeType.d.ts +2 -2
  656. package/umd/src/utils/files/getFileExtension.d.ts +2 -2
  657. package/umd/src/utils/files/isDirectoryExisting.d.ts +1 -1
  658. package/umd/src/utils/files/isFileExisting.d.ts +1 -1
  659. package/umd/src/utils/files/listAllFiles.d.ts +1 -1
  660. package/umd/src/utils/files/mimeTypeToExtension.d.ts +2 -2
  661. package/umd/src/utils/filesystem/promptbookTemporaryPath.d.ts +27 -0
  662. package/umd/src/utils/filesystem/promptbookTemporaryPath.test.d.ts +1 -0
  663. package/umd/src/utils/knowledge/inlineKnowledgeSource.d.ts +3 -1
  664. package/umd/src/utils/markdown/addAutoGeneratedSection.d.ts +2 -2
  665. package/umd/src/utils/markdown/createMarkdownChart.d.ts +1 -1
  666. package/umd/src/utils/markdown/createMarkdownTable.d.ts +1 -2
  667. package/umd/src/utils/markdown/escapeMarkdownBlock.d.ts +1 -1
  668. package/umd/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
  669. package/umd/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -1
  670. package/umd/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -1
  671. package/umd/src/utils/markdown/flattenMarkdown.d.ts +1 -1
  672. package/umd/src/utils/markdown/humanizeAiText.d.ts +1 -1
  673. package/umd/src/utils/markdown/humanizeAiTextEllipsis.d.ts +1 -1
  674. package/umd/src/utils/markdown/humanizeAiTextEmdashed.d.ts +1 -1
  675. package/umd/src/utils/markdown/humanizeAiTextQuotes.d.ts +1 -1
  676. package/umd/src/utils/markdown/humanizeAiTextSources.d.ts +1 -1
  677. package/umd/src/utils/markdown/humanizeAiTextWhitespace.d.ts +1 -1
  678. package/umd/src/utils/markdown/parseMarkdownSection.d.ts +1 -1
  679. package/umd/src/utils/markdown/prettifyMarkdown.d.ts +1 -1
  680. package/umd/src/utils/markdown/promptbookifyAiText.d.ts +1 -1
  681. package/umd/src/utils/markdown/removeMarkdownComments.d.ts +1 -2
  682. package/umd/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -1
  683. package/umd/src/utils/markdown/splitMarkdownIntoSections.d.ts +1 -1
  684. package/umd/src/utils/misc/$Register.d.ts +1 -1
  685. package/umd/src/utils/misc/$getCurrentDate.d.ts +1 -1
  686. package/umd/src/utils/misc/aboutPromptbookInformation.d.ts +1 -1
  687. package/umd/src/utils/misc/computeHash.d.ts +2 -2
  688. package/umd/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -1
  689. package/umd/src/utils/normalization/suffixUrl.d.ts +1 -1
  690. package/umd/src/utils/organization/keepImported.d.ts +1 -1
  691. package/umd/src/utils/parameters/extractParameterNames.d.ts +2 -2
  692. package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -1
  693. package/umd/src/utils/parameters/numberToString.d.ts +1 -1
  694. package/umd/src/utils/parameters/templateParameters.d.ts +2 -1
  695. package/umd/src/utils/parameters/valueToString.d.ts +1 -1
  696. package/umd/src/utils/random/$generateBookBoilerplate.d.ts +1 -1
  697. package/umd/src/utils/random/$randomAgentPersona.d.ts +1 -1
  698. package/umd/src/utils/random/$randomAgentRule.d.ts +1 -1
  699. package/umd/src/utils/random/$randomFullnameWithColor.d.ts +1 -1
  700. package/umd/src/utils/random/$randomSeed.d.ts +1 -1
  701. package/umd/src/utils/random/$randomToken.d.ts +1 -1
  702. package/umd/src/utils/random/NamePool.d.ts +1 -1
  703. package/umd/src/utils/serialization/checkSerializableAsJson.d.ts +1 -1
  704. package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +1 -1
  705. package/umd/src/utils/toolCalls/mergeToolCalls.d.ts +1 -1
  706. package/umd/src/utils/validators/email/isValidEmail.d.ts +1 -1
  707. package/umd/src/utils/validators/filePath/isRootPath.d.ts +1 -2
  708. package/umd/src/utils/validators/filePath/isValidFilePath.d.ts +1 -1
  709. package/umd/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -1
  710. package/umd/src/utils/validators/parameterName/validateParameterName.d.ts +1 -1
  711. package/umd/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +1 -1
  712. package/umd/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +1 -1
  713. package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +2 -2
  714. package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +1 -1
  715. package/umd/src/utils/validators/url/isValidPipelineUrl.d.ts +1 -1
  716. package/umd/src/utils/validators/url/isValidUrl.d.ts +1 -1
  717. package/umd/src/utils/validators/uuid/isValidUuid.d.ts +1 -1
  718. package/umd/src/version.d.ts +1 -1
  719. package/umd/src/wizard/$getCompiledBook.d.ts +2 -1
  720. package/umd/src/wizard/wizard.d.ts +4 -1
package/umd/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs/promises'), require('spacetrim'), require('child_process'), require('colors'), require('waitasecond'), require('crypto-js'), require('crypto-js/enc-hex'), require('path'), require('crypto'), require('rxjs'), require('crypto-js/sha256'), require('mime-types'), require('papaparse')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'fs/promises', 'spacetrim', 'child_process', 'colors', 'waitasecond', 'crypto-js', 'crypto-js/enc-hex', 'path', 'crypto', 'rxjs', 'crypto-js/sha256', 'mime-types', 'papaparse'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-documents"] = {}, global.promises, global.spacetrim, global.child_process, global.colors, global.waitasecond, global.cryptoJs, global.hexEncoder, global.path, global.crypto, global.rxjs, global.sha256, global.mimeTypes, global.papaparse));
5
- })(this, (function (exports, promises, spacetrim, child_process, colors, waitasecond, cryptoJs, hexEncoder, path, crypto, rxjs, sha256, mimeTypes, papaparse) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('fs/promises'), require('spacetrim'), require('child_process'), require('colors'), require('waitasecond'), require('crypto'), require('rxjs'), require('crypto-js/enc-hex'), require('crypto-js/sha256'), require('path'), require('crypto-js'), require('mime-types'), require('papaparse')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'fs/promises', 'spacetrim', 'child_process', 'colors', 'waitasecond', 'crypto', 'rxjs', 'crypto-js/enc-hex', 'crypto-js/sha256', 'path', 'crypto-js', 'mime-types', 'papaparse'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-documents"] = {}, global.promises, global.spacetrim, global.child_process, global.colors, global.waitasecond, global.crypto, global.rxjs, global.hexEncoder, global.sha256, global.path, global.cryptoJs, global.mimeTypes, global.papaparse));
5
+ })(this, (function (exports, promises, spacetrim, child_process, colors, waitasecond, crypto, rxjs, hexEncoder, sha256, path, cryptoJs, mimeTypes, papaparse) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -24,7 +24,7 @@
24
24
  * @generated
25
25
  * @see https://github.com/webgptorg/promptbook
26
26
  */
27
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-65';
27
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-69';
28
28
  /**
29
29
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
30
30
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -961,6 +961,35 @@
961
961
  }
962
962
  // TODO: Maybe implement by mix+hsl
963
963
 
964
+ /**
965
+ * Stable root directory used for Promptbook-owned temporary files and caches.
966
+ *
967
+ * @private internal utility for Promptbook temporary folders
968
+ */
969
+ const PROMPTBOOK_TEMPORARY_DIRECTORY = '.promptbook';
970
+ /**
971
+ * Builds one normalized project-relative path inside Promptbook's dedicated temporary root.
972
+ *
973
+ * The returned path intentionally uses `/` separators so the same helper can be reused from
974
+ * Node.js and edge-safe code without depending on the Node `path` module.
975
+ *
976
+ * @private internal utility for Promptbook temporary folders
977
+ */
978
+ function getPromptbookTemporaryPath(...pathSegments) {
979
+ const normalizedPathSegments = pathSegments.flatMap(splitPathSegments).filter(Boolean);
980
+ return [PROMPTBOOK_TEMPORARY_DIRECTORY, ...normalizedPathSegments].join('/');
981
+ }
982
+ /**
983
+ * Normalizes one raw path segment into slash-delimited pieces without empty items.
984
+ */
985
+ function splitPathSegments(pathSegment) {
986
+ return pathSegment
987
+ .split(/[\\/]+/u)
988
+ .map((segment) => segment.trim())
989
+ .filter(Boolean);
990
+ }
991
+ // Note: [💞] Ignore a discrepancy between file name and entity name
992
+
964
993
  /**
965
994
  * Returns the same value that is passed as argument.
966
995
  * No side effects.
@@ -1136,7 +1165,6 @@
1136
1165
  */
1137
1166
  const DEFAULT_MAX_EXECUTION_ATTEMPTS = 7; // <- TODO: [🤹‍♂️]
1138
1167
  // <- TODO: [🕝] Make also `AGENTS_DIRNAME_ALTERNATIVES`
1139
- // TODO: Just `.promptbook` in config, hardcode subfolders like `download-cache` or `execution-cache`
1140
1168
  /**
1141
1169
  * Where to store the temporary downloads
1142
1170
  *
@@ -1144,7 +1172,15 @@
1144
1172
  *
1145
1173
  * @public exported from `@promptbook/core`
1146
1174
  */
1147
- const DEFAULT_DOWNLOAD_CACHE_DIRNAME = './.promptbook/download-cache';
1175
+ const DEFAULT_DOWNLOAD_CACHE_DIRNAME = `./${getPromptbookTemporaryPath('download-cache')}`;
1176
+ /**
1177
+ * Where to store the cache of executions for promptbook CLI
1178
+ *
1179
+ * Note: When the folder does not exist, it is created recursively
1180
+ *
1181
+ * @public exported from `@promptbook/core`
1182
+ */
1183
+ `./${getPromptbookTemporaryPath('execution-cache')}`;
1148
1184
  /**
1149
1185
  * Where to store the scrape cache
1150
1186
  *
@@ -1152,7 +1188,7 @@
1152
1188
  *
1153
1189
  * @public exported from `@promptbook/core`
1154
1190
  */
1155
- const DEFAULT_SCRAPE_CACHE_DIRNAME = './.promptbook/scrape-cache';
1191
+ const DEFAULT_SCRAPE_CACHE_DIRNAME = `./${getPromptbookTemporaryPath('scrape-cache')}`;
1156
1192
  // <- TODO: [🧜‍♂️]
1157
1193
  /**
1158
1194
  * Default settings for parsing and generating CSV files in Promptbook.
@@ -1532,337 +1568,27 @@
1532
1568
  // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
1533
1569
  // TODO: [🖇] What about symlinks?
1534
1570
 
1571
+ 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"}];
1572
+
1535
1573
  /**
1536
- * Converts a name to a properly formatted subfolder path for cache storage.
1537
- * Handles normalization and path formatting to create consistent cache directory structures.
1574
+ * Checks if value is valid email
1538
1575
  *
1539
- * @private for `FileCacheStorage`
1576
+ * @public exported from `@promptbook/utils`
1540
1577
  */
1541
- function nameToSubfolderPath(name) {
1542
- return [name.substr(0, 1).toLowerCase(), name.substr(1, 1).toLowerCase()];
1578
+ function isValidEmail(email) {
1579
+ if (typeof email !== 'string') {
1580
+ return false;
1581
+ }
1582
+ if (email.split(/\r?\n/).length > 1) {
1583
+ return false;
1584
+ }
1585
+ return /^.+@.+\..+$/.test(email);
1543
1586
  }
1544
1587
 
1545
1588
  /**
1546
- * Collection of default diacritics removal map.
1547
- */
1548
- const defaultDiacriticsRemovalMap = [
1549
- {
1550
- base: 'A',
1551
- letters: '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F',
1552
- },
1553
- { base: 'AA', letters: '\uA732' },
1554
- { base: 'AE', letters: '\u00C6\u01FC\u01E2' },
1555
- { base: 'AO', letters: '\uA734' },
1556
- { base: 'AU', letters: '\uA736' },
1557
- { base: 'AV', letters: '\uA738\uA73A' },
1558
- { base: 'AY', letters: '\uA73C' },
1559
- {
1560
- base: 'B',
1561
- letters: '\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181',
1562
- },
1563
- {
1564
- base: 'C',
1565
- letters: '\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E',
1566
- },
1567
- {
1568
- base: 'D',
1569
- letters: '\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779\u00D0',
1570
- },
1571
- { base: 'DZ', letters: '\u01F1\u01C4' },
1572
- { base: 'Dz', letters: '\u01F2\u01C5' },
1573
- {
1574
- base: 'E',
1575
- letters: '\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E',
1576
- },
1577
- { base: 'F', letters: '\u0046\u24BB\uFF26\u1E1E\u0191\uA77B' },
1578
- {
1579
- base: 'G',
1580
- letters: '\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E',
1581
- },
1582
- {
1583
- base: 'H',
1584
- letters: '\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D',
1585
- },
1586
- {
1587
- base: 'I',
1588
- letters: '\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197',
1589
- },
1590
- { base: 'J', letters: '\u004A\u24BF\uFF2A\u0134\u0248' },
1591
- {
1592
- base: 'K',
1593
- letters: '\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2',
1594
- },
1595
- {
1596
- base: 'L',
1597
- letters: '\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780',
1598
- },
1599
- { base: 'LJ', letters: '\u01C7' },
1600
- { base: 'Lj', letters: '\u01C8' },
1601
- { base: 'M', letters: '\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C' },
1602
- {
1603
- base: 'N',
1604
- letters: '\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4',
1605
- },
1606
- { base: 'NJ', letters: '\u01CA' },
1607
- { base: 'Nj', letters: '\u01CB' },
1608
- {
1609
- base: 'O',
1610
- letters: '\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C',
1611
- },
1612
- { base: 'OI', letters: '\u01A2' },
1613
- { base: 'OO', letters: '\uA74E' },
1614
- { base: 'OU', letters: '\u0222' },
1615
- { base: 'OE', letters: '\u008C\u0152' },
1616
- { base: 'oe', letters: '\u009C\u0153' },
1617
- {
1618
- base: 'P',
1619
- letters: '\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754',
1620
- },
1621
- { base: 'Q', letters: '\u0051\u24C6\uFF31\uA756\uA758\u024A' },
1622
- {
1623
- base: 'R',
1624
- letters: '\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782',
1625
- },
1626
- {
1627
- base: 'S',
1628
- letters: '\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784',
1629
- },
1630
- {
1631
- base: 'T',
1632
- letters: '\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786',
1633
- },
1634
- { base: 'TZ', letters: '\uA728' },
1635
- {
1636
- base: 'U',
1637
- letters: '\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244',
1638
- },
1639
- { base: 'V', letters: '\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245' },
1640
- { base: 'VY', letters: '\uA760' },
1641
- {
1642
- base: 'W',
1643
- letters: '\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72',
1644
- },
1645
- { base: 'X', letters: '\u0058\u24CD\uFF38\u1E8A\u1E8C' },
1646
- {
1647
- base: 'Y',
1648
- letters: '\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE',
1649
- },
1650
- {
1651
- base: 'Z',
1652
- letters: '\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762',
1653
- },
1654
- {
1655
- base: 'a',
1656
- letters: '\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250',
1657
- },
1658
- { base: 'aa', letters: '\uA733' },
1659
- { base: 'ae', letters: '\u00E6\u01FD\u01E3' },
1660
- { base: 'ao', letters: '\uA735' },
1661
- { base: 'au', letters: '\uA737' },
1662
- { base: 'av', letters: '\uA739\uA73B' },
1663
- { base: 'ay', letters: '\uA73D' },
1664
- {
1665
- base: 'b',
1666
- letters: '\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253',
1667
- },
1668
- {
1669
- base: 'c',
1670
- letters: '\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184',
1671
- },
1672
- {
1673
- base: 'd',
1674
- letters: '\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A',
1675
- },
1676
- { base: 'dz', letters: '\u01F3\u01C6' },
1677
- {
1678
- base: 'e',
1679
- letters: '\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD',
1680
- },
1681
- { base: 'f', letters: '\u0066\u24D5\uFF46\u1E1F\u0192\uA77C' },
1682
- {
1683
- base: 'g',
1684
- letters: '\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F',
1685
- },
1686
- {
1687
- base: 'h',
1688
- letters: '\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265',
1689
- },
1690
- { base: 'hv', letters: '\u0195' },
1691
- {
1692
- base: 'i',
1693
- letters: '\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131',
1694
- },
1695
- { base: 'j', letters: '\u006A\u24D9\uFF4A\u0135\u01F0\u0249' },
1696
- {
1697
- base: 'k',
1698
- letters: '\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3',
1699
- },
1700
- {
1701
- base: 'l',
1702
- letters: '\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747',
1703
- },
1704
- { base: 'lj', letters: '\u01C9' },
1705
- { base: 'm', letters: '\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F' },
1706
- {
1707
- base: 'n',
1708
- letters: '\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5',
1709
- },
1710
- { base: 'nj', letters: '\u01CC' },
1711
- {
1712
- base: 'o',
1713
- letters: '\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275',
1714
- },
1715
- { base: 'oi', letters: '\u01A3' },
1716
- { base: 'ou', letters: '\u0223' },
1717
- { base: 'oo', letters: '\uA74F' },
1718
- {
1719
- base: 'p',
1720
- letters: '\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755',
1721
- },
1722
- { base: 'q', letters: '\u0071\u24E0\uFF51\u024B\uA757\uA759' },
1723
- {
1724
- base: 'r',
1725
- letters: '\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783',
1726
- },
1727
- {
1728
- base: 's',
1729
- letters: '\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B',
1730
- },
1731
- {
1732
- base: 't',
1733
- letters: '\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787',
1734
- },
1735
- { base: 'tz', letters: '\uA729' },
1736
- {
1737
- base: 'u',
1738
- letters: '\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289',
1739
- },
1740
- { base: 'v', letters: '\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C' },
1741
- { base: 'vy', letters: '\uA761' },
1742
- {
1743
- base: 'w',
1744
- letters: '\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73',
1745
- },
1746
- { base: 'x', letters: '\u0078\u24E7\uFF58\u1E8B\u1E8D' },
1747
- {
1748
- base: 'y',
1749
- letters: '\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF',
1750
- },
1751
- {
1752
- base: 'z',
1753
- letters: '\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763',
1754
- },
1755
- ];
1756
- /**
1757
- * Map of letters from diacritic variant to diacritless variant
1758
- * Contains lowercase and uppercase separatelly
1589
+ * Tests if given string is valid file path.
1759
1590
  *
1760
- * > "á" => "a"
1761
- * > "ě" => "e"
1762
- * > "Ă" => "A"
1763
- * > ...
1764
- *
1765
- * @public exported from `@promptbook/utils`
1766
- */
1767
- const DIACRITIC_VARIANTS_LETTERS = {};
1768
- // tslint:disable-next-line: prefer-for-of
1769
- for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
1770
- const letters = defaultDiacriticsRemovalMap[i].letters;
1771
- // tslint:disable-next-line: prefer-for-of
1772
- for (let j = 0; j < letters.length; j++) {
1773
- DIACRITIC_VARIANTS_LETTERS[letters[j]] = defaultDiacriticsRemovalMap[i].base;
1774
- }
1775
- }
1776
- // <- TODO: [🍓] Put to maker function to save execution time if not needed
1777
- /*
1778
- @see https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
1779
- Licensed under the Apache License, Version 2.0 (the "License");
1780
- you may not use this file except in compliance with the License.
1781
- You may obtain a copy of the License at
1782
-
1783
- http://www.apache.org/licenses/LICENSE-2.0
1784
-
1785
- Unless required by applicable law or agreed to in writing, software
1786
- distributed under the License is distributed on an "AS IS" BASIS,
1787
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1788
- See the License for the specific language governing permissions and
1789
- limitations under the License.
1790
- */
1791
-
1792
- /**
1793
- * Removes diacritic marks (accents) from characters in a string.
1794
- *
1795
- * Note: [🔂] This function is idempotent.
1796
- *
1797
- * @param input The string containing diacritics to be normalized.
1798
- * @returns The string with diacritics removed or normalized.
1799
- *
1800
- * @public exported from `@promptbook/utils`
1801
- */
1802
- function removeDiacritics(input) {
1803
- /*eslint no-control-regex: "off"*/
1804
- return input.replace(/[^\u0000-\u007E]/g, (character) => {
1805
- return DIACRITIC_VARIANTS_LETTERS[character] || character;
1806
- });
1807
- }
1808
- // TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
1809
-
1810
- /**
1811
- * Converts a given text to kebab-case format.
1812
- *
1813
- * Note: [🔂] This function is idempotent.
1814
- *
1815
- * @param text The text to be converted.
1816
- * @returns The kebab-case formatted string.
1817
- * @example 'hello-world'
1818
- * @example 'i-love-promptbook'
1819
- *
1820
- * @public exported from `@promptbook/utils`
1821
- */
1822
- function normalizeToKebabCase(text) {
1823
- text = removeDiacritics(text);
1824
- let charType;
1825
- let lastCharType = 'OTHER';
1826
- let normalizedName = '';
1827
- for (const char of text) {
1828
- let normalizedChar;
1829
- if (/^[a-z]$/.test(char)) {
1830
- charType = 'LOWERCASE';
1831
- normalizedChar = char;
1832
- }
1833
- else if (/^[A-Z]$/.test(char)) {
1834
- charType = 'UPPERCASE';
1835
- normalizedChar = char.toLowerCase();
1836
- }
1837
- else if (/^[0-9]$/.test(char)) {
1838
- charType = 'NUMBER';
1839
- normalizedChar = char;
1840
- }
1841
- else {
1842
- charType = 'OTHER';
1843
- normalizedChar = '-';
1844
- }
1845
- if (charType !== lastCharType &&
1846
- !(lastCharType === 'UPPERCASE' && charType === 'LOWERCASE') &&
1847
- !(lastCharType === 'NUMBER') &&
1848
- !(charType === 'NUMBER')) {
1849
- normalizedName += '-';
1850
- }
1851
- normalizedName += normalizedChar;
1852
- lastCharType = charType;
1853
- }
1854
- normalizedName = normalizedName.split(/-+/g).join('-');
1855
- normalizedName = normalizedName.split(/-?\/-?/g).join('/');
1856
- normalizedName = normalizedName.replace(/^-/, '');
1857
- normalizedName = normalizedName.replace(/-$/, '');
1858
- return normalizedName;
1859
- }
1860
- // Note: [💞] Ignore a discrepancy between file name and entity name
1861
-
1862
- /**
1863
- * Tests if given string is valid file path.
1864
- *
1865
- * Note: This does not check if the file exists only if the path is valid
1591
+ * Note: This does not check if the file exists only if the path is valid
1866
1592
  *
1867
1593
  * @public exported from `@promptbook/utils`
1868
1594
  */
@@ -1945,137 +1671,6 @@
1945
1671
  }
1946
1672
  }
1947
1673
 
1948
- /**
1949
- * Removes emojis from a string and fix whitespaces
1950
- *
1951
- * Note: [🔂] This function is idempotent.
1952
- *
1953
- * @param text with emojis
1954
- * @returns text without emojis
1955
- *
1956
- * @public exported from `@promptbook/utils`
1957
- */
1958
- function removeEmojis(text) {
1959
- // Replace emojis (and also ZWJ sequence) with hyphens
1960
- text = text.replace(/(\p{Extended_Pictographic})\p{Modifier_Symbol}/gu, '$1');
1961
- text = text.replace(/(\p{Extended_Pictographic})[\u{FE00}-\u{FE0F}]/gu, '$1');
1962
- text = text.replace(/(\p{Extended_Pictographic})(\u{200D}\p{Extended_Pictographic})*/gu, '$1');
1963
- text = text.replace(/\p{Extended_Pictographic}/gu, '');
1964
- return text;
1965
- }
1966
-
1967
- /**
1968
- * Converts a title string into a normalized name.
1969
- *
1970
- * Note: [🔂] This function is idempotent.
1971
- *
1972
- * @param value The title string to be converted to a name.
1973
- * @returns A normalized name derived from the input title.
1974
- * @example 'Hello World!' -> 'hello-world'
1975
- *
1976
- * @public exported from `@promptbook/utils`
1977
- */
1978
- function titleToName(value) {
1979
- if (isValidUrl(value)) {
1980
- value = value.replace(/^https?:\/\//, '');
1981
- value = value.replace(/\.html$/, '');
1982
- }
1983
- else if (isValidFilePath(value)) {
1984
- value = path.basename(value);
1985
- // Note: Keeping extension in the name
1986
- }
1987
- value = value.split('/').join('-');
1988
- value = removeEmojis(value);
1989
- value = normalizeToKebabCase(value);
1990
- // TODO: [🧠] Maybe warn or add some padding to short name which are not good identifiers
1991
- return value;
1992
- }
1993
-
1994
- /**
1995
- * Retrieves an intermediate source for a scraper based on the knowledge source.
1996
- * Manages the caching and retrieval of intermediate scraper results for optimized performance.
1997
- *
1998
- * @private as internal utility for scrapers
1999
- */
2000
- async function getScraperIntermediateSource(source, options) {
2001
- const { filename: sourceFilename, url } = source;
2002
- const { rootDirname, cacheDirname, intermediateFilesStrategy, extension, isVerbose } = options;
2003
- // TODO: [👬] DRY
2004
- const hash = cryptoJs.SHA256(
2005
- // <- TODO: [🥬] Encapsulate sha256 to some private utility function
2006
- hexEncoder__default["default"].parse(sourceFilename || url || 'untitled'))
2007
- .toString( /* hex */)
2008
- .substring(0, 20);
2009
- // <- TODO: [🥬] Make some system for hashes and ids of promptbook
2010
- const semanticName = normalizeToKebabCase(titleToName((sourceFilename || url || '').split('intermediate').join(''))).substring(0, 20);
2011
- // <- TODO: [🐱‍🐉]
2012
- const pieces = ['intermediate', semanticName, hash].filter((piece) => piece !== '');
2013
- const name = pieces.join('-').split('--').join('-');
2014
- const cacheFilename = path.join(process.cwd(), cacheDirname, ...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), name)
2015
- .split('\\')
2016
- .join('/') +
2017
- '.' +
2018
- extension;
2019
- // Note: Try to create cache directory, but don't fail if filesystem has issues
2020
- try {
2021
- await promises.mkdir(path.dirname(cacheFilename), { recursive: true });
2022
- }
2023
- catch (error) {
2024
- // Note: If we can't create cache directory, continue without it
2025
- // This handles read-only filesystems, permission issues, and missing parent directories
2026
- if (error instanceof Error &&
2027
- (error.message.includes('EROFS') ||
2028
- error.message.includes('read-only') ||
2029
- error.message.includes('EACCES') ||
2030
- error.message.includes('EPERM') ||
2031
- error.message.includes('ENOENT'))) ;
2032
- else {
2033
- // Re-throw other unexpected errors
2034
- throw error;
2035
- }
2036
- }
2037
- let isDestroyed = true;
2038
- const fileHandler = {
2039
- filename: cacheFilename,
2040
- get isDestroyed() {
2041
- return isDestroyed;
2042
- },
2043
- async destroy() {
2044
- if (intermediateFilesStrategy === 'HIDE_AND_CLEAN') {
2045
- if (isVerbose) {
2046
- console.info('legacyDocumentScraper: Clening cache');
2047
- }
2048
- await promises.rm(cacheFilename);
2049
- // TODO: [🐿][🧠] Maybe remove empty folders
2050
- }
2051
- isDestroyed = true;
2052
- },
2053
- };
2054
- return fileHandler;
2055
- }
2056
- // Note: [🟢] Code for Node scraper helper [getScraperIntermediateSource](src/scrapers/_common/utils/getScraperIntermediateSource.ts) should never be published into packages that could be imported into browser environment
2057
- // Note: Not using `FileCacheStorage` for two reasons:
2058
- // 1. Need to store more than serialized JSONs.
2059
- // 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
2060
- // TODO: [🐱‍🐉][🧠] Make some smart crop
2061
-
2062
- 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"}];
2063
-
2064
- /**
2065
- * Checks if value is valid email
2066
- *
2067
- * @public exported from `@promptbook/utils`
2068
- */
2069
- function isValidEmail(email) {
2070
- if (typeof email !== 'string') {
2071
- return false;
2072
- }
2073
- if (email.split(/\r?\n/).length > 1) {
2074
- return false;
2075
- }
2076
- return /^.+@.+\..+$/.test(email);
2077
- }
2078
-
2079
1674
  /**
2080
1675
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
2081
1676
  *
@@ -4616,95 +4211,412 @@
4616
4211
  *
4617
4212
  * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
4618
4213
  *
4619
- * @public exported from `@promptbook/core`
4214
+ * @public exported from `@promptbook/core`
4215
+ */
4216
+ const $scrapersRegister = new $Register('scraper_constructors');
4217
+ // TODO: [®] DRY Register logic
4218
+
4219
+ /**
4220
+ * Creates a message with all registered scrapers
4221
+ *
4222
+ * Note: This function is used to create a (error) message when there is no scraper for particular mime type
4223
+ *
4224
+ * @private internal function of `createScrapersFromConfiguration` and `createScrapersFromEnv`
4225
+ */
4226
+ function $registeredScrapersMessage(availableScrapers) {
4227
+ /**
4228
+ * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
4229
+ */
4230
+ const all = [];
4231
+ for (const { packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser, } of $scrapersMetadataRegister.list()) {
4232
+ if (all.some((item) => item.packageName === packageName && item.className === className)) {
4233
+ continue;
4234
+ }
4235
+ all.push({ packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser });
4236
+ }
4237
+ for (const { packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser, } of $scrapersRegister.list()) {
4238
+ if (all.some((item) => item.packageName === packageName && item.className === className)) {
4239
+ continue;
4240
+ }
4241
+ all.push({ packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser });
4242
+ }
4243
+ for (const { metadata } of availableScrapers) {
4244
+ all.push(metadata);
4245
+ }
4246
+ const metadata = all.map((metadata) => {
4247
+ const isMetadataAviailable = $scrapersMetadataRegister
4248
+ .list()
4249
+ .find(({ packageName, className }) => metadata.packageName === packageName && metadata.className === className);
4250
+ const isInstalled = $scrapersRegister
4251
+ .list()
4252
+ .find(({ packageName, className }) => metadata.packageName === packageName && metadata.className === className);
4253
+ const isAvailableInTools = availableScrapers.some(({ metadata: { packageName, className } }) => metadata.packageName === packageName && metadata.className === className);
4254
+ return { ...metadata, isMetadataAviailable, isInstalled, isAvailableInTools };
4255
+ });
4256
+ if (metadata.length === 0) {
4257
+ return spacetrim.spaceTrim(`
4258
+ **No scrapers are available**
4259
+
4260
+ This is a unexpected behavior, you are probably using some broken version of Promptbook
4261
+ At least there should be available the metadata of the scrapers
4262
+ `);
4263
+ }
4264
+ return spacetrim.spaceTrim((block) => `
4265
+ Available scrapers are:
4266
+ ${block(metadata
4267
+ .map(({ packageName, className, isMetadataAviailable, isInstalled, mimeTypes, isAvailableInBrowser, isAvailableInTools, }, i) => {
4268
+ const more = [];
4269
+ // TODO: [🧠] Maybe use `documentationUrl`
4270
+ if (isMetadataAviailable) {
4271
+ more.push(`⬜ Metadata registered`);
4272
+ } // not else
4273
+ if (isInstalled) {
4274
+ more.push(`🟩 Installed`);
4275
+ } // not else
4276
+ if (isAvailableInTools) {
4277
+ more.push(`🟦 Available in tools`);
4278
+ } // not else
4279
+ if (!isMetadataAviailable && isInstalled) {
4280
+ more.push(`When no metadata registered but scraper is installed, it is an unexpected behavior`);
4281
+ } // not else
4282
+ if (!isInstalled && isAvailableInTools) {
4283
+ more.push(`When the scraper is not installed but available in tools, it is an unexpected compatibility behavior`);
4284
+ } // not else
4285
+ if (!isAvailableInBrowser) {
4286
+ more.push(`Not usable in browser`);
4287
+ }
4288
+ const moreText = more.length === 0 ? '' : ` *(${more.join('; ')})*`;
4289
+ return `${i + 1}) \`${className}\` from \`${packageName}\` compatible to scrape ${mimeTypes
4290
+ .map((mimeType) => `"${mimeType}"`)
4291
+ .join(', ')}${moreText}`;
4292
+ })
4293
+ .join('\n'))}
4294
+
4295
+ Legend:
4296
+ - ⬜ **Metadata registered** means that Promptbook knows about the scraper, it is similar to registration in some registry
4297
+ - 🟩 **Installed** means that you have imported package with particular scraper
4298
+ - 🟦 **Available in tools** means that you have passed scraper as dependency into prepare or execution process
4299
+
4300
+ `);
4301
+ }
4302
+ // TODO: [®] DRY Register logic
4303
+
4304
+ /**
4305
+ * Collection of default diacritics removal map.
4306
+ */
4307
+ const defaultDiacriticsRemovalMap = [
4308
+ {
4309
+ base: 'A',
4310
+ letters: '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F',
4311
+ },
4312
+ { base: 'AA', letters: '\uA732' },
4313
+ { base: 'AE', letters: '\u00C6\u01FC\u01E2' },
4314
+ { base: 'AO', letters: '\uA734' },
4315
+ { base: 'AU', letters: '\uA736' },
4316
+ { base: 'AV', letters: '\uA738\uA73A' },
4317
+ { base: 'AY', letters: '\uA73C' },
4318
+ {
4319
+ base: 'B',
4320
+ letters: '\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181',
4321
+ },
4322
+ {
4323
+ base: 'C',
4324
+ letters: '\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E',
4325
+ },
4326
+ {
4327
+ base: 'D',
4328
+ letters: '\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779\u00D0',
4329
+ },
4330
+ { base: 'DZ', letters: '\u01F1\u01C4' },
4331
+ { base: 'Dz', letters: '\u01F2\u01C5' },
4332
+ {
4333
+ base: 'E',
4334
+ letters: '\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E',
4335
+ },
4336
+ { base: 'F', letters: '\u0046\u24BB\uFF26\u1E1E\u0191\uA77B' },
4337
+ {
4338
+ base: 'G',
4339
+ letters: '\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E',
4340
+ },
4341
+ {
4342
+ base: 'H',
4343
+ letters: '\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D',
4344
+ },
4345
+ {
4346
+ base: 'I',
4347
+ letters: '\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197',
4348
+ },
4349
+ { base: 'J', letters: '\u004A\u24BF\uFF2A\u0134\u0248' },
4350
+ {
4351
+ base: 'K',
4352
+ letters: '\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2',
4353
+ },
4354
+ {
4355
+ base: 'L',
4356
+ letters: '\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780',
4357
+ },
4358
+ { base: 'LJ', letters: '\u01C7' },
4359
+ { base: 'Lj', letters: '\u01C8' },
4360
+ { base: 'M', letters: '\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C' },
4361
+ {
4362
+ base: 'N',
4363
+ letters: '\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4',
4364
+ },
4365
+ { base: 'NJ', letters: '\u01CA' },
4366
+ { base: 'Nj', letters: '\u01CB' },
4367
+ {
4368
+ base: 'O',
4369
+ letters: '\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C',
4370
+ },
4371
+ { base: 'OI', letters: '\u01A2' },
4372
+ { base: 'OO', letters: '\uA74E' },
4373
+ { base: 'OU', letters: '\u0222' },
4374
+ { base: 'OE', letters: '\u008C\u0152' },
4375
+ { base: 'oe', letters: '\u009C\u0153' },
4376
+ {
4377
+ base: 'P',
4378
+ letters: '\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754',
4379
+ },
4380
+ { base: 'Q', letters: '\u0051\u24C6\uFF31\uA756\uA758\u024A' },
4381
+ {
4382
+ base: 'R',
4383
+ letters: '\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782',
4384
+ },
4385
+ {
4386
+ base: 'S',
4387
+ letters: '\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784',
4388
+ },
4389
+ {
4390
+ base: 'T',
4391
+ letters: '\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786',
4392
+ },
4393
+ { base: 'TZ', letters: '\uA728' },
4394
+ {
4395
+ base: 'U',
4396
+ letters: '\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244',
4397
+ },
4398
+ { base: 'V', letters: '\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245' },
4399
+ { base: 'VY', letters: '\uA760' },
4400
+ {
4401
+ base: 'W',
4402
+ letters: '\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72',
4403
+ },
4404
+ { base: 'X', letters: '\u0058\u24CD\uFF38\u1E8A\u1E8C' },
4405
+ {
4406
+ base: 'Y',
4407
+ letters: '\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE',
4408
+ },
4409
+ {
4410
+ base: 'Z',
4411
+ letters: '\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762',
4412
+ },
4413
+ {
4414
+ base: 'a',
4415
+ letters: '\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250',
4416
+ },
4417
+ { base: 'aa', letters: '\uA733' },
4418
+ { base: 'ae', letters: '\u00E6\u01FD\u01E3' },
4419
+ { base: 'ao', letters: '\uA735' },
4420
+ { base: 'au', letters: '\uA737' },
4421
+ { base: 'av', letters: '\uA739\uA73B' },
4422
+ { base: 'ay', letters: '\uA73D' },
4423
+ {
4424
+ base: 'b',
4425
+ letters: '\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253',
4426
+ },
4427
+ {
4428
+ base: 'c',
4429
+ letters: '\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184',
4430
+ },
4431
+ {
4432
+ base: 'd',
4433
+ letters: '\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A',
4434
+ },
4435
+ { base: 'dz', letters: '\u01F3\u01C6' },
4436
+ {
4437
+ base: 'e',
4438
+ letters: '\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD',
4439
+ },
4440
+ { base: 'f', letters: '\u0066\u24D5\uFF46\u1E1F\u0192\uA77C' },
4441
+ {
4442
+ base: 'g',
4443
+ letters: '\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F',
4444
+ },
4445
+ {
4446
+ base: 'h',
4447
+ letters: '\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265',
4448
+ },
4449
+ { base: 'hv', letters: '\u0195' },
4450
+ {
4451
+ base: 'i',
4452
+ letters: '\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131',
4453
+ },
4454
+ { base: 'j', letters: '\u006A\u24D9\uFF4A\u0135\u01F0\u0249' },
4455
+ {
4456
+ base: 'k',
4457
+ letters: '\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3',
4458
+ },
4459
+ {
4460
+ base: 'l',
4461
+ letters: '\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747',
4462
+ },
4463
+ { base: 'lj', letters: '\u01C9' },
4464
+ { base: 'm', letters: '\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F' },
4465
+ {
4466
+ base: 'n',
4467
+ letters: '\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5',
4468
+ },
4469
+ { base: 'nj', letters: '\u01CC' },
4470
+ {
4471
+ base: 'o',
4472
+ letters: '\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275',
4473
+ },
4474
+ { base: 'oi', letters: '\u01A3' },
4475
+ { base: 'ou', letters: '\u0223' },
4476
+ { base: 'oo', letters: '\uA74F' },
4477
+ {
4478
+ base: 'p',
4479
+ letters: '\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755',
4480
+ },
4481
+ { base: 'q', letters: '\u0071\u24E0\uFF51\u024B\uA757\uA759' },
4482
+ {
4483
+ base: 'r',
4484
+ letters: '\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783',
4485
+ },
4486
+ {
4487
+ base: 's',
4488
+ letters: '\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B',
4489
+ },
4490
+ {
4491
+ base: 't',
4492
+ letters: '\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787',
4493
+ },
4494
+ { base: 'tz', letters: '\uA729' },
4495
+ {
4496
+ base: 'u',
4497
+ letters: '\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289',
4498
+ },
4499
+ { base: 'v', letters: '\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C' },
4500
+ { base: 'vy', letters: '\uA761' },
4501
+ {
4502
+ base: 'w',
4503
+ letters: '\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73',
4504
+ },
4505
+ { base: 'x', letters: '\u0078\u24E7\uFF58\u1E8B\u1E8D' },
4506
+ {
4507
+ base: 'y',
4508
+ letters: '\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF',
4509
+ },
4510
+ {
4511
+ base: 'z',
4512
+ letters: '\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763',
4513
+ },
4514
+ ];
4515
+ /**
4516
+ * Map of letters from diacritic variant to diacritless variant
4517
+ * Contains lowercase and uppercase separatelly
4518
+ *
4519
+ * > "á" => "a"
4520
+ * > "ě" => "e"
4521
+ * > "Ă" => "A"
4522
+ * > ...
4523
+ *
4524
+ * @public exported from `@promptbook/utils`
4525
+ */
4526
+ const DIACRITIC_VARIANTS_LETTERS = {};
4527
+ // tslint:disable-next-line: prefer-for-of
4528
+ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
4529
+ const letters = defaultDiacriticsRemovalMap[i].letters;
4530
+ // tslint:disable-next-line: prefer-for-of
4531
+ for (let j = 0; j < letters.length; j++) {
4532
+ DIACRITIC_VARIANTS_LETTERS[letters[j]] = defaultDiacriticsRemovalMap[i].base;
4533
+ }
4534
+ }
4535
+ // <- TODO: [🍓] Put to maker function to save execution time if not needed
4536
+ /*
4537
+ @see https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
4538
+ Licensed under the Apache License, Version 2.0 (the "License");
4539
+ you may not use this file except in compliance with the License.
4540
+ You may obtain a copy of the License at
4541
+
4542
+ http://www.apache.org/licenses/LICENSE-2.0
4543
+
4544
+ Unless required by applicable law or agreed to in writing, software
4545
+ distributed under the License is distributed on an "AS IS" BASIS,
4546
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4547
+ See the License for the specific language governing permissions and
4548
+ limitations under the License.
4549
+ */
4550
+
4551
+ /**
4552
+ * Removes diacritic marks (accents) from characters in a string.
4553
+ *
4554
+ * Note: [🔂] This function is idempotent.
4555
+ *
4556
+ * @param input The string containing diacritics to be normalized.
4557
+ * @returns The string with diacritics removed or normalized.
4558
+ *
4559
+ * @public exported from `@promptbook/utils`
4620
4560
  */
4621
- const $scrapersRegister = new $Register('scraper_constructors');
4622
- // TODO: [®] DRY Register logic
4561
+ function removeDiacritics(input) {
4562
+ /*eslint no-control-regex: "off"*/
4563
+ return input.replace(/[^\u0000-\u007E]/g, (character) => {
4564
+ return DIACRITIC_VARIANTS_LETTERS[character] || character;
4565
+ });
4566
+ }
4567
+ // TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4623
4568
 
4624
4569
  /**
4625
- * Creates a message with all registered scrapers
4570
+ * Converts a given text to kebab-case format.
4626
4571
  *
4627
- * Note: This function is used to create a (error) message when there is no scraper for particular mime type
4572
+ * Note: [🔂] This function is idempotent.
4628
4573
  *
4629
- * @private internal function of `createScrapersFromConfiguration` and `createScrapersFromEnv`
4574
+ * @param text The text to be converted.
4575
+ * @returns The kebab-case formatted string.
4576
+ * @example 'hello-world'
4577
+ * @example 'i-love-promptbook'
4578
+ *
4579
+ * @public exported from `@promptbook/utils`
4630
4580
  */
4631
- function $registeredScrapersMessage(availableScrapers) {
4632
- /**
4633
- * Mixes registered scrapers from $scrapersMetadataRegister and $scrapersRegister
4634
- */
4635
- const all = [];
4636
- for (const { packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser, } of $scrapersMetadataRegister.list()) {
4637
- if (all.some((item) => item.packageName === packageName && item.className === className)) {
4638
- continue;
4581
+ function normalizeToKebabCase(text) {
4582
+ text = removeDiacritics(text);
4583
+ let charType;
4584
+ let lastCharType = 'OTHER';
4585
+ let normalizedName = '';
4586
+ for (const char of text) {
4587
+ let normalizedChar;
4588
+ if (/^[a-z]$/.test(char)) {
4589
+ charType = 'LOWERCASE';
4590
+ normalizedChar = char;
4639
4591
  }
4640
- all.push({ packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser });
4641
- }
4642
- for (const { packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser, } of $scrapersRegister.list()) {
4643
- if (all.some((item) => item.packageName === packageName && item.className === className)) {
4644
- continue;
4592
+ else if (/^[A-Z]$/.test(char)) {
4593
+ charType = 'UPPERCASE';
4594
+ normalizedChar = char.toLowerCase();
4645
4595
  }
4646
- all.push({ packageName, className, mimeTypes, documentationUrl, isAvailableInBrowser });
4647
- }
4648
- for (const { metadata } of availableScrapers) {
4649
- all.push(metadata);
4650
- }
4651
- const metadata = all.map((metadata) => {
4652
- const isMetadataAviailable = $scrapersMetadataRegister
4653
- .list()
4654
- .find(({ packageName, className }) => metadata.packageName === packageName && metadata.className === className);
4655
- const isInstalled = $scrapersRegister
4656
- .list()
4657
- .find(({ packageName, className }) => metadata.packageName === packageName && metadata.className === className);
4658
- const isAvailableInTools = availableScrapers.some(({ metadata: { packageName, className } }) => metadata.packageName === packageName && metadata.className === className);
4659
- return { ...metadata, isMetadataAviailable, isInstalled, isAvailableInTools };
4660
- });
4661
- if (metadata.length === 0) {
4662
- return spacetrim.spaceTrim(`
4663
- **No scrapers are available**
4664
-
4665
- This is a unexpected behavior, you are probably using some broken version of Promptbook
4666
- At least there should be available the metadata of the scrapers
4667
- `);
4668
- }
4669
- return spacetrim.spaceTrim((block) => `
4670
- Available scrapers are:
4671
- ${block(metadata
4672
- .map(({ packageName, className, isMetadataAviailable, isInstalled, mimeTypes, isAvailableInBrowser, isAvailableInTools, }, i) => {
4673
- const more = [];
4674
- // TODO: [🧠] Maybe use `documentationUrl`
4675
- if (isMetadataAviailable) {
4676
- more.push(`⬜ Metadata registered`);
4677
- } // not else
4678
- if (isInstalled) {
4679
- more.push(`🟩 Installed`);
4680
- } // not else
4681
- if (isAvailableInTools) {
4682
- more.push(`🟦 Available in tools`);
4683
- } // not else
4684
- if (!isMetadataAviailable && isInstalled) {
4685
- more.push(`When no metadata registered but scraper is installed, it is an unexpected behavior`);
4686
- } // not else
4687
- if (!isInstalled && isAvailableInTools) {
4688
- more.push(`When the scraper is not installed but available in tools, it is an unexpected compatibility behavior`);
4689
- } // not else
4690
- if (!isAvailableInBrowser) {
4691
- more.push(`Not usable in browser`);
4596
+ else if (/^[0-9]$/.test(char)) {
4597
+ charType = 'NUMBER';
4598
+ normalizedChar = char;
4599
+ }
4600
+ else {
4601
+ charType = 'OTHER';
4602
+ normalizedChar = '-';
4603
+ }
4604
+ if (charType !== lastCharType &&
4605
+ !(lastCharType === 'UPPERCASE' && charType === 'LOWERCASE') &&
4606
+ !(lastCharType === 'NUMBER') &&
4607
+ !(charType === 'NUMBER')) {
4608
+ normalizedName += '-';
4609
+ }
4610
+ normalizedName += normalizedChar;
4611
+ lastCharType = charType;
4692
4612
  }
4693
- const moreText = more.length === 0 ? '' : ` *(${more.join('; ')})*`;
4694
- return `${i + 1}) \`${className}\` from \`${packageName}\` compatible to scrape ${mimeTypes
4695
- .map((mimeType) => `"${mimeType}"`)
4696
- .join(', ')}${moreText}`;
4697
- })
4698
- .join('\n'))}
4699
-
4700
- Legend:
4701
- - ⬜ **Metadata registered** means that Promptbook knows about the scraper, it is similar to registration in some registry
4702
- - 🟩 **Installed** means that you have imported package with particular scraper
4703
- - 🟦 **Available in tools** means that you have passed scraper as dependency into prepare or execution process
4704
-
4705
- `);
4613
+ normalizedName = normalizedName.split(/-+/g).join('-');
4614
+ normalizedName = normalizedName.split(/-?\/-?/g).join('/');
4615
+ normalizedName = normalizedName.replace(/^-/, '');
4616
+ normalizedName = normalizedName.replace(/-$/, '');
4617
+ return normalizedName;
4706
4618
  }
4707
- // TODO: [®] DRY Register logic
4619
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4708
4620
 
4709
4621
  /**
4710
4622
  * Creates unique name for the source
@@ -4725,6 +4637,16 @@
4725
4637
  }
4726
4638
  // TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
4727
4639
 
4640
+ /**
4641
+ * Converts a name to a properly formatted subfolder path for cache storage.
4642
+ * Handles normalization and path formatting to create consistent cache directory structures.
4643
+ *
4644
+ * @private for `FileCacheStorage`
4645
+ */
4646
+ function nameToSubfolderPath(name) {
4647
+ return [name.substr(0, 1).toLowerCase(), name.substr(1, 1).toLowerCase()];
4648
+ }
4649
+
4728
4650
  /**
4729
4651
  * Convert file extension to mime type
4730
4652
  *
@@ -4745,6 +4667,52 @@
4745
4667
  return mimeTypes.extension(value) || null;
4746
4668
  }
4747
4669
 
4670
+ /**
4671
+ * Removes emojis from a string and fix whitespaces
4672
+ *
4673
+ * Note: [🔂] This function is idempotent.
4674
+ *
4675
+ * @param text with emojis
4676
+ * @returns text without emojis
4677
+ *
4678
+ * @public exported from `@promptbook/utils`
4679
+ */
4680
+ function removeEmojis(text) {
4681
+ // Replace emojis (and also ZWJ sequence) with hyphens
4682
+ text = text.replace(/(\p{Extended_Pictographic})\p{Modifier_Symbol}/gu, '$1');
4683
+ text = text.replace(/(\p{Extended_Pictographic})[\u{FE00}-\u{FE0F}]/gu, '$1');
4684
+ text = text.replace(/(\p{Extended_Pictographic})(\u{200D}\p{Extended_Pictographic})*/gu, '$1');
4685
+ text = text.replace(/\p{Extended_Pictographic}/gu, '');
4686
+ return text;
4687
+ }
4688
+
4689
+ /**
4690
+ * Converts a title string into a normalized name.
4691
+ *
4692
+ * Note: [🔂] This function is idempotent.
4693
+ *
4694
+ * @param value The title string to be converted to a name.
4695
+ * @returns A normalized name derived from the input title.
4696
+ * @example 'Hello World!' -> 'hello-world'
4697
+ *
4698
+ * @public exported from `@promptbook/utils`
4699
+ */
4700
+ function titleToName(value) {
4701
+ if (isValidUrl(value)) {
4702
+ value = value.replace(/^https?:\/\//, '');
4703
+ value = value.replace(/\.html$/, '');
4704
+ }
4705
+ else if (isValidFilePath(value)) {
4706
+ value = path.basename(value);
4707
+ // Note: Keeping extension in the name
4708
+ }
4709
+ value = value.split('/').join('-');
4710
+ value = removeEmojis(value);
4711
+ value = normalizeToKebabCase(value);
4712
+ // TODO: [🧠] Maybe warn or add some padding to short name which are not good identifiers
4713
+ return value;
4714
+ }
4715
+
4748
4716
  /**
4749
4717
  * The built-in `fetch' function with a lightweight error handling wrapper as default fetch function used in Promptbook scrapers
4750
4718
  *
@@ -7856,6 +7824,74 @@
7856
7824
  // TODO: [🪂] Do it in parallel 11:11
7857
7825
  // Note: No need to aggregate usage here, it is done by intercepting the llmTools
7858
7826
 
7827
+ /**
7828
+ * Retrieves an intermediate source for a scraper based on the knowledge source.
7829
+ * Manages the caching and retrieval of intermediate scraper results for optimized performance.
7830
+ *
7831
+ * @private as internal utility for scrapers
7832
+ */
7833
+ async function getScraperIntermediateSource(source, options) {
7834
+ const { filename: sourceFilename, url } = source;
7835
+ const { rootDirname, cacheDirname, intermediateFilesStrategy, extension, isVerbose } = options;
7836
+ // TODO: [👬] DRY
7837
+ const hash = cryptoJs.SHA256(
7838
+ // <- TODO: [🥬] Encapsulate sha256 to some private utility function
7839
+ hexEncoder__default["default"].parse(sourceFilename || url || 'untitled'))
7840
+ .toString( /* hex */)
7841
+ .substring(0, 20);
7842
+ // <- TODO: [🥬] Make some system for hashes and ids of promptbook
7843
+ const semanticName = normalizeToKebabCase(titleToName((sourceFilename || url || '').split('intermediate').join(''))).substring(0, 20);
7844
+ // <- TODO: [🐱‍🐉]
7845
+ const pieces = ['intermediate', semanticName, hash].filter((piece) => piece !== '');
7846
+ const name = pieces.join('-').split('--').join('-');
7847
+ const cacheFilename = path.join(process.cwd(), cacheDirname, ...nameToSubfolderPath(hash /* <- TODO: [🎎] Maybe add some SHA256 prefix */), name)
7848
+ .split('\\')
7849
+ .join('/') +
7850
+ '.' +
7851
+ extension;
7852
+ // Note: Try to create cache directory, but don't fail if filesystem has issues
7853
+ try {
7854
+ await promises.mkdir(path.dirname(cacheFilename), { recursive: true });
7855
+ }
7856
+ catch (error) {
7857
+ // Note: If we can't create cache directory, continue without it
7858
+ // This handles read-only filesystems, permission issues, and missing parent directories
7859
+ if (error instanceof Error &&
7860
+ (error.message.includes('EROFS') ||
7861
+ error.message.includes('read-only') ||
7862
+ error.message.includes('EACCES') ||
7863
+ error.message.includes('EPERM') ||
7864
+ error.message.includes('ENOENT'))) ;
7865
+ else {
7866
+ // Re-throw other unexpected errors
7867
+ throw error;
7868
+ }
7869
+ }
7870
+ let isDestroyed = true;
7871
+ const fileHandler = {
7872
+ filename: cacheFilename,
7873
+ get isDestroyed() {
7874
+ return isDestroyed;
7875
+ },
7876
+ async destroy() {
7877
+ if (intermediateFilesStrategy === 'HIDE_AND_CLEAN') {
7878
+ if (isVerbose) {
7879
+ console.info('legacyDocumentScraper: Clening cache');
7880
+ }
7881
+ await promises.rm(cacheFilename);
7882
+ // TODO: [🐿][🧠] Maybe remove empty folders
7883
+ }
7884
+ isDestroyed = true;
7885
+ },
7886
+ };
7887
+ return fileHandler;
7888
+ }
7889
+ // Note: [🟢] Code for Node scraper helper [getScraperIntermediateSource](src/scrapers/_common/utils/getScraperIntermediateSource.ts) should never be published into packages that could be imported into browser environment
7890
+ // Note: Not using `FileCacheStorage` for two reasons:
7891
+ // 1. Need to store more than serialized JSONs.
7892
+ // 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
7893
+ // TODO: [🐱‍🐉][🧠] Make some smart crop
7894
+
7859
7895
  /**
7860
7896
  * Metadata of the scraper
7861
7897
  *