@promptbook/wizard 0.112.0-31 → 0.112.0-34

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 (351) hide show
  1. package/esm/index.es.js +146 -120
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/_packages/components.index.d.ts +6 -0
  4. package/esm/src/_packages/types.index.d.ts +55 -49
  5. package/esm/src/book-2.0/agent-source/AgentReferenceResolver.d.ts +11 -0
  6. package/esm/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +8 -0
  7. package/esm/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +33 -0
  8. package/esm/src/book-2.0/agent-source/createTeamToolName.d.ts +7 -7
  9. package/esm/src/book-components/Chat/Chat/ChatActionsBar.d.ts +5 -0
  10. package/esm/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +42 -0
  11. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +18 -15
  12. package/esm/src/book-components/Chat/Chat/ChatMessageItem.test.d.ts +1 -1
  13. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +14 -0
  14. package/esm/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
  15. package/esm/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
  16. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +290 -0
  17. package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +16 -0
  18. package/esm/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +33 -0
  19. package/esm/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
  20. package/esm/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
  21. package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +4 -0
  22. package/esm/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +26 -0
  23. package/esm/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +31 -0
  24. package/esm/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +32 -0
  25. package/esm/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +31 -0
  26. package/esm/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +31 -0
  27. package/esm/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +38 -0
  28. package/esm/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +38 -0
  29. package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +46 -0
  30. package/esm/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +33 -0
  31. package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +10 -1
  32. package/esm/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +29 -0
  33. package/esm/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +26 -0
  34. package/esm/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +9 -0
  35. package/esm/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
  36. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +76 -0
  37. package/esm/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
  38. package/esm/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
  39. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -1
  40. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.test.d.ts +2 -0
  41. package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +18 -0
  42. package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.test.d.ts +2 -0
  43. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +77 -1
  44. package/esm/src/book-components/Chat/utils/formatToolCallDateTime.d.ts +37 -0
  45. package/esm/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +11 -0
  46. package/esm/src/book-components/Chat/utils/formatToolCallTranslationTemplate.d.ts +10 -0
  47. package/esm/src/book-components/Chat/utils/getChatMessageTimingDisplay.d.ts +5 -1
  48. package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.d.ts +26 -1
  49. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +26 -3
  50. package/esm/src/cli/$runPromptbookCli.d.ts +1 -3
  51. package/esm/src/cli/cli-commands/_boilerplate.d.ts +2 -4
  52. package/esm/src/cli/cli-commands/about.d.ts +1 -1
  53. package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +2 -4
  54. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +2 -4
  55. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -4
  56. package/esm/src/cli/cli-commands/coder/init.d.ts +2 -4
  57. package/esm/src/cli/cli-commands/coder/run.d.ts +2 -4
  58. package/esm/src/cli/cli-commands/coder/verify.d.ts +2 -4
  59. package/esm/src/cli/cli-commands/coder.d.ts +2 -4
  60. package/esm/src/cli/cli-commands/hello.d.ts +1 -1
  61. package/esm/src/cli/cli-commands/list-models.d.ts +2 -4
  62. package/esm/src/cli/cli-commands/list-scrapers.d.ts +2 -4
  63. package/esm/src/cli/cli-commands/login.d.ts +1 -1
  64. package/esm/src/cli/cli-commands/make.d.ts +1 -1
  65. package/esm/src/cli/cli-commands/prettify.d.ts +1 -1
  66. package/esm/src/cli/cli-commands/run.d.ts +1 -1
  67. package/esm/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
  68. package/esm/src/cli/cli-commands/start-agents-server.d.ts +2 -4
  69. package/esm/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
  70. package/esm/src/cli/cli-commands/test-command.d.ts +1 -1
  71. package/esm/src/cli/main.d.ts +2 -4
  72. package/esm/src/cli/promptbookCli.d.ts +1 -1
  73. package/esm/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +1 -3
  74. package/esm/src/conversion/archive/loadArchive.d.ts +1 -3
  75. package/esm/src/conversion/archive/saveArchive.d.ts +1 -1
  76. package/esm/src/conversion/validation/_importPipeline.d.ts +2 -4
  77. package/esm/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -3
  78. package/esm/src/executables/$provideExecutablesForNode.d.ts +1 -1
  79. package/esm/src/executables/apps/locateLibreoffice.d.ts +2 -4
  80. package/esm/src/executables/apps/locatePandoc.d.ts +2 -4
  81. package/esm/src/executables/locateApp.d.ts +2 -4
  82. package/esm/src/executables/platforms/locateAppOnLinux.d.ts +2 -4
  83. package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +2 -4
  84. package/esm/src/executables/platforms/locateAppOnWindows.d.ts +2 -4
  85. package/esm/src/execution/translation/automatic-translate/translateMessages.d.ts +2 -4
  86. package/esm/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
  87. package/esm/src/llm-providers/_common/register/$provideEnvFilename.d.ts +1 -3
  88. package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
  89. package/esm/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -1
  90. package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -3
  91. package/esm/src/llm-providers/_multiple/playground/playground.d.ts +1 -3
  92. package/esm/src/llm-providers/agent/playground/playground.d.ts +1 -1
  93. package/esm/src/llm-providers/anthropic-claude/playground/playground.d.ts +1 -1
  94. package/esm/src/llm-providers/azure-openai/playground/playground.d.ts +2 -4
  95. package/esm/src/llm-providers/ollama/playground/playground.d.ts +2 -4
  96. package/esm/src/llm-providers/openai/playground/playground.d.ts +2 -4
  97. package/esm/src/llm-providers/remote/playground/playground.d.ts +1 -3
  98. package/esm/src/llm-providers/vercel/playground/playground.d.ts +2 -4
  99. package/esm/src/playground/permanent/_boilerplate.d.ts +1 -3
  100. package/esm/src/playground/permanent/agent-with-browser-playground.d.ts +1 -3
  101. package/esm/src/playground/permanent/error-handling-playground.d.ts +1 -3
  102. package/esm/src/playground/playground.d.ts +2 -4
  103. package/esm/src/remote-server/startAgentServer.d.ts +1 -3
  104. package/esm/src/remote-server/startRemoteServer.d.ts +1 -2
  105. package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +4 -6
  106. package/esm/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +1 -3
  107. package/esm/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -4
  108. package/esm/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -4
  109. package/esm/src/scrapers/_common/register/$provideScriptingForNode.d.ts +2 -4
  110. package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -1
  111. package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -1
  112. package/esm/src/scrapers/document/playground/document-scraper-playground.d.ts +1 -3
  113. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -1
  114. package/esm/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +1 -3
  115. package/esm/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +1 -3
  116. package/esm/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
  117. package/esm/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +1 -3
  118. package/esm/src/scrapers/pdf/PdfScraper.d.ts +1 -1
  119. package/esm/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +1 -3
  120. package/esm/src/scrapers/website/WebsiteScraper.d.ts +1 -1
  121. package/esm/src/scrapers/website/playground/website-scraper-playground.d.ts +1 -3
  122. package/esm/src/speech-recognition/BrowserSpeechRecognition.d.ts +2 -4
  123. package/esm/src/storage/file-cache-storage/FileCacheStorage.d.ts +2 -4
  124. package/esm/src/storage/local-storage/getIndexedDbStorage.d.ts +1 -3
  125. package/esm/src/storage/local-storage/getLocalStorage.d.ts +1 -3
  126. package/esm/src/storage/local-storage/getSessionStorage.d.ts +1 -3
  127. package/esm/src/transpilers/openai-sdk/playground/playground.d.ts +1 -3
  128. package/esm/src/types/InputParameters_private.d.ts +11 -0
  129. package/esm/src/types/Parameters_private.d.ts +16 -0
  130. package/esm/src/types/ReservedParameters_private.d.ts +10 -0
  131. package/esm/src/types/number_bytes.d.ts +21 -0
  132. package/esm/src/types/number_id.d.ts +13 -0
  133. package/esm/src/types/number_likeness.d.ts +8 -0
  134. package/esm/src/types/number_milliseconds.d.ts +33 -0
  135. package/esm/src/types/number_percent.d.ts +18 -0
  136. package/esm/src/types/number_positive.d.ts +16 -0
  137. package/esm/src/types/number_usd.d.ts +6 -106
  138. package/esm/src/types/string_agent_hash_private.d.ts +9 -0
  139. package/esm/src/types/string_agent_name_in_book_private.d.ts +8 -0
  140. package/esm/src/types/string_agent_name_private.d.ts +9 -0
  141. package/esm/src/types/string_agent_permanent_id_private.d.ts +10 -0
  142. package/esm/src/types/string_base64_private.d.ts +17 -0
  143. package/esm/src/types/string_business_category_name_private.d.ts +6 -0
  144. package/esm/src/types/string_char_private.d.ts +8 -0
  145. package/esm/src/types/string_chat_prompt_private.d.ts +9 -0
  146. package/esm/src/types/string_completion_prompt_private.d.ts +9 -0
  147. package/esm/src/types/string_email_private.d.ts +16 -0
  148. package/esm/src/types/string_host_private.d.ts +55 -0
  149. package/esm/src/types/string_mime_type_private.d.ts +17 -0
  150. package/esm/src/types/string_model_description_private.d.ts +8 -0
  151. package/esm/src/types/string_model_name_private.d.ts +8 -0
  152. package/esm/src/types/string_name_private.d.ts +9 -0
  153. package/esm/src/types/string_page_private.d.ts +9 -0
  154. package/esm/src/types/string_parameter_name.d.ts +74 -31
  155. package/esm/src/types/string_parameter_value_private.d.ts +9 -0
  156. package/esm/src/types/string_persona_description_private.d.ts +8 -0
  157. package/esm/src/types/string_prompt_image_private.d.ts +8 -0
  158. package/esm/src/types/string_prompt_private.d.ts +8 -0
  159. package/esm/src/types/string_reserved_parameter_name_private.d.ts +11 -0
  160. package/esm/src/types/string_system_message_private.d.ts +9 -0
  161. package/esm/src/types/string_template_private.d.ts +8 -0
  162. package/esm/src/types/string_text_prompt_private.d.ts +9 -0
  163. package/esm/src/types/string_title_private.d.ts +9 -0
  164. package/esm/src/types/string_url.d.ts +50 -46
  165. package/esm/src/types/string_url_private.d.ts +88 -0
  166. package/esm/src/types/typeAliases.d.ts +7 -1
  167. package/esm/src/utils/execCommand/$execCommand.d.ts +1 -3
  168. package/esm/src/utils/execCommand/$execCommands.d.ts +1 -3
  169. package/esm/src/utils/files/$induceBookDownload.d.ts +1 -3
  170. package/esm/src/utils/files/$induceFileDownload.d.ts +1 -3
  171. package/esm/src/utils/files/ObjectUrl.d.ts +1 -3
  172. package/esm/src/utils/toolCalls/mergeToolCalls.d.ts +1 -1
  173. package/esm/src/version.d.ts +1 -1
  174. package/esm/src/wizard/$getCompiledBook.d.ts +2 -4
  175. package/esm/src/wizard/wizard.d.ts +2 -4
  176. package/package.json +2 -2
  177. package/umd/index.umd.js +146 -120
  178. package/umd/index.umd.js.map +1 -1
  179. package/umd/src/_packages/components.index.d.ts +6 -0
  180. package/umd/src/_packages/types.index.d.ts +55 -49
  181. package/umd/src/book-2.0/agent-source/AgentReferenceResolver.d.ts +11 -0
  182. package/umd/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +8 -0
  183. package/umd/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +33 -0
  184. package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +7 -7
  185. package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +5 -0
  186. package/umd/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +42 -0
  187. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +18 -15
  188. package/umd/src/book-components/Chat/Chat/ChatMessageItem.test.d.ts +1 -1
  189. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +14 -0
  190. package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
  191. package/umd/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
  192. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +290 -0
  193. package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +16 -0
  194. package/umd/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +33 -0
  195. package/umd/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
  196. package/umd/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
  197. package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +4 -0
  198. package/umd/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +26 -0
  199. package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +31 -0
  200. package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +32 -0
  201. package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +31 -0
  202. package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +31 -0
  203. package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +38 -0
  204. package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +38 -0
  205. package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +46 -0
  206. package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +33 -0
  207. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +10 -1
  208. package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +29 -0
  209. package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +26 -0
  210. package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +9 -0
  211. package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
  212. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +76 -0
  213. package/umd/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
  214. package/umd/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
  215. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -1
  216. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.test.d.ts +2 -0
  217. package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +18 -0
  218. package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.test.d.ts +2 -0
  219. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +77 -1
  220. package/umd/src/book-components/Chat/utils/formatToolCallDateTime.d.ts +37 -0
  221. package/umd/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +11 -0
  222. package/umd/src/book-components/Chat/utils/formatToolCallTranslationTemplate.d.ts +10 -0
  223. package/umd/src/book-components/Chat/utils/getChatMessageTimingDisplay.d.ts +5 -1
  224. package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.d.ts +26 -1
  225. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +26 -3
  226. package/umd/src/cli/$runPromptbookCli.d.ts +1 -3
  227. package/umd/src/cli/cli-commands/_boilerplate.d.ts +2 -4
  228. package/umd/src/cli/cli-commands/about.d.ts +1 -1
  229. package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +2 -4
  230. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +2 -4
  231. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -4
  232. package/umd/src/cli/cli-commands/coder/init.d.ts +2 -4
  233. package/umd/src/cli/cli-commands/coder/run.d.ts +2 -4
  234. package/umd/src/cli/cli-commands/coder/verify.d.ts +2 -4
  235. package/umd/src/cli/cli-commands/coder.d.ts +2 -4
  236. package/umd/src/cli/cli-commands/hello.d.ts +1 -1
  237. package/umd/src/cli/cli-commands/list-models.d.ts +2 -4
  238. package/umd/src/cli/cli-commands/list-scrapers.d.ts +2 -4
  239. package/umd/src/cli/cli-commands/login.d.ts +1 -1
  240. package/umd/src/cli/cli-commands/make.d.ts +1 -1
  241. package/umd/src/cli/cli-commands/prettify.d.ts +1 -1
  242. package/umd/src/cli/cli-commands/run.d.ts +1 -1
  243. package/umd/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
  244. package/umd/src/cli/cli-commands/start-agents-server.d.ts +2 -4
  245. package/umd/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
  246. package/umd/src/cli/cli-commands/test-command.d.ts +1 -1
  247. package/umd/src/cli/main.d.ts +2 -4
  248. package/umd/src/cli/promptbookCli.d.ts +1 -1
  249. package/umd/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +1 -3
  250. package/umd/src/conversion/archive/loadArchive.d.ts +1 -3
  251. package/umd/src/conversion/archive/saveArchive.d.ts +1 -1
  252. package/umd/src/conversion/validation/_importPipeline.d.ts +2 -4
  253. package/umd/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -3
  254. package/umd/src/executables/$provideExecutablesForNode.d.ts +1 -1
  255. package/umd/src/executables/apps/locateLibreoffice.d.ts +2 -4
  256. package/umd/src/executables/apps/locatePandoc.d.ts +2 -4
  257. package/umd/src/executables/locateApp.d.ts +2 -4
  258. package/umd/src/executables/platforms/locateAppOnLinux.d.ts +2 -4
  259. package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +2 -4
  260. package/umd/src/executables/platforms/locateAppOnWindows.d.ts +2 -4
  261. package/umd/src/execution/translation/automatic-translate/translateMessages.d.ts +2 -4
  262. package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
  263. package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +1 -3
  264. package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
  265. package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -1
  266. package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -3
  267. package/umd/src/llm-providers/_multiple/playground/playground.d.ts +1 -3
  268. package/umd/src/llm-providers/agent/playground/playground.d.ts +1 -1
  269. package/umd/src/llm-providers/anthropic-claude/playground/playground.d.ts +1 -1
  270. package/umd/src/llm-providers/azure-openai/playground/playground.d.ts +2 -4
  271. package/umd/src/llm-providers/ollama/playground/playground.d.ts +2 -4
  272. package/umd/src/llm-providers/openai/playground/playground.d.ts +2 -4
  273. package/umd/src/llm-providers/remote/playground/playground.d.ts +1 -3
  274. package/umd/src/llm-providers/vercel/playground/playground.d.ts +2 -4
  275. package/umd/src/playground/permanent/_boilerplate.d.ts +1 -3
  276. package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +1 -3
  277. package/umd/src/playground/permanent/error-handling-playground.d.ts +1 -3
  278. package/umd/src/playground/playground.d.ts +2 -4
  279. package/umd/src/remote-server/startAgentServer.d.ts +1 -3
  280. package/umd/src/remote-server/startRemoteServer.d.ts +1 -2
  281. package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +4 -6
  282. package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +1 -3
  283. package/umd/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -4
  284. package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -4
  285. package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +2 -4
  286. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -1
  287. package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -1
  288. package/umd/src/scrapers/document/playground/document-scraper-playground.d.ts +1 -3
  289. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -1
  290. package/umd/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +1 -3
  291. package/umd/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +1 -3
  292. package/umd/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
  293. package/umd/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +1 -3
  294. package/umd/src/scrapers/pdf/PdfScraper.d.ts +1 -1
  295. package/umd/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +1 -3
  296. package/umd/src/scrapers/website/WebsiteScraper.d.ts +1 -1
  297. package/umd/src/scrapers/website/playground/website-scraper-playground.d.ts +1 -3
  298. package/umd/src/speech-recognition/BrowserSpeechRecognition.d.ts +2 -4
  299. package/umd/src/storage/file-cache-storage/FileCacheStorage.d.ts +2 -4
  300. package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +1 -3
  301. package/umd/src/storage/local-storage/getLocalStorage.d.ts +1 -3
  302. package/umd/src/storage/local-storage/getSessionStorage.d.ts +1 -3
  303. package/umd/src/transpilers/openai-sdk/playground/playground.d.ts +1 -3
  304. package/umd/src/types/InputParameters_private.d.ts +11 -0
  305. package/umd/src/types/Parameters_private.d.ts +16 -0
  306. package/umd/src/types/ReservedParameters_private.d.ts +10 -0
  307. package/umd/src/types/number_bytes.d.ts +21 -0
  308. package/umd/src/types/number_id.d.ts +13 -0
  309. package/umd/src/types/number_likeness.d.ts +8 -0
  310. package/umd/src/types/number_milliseconds.d.ts +33 -0
  311. package/umd/src/types/number_percent.d.ts +18 -0
  312. package/umd/src/types/number_positive.d.ts +16 -0
  313. package/umd/src/types/number_usd.d.ts +6 -106
  314. package/umd/src/types/string_agent_hash_private.d.ts +9 -0
  315. package/umd/src/types/string_agent_name_in_book_private.d.ts +8 -0
  316. package/umd/src/types/string_agent_name_private.d.ts +9 -0
  317. package/umd/src/types/string_agent_permanent_id_private.d.ts +10 -0
  318. package/umd/src/types/string_base64_private.d.ts +17 -0
  319. package/umd/src/types/string_business_category_name_private.d.ts +6 -0
  320. package/umd/src/types/string_char_private.d.ts +8 -0
  321. package/umd/src/types/string_chat_prompt_private.d.ts +9 -0
  322. package/umd/src/types/string_completion_prompt_private.d.ts +9 -0
  323. package/umd/src/types/string_email_private.d.ts +16 -0
  324. package/umd/src/types/string_host_private.d.ts +55 -0
  325. package/umd/src/types/string_mime_type_private.d.ts +17 -0
  326. package/umd/src/types/string_model_description_private.d.ts +8 -0
  327. package/umd/src/types/string_model_name_private.d.ts +8 -0
  328. package/umd/src/types/string_name_private.d.ts +9 -0
  329. package/umd/src/types/string_page_private.d.ts +9 -0
  330. package/umd/src/types/string_parameter_name.d.ts +74 -31
  331. package/umd/src/types/string_parameter_value_private.d.ts +9 -0
  332. package/umd/src/types/string_persona_description_private.d.ts +8 -0
  333. package/umd/src/types/string_prompt_image_private.d.ts +8 -0
  334. package/umd/src/types/string_prompt_private.d.ts +8 -0
  335. package/umd/src/types/string_reserved_parameter_name_private.d.ts +11 -0
  336. package/umd/src/types/string_system_message_private.d.ts +9 -0
  337. package/umd/src/types/string_template_private.d.ts +8 -0
  338. package/umd/src/types/string_text_prompt_private.d.ts +9 -0
  339. package/umd/src/types/string_title_private.d.ts +9 -0
  340. package/umd/src/types/string_url.d.ts +50 -46
  341. package/umd/src/types/string_url_private.d.ts +88 -0
  342. package/umd/src/types/typeAliases.d.ts +7 -1
  343. package/umd/src/utils/execCommand/$execCommand.d.ts +1 -3
  344. package/umd/src/utils/execCommand/$execCommands.d.ts +1 -3
  345. package/umd/src/utils/files/$induceBookDownload.d.ts +1 -3
  346. package/umd/src/utils/files/$induceFileDownload.d.ts +1 -3
  347. package/umd/src/utils/files/ObjectUrl.d.ts +1 -3
  348. package/umd/src/utils/toolCalls/mergeToolCalls.d.ts +1 -1
  349. package/umd/src/version.d.ts +1 -1
  350. package/umd/src/wizard/$getCompiledBook.d.ts +2 -4
  351. package/umd/src/wizard/wizard.d.ts +2 -4
package/esm/index.es.js CHANGED
@@ -38,7 +38,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
38
38
  * @generated
39
39
  * @see https://github.com/webgptorg/promptbook
40
40
  */
41
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-31';
41
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-34';
42
42
  /**
43
43
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
44
44
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -12801,9 +12801,7 @@ function $execCommand(options) {
12801
12801
  }
12802
12802
  });
12803
12803
  }
12804
- /**
12805
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12806
- */
12804
+ /** Note: [🟢] Code for Node command-execution helper [$execCommand](src/utils/execCommand/$execCommand.ts) should never be published into packages that could be imported into browser environment */
12807
12805
 
12808
12806
  /**
12809
12807
  * Get the file extension from a file name
@@ -12912,12 +12910,12 @@ async function getScraperIntermediateSource(source, options) {
12912
12910
  };
12913
12911
  return fileHandler;
12914
12912
  }
12913
+ /** 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 */
12915
12914
  /**
12916
12915
  * Note: Not using `FileCacheStorage` for two reasons:
12917
12916
  * 1) Need to store more than serialized JSONs
12918
12917
  * 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
12919
12918
  * TODO: [🐱‍🐉][🧠] Make some smart crop
12920
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
12921
12919
  */
12922
12920
 
12923
12921
  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"}];
@@ -17115,12 +17113,10 @@ class BoilerplateScraper {
17115
17113
  return knowledge;
17116
17114
  }
17117
17115
  }
17118
- /**
17119
- * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
17120
- * TODO: [🪂] Do it in parallel
17121
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17122
- * @@ Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17123
- */
17116
+ /** TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time */
17117
+ /** TODO: [🪂] Do it in parallel */
17118
+ /** Note: No need to aggregate usage here, it is done by intercepting the llmTools */
17119
+ /** Note: [🟢] Code for Node scraper boilerplate [BoilerplateScraper](src/scrapers/_boilerplate/BoilerplateScraper.ts) should never be published into packages that could be imported into browser environment */
17124
17120
 
17125
17121
  /**
17126
17122
  * Constructor of `BoilerplateScraper`
@@ -17278,11 +17274,11 @@ class DocumentScraper {
17278
17274
  return knowledge;
17279
17275
  }
17280
17276
  }
17277
+ /** Note: [🟢] Code for Node scraper implementation [DocumentScraper](src/scrapers/document/DocumentScraper.ts) should never be published into packages that could be imported into browser environment */
17281
17278
  /**
17282
17279
  * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
17283
17280
  * TODO: [🪂] Do it in parallel 11:11
17284
17281
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17285
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17286
17282
  */
17287
17283
 
17288
17284
  /**
@@ -17445,11 +17441,11 @@ class LegacyDocumentScraper {
17445
17441
  return knowledge;
17446
17442
  }
17447
17443
  }
17444
+ /** Note: [🟢] Code for Node scraper implementation [LegacyDocumentScraper](src/scrapers/document-legacy/LegacyDocumentScraper.ts) should never be published into packages that could be imported into browser environment */
17448
17445
  /**
17449
17446
  * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
17450
17447
  * TODO: [🪂] Do it in parallel 11:11
17451
17448
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17452
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17453
17449
  */
17454
17450
 
17455
17451
  /**
@@ -17683,12 +17679,12 @@ class MarkitdownScraper {
17683
17679
  return knowledge;
17684
17680
  }
17685
17681
  }
17682
+ /** Note: [🟢] Code for Node scraper implementation [MarkitdownScraper](src/scrapers/markitdown/MarkitdownScraper.ts) should never be published into packages that could be imported into browser environment */
17686
17683
  /**
17687
17684
  * TODO: [🧠][🌜] Export only from `@promptbook/markitdown` or `@promptbook/pdf` NOT both
17688
17685
  * TODO: [👣] Converted documents can act as cached items - there is no need to run conversion each time
17689
17686
  * TODO: [🪂] Do it in parallel
17690
17687
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17691
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17692
17688
  */
17693
17689
 
17694
17690
  /**
@@ -17792,11 +17788,11 @@ class PdfScraper {
17792
17788
  throw new NotYetImplementedError('PDF scraping not yet implemented');
17793
17789
  }
17794
17790
  }
17791
+ /** Note: [🟢] Code for Node scraper implementation [PdfScraper](src/scrapers/pdf/PdfScraper.ts) should never be published into packages that could be imported into browser environment */
17795
17792
  /**
17796
17793
  * TODO: [👣] Converted pdf documents can act as cached items - there is no need to run conversion each time
17797
17794
  * TODO: [🪂] Do it in parallel 11:11
17798
17795
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17799
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17800
17796
  */
17801
17797
 
17802
17798
  /**
@@ -17986,11 +17982,11 @@ class WebsiteScraper {
17986
17982
  return knowledge;
17987
17983
  }
17988
17984
  }
17985
+ /** Note: [🟢] Code for Node scraper implementation [WebsiteScraper](src/scrapers/website/WebsiteScraper.ts) should never be published into packages that could be imported into browser environment */
17989
17986
  /**
17990
17987
  * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
17991
17988
  * TODO: [🪂] Do it in parallel 11:11
17992
17989
  * Note: No need to aggregate usage here, it is done by intercepting the llmTools
17993
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
17994
17990
  */
17995
17991
 
17996
17992
  /**
@@ -22352,10 +22348,6 @@ class StyleCommitmentDefinition extends BaseCommitmentDefinition {
22352
22348
  * Prefix used for TEAM tool names.
22353
22349
  */
22354
22350
  const TEAM_TOOL_PREFIX = 'team_chat_';
22355
- /**
22356
- * Length of URL hash suffix appended to TEAM tool names.
22357
- */
22358
- const TEAM_TOOL_HASH_LENGTH = 10;
22359
22351
  /**
22360
22352
  * Fallback normalized name when teammate label is empty.
22361
22353
  */
@@ -22372,20 +22364,19 @@ function normalizeTeammateToolNamePart(teammateLabel) {
22372
22364
  return normalized || TEAM_TOOL_FALLBACK_NAME;
22373
22365
  }
22374
22366
  /**
22375
- * Builds a deterministic TEAM tool name from teammate identity.
22367
+ * Builds a deterministic TEAM tool name from the teammate label.
22376
22368
  *
22377
- * The readable part is based on teammate label while the hash suffix
22378
- * keeps uniqueness and stable mapping for the underlying teammate URL.
22369
+ * The tool name is derived solely from the human-readable label so that it
22370
+ * remains stable and predictable regardless of internal technical identifiers.
22379
22371
  *
22380
- * @param teammateUrl - Canonical teammate URL used at runtime.
22381
- * @param teammateLabel - Human-readable teammate label.
22382
- * @returns Deterministic TEAM tool name.
22372
+ * @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
22373
+ * @param teammateLabel - Human-readable teammate label used as the basis for the name.
22374
+ * @returns TEAM tool name derived from the label.
22383
22375
  * @private internal utility of TEAM commitments and chat UI mapping
22384
22376
  */
22385
- function createTeamToolName(teammateUrl, teammateLabel) {
22377
+ function createTeamToolName(_teammateUrl, teammateLabel) {
22386
22378
  const normalizedLabel = normalizeTeammateToolNamePart(teammateLabel);
22387
- const hash = computeHash(teammateUrl).substring(0, TEAM_TOOL_HASH_LENGTH);
22388
- return `${TEAM_TOOL_PREFIX}${normalizedLabel}_${hash}`;
22379
+ return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
22389
22380
  }
22390
22381
 
22391
22382
  const urlRegex = /https?:\/\/[^\s]+/gi;
@@ -22590,7 +22581,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
22590
22581
  `);
22591
22582
  }
22592
22583
  applyToAgentModelRequirements(requirements, content) {
22593
- var _a, _b;
22584
+ var _a, _b, _c;
22594
22585
  const trimmedContent = content.trim();
22595
22586
  if (!trimmedContent) {
22596
22587
  return requirements;
@@ -22602,14 +22593,18 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
22602
22593
  }
22603
22594
  const agentName = ((_a = requirements._metadata) === null || _a === void 0 ? void 0 : _a.agentName) || 'Agent';
22604
22595
  const existingTeammates = ((_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.teammates) || [];
22596
+ const preResolvedProfiles = (((_c = requirements._metadata) === null || _c === void 0 ? void 0 : _c.preResolvedTeammateProfiles) || {});
22605
22597
  const resolvedTeammates = resolveTeamTeammateLabels(trimmedContent, teammates);
22606
22598
  const teamEntries = resolvedTeammates.map((teammate) => {
22599
+ const profile = preResolvedProfiles[teammate.url];
22600
+ const resolvedLabel = (profile === null || profile === void 0 ? void 0 : profile.agentName) || teammate.label;
22607
22601
  const existingTeammate = existingTeammates.find((entry) => entry.url === teammate.url);
22608
22602
  return {
22609
22603
  toolName: ((existingTeammate === null || existingTeammate === void 0 ? void 0 : existingTeammate.toolName) ||
22610
- createTeamToolName(teammate.url, teammate.label)),
22611
- teammate,
22604
+ createTeamToolName(teammate.url, resolvedLabel)),
22605
+ teammate: { ...teammate, label: resolvedLabel },
22612
22606
  agentName,
22607
+ description: (profile === null || profile === void 0 ? void 0 : profile.personaDescription) || null,
22613
22608
  };
22614
22609
  });
22615
22610
  for (const entry of teamEntries) {
@@ -22621,9 +22616,12 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
22621
22616
  if (updatedTools.some((tool) => tool.name === entry.toolName)) {
22622
22617
  continue;
22623
22618
  }
22619
+ const toolDescription = entry.description
22620
+ ? `Consult teammate ${entry.teammate.label}\n${entry.description}`
22621
+ : `Consult teammate ${entry.teammate.label}`;
22624
22622
  updatedTools.push({
22625
22623
  name: entry.toolName,
22626
- description: `Consult teammate ${entry.teammate.label}`,
22624
+ description: toolDescription,
22627
22625
  parameters: {
22628
22626
  type: 'object',
22629
22627
  properties: {
@@ -22652,8 +22650,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
22652
22650
  toolName: entry.toolName,
22653
22651
  });
22654
22652
  }
22655
- const teamOverviewText = createTeamOverviewText(trimmedContent, teamEntries);
22656
- const teamSystemMessage = this.createSystemMessageSection('Teammates:', buildTeamSystemMessageBody(teamOverviewText, teamEntries));
22653
+ const teamSystemMessage = this.createSystemMessageSection('Teammates:', buildTeamSystemMessageBody(teamEntries));
22657
22654
  return this.appendToSystemMessage({
22658
22655
  ...requirements,
22659
22656
  tools: updatedTools,
@@ -22690,25 +22687,24 @@ function resolveTeamTeammateLabels(teamContent, teammates) {
22690
22687
  };
22691
22688
  });
22692
22689
  }
22693
- /**
22694
- * Rewrites TEAM commitment content into a URL-free teammate overview text.
22695
- */
22696
- function createTeamOverviewText(teamContent, teamEntries) {
22697
- let overviewText = teamContent;
22698
- for (const entry of teamEntries) {
22699
- overviewText = overviewText.split(entry.teammate.url).join(entry.teammate.label);
22700
- }
22701
- return overviewText.trim();
22702
- }
22703
22690
  /**
22704
22691
  * Builds the textual TEAM section body for the final system message.
22692
+ *
22693
+ * Each teammate is listed with its tool name and, when available, a one-line description.
22694
+ * Uses `spaceTrim` to ensure consistent whitespace and indentation.
22705
22695
  */
22706
- function buildTeamSystemMessageBody(teamOverviewText, teamEntries) {
22707
- const teammateLines = teamEntries.map((entry, index) => `${index + 1}) ${entry.teammate.label} tool \`${entry.toolName}\``);
22708
- if (!teamOverviewText) {
22709
- return teammateLines.join('\n');
22710
- }
22711
- return `${teamOverviewText}\n\n${teammateLines.join('\n')}`;
22696
+ function buildTeamSystemMessageBody(teamEntries) {
22697
+ const lines = teamEntries.map((entry, index) => {
22698
+ const toolLine = `${index + 1}) ${entry.teammate.label} tool \`${entry.toolName}\``;
22699
+ if (!entry.description) {
22700
+ return toolLine;
22701
+ }
22702
+ return spaceTrim$1(`
22703
+ ${toolLine}
22704
+ ${entry.description}
22705
+ `);
22706
+ });
22707
+ return lines.join('\n');
22712
22708
  }
22713
22709
  /**
22714
22710
  * Registers tool function and title for a teammate tool.
@@ -29412,7 +29408,7 @@ function getSafeReferenceCommitmentFallback(commitmentType, originalContent) {
29412
29408
  * @private @@@
29413
29409
  */
29414
29410
  async function createAgentModelRequirementsWithCommitments(agentSource, modelName, options) {
29415
- var _a;
29411
+ var _a, _b, _c;
29416
29412
  const agentReferenceResolver = options === null || options === void 0 ? void 0 : options.agentReferenceResolver;
29417
29413
  // Parse the agent source to extract commitments
29418
29414
  const parseResult = parseAgentSourceWithCommitments(agentSource);
@@ -29480,6 +29476,36 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
29480
29476
  if (commitment.type === 'CLOSED' && i !== filteredCommitments.length - 1) {
29481
29477
  continue;
29482
29478
  }
29479
+ // For TEAM commitments, pre-resolve teammate profiles if a resolver is provided
29480
+ // and store them in metadata before the commitment is applied.
29481
+ const profileResolver = (_a = options === null || options === void 0 ? void 0 : options.teammateProfileResolver) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.agentReferenceResolver;
29482
+ if (commitment.type === 'TEAM' && (profileResolver === null || profileResolver === void 0 ? void 0 : profileResolver.resolveTeammateProfile)) {
29483
+ try {
29484
+ const parsedTeammates = parseTeamCommitmentContent(commitmentContent, { strict: false });
29485
+ const preResolved = {
29486
+ ...(_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.preResolvedTeammateProfiles,
29487
+ };
29488
+ for (const teammate of parsedTeammates) {
29489
+ if (preResolved[teammate.url]) {
29490
+ continue;
29491
+ }
29492
+ const profile = await profileResolver.resolveTeammateProfile(teammate.url);
29493
+ if (profile) {
29494
+ preResolved[teammate.url] = profile;
29495
+ }
29496
+ }
29497
+ requirements = {
29498
+ ...requirements,
29499
+ _metadata: {
29500
+ ...requirements._metadata,
29501
+ preResolvedTeammateProfiles: preResolved,
29502
+ },
29503
+ };
29504
+ }
29505
+ catch (error) {
29506
+ console.warn('Failed to pre-resolve teammate profiles for TEAM commitment:', error);
29507
+ }
29508
+ }
29483
29509
  const definition = getCommitmentDefinition(commitment.type);
29484
29510
  if (definition) {
29485
29511
  try {
@@ -29575,7 +29601,7 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
29575
29601
  // Add example interactions to the system message
29576
29602
  const examples = [];
29577
29603
  // 1. Initial message as an example agent response
29578
- const initialMessage = (_a = parseResult.commitments.find((c) => c.type === 'INITIAL MESSAGE')) === null || _a === void 0 ? void 0 : _a.content;
29604
+ const initialMessage = (_c = parseResult.commitments.find((c) => c.type === 'INITIAL MESSAGE')) === null || _c === void 0 ? void 0 : _c.content;
29579
29605
  if (initialMessage) {
29580
29606
  examples.push(`Agent: ${initialMessage}`);
29581
29607
  }
@@ -30573,10 +30599,8 @@ function $provideFilesystemForNode(options) {
30573
30599
  watch,
30574
30600
  };
30575
30601
  }
30576
- /**
30577
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
30578
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
30579
- */
30602
+ /** Note: [🟢] Code for Node scraper registration helper [$provideFilesystemForNode](src/scrapers/_common/register/$provideFilesystemForNode.ts) should never be published into packages that could be imported into browser environment */
30603
+ /** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
30580
30604
 
30581
30605
  /**
30582
30606
  * Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
@@ -30698,9 +30722,7 @@ async function fetchUrlContent(url) {
30698
30722
  `);
30699
30723
  }
30700
30724
  }
30701
- /**
30702
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
30703
- */
30725
+ /** Note: [🟢] Code for Node browser-fetch helper [fetchUrlContent](src/commitments/USE_BROWSER/fetchUrlContent.ts) should never be published into packages that could be imported into browser environment */
30704
30726
 
30705
30727
  /**
30706
30728
  * Cached implementation of `run_browser` when it can be resolved.
@@ -30976,10 +30998,8 @@ async function locateAppOnLinux({ linuxWhich, }) {
30976
30998
  return null;
30977
30999
  }
30978
31000
  }
30979
- /**
30980
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
30981
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
30982
- */
31001
+ /** Note: [🟢] Code for Node executable locator [locateAppOnLinux](src/executables/platforms/locateAppOnLinux.ts) should never be published into packages that could be imported into browser environment */
31002
+ /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
30983
31003
 
30984
31004
  /**
30985
31005
  * Checks if the file is executable
@@ -31032,10 +31052,8 @@ async function locateAppOnMacOs({ macOsName, }) {
31032
31052
  return null;
31033
31053
  }
31034
31054
  }
31035
- /**
31036
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
31037
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31038
- */
31055
+ /** Note: [🟢] Code for Node executable locator [locateAppOnMacOs](src/executables/platforms/locateAppOnMacOs.ts) should never be published into packages that could be imported into browser environment */
31056
+ /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
31039
31057
 
31040
31058
  /**
31041
31059
  * Attempts to locate the specified application on a Windows system by searching common installation directories.
@@ -31064,10 +31082,8 @@ async function locateAppOnWindows({ appName, windowsSuffix, }) {
31064
31082
  return null;
31065
31083
  }
31066
31084
  }
31067
- /**
31068
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
31069
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31070
- */
31085
+ /** Note: [🟢] Code for Node executable locator [locateAppOnWindows](src/executables/platforms/locateAppOnWindows.ts) should never be published into packages that could be imported into browser environment */
31086
+ /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
31071
31087
 
31072
31088
  /**
31073
31089
  * Locates an application on the system
@@ -31104,10 +31120,8 @@ function locateApp(options) {
31104
31120
  }
31105
31121
  }
31106
31122
  }
31107
- /**
31108
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
31109
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31110
- */
31123
+ /** Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment */
31124
+ /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
31111
31125
 
31112
31126
  /**
31113
31127
  * Locates the LibreOffice executable on the current system by searching platform-specific paths.
@@ -31123,10 +31137,8 @@ function locateLibreoffice() {
31123
31137
  macOsName: 'LibreOffice',
31124
31138
  });
31125
31139
  }
31126
- /**
31127
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
31128
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31129
- */
31140
+ /** Note: [🟢] Code for Node executable locator [locateLibreoffice](src/executables/apps/locateLibreoffice.ts) should never be published into packages that could be imported into browser environment */
31141
+ /** TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents` */
31130
31142
 
31131
31143
  /**
31132
31144
  * Locates the Pandoc executable on the current system by searching platform-specific paths.
@@ -31142,10 +31154,8 @@ function locatePandoc() {
31142
31154
  macOsName: 'Pandoc',
31143
31155
  });
31144
31156
  }
31145
- /**
31146
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
31147
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31148
- */
31157
+ /** Note: [🟢] Code for Node executable locator [locatePandoc](src/executables/apps/locatePandoc.ts) should never be published into packages that could be imported into browser environment */
31158
+ /** TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents` */
31149
31159
 
31150
31160
  /**
31151
31161
  * Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
@@ -31162,9 +31172,9 @@ async function $provideExecutablesForNode(options) {
31162
31172
  // <- TODO: [🧠] `null` vs `undefined`
31163
31173
  };
31164
31174
  }
31175
+ /** Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment */
31165
31176
  /**
31166
31177
  * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
31167
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31168
31178
  * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
31169
31179
  */
31170
31180
 
@@ -31382,9 +31392,7 @@ async function $provideEnvFilename() {
31382
31392
  }
31383
31393
  return null;
31384
31394
  }
31385
- /**
31386
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31387
- */
31395
+ /** Note: [🟢] Code for Node environment helper [$provideEnvFilename](src/llm-providers/_common/register/$provideEnvFilename.ts) should never be published into packages that could be imported into browser environment */
31388
31396
 
31389
31397
  /**
31390
31398
  * Stores data in .env variables
@@ -31591,10 +31599,8 @@ class FileCacheStorage {
31591
31599
  // [0] When `setItem` and `removeItem` called, the state of the file system should be the same
31592
31600
  }
31593
31601
  }
31594
- /**
31595
- * TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
31596
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31597
- */
31602
+ /** Note: [🟢] Code for Node file-cache storage [FileCacheStorage](src/storage/file-cache-storage/FileCacheStorage.ts) should never be published into packages that could be imported into browser environment */
31603
+ /** TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values */
31598
31604
 
31599
31605
  /**
31600
31606
  * Stores data in memory (HEAP)
@@ -31874,9 +31880,7 @@ async function $provideLlmToolsConfigurationFromEnv() {
31874
31880
  .filter((configuration) => configuration !== null);
31875
31881
  return llmToolsConfiguration;
31876
31882
  }
31877
- /**
31878
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31879
- */
31883
+ /** Note: [🟢] Code for Node environment helper [$provideLlmToolsConfigurationFromEnv](src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.ts) should never be published into packages that could be imported into browser environment */
31880
31884
 
31881
31885
  /**
31882
31886
  * Creates LLM execution tools from provided configuration objects
@@ -31982,20 +31986,18 @@ async function $provideLlmToolsFromEnv(options = {}) {
31982
31986
  }
31983
31987
  return createLlmToolsFromConfiguration(configuration, options);
31984
31988
  }
31989
+ /** Note: [🟢] Code for Node environment helper [$provideLlmToolsFromEnv](src/llm-providers/_common/register/$provideLlmToolsFromEnv.ts) should never be published into packages that could be imported into browser environment */
31985
31990
  /**
31986
31991
  * TODO: The architecture for LLM tools configuration consists of three key functions:
31987
31992
  * 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
31988
31993
  * 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
31989
31994
  * 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
31990
- *
31991
31995
  * This layered approach allows flexibility in how tools are configured:
31992
31996
  * - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
31993
31997
  * - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
31994
31998
  * - Use createLlmToolsFromConfiguration for explicit control over tool configurations
31995
- *
31996
31999
  * TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
31997
32000
  * TODO: [🧠] Is there some meaningfull way how to test this util
31998
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
31999
32001
  * TODO: [🥃] Allow `ptbk make` without llm tools
32000
32002
  * TODO: This should be maybe not under `_common` but under `utils`
32001
32003
  * TODO: [®] DRY Register logic
@@ -32058,8 +32060,8 @@ async function $provideLlmToolsForWizardOrCli(options) {
32058
32060
  isCacheReloaded,
32059
32061
  });
32060
32062
  }
32063
+ /** Note: [🟢] Code for Node environment helper [$provideLlmToolsForWizardOrCli](src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.ts) should never be published into packages that could be imported into browser environment */
32061
32064
  /**
32062
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
32063
32065
  * TODO: [👷‍♂️] Write a comprehensive manual about the construction of LLM tools
32064
32066
  * TODO: [🥃] Allow `ptbk make` without llm tools
32065
32067
  * TODO: This should be maybe not under `_common` but under `utils-internal` / `utils/internal`
@@ -32089,10 +32091,8 @@ async function $provideScrapersForNode(tools, options) {
32089
32091
  }
32090
32092
  return scrapers;
32091
32093
  }
32092
- /**
32093
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
32094
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
32095
- */
32094
+ /** Note: [🟢] Code for Node scraper registration helper [$provideScrapersForNode](src/scrapers/_common/register/$provideScrapersForNode.ts) should never be published into packages that could be imported into browser environment */
32095
+ /** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
32096
32096
 
32097
32097
  /**
32098
32098
  * Extracts exactly ONE code block from markdown.
@@ -32436,9 +32436,7 @@ async function loadArchive(filePath, fs) {
32436
32436
  }
32437
32437
  return collectionJson;
32438
32438
  }
32439
- /**
32440
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
32441
- */
32439
+ /** Note: [🟢] Code for Node archive helper [loadArchive](src/conversion/archive/loadArchive.ts) should never be published into packages that could be imported into browser environment */
32442
32440
 
32443
32441
  /**
32444
32442
  * All available task types
@@ -35834,10 +35832,8 @@ async function $provideExecutionToolsForNode(options) {
35834
35832
  };
35835
35833
  return tools;
35836
35834
  }
35837
- /**
35838
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
35839
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
35840
- */
35835
+ /** Note: [🟢] Code for Node execution helper [$provideExecutionToolsForNode](src/execution/utils/$provideExecutionToolsForNode.ts) should never be published into packages that could be imported into browser environment */
35836
+ /** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
35841
35837
 
35842
35838
  /**
35843
35839
  * Checks if the directory exists
@@ -36171,10 +36167,10 @@ async function saveArchive(filePath, collectionJson, fs) {
36171
36167
  const data = await archive.generateAsync({ type: 'nodebuffer', streamFiles: true });
36172
36168
  await fs.writeFile(filePath, data);
36173
36169
  }
36170
+ /** Note: [🟢] Code for Node archive helper [saveArchive](src/conversion/archive/saveArchive.ts) should never be published into packages that could be imported into browser environment */
36174
36171
  /**
36175
36172
  * TODO: Add metadata to zip
36176
36173
  * TODO: Compression level and other zip options from config
36177
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
36178
36174
  */
36179
36175
 
36180
36176
  /**
@@ -36338,10 +36334,8 @@ async function $getCompiledBook(tools, pipelineSource, options) {
36338
36334
 
36339
36335
  `));
36340
36336
  }
36341
- /**
36342
- * TODO: Write unit test
36343
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
36344
- */
36337
+ /** Note: [🟢] Code for Node wizard helper [$getCompiledBook](src/wizard/$getCompiledBook.ts) should never be published into packages that could be imported into browser environment */
36338
+ /** TODO: Write unit test */
36345
36339
 
36346
36340
  /**
36347
36341
  * Wizard for simple usage of the Promptbook
@@ -36458,10 +36452,8 @@ class Wizard {
36458
36452
  * @public exported from `@promptbook/wizard`
36459
36453
  */
36460
36454
  const wizard = new Wizard();
36461
- /**
36462
- * TODO: [🧠] Maybe some way how to handle the progress and streaming?
36463
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
36464
- */
36455
+ /** Note: [🟢] Code for Node wizard helper [wizard](src/wizard/wizard.ts) should never be published into packages that could be imported into browser environment */
36456
+ /** TODO: [🧠] Maybe some way how to handle the progress and streaming? */
36465
36457
 
36466
36458
  /**
36467
36459
  * Keep-alive helpers used for streaming chat responses.
@@ -36692,13 +36684,23 @@ function getToolCallIdentity(toolCall) {
36692
36684
  */
36693
36685
  function mergeToolCalls(existingToolCalls, incomingToolCalls) {
36694
36686
  if (!existingToolCalls || existingToolCalls.length === 0) {
36695
- return incomingToolCalls ? [...incomingToolCalls] : [];
36687
+ return incomingToolCalls ? deduplicatePreparationToolCalls([...incomingToolCalls]) : [];
36696
36688
  }
36697
36689
  if (!incomingToolCalls || incomingToolCalls.length === 0) {
36698
36690
  return [...existingToolCalls];
36699
36691
  }
36700
36692
  const mergedToolCalls = [...existingToolCalls];
36701
36693
  for (const incomingToolCall of incomingToolCalls) {
36694
+ if (isAssistantPreparationToolCall(incomingToolCall)) {
36695
+ // A new preparation phase always replaces any previous assistant_preparation tool
36696
+ // call, regardless of phase argument, so only one chip is ever shown at a time.
36697
+ const existingPreparationIndex = mergedToolCalls.findIndex(isAssistantPreparationToolCall);
36698
+ if (existingPreparationIndex !== -1) {
36699
+ mergedToolCalls.splice(existingPreparationIndex, 1);
36700
+ }
36701
+ mergedToolCalls.push(incomingToolCall);
36702
+ continue;
36703
+ }
36702
36704
  const incomingIdentity = getToolCallIdentity(incomingToolCall);
36703
36705
  const existingIndex = mergedToolCalls.findIndex((existingToolCall) => getToolCallIdentity(existingToolCall) === incomingIdentity);
36704
36706
  if (existingIndex === -1) {
@@ -36810,6 +36812,30 @@ function serializeValueForMerge(value) {
36810
36812
  return String(value);
36811
36813
  }
36812
36814
  }
36815
+ /**
36816
+ * Ensures at most one `assistant_preparation` tool call survives in the list,
36817
+ * keeping the last occurrence so the most recent preparation phase is shown.
36818
+ *
36819
+ * @param toolCalls - Mutable list to deduplicate in-place.
36820
+ * @returns The same array after removing redundant preparation entries.
36821
+ * @private helper of `mergeToolCalls`
36822
+ */
36823
+ function deduplicatePreparationToolCalls(toolCalls) {
36824
+ let lastPreparationIndex = -1;
36825
+ for (let index = toolCalls.length - 1; index >= 0; index--) {
36826
+ if (!isAssistantPreparationToolCall(toolCalls[index])) {
36827
+ continue;
36828
+ }
36829
+ if (lastPreparationIndex === -1) {
36830
+ lastPreparationIndex = index;
36831
+ }
36832
+ else {
36833
+ // Remove earlier duplicate — keep only the last (most recent) one.
36834
+ toolCalls.splice(index, 1);
36835
+ }
36836
+ }
36837
+ return toolCalls;
36838
+ }
36813
36839
 
36814
36840
  /**
36815
36841
  * Gets all tool titles provided by all commitments