@promptbook/node 0.112.0-32 → 0.112.0-35

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 (1518) hide show
  1. package/README.md +18 -0
  2. package/esm/index.es.js +776 -800
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/_packages/types.index.d.ts +94 -94
  5. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -4
  6. package/esm/src/book-2.0/agent-source/AgentModelRequirements.d.ts +0 -4
  7. package/esm/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +7 -0
  8. package/esm/src/book-2.0/agent-source/createTeamToolName.d.ts +1 -0
  9. package/esm/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +1 -0
  10. package/esm/src/book-2.0/agent-source/padBook.d.ts +1 -4
  11. package/esm/src/book-2.0/agent-source/parseAgentSource.d.ts +0 -3
  12. package/esm/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -0
  13. package/esm/src/book-2.0/agent-source/parseParameters.d.ts +1 -0
  14. package/esm/src/book-2.0/agent-source/parseTeamCommitment.d.ts +0 -3
  15. package/esm/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +8 -3
  16. package/esm/src/book-2.0/agent-source/string_book.d.ts +1 -0
  17. package/esm/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +0 -3
  18. package/esm/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +0 -3
  19. package/esm/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +0 -3
  20. package/esm/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +4 -0
  21. package/esm/src/book-components/BookEditor/BookEditor.d.ts +0 -3
  22. package/esm/src/book-components/BookEditor/BookEditorActionbar.d.ts +4 -0
  23. package/esm/src/book-components/BookEditor/BookEditorMonaco.d.ts +2 -0
  24. package/esm/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +3 -0
  25. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +1 -0
  26. package/esm/src/book-components/BookEditor/useBookEditorMonacoDecorations.d.ts +6 -0
  27. package/esm/src/book-components/BookEditor/useBookEditorMonacoDiagnostics.d.ts +9 -0
  28. package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +7 -0
  29. package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +3 -0
  30. package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +24 -0
  31. package/esm/src/book-components/Chat/AgentChat/AgentChat.d.ts +0 -3
  32. package/esm/src/book-components/Chat/AgentChip/AgentChip.d.ts +6 -5
  33. package/esm/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +38 -0
  34. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -14
  35. package/esm/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
  36. package/esm/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
  37. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +2 -3
  38. package/esm/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
  39. package/esm/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
  40. package/esm/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +34 -0
  41. package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
  42. package/esm/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
  43. package/esm/src/book-components/Chat/Chat/constants.d.ts +4 -3
  44. package/esm/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
  45. package/esm/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
  46. package/esm/src/book-components/Chat/Chat/insertDictationChunk.d.ts +16 -0
  47. package/esm/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
  48. package/esm/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
  49. package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
  50. package/esm/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +27 -0
  51. package/esm/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +32 -0
  52. package/esm/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +33 -0
  53. package/esm/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +32 -0
  54. package/esm/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +32 -0
  55. package/esm/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +39 -0
  56. package/esm/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +39 -0
  57. package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +47 -0
  58. package/esm/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +34 -0
  59. package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +3 -2
  60. package/esm/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +30 -0
  61. package/esm/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +27 -0
  62. package/esm/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
  63. package/esm/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +10 -0
  64. package/esm/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
  65. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +53 -0
  66. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
  67. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -0
  68. package/esm/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
  69. package/esm/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
  70. package/esm/src/book-components/Chat/LlmChat/defaults.d.ts +0 -3
  71. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
  72. package/esm/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
  73. package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
  74. package/esm/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
  75. package/esm/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
  76. package/esm/src/book-components/Chat/effects/index.d.ts +0 -4
  77. package/esm/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
  78. package/esm/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
  79. package/esm/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
  80. package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
  81. package/esm/src/book-components/Chat/save/index.d.ts +0 -3
  82. package/esm/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
  83. package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
  84. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
  85. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
  86. package/esm/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
  87. package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
  88. package/esm/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
  89. package/esm/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
  90. package/esm/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
  91. package/esm/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
  92. package/esm/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
  93. package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
  94. package/esm/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
  95. package/esm/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
  96. package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
  97. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
  98. package/esm/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
  99. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
  100. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
  101. package/esm/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
  102. package/esm/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
  103. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
  104. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
  105. package/esm/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
  106. package/esm/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
  107. package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
  108. package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
  109. package/esm/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
  110. package/esm/src/book-components/Qr/GenericQrCode.d.ts +5 -0
  111. package/esm/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
  112. package/esm/src/book-components/Qr/useQrCode.d.ts +4 -1
  113. package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
  114. package/esm/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
  115. package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
  116. package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -3
  117. package/esm/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
  118. package/esm/src/book-components/icons/AboutIcon.d.ts +1 -0
  119. package/esm/src/book-components/icons/AttachmentIcon.d.ts +4 -0
  120. package/esm/src/book-components/icons/CameraIcon.d.ts +4 -0
  121. package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -0
  122. package/esm/src/book-components/icons/EmailIcon.d.ts +1 -0
  123. package/esm/src/book-components/icons/MenuIcon.d.ts +1 -3
  124. package/esm/src/book-components/icons/SaveIcon.d.ts +1 -0
  125. package/esm/src/book-components/icons/SendIcon.d.ts +0 -3
  126. package/esm/src/book-components/icons/TeacherIcon.d.ts +1 -0
  127. package/esm/src/cli/$runPromptbookCli.d.ts +0 -3
  128. package/esm/src/cli/cli-commands/_boilerplate.d.ts +0 -4
  129. package/esm/src/cli/cli-commands/about.d.ts +0 -6
  130. package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
  131. package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -4
  132. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -4
  133. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -4
  134. package/esm/src/cli/cli-commands/coder/init.d.ts +0 -4
  135. package/esm/src/cli/cli-commands/coder/run.d.ts +1 -5
  136. package/esm/src/cli/cli-commands/coder/run.test.d.ts +1 -0
  137. package/esm/src/cli/cli-commands/coder/verify.d.ts +0 -4
  138. package/esm/src/cli/cli-commands/coder.d.ts +0 -4
  139. package/esm/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
  140. package/esm/src/cli/cli-commands/hello.d.ts +0 -5
  141. package/esm/src/cli/cli-commands/list-models.d.ts +0 -4
  142. package/esm/src/cli/cli-commands/list-scrapers.d.ts +0 -4
  143. package/esm/src/cli/cli-commands/login.d.ts +0 -5
  144. package/esm/src/cli/cli-commands/make.d.ts +1 -1
  145. package/esm/src/cli/cli-commands/prettify.d.ts +0 -6
  146. package/esm/src/cli/cli-commands/run.d.ts +0 -8
  147. package/esm/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
  148. package/esm/src/cli/cli-commands/start-agents-server.d.ts +0 -4
  149. package/esm/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
  150. package/esm/src/cli/cli-commands/test-command.d.ts +0 -7
  151. package/esm/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
  152. package/esm/src/cli/main.d.ts +0 -4
  153. package/esm/src/cli/promptbookCli.d.ts +0 -7
  154. package/esm/src/collection/agent-collection/AgentCollection.d.ts +0 -3
  155. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
  156. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
  157. package/esm/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
  158. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
  159. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
  160. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
  161. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
  162. package/esm/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
  163. package/esm/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
  164. package/esm/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
  165. package/esm/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
  166. package/esm/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
  167. package/esm/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
  168. package/esm/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
  169. package/esm/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
  170. package/esm/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
  171. package/esm/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
  172. package/esm/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
  173. package/esm/src/commands/JOKER/JokerCommand.d.ts +1 -0
  174. package/esm/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
  175. package/esm/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
  176. package/esm/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
  177. package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
  178. package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
  179. package/esm/src/commands/MODEL/ModelCommand.d.ts +1 -0
  180. package/esm/src/commands/MODEL/modelCommandParser.d.ts +1 -0
  181. package/esm/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
  182. package/esm/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
  183. package/esm/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
  184. package/esm/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
  185. package/esm/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
  186. package/esm/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
  187. package/esm/src/commands/SECTION/SectionCommand.d.ts +1 -0
  188. package/esm/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
  189. package/esm/src/commands/URL/UrlCommand.d.ts +1 -0
  190. package/esm/src/commands/URL/urlCommandParser.d.ts +1 -0
  191. package/esm/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
  192. package/esm/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
  193. package/esm/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
  194. package/esm/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
  195. package/esm/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
  196. package/esm/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  197. package/esm/src/commands/_common/stringifyCommand.d.ts +1 -1
  198. package/esm/src/commands/_common/types/CommandParser.d.ts +0 -4
  199. package/esm/src/commands/index.d.ts +0 -3
  200. package/esm/src/commitments/ACTION/ACTION.d.ts +0 -3
  201. package/esm/src/commitments/CLOSED/CLOSED.d.ts +0 -3
  202. package/esm/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
  203. package/esm/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
  204. package/esm/src/commitments/DELETE/DELETE.d.ts +0 -3
  205. package/esm/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
  206. package/esm/src/commitments/FORMAT/FORMAT.d.ts +0 -3
  207. package/esm/src/commitments/FROM/FROM.d.ts +0 -3
  208. package/esm/src/commitments/GOAL/GOAL.d.ts +0 -3
  209. package/esm/src/commitments/IMPORT/IMPORT.d.ts +0 -3
  210. package/esm/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
  211. package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -3
  212. package/esm/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
  213. package/esm/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
  214. package/esm/src/commitments/META/META.d.ts +0 -3
  215. package/esm/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
  216. package/esm/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
  217. package/esm/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
  218. package/esm/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
  219. package/esm/src/commitments/META_FONT/META_FONT.d.ts +0 -3
  220. package/esm/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
  221. package/esm/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
  222. package/esm/src/commitments/META_LINK/META_LINK.d.ts +0 -3
  223. package/esm/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
  224. package/esm/src/commitments/MODEL/MODEL.d.ts +0 -3
  225. package/esm/src/commitments/OPEN/OPEN.d.ts +0 -3
  226. package/esm/src/commitments/PERSONA/PERSONA.d.ts +0 -3
  227. package/esm/src/commitments/RULE/RULE.d.ts +0 -3
  228. package/esm/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
  229. package/esm/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
  230. package/esm/src/commitments/TEAM/TEAM.d.ts +0 -3
  231. package/esm/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
  232. package/esm/src/commitments/USE/USE.d.ts +0 -3
  233. package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
  234. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
  235. package/esm/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -7
  236. package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
  237. package/esm/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
  238. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
  239. package/esm/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
  240. package/esm/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
  241. package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
  242. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
  243. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
  244. package/esm/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
  245. package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
  246. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
  247. package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
  248. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
  249. package/esm/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
  250. package/esm/src/commitments/WALLET/WALLET.d.ts +0 -3
  251. package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
  252. package/esm/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
  253. package/esm/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
  254. package/esm/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
  255. package/esm/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
  256. package/esm/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
  257. package/esm/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
  258. package/esm/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
  259. package/esm/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
  260. package/esm/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
  261. package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
  262. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
  263. package/esm/src/commitments/index.d.ts +0 -4
  264. package/esm/src/config.test.d.ts +0 -3
  265. package/esm/src/constants/streaming.d.ts +0 -3
  266. package/esm/src/constants.d.ts +0 -3
  267. package/esm/src/conversion/archive/loadArchive.d.ts +0 -3
  268. package/esm/src/conversion/archive/saveArchive.d.ts +0 -5
  269. package/esm/src/conversion/compilePipeline.d.ts +2 -7
  270. package/esm/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
  271. package/esm/src/conversion/parsePipeline.d.ts +1 -11
  272. package/esm/src/conversion/pipelineJsonToString.d.ts +1 -7
  273. package/esm/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
  274. package/esm/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
  275. package/esm/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
  276. package/esm/src/conversion/validation/_importPipeline.d.ts +6 -4
  277. package/esm/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
  278. package/esm/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
  279. package/esm/src/conversion/validation/validatePipeline.d.ts +3 -9
  280. package/esm/src/conversion/validation/validatePipeline.test.d.ts +0 -3
  281. package/esm/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -4
  282. package/esm/src/errors/0-BoilerplateError.d.ts +0 -3
  283. package/esm/src/errors/0-index.d.ts +0 -3
  284. package/esm/src/errors/DatabaseError.d.ts +0 -3
  285. package/esm/src/errors/ExpectError.d.ts +2 -1
  286. package/esm/src/errors/ParseError.d.ts +0 -3
  287. package/esm/src/errors/PipelineExecutionError.d.ts +0 -3
  288. package/esm/src/executables/$provideExecutablesForNode.d.ts +0 -5
  289. package/esm/src/executables/apps/locateLibreoffice.d.ts +0 -4
  290. package/esm/src/executables/apps/locatePandoc.d.ts +0 -4
  291. package/esm/src/executables/browsers/locateBrowser.d.ts +0 -1
  292. package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
  293. package/esm/src/executables/locateApp.d.ts +0 -4
  294. package/esm/src/executables/platforms/locateAppOnLinux.d.ts +0 -4
  295. package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +0 -4
  296. package/esm/src/executables/platforms/locateAppOnWindows.d.ts +0 -4
  297. package/esm/src/execution/AbstractTaskResult.d.ts +0 -4
  298. package/esm/src/execution/AvailableModel.d.ts +0 -4
  299. package/esm/src/execution/CommonToolsOptions.d.ts +0 -5
  300. package/esm/src/execution/ExecutionTask.d.ts +4 -4
  301. package/esm/src/execution/FilesystemTools.d.ts +0 -3
  302. package/esm/src/execution/LlmExecutionTools.d.ts +3 -9
  303. package/esm/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
  304. package/esm/src/execution/PipelineExecutor.d.ts +0 -3
  305. package/esm/src/execution/PipelineExecutorResult.d.ts +0 -3
  306. package/esm/src/execution/PromptResult.d.ts +1 -9
  307. package/esm/src/execution/PromptbookFetch.test-type.d.ts +0 -4
  308. package/esm/src/execution/ScriptExecutionTools.d.ts +0 -4
  309. package/esm/src/execution/Usage.d.ts +0 -3
  310. package/esm/src/execution/UserInterfaceTools.d.ts +3 -0
  311. package/esm/src/execution/assertsTaskSuccessful.d.ts +1 -3
  312. package/esm/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
  313. package/esm/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
  314. package/esm/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
  315. package/esm/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
  316. package/esm/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
  317. package/esm/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
  318. package/esm/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
  319. package/esm/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
  320. package/esm/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
  321. package/esm/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
  322. package/esm/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
  323. package/esm/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
  324. package/esm/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
  325. package/esm/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -5
  326. package/esm/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -6
  327. package/esm/src/execution/utils/checkExpectations.d.ts +2 -5
  328. package/esm/src/execution/utils/forEachAsync.d.ts +5 -1
  329. package/esm/src/execution/utils/usage-constants.d.ts +0 -3
  330. package/esm/src/execution/utils/usageToHuman.d.ts +0 -8
  331. package/esm/src/execution/utils/validatePromptResult.d.ts +1 -0
  332. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
  333. package/esm/src/formats/_common/FormatParser.d.ts +2 -9
  334. package/esm/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
  335. package/esm/src/formats/csv/CsvFormatParser.d.ts +2 -8
  336. package/esm/src/formats/index.d.ts +0 -3
  337. package/esm/src/formats/json/JsonFormatParser.d.ts +0 -11
  338. package/esm/src/formats/text/TextFormatParser.d.ts +0 -9
  339. package/esm/src/formats/xml/XmlFormatParser.d.ts +0 -11
  340. package/esm/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
  341. package/esm/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
  342. package/esm/src/formfactors/index.d.ts +0 -3
  343. package/esm/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
  344. package/esm/src/high-level-abstractions/index.d.ts +0 -4
  345. package/esm/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
  346. package/esm/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
  347. package/esm/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
  348. package/esm/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -3
  349. package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
  350. package/esm/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
  351. package/esm/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
  352. package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -18
  353. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
  354. package/esm/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
  355. package/esm/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
  356. package/esm/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
  357. package/esm/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
  358. package/esm/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
  359. package/esm/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
  360. package/esm/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
  361. package/esm/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
  362. package/esm/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
  363. package/esm/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
  364. package/esm/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
  365. package/esm/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
  366. package/esm/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
  367. package/esm/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
  368. package/esm/src/llm-providers/_multiple/playground/playground.d.ts +0 -3
  369. package/esm/src/llm-providers/agent/Agent.d.ts +0 -3
  370. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
  371. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
  372. package/esm/src/llm-providers/agent/playground/playground.d.ts +0 -6
  373. package/esm/src/llm-providers/agent/register-configuration.d.ts +0 -5
  374. package/esm/src/llm-providers/agent/register-constructor.d.ts +0 -4
  375. package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
  376. package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
  377. package/esm/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
  378. package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
  379. package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
  380. package/esm/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
  381. package/esm/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
  382. package/esm/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
  383. package/esm/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
  384. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
  385. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
  386. package/esm/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
  387. package/esm/src/llm-providers/azure-openai/playground/playground.d.ts +0 -4
  388. package/esm/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
  389. package/esm/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
  390. package/esm/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
  391. package/esm/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
  392. package/esm/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
  393. package/esm/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
  394. package/esm/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
  395. package/esm/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
  396. package/esm/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
  397. package/esm/src/llm-providers/google/google-models.d.ts +1 -6
  398. package/esm/src/llm-providers/google/register-configuration.d.ts +0 -3
  399. package/esm/src/llm-providers/google/register-constructor.d.ts +0 -4
  400. package/esm/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
  401. package/esm/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
  402. package/esm/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
  403. package/esm/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
  404. package/esm/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
  405. package/esm/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
  406. package/esm/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
  407. package/esm/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
  408. package/esm/src/llm-providers/ollama/ollama-models.d.ts +1 -4
  409. package/esm/src/llm-providers/ollama/playground/playground.d.ts +0 -4
  410. package/esm/src/llm-providers/ollama/register-configuration.d.ts +0 -3
  411. package/esm/src/llm-providers/ollama/register-constructor.d.ts +0 -4
  412. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
  413. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
  414. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
  415. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
  416. package/esm/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
  417. package/esm/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
  418. package/esm/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
  419. package/esm/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
  420. package/esm/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
  421. package/esm/src/llm-providers/openai/openai-models.d.ts +1 -0
  422. package/esm/src/llm-providers/openai/openai-models.test.d.ts +0 -3
  423. package/esm/src/llm-providers/openai/playground/playground.d.ts +0 -4
  424. package/esm/src/llm-providers/openai/register-configuration.d.ts +0 -3
  425. package/esm/src/llm-providers/openai/register-constructor.d.ts +0 -4
  426. package/esm/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
  427. package/esm/src/llm-providers/remote/playground/playground.d.ts +0 -3
  428. package/esm/src/llm-providers/vercel/playground/playground.d.ts +0 -4
  429. package/esm/src/other/templates/getBookTemplates.d.ts +2 -5
  430. package/esm/src/personas/preparePersona.d.ts +1 -7
  431. package/esm/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
  432. package/esm/src/pipeline/PipelineInterface/constants.d.ts +0 -3
  433. package/esm/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
  434. package/esm/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
  435. package/esm/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
  436. package/esm/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
  437. package/esm/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
  438. package/esm/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
  439. package/esm/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
  440. package/esm/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
  441. package/esm/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
  442. package/esm/src/pipeline/book-notation.d.ts +1 -4
  443. package/esm/src/pipeline/isValidPipelineString.d.ts +1 -3
  444. package/esm/src/pipeline/isValidPipelineString.test.d.ts +0 -3
  445. package/esm/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
  446. package/esm/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
  447. package/esm/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
  448. package/esm/src/pipeline/prompt-notation.d.ts +2 -5
  449. package/esm/src/pipeline/prompt-notation.test.d.ts +0 -3
  450. package/esm/src/pipeline/validatePipelineString.d.ts +1 -3
  451. package/esm/src/playground/permanent/_boilerplate.d.ts +0 -3
  452. package/esm/src/playground/permanent/agent-with-browser-playground.d.ts +0 -3
  453. package/esm/src/playground/permanent/error-handling-playground.d.ts +0 -3
  454. package/esm/src/playground/playground.d.ts +0 -4
  455. package/esm/src/postprocessing/utils/extractBlock.d.ts +2 -1
  456. package/esm/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
  457. package/esm/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
  458. package/esm/src/prepare/preparePipeline.d.ts +3 -2
  459. package/esm/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
  460. package/esm/src/prepare/prepareTasks.d.ts +6 -10
  461. package/esm/src/prepare/unpreparePipeline.d.ts +1 -5
  462. package/esm/src/remote-server/RemoteServer.d.ts +3 -0
  463. package/esm/src/remote-server/openapi.d.ts +3 -4
  464. package/esm/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
  465. package/esm/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
  466. package/esm/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
  467. package/esm/src/remote-server/startAgentServer.d.ts +6 -4
  468. package/esm/src/remote-server/startRemoteServer.d.ts +1 -16
  469. package/esm/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
  470. package/esm/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
  471. package/esm/src/remote-server/ui/ServerApp.d.ts +1 -0
  472. package/esm/src/remote-server/ui/types.d.ts +3 -0
  473. package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -6
  474. package/esm/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
  475. package/esm/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -3
  476. package/esm/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
  477. package/esm/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
  478. package/esm/src/scrapers/_common/Scraper.d.ts +0 -5
  479. package/esm/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
  480. package/esm/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
  481. package/esm/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -4
  482. package/esm/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -4
  483. package/esm/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -4
  484. package/esm/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
  485. package/esm/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
  486. package/esm/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
  487. package/esm/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
  488. package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
  489. package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
  490. package/esm/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
  491. package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -6
  492. package/esm/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
  493. package/esm/src/scrapers/document/createDocumentScraper.d.ts +0 -3
  494. package/esm/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -3
  495. package/esm/src/scrapers/document/register-constructor.d.ts +0 -4
  496. package/esm/src/scrapers/document/register-metadata.d.ts +0 -3
  497. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
  498. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
  499. package/esm/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
  500. package/esm/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -3
  501. package/esm/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
  502. package/esm/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
  503. package/esm/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
  504. package/esm/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
  505. package/esm/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
  506. package/esm/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -3
  507. package/esm/src/scrapers/markdown/register-constructor.d.ts +0 -4
  508. package/esm/src/scrapers/markdown/register-metadata.d.ts +0 -3
  509. package/esm/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
  510. package/esm/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
  511. package/esm/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -3
  512. package/esm/src/scrapers/markitdown/register-constructor.d.ts +0 -5
  513. package/esm/src/scrapers/markitdown/register-metadata.d.ts +0 -3
  514. package/esm/src/scrapers/pdf/PdfScraper.d.ts +1 -6
  515. package/esm/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
  516. package/esm/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -3
  517. package/esm/src/scrapers/pdf/register-constructor.d.ts +0 -4
  518. package/esm/src/scrapers/pdf/register-metadata.d.ts +0 -3
  519. package/esm/src/scrapers/website/WebsiteScraper.d.ts +1 -6
  520. package/esm/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
  521. package/esm/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -3
  522. package/esm/src/scrapers/website/register-constructor.d.ts +0 -4
  523. package/esm/src/scrapers/website/register-metadata.d.ts +0 -3
  524. package/esm/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
  525. package/esm/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
  526. package/esm/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
  527. package/esm/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
  528. package/esm/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
  529. package/esm/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
  530. package/esm/src/search-engines/SearchEngine.d.ts +3 -0
  531. package/esm/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -4
  532. package/esm/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
  533. package/esm/src/storage/_common/PromptbookStorage.d.ts +0 -4
  534. package/esm/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
  535. package/esm/src/storage/env-storage/$EnvStorage.d.ts +0 -3
  536. package/esm/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -4
  537. package/esm/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -3
  538. package/esm/src/storage/local-storage/getLocalStorage.d.ts +0 -3
  539. package/esm/src/storage/local-storage/getSessionStorage.d.ts +0 -3
  540. package/esm/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
  541. package/esm/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
  542. package/esm/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
  543. package/esm/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
  544. package/esm/src/transpilers/openai-sdk/playground/playground.d.ts +0 -3
  545. package/esm/src/transpilers/openai-sdk/register.d.ts +2 -5
  546. package/esm/src/types/Arrayable.d.ts +1 -0
  547. package/esm/src/types/InputParameters_private.d.ts +13 -0
  548. package/esm/src/types/IntermediateFilesStrategy.d.ts +0 -3
  549. package/esm/src/types/LlmCall.d.ts +0 -3
  550. package/esm/src/types/ModelRequirements.d.ts +1 -0
  551. package/esm/src/types/ModelVariant.d.ts +3 -0
  552. package/esm/src/types/Parameters.d.ts +31 -0
  553. package/esm/src/types/Parameters_private.d.ts +18 -0
  554. package/esm/src/types/Prompt.d.ts +1 -6
  555. package/esm/src/types/ReservedParameters_private.d.ts +11 -0
  556. package/esm/src/types/ToolCall.d.ts +0 -2
  557. package/esm/src/types/Updatable.d.ts +1 -3
  558. package/esm/src/types/number_bytes.d.ts +21 -0
  559. package/esm/src/types/number_id.d.ts +13 -0
  560. package/esm/src/types/number_likeness.d.ts +8 -0
  561. package/esm/src/types/number_milliseconds.d.ts +33 -0
  562. package/esm/src/types/number_percent.d.ts +18 -0
  563. package/esm/src/types/number_positive.d.ts +16 -0
  564. package/esm/src/types/number_usd.d.ts +6 -106
  565. package/esm/src/types/string_agent_hash_private.d.ts +9 -0
  566. package/esm/src/types/string_agent_name.d.ts +32 -0
  567. package/esm/src/types/string_agent_name_in_book_private.d.ts +8 -0
  568. package/esm/src/types/string_agent_name_private.d.ts +10 -0
  569. package/esm/src/types/string_agent_permanent_id_private.d.ts +11 -0
  570. package/esm/src/types/string_base64_private.d.ts +17 -0
  571. package/esm/src/types/string_business_category_name.d.ts +5 -0
  572. package/esm/src/types/string_business_category_name_private.d.ts +6 -0
  573. package/esm/src/types/string_char_private.d.ts +8 -0
  574. package/esm/src/types/string_chat_prompt_private.d.ts +9 -0
  575. package/esm/src/types/string_completion_prompt_private.d.ts +9 -0
  576. package/esm/src/types/string_email_private.d.ts +16 -0
  577. package/esm/src/types/string_host_private.d.ts +55 -0
  578. package/esm/src/types/string_markdown.d.ts +0 -1
  579. package/esm/src/types/string_mime_type_private.d.ts +18 -0
  580. package/esm/src/types/string_model_description_private.d.ts +8 -0
  581. package/esm/src/types/string_model_name.d.ts +7 -0
  582. package/esm/src/types/string_model_name_private.d.ts +8 -0
  583. package/esm/src/types/string_name.d.ts +31 -0
  584. package/esm/src/types/string_name_private.d.ts +9 -0
  585. package/esm/src/types/string_page.d.ts +15 -0
  586. package/esm/src/types/string_page_private.d.ts +9 -0
  587. package/esm/src/types/string_parameter_name.d.ts +11 -167
  588. package/esm/src/types/string_parameter_value_private.d.ts +9 -0
  589. package/esm/src/types/string_persona_description.d.ts +14 -0
  590. package/esm/src/types/string_persona_description_private.d.ts +8 -0
  591. package/esm/src/types/string_prompt.d.ts +49 -0
  592. package/esm/src/types/string_prompt_image_private.d.ts +8 -0
  593. package/esm/src/types/string_prompt_private.d.ts +8 -0
  594. package/esm/src/types/string_reserved_parameter_name_private.d.ts +11 -0
  595. package/esm/src/types/string_sha256.d.ts +2 -2
  596. package/esm/src/types/string_system_message_private.d.ts +9 -0
  597. package/esm/src/types/string_template_private.d.ts +8 -0
  598. package/esm/src/types/string_text_prompt_private.d.ts +9 -0
  599. package/esm/src/types/string_title.d.ts +8 -0
  600. package/esm/src/types/string_title_private.d.ts +9 -0
  601. package/esm/src/types/string_url.d.ts +50 -46
  602. package/esm/src/types/string_url_private.d.ts +88 -0
  603. package/esm/src/types/typeAliasEmoji.d.ts +0 -3
  604. package/esm/src/types/typeAliases.d.ts +7 -7
  605. package/esm/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
  606. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
  607. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
  608. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
  609. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
  610. package/esm/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
  611. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
  612. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
  613. package/esm/src/utils/chat/chatAttachments.d.ts +0 -3
  614. package/esm/src/utils/chat/constants.d.ts +0 -3
  615. package/esm/src/utils/clientVersion.d.ts +0 -3
  616. package/esm/src/utils/color/$randomColor.d.ts +0 -5
  617. package/esm/src/utils/color/css-colors.d.ts +0 -3
  618. package/esm/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
  619. package/esm/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
  620. package/esm/src/utils/color/operators/ColorTransformer.d.ts +2 -0
  621. package/esm/src/utils/color/operators/lighten.d.ts +0 -3
  622. package/esm/src/utils/color/operators/saturate.d.ts +0 -3
  623. package/esm/src/utils/color/utils/areColorsEqual.d.ts +0 -3
  624. package/esm/src/utils/color/utils/colorDistance.d.ts +2 -2
  625. package/esm/src/utils/color/utils/colorHue.d.ts +0 -1
  626. package/esm/src/utils/color/utils/colorHueDistance.d.ts +0 -1
  627. package/esm/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
  628. package/esm/src/utils/database/uniqueConstraint.d.ts +1 -3
  629. package/esm/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
  630. package/esm/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
  631. package/esm/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
  632. package/esm/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
  633. package/esm/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
  634. package/esm/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
  635. package/esm/src/utils/environment/$getGlobalScope.d.ts +1 -1
  636. package/esm/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
  637. package/esm/src/utils/environment/$isRunningInJest.d.ts +0 -3
  638. package/esm/src/utils/environment/$isRunningInNode.d.ts +0 -3
  639. package/esm/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
  640. package/esm/src/utils/execCommand/$execCommand.d.ts +0 -4
  641. package/esm/src/utils/execCommand/$execCommands.d.ts +0 -3
  642. package/esm/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
  643. package/esm/src/utils/expectation-counters/constants.d.ts +0 -4
  644. package/esm/src/utils/expectation-counters/countCharacters.d.ts +0 -4
  645. package/esm/src/utils/expectation-counters/countLines.d.ts +0 -4
  646. package/esm/src/utils/expectation-counters/countPages.d.ts +0 -4
  647. package/esm/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
  648. package/esm/src/utils/expectation-counters/countSentences.d.ts +0 -4
  649. package/esm/src/utils/expectation-counters/countWords.d.ts +0 -5
  650. package/esm/src/utils/expectation-counters/index.d.ts +0 -4
  651. package/esm/src/utils/files/$induceBookDownload.d.ts +0 -3
  652. package/esm/src/utils/files/$induceFileDownload.d.ts +0 -3
  653. package/esm/src/utils/files/ObjectUrl.d.ts +0 -3
  654. package/esm/src/utils/files/isDirectoryExisting.d.ts +0 -6
  655. package/esm/src/utils/files/isExecutable.d.ts +0 -4
  656. package/esm/src/utils/files/isFileExisting.d.ts +0 -5
  657. package/esm/src/utils/files/listAllFiles.d.ts +1 -5
  658. package/esm/src/utils/files/readResponseBytes.d.ts +1 -0
  659. package/esm/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
  660. package/esm/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
  661. package/esm/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
  662. package/esm/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
  663. package/esm/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
  664. package/esm/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
  665. package/esm/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
  666. package/esm/src/utils/markdown/createMarkdownTable.d.ts +0 -3
  667. package/esm/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
  668. package/esm/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
  669. package/esm/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
  670. package/esm/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
  671. package/esm/src/utils/markdown/humanizeAiText.d.ts +0 -3
  672. package/esm/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
  673. package/esm/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
  674. package/esm/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
  675. package/esm/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
  676. package/esm/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
  677. package/esm/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
  678. package/esm/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
  679. package/esm/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
  680. package/esm/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
  681. package/esm/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
  682. package/esm/src/utils/markdown/trimCodeBlock.d.ts +1 -1
  683. package/esm/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
  684. package/esm/src/utils/misc/$getCurrentDate.d.ts +1 -0
  685. package/esm/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
  686. package/esm/src/utils/misc/computeHash.d.ts +0 -3
  687. package/esm/src/utils/misc/debounce.d.ts +2 -0
  688. package/esm/src/utils/misc/emojis.d.ts +3 -8
  689. package/esm/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
  690. package/esm/src/utils/misc/parseNumber.d.ts +0 -4
  691. package/esm/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
  692. package/esm/src/utils/normalization/IKeywords.d.ts +0 -3
  693. package/esm/src/utils/normalization/nameToUriPart.d.ts +1 -0
  694. package/esm/src/utils/normalization/nameToUriParts.d.ts +1 -0
  695. package/esm/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
  696. package/esm/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
  697. package/esm/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
  698. package/esm/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
  699. package/esm/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  700. package/esm/src/utils/normalization/orderJson.d.ts +1 -0
  701. package/esm/src/utils/normalization/orderJson.test.d.ts +0 -3
  702. package/esm/src/utils/normalization/parseKeywords.d.ts +1 -4
  703. package/esm/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
  704. package/esm/src/utils/normalization/removeDiacritics.d.ts +1 -3
  705. package/esm/src/utils/normalization/removeEmojis.d.ts +1 -0
  706. package/esm/src/utils/normalization/removeQuotes.d.ts +1 -0
  707. package/esm/src/utils/normalization/searchKeywords.d.ts +1 -3
  708. package/esm/src/utils/normalization/titleToName.d.ts +1 -0
  709. package/esm/src/utils/normalization/unwrapResult.d.ts +1 -3
  710. package/esm/src/utils/organization/$sideEffect.d.ts +1 -0
  711. package/esm/src/utils/organization/TODO_USE.d.ts +1 -0
  712. package/esm/src/utils/organization/just.d.ts +1 -0
  713. package/esm/src/utils/organization/keepImported.d.ts +1 -0
  714. package/esm/src/utils/organization/keepTypeImported.d.ts +1 -0
  715. package/esm/src/utils/organization/keepUnused.d.ts +1 -0
  716. package/esm/src/utils/organization/preserve.d.ts +1 -3
  717. package/esm/src/utils/organization/really_any.d.ts +1 -0
  718. package/esm/src/utils/organization/spaceTrim.d.ts +3 -2
  719. package/esm/src/utils/parameters/extractParameterNames.d.ts +1 -0
  720. package/esm/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
  721. package/esm/src/utils/parameters/templateParameters.d.ts +2 -1
  722. package/esm/src/utils/parameters/valueToString.d.ts +2 -2
  723. package/esm/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
  724. package/esm/src/utils/random/$randomAgentPersona.d.ts +1 -3
  725. package/esm/src/utils/random/$randomAgentRule.d.ts +1 -3
  726. package/esm/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
  727. package/esm/src/utils/random/$randomItem.d.ts +0 -3
  728. package/esm/src/utils/random/$randomSeed.d.ts +0 -3
  729. package/esm/src/utils/random/$randomToken.d.ts +2 -5
  730. package/esm/src/utils/random/EnglishNamePool.d.ts +1 -0
  731. package/esm/src/utils/serialization/$deepFreeze.d.ts +1 -3
  732. package/esm/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
  733. package/esm/src/utils/serialization/clonePipeline.d.ts +1 -3
  734. package/esm/src/utils/serialization/deepClone.d.ts +1 -3
  735. package/esm/src/utils/serialization/exportJson.d.ts +1 -3
  736. package/esm/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
  737. package/esm/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
  738. package/esm/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
  739. package/esm/src/utils/sets/difference.d.ts +1 -3
  740. package/esm/src/utils/sets/intersection.d.ts +1 -0
  741. package/esm/src/utils/sets/union.d.ts +1 -0
  742. package/esm/src/utils/take/classes/TakeChain.d.ts +4 -1
  743. package/esm/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
  744. package/esm/src/utils/take/interfaces/Takeable.d.ts +2 -1
  745. package/esm/src/utils/take/take.d.ts +1 -1
  746. package/esm/src/utils/validators/filePath/isRootPath.d.ts +1 -3
  747. package/esm/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
  748. package/esm/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
  749. package/esm/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
  750. package/esm/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
  751. package/esm/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  752. package/esm/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
  753. package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
  754. package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
  755. package/esm/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
  756. package/esm/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
  757. package/esm/src/version.d.ts +1 -1
  758. package/esm/src/wizard/$getCompiledBook.d.ts +0 -4
  759. package/esm/src/wizard/wizard.d.ts +1 -4
  760. package/package.json +2 -2
  761. package/umd/index.umd.js +776 -800
  762. package/umd/index.umd.js.map +1 -1
  763. package/umd/src/_packages/types.index.d.ts +94 -94
  764. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -4
  765. package/umd/src/book-2.0/agent-source/AgentModelRequirements.d.ts +0 -4
  766. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +7 -0
  767. package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +1 -0
  768. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +1 -0
  769. package/umd/src/book-2.0/agent-source/padBook.d.ts +1 -4
  770. package/umd/src/book-2.0/agent-source/parseAgentSource.d.ts +0 -3
  771. package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -0
  772. package/umd/src/book-2.0/agent-source/parseParameters.d.ts +1 -0
  773. package/umd/src/book-2.0/agent-source/parseTeamCommitment.d.ts +0 -3
  774. package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +8 -3
  775. package/umd/src/book-2.0/agent-source/string_book.d.ts +1 -0
  776. package/umd/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +0 -3
  777. package/umd/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +0 -3
  778. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +0 -3
  779. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +4 -0
  780. package/umd/src/book-components/BookEditor/BookEditor.d.ts +0 -3
  781. package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +4 -0
  782. package/umd/src/book-components/BookEditor/BookEditorMonaco.d.ts +2 -0
  783. package/umd/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +3 -0
  784. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +1 -0
  785. package/umd/src/book-components/BookEditor/useBookEditorMonacoDecorations.d.ts +6 -0
  786. package/umd/src/book-components/BookEditor/useBookEditorMonacoDiagnostics.d.ts +9 -0
  787. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +7 -0
  788. package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +3 -0
  789. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +24 -0
  790. package/umd/src/book-components/Chat/AgentChat/AgentChat.d.ts +0 -3
  791. package/umd/src/book-components/Chat/AgentChip/AgentChip.d.ts +6 -5
  792. package/umd/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +38 -0
  793. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -14
  794. package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
  795. package/umd/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
  796. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +2 -3
  797. package/umd/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
  798. package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
  799. package/umd/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +34 -0
  800. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
  801. package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
  802. package/umd/src/book-components/Chat/Chat/constants.d.ts +4 -3
  803. package/umd/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
  804. package/umd/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
  805. package/umd/src/book-components/Chat/Chat/insertDictationChunk.d.ts +16 -0
  806. package/umd/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
  807. package/umd/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
  808. package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
  809. package/umd/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +27 -0
  810. package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +32 -0
  811. package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +33 -0
  812. package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +32 -0
  813. package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +32 -0
  814. package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +39 -0
  815. package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +39 -0
  816. package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +47 -0
  817. package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +34 -0
  818. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +3 -2
  819. package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +30 -0
  820. package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +27 -0
  821. package/umd/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
  822. package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +10 -0
  823. package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
  824. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +53 -0
  825. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
  826. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -0
  827. package/umd/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
  828. package/umd/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
  829. package/umd/src/book-components/Chat/LlmChat/defaults.d.ts +0 -3
  830. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
  831. package/umd/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
  832. package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
  833. package/umd/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
  834. package/umd/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
  835. package/umd/src/book-components/Chat/effects/index.d.ts +0 -4
  836. package/umd/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
  837. package/umd/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
  838. package/umd/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
  839. package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
  840. package/umd/src/book-components/Chat/save/index.d.ts +0 -3
  841. package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
  842. package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
  843. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
  844. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
  845. package/umd/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
  846. package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
  847. package/umd/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
  848. package/umd/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
  849. package/umd/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
  850. package/umd/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
  851. package/umd/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
  852. package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
  853. package/umd/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
  854. package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
  855. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
  856. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
  857. package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
  858. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
  859. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
  860. package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
  861. package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
  862. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
  863. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
  864. package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
  865. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
  866. package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
  867. package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
  868. package/umd/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
  869. package/umd/src/book-components/Qr/GenericQrCode.d.ts +5 -0
  870. package/umd/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
  871. package/umd/src/book-components/Qr/useQrCode.d.ts +4 -1
  872. package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
  873. package/umd/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
  874. package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
  875. package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -3
  876. package/umd/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
  877. package/umd/src/book-components/icons/AboutIcon.d.ts +1 -0
  878. package/umd/src/book-components/icons/AttachmentIcon.d.ts +4 -0
  879. package/umd/src/book-components/icons/CameraIcon.d.ts +4 -0
  880. package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -0
  881. package/umd/src/book-components/icons/EmailIcon.d.ts +1 -0
  882. package/umd/src/book-components/icons/MenuIcon.d.ts +1 -3
  883. package/umd/src/book-components/icons/SaveIcon.d.ts +1 -0
  884. package/umd/src/book-components/icons/SendIcon.d.ts +0 -3
  885. package/umd/src/book-components/icons/TeacherIcon.d.ts +1 -0
  886. package/umd/src/cli/$runPromptbookCli.d.ts +0 -3
  887. package/umd/src/cli/cli-commands/_boilerplate.d.ts +0 -4
  888. package/umd/src/cli/cli-commands/about.d.ts +0 -6
  889. package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
  890. package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -4
  891. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -4
  892. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -4
  893. package/umd/src/cli/cli-commands/coder/init.d.ts +0 -4
  894. package/umd/src/cli/cli-commands/coder/run.d.ts +1 -5
  895. package/umd/src/cli/cli-commands/coder/run.test.d.ts +1 -0
  896. package/umd/src/cli/cli-commands/coder/verify.d.ts +0 -4
  897. package/umd/src/cli/cli-commands/coder.d.ts +0 -4
  898. package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
  899. package/umd/src/cli/cli-commands/hello.d.ts +0 -5
  900. package/umd/src/cli/cli-commands/list-models.d.ts +0 -4
  901. package/umd/src/cli/cli-commands/list-scrapers.d.ts +0 -4
  902. package/umd/src/cli/cli-commands/login.d.ts +0 -5
  903. package/umd/src/cli/cli-commands/make.d.ts +1 -1
  904. package/umd/src/cli/cli-commands/prettify.d.ts +0 -6
  905. package/umd/src/cli/cli-commands/run.d.ts +0 -8
  906. package/umd/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
  907. package/umd/src/cli/cli-commands/start-agents-server.d.ts +0 -4
  908. package/umd/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
  909. package/umd/src/cli/cli-commands/test-command.d.ts +0 -7
  910. package/umd/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
  911. package/umd/src/cli/main.d.ts +0 -4
  912. package/umd/src/cli/promptbookCli.d.ts +0 -7
  913. package/umd/src/collection/agent-collection/AgentCollection.d.ts +0 -3
  914. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
  915. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
  916. package/umd/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
  917. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
  918. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
  919. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
  920. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
  921. package/umd/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
  922. package/umd/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
  923. package/umd/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
  924. package/umd/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
  925. package/umd/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
  926. package/umd/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
  927. package/umd/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
  928. package/umd/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
  929. package/umd/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
  930. package/umd/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
  931. package/umd/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
  932. package/umd/src/commands/JOKER/JokerCommand.d.ts +1 -0
  933. package/umd/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
  934. package/umd/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
  935. package/umd/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
  936. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
  937. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
  938. package/umd/src/commands/MODEL/ModelCommand.d.ts +1 -0
  939. package/umd/src/commands/MODEL/modelCommandParser.d.ts +1 -0
  940. package/umd/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
  941. package/umd/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
  942. package/umd/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
  943. package/umd/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
  944. package/umd/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
  945. package/umd/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
  946. package/umd/src/commands/SECTION/SectionCommand.d.ts +1 -0
  947. package/umd/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
  948. package/umd/src/commands/URL/UrlCommand.d.ts +1 -0
  949. package/umd/src/commands/URL/urlCommandParser.d.ts +1 -0
  950. package/umd/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
  951. package/umd/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
  952. package/umd/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
  953. package/umd/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
  954. package/umd/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
  955. package/umd/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  956. package/umd/src/commands/_common/stringifyCommand.d.ts +1 -1
  957. package/umd/src/commands/_common/types/CommandParser.d.ts +0 -4
  958. package/umd/src/commands/index.d.ts +0 -3
  959. package/umd/src/commitments/ACTION/ACTION.d.ts +0 -3
  960. package/umd/src/commitments/CLOSED/CLOSED.d.ts +0 -3
  961. package/umd/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
  962. package/umd/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
  963. package/umd/src/commitments/DELETE/DELETE.d.ts +0 -3
  964. package/umd/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
  965. package/umd/src/commitments/FORMAT/FORMAT.d.ts +0 -3
  966. package/umd/src/commitments/FROM/FROM.d.ts +0 -3
  967. package/umd/src/commitments/GOAL/GOAL.d.ts +0 -3
  968. package/umd/src/commitments/IMPORT/IMPORT.d.ts +0 -3
  969. package/umd/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
  970. package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -3
  971. package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
  972. package/umd/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
  973. package/umd/src/commitments/META/META.d.ts +0 -3
  974. package/umd/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
  975. package/umd/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
  976. package/umd/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
  977. package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
  978. package/umd/src/commitments/META_FONT/META_FONT.d.ts +0 -3
  979. package/umd/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
  980. package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
  981. package/umd/src/commitments/META_LINK/META_LINK.d.ts +0 -3
  982. package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
  983. package/umd/src/commitments/MODEL/MODEL.d.ts +0 -3
  984. package/umd/src/commitments/OPEN/OPEN.d.ts +0 -3
  985. package/umd/src/commitments/PERSONA/PERSONA.d.ts +0 -3
  986. package/umd/src/commitments/RULE/RULE.d.ts +0 -3
  987. package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
  988. package/umd/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
  989. package/umd/src/commitments/TEAM/TEAM.d.ts +0 -3
  990. package/umd/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
  991. package/umd/src/commitments/USE/USE.d.ts +0 -3
  992. package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
  993. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
  994. package/umd/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -7
  995. package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
  996. package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
  997. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
  998. package/umd/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
  999. package/umd/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
  1000. package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
  1001. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
  1002. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
  1003. package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
  1004. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
  1005. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
  1006. package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
  1007. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
  1008. package/umd/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
  1009. package/umd/src/commitments/WALLET/WALLET.d.ts +0 -3
  1010. package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
  1011. package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
  1012. package/umd/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
  1013. package/umd/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
  1014. package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
  1015. package/umd/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
  1016. package/umd/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
  1017. package/umd/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
  1018. package/umd/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
  1019. package/umd/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
  1020. package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
  1021. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
  1022. package/umd/src/commitments/index.d.ts +0 -4
  1023. package/umd/src/config.test.d.ts +0 -3
  1024. package/umd/src/constants/streaming.d.ts +0 -3
  1025. package/umd/src/constants.d.ts +0 -3
  1026. package/umd/src/conversion/archive/loadArchive.d.ts +0 -3
  1027. package/umd/src/conversion/archive/saveArchive.d.ts +0 -5
  1028. package/umd/src/conversion/compilePipeline.d.ts +2 -7
  1029. package/umd/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
  1030. package/umd/src/conversion/parsePipeline.d.ts +1 -11
  1031. package/umd/src/conversion/pipelineJsonToString.d.ts +1 -7
  1032. package/umd/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
  1033. package/umd/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
  1034. package/umd/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
  1035. package/umd/src/conversion/validation/_importPipeline.d.ts +6 -4
  1036. package/umd/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
  1037. package/umd/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
  1038. package/umd/src/conversion/validation/validatePipeline.d.ts +3 -9
  1039. package/umd/src/conversion/validation/validatePipeline.test.d.ts +0 -3
  1040. package/umd/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -4
  1041. package/umd/src/errors/0-BoilerplateError.d.ts +0 -3
  1042. package/umd/src/errors/0-index.d.ts +0 -3
  1043. package/umd/src/errors/DatabaseError.d.ts +0 -3
  1044. package/umd/src/errors/ExpectError.d.ts +2 -1
  1045. package/umd/src/errors/ParseError.d.ts +0 -3
  1046. package/umd/src/errors/PipelineExecutionError.d.ts +0 -3
  1047. package/umd/src/executables/$provideExecutablesForNode.d.ts +0 -5
  1048. package/umd/src/executables/apps/locateLibreoffice.d.ts +0 -4
  1049. package/umd/src/executables/apps/locatePandoc.d.ts +0 -4
  1050. package/umd/src/executables/browsers/locateBrowser.d.ts +0 -1
  1051. package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
  1052. package/umd/src/executables/locateApp.d.ts +0 -4
  1053. package/umd/src/executables/platforms/locateAppOnLinux.d.ts +0 -4
  1054. package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +0 -4
  1055. package/umd/src/executables/platforms/locateAppOnWindows.d.ts +0 -4
  1056. package/umd/src/execution/AbstractTaskResult.d.ts +0 -4
  1057. package/umd/src/execution/AvailableModel.d.ts +0 -4
  1058. package/umd/src/execution/CommonToolsOptions.d.ts +0 -5
  1059. package/umd/src/execution/ExecutionTask.d.ts +4 -4
  1060. package/umd/src/execution/FilesystemTools.d.ts +0 -3
  1061. package/umd/src/execution/LlmExecutionTools.d.ts +3 -9
  1062. package/umd/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
  1063. package/umd/src/execution/PipelineExecutor.d.ts +0 -3
  1064. package/umd/src/execution/PipelineExecutorResult.d.ts +0 -3
  1065. package/umd/src/execution/PromptResult.d.ts +1 -9
  1066. package/umd/src/execution/PromptbookFetch.test-type.d.ts +0 -4
  1067. package/umd/src/execution/ScriptExecutionTools.d.ts +0 -4
  1068. package/umd/src/execution/Usage.d.ts +0 -3
  1069. package/umd/src/execution/UserInterfaceTools.d.ts +3 -0
  1070. package/umd/src/execution/assertsTaskSuccessful.d.ts +1 -3
  1071. package/umd/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
  1072. package/umd/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
  1073. package/umd/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
  1074. package/umd/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
  1075. package/umd/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
  1076. package/umd/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
  1077. package/umd/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
  1078. package/umd/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
  1079. package/umd/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
  1080. package/umd/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
  1081. package/umd/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
  1082. package/umd/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
  1083. package/umd/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
  1084. package/umd/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -5
  1085. package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -6
  1086. package/umd/src/execution/utils/checkExpectations.d.ts +2 -5
  1087. package/umd/src/execution/utils/forEachAsync.d.ts +5 -1
  1088. package/umd/src/execution/utils/usage-constants.d.ts +0 -3
  1089. package/umd/src/execution/utils/usageToHuman.d.ts +0 -8
  1090. package/umd/src/execution/utils/validatePromptResult.d.ts +1 -0
  1091. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
  1092. package/umd/src/formats/_common/FormatParser.d.ts +2 -9
  1093. package/umd/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
  1094. package/umd/src/formats/csv/CsvFormatParser.d.ts +2 -8
  1095. package/umd/src/formats/index.d.ts +0 -3
  1096. package/umd/src/formats/json/JsonFormatParser.d.ts +0 -11
  1097. package/umd/src/formats/text/TextFormatParser.d.ts +0 -9
  1098. package/umd/src/formats/xml/XmlFormatParser.d.ts +0 -11
  1099. package/umd/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
  1100. package/umd/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
  1101. package/umd/src/formfactors/index.d.ts +0 -3
  1102. package/umd/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
  1103. package/umd/src/high-level-abstractions/index.d.ts +0 -4
  1104. package/umd/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
  1105. package/umd/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
  1106. package/umd/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
  1107. package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -3
  1108. package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
  1109. package/umd/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
  1110. package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
  1111. package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -18
  1112. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
  1113. package/umd/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
  1114. package/umd/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
  1115. package/umd/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
  1116. package/umd/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
  1117. package/umd/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
  1118. package/umd/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
  1119. package/umd/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
  1120. package/umd/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
  1121. package/umd/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
  1122. package/umd/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
  1123. package/umd/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
  1124. package/umd/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
  1125. package/umd/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
  1126. package/umd/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
  1127. package/umd/src/llm-providers/_multiple/playground/playground.d.ts +0 -3
  1128. package/umd/src/llm-providers/agent/Agent.d.ts +0 -3
  1129. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
  1130. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
  1131. package/umd/src/llm-providers/agent/playground/playground.d.ts +0 -6
  1132. package/umd/src/llm-providers/agent/register-configuration.d.ts +0 -5
  1133. package/umd/src/llm-providers/agent/register-constructor.d.ts +0 -4
  1134. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
  1135. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
  1136. package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
  1137. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
  1138. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
  1139. package/umd/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
  1140. package/umd/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
  1141. package/umd/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
  1142. package/umd/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
  1143. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
  1144. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
  1145. package/umd/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
  1146. package/umd/src/llm-providers/azure-openai/playground/playground.d.ts +0 -4
  1147. package/umd/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
  1148. package/umd/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
  1149. package/umd/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
  1150. package/umd/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
  1151. package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
  1152. package/umd/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
  1153. package/umd/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
  1154. package/umd/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
  1155. package/umd/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
  1156. package/umd/src/llm-providers/google/google-models.d.ts +1 -6
  1157. package/umd/src/llm-providers/google/register-configuration.d.ts +0 -3
  1158. package/umd/src/llm-providers/google/register-constructor.d.ts +0 -4
  1159. package/umd/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
  1160. package/umd/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
  1161. package/umd/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
  1162. package/umd/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
  1163. package/umd/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
  1164. package/umd/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
  1165. package/umd/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
  1166. package/umd/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
  1167. package/umd/src/llm-providers/ollama/ollama-models.d.ts +1 -4
  1168. package/umd/src/llm-providers/ollama/playground/playground.d.ts +0 -4
  1169. package/umd/src/llm-providers/ollama/register-configuration.d.ts +0 -3
  1170. package/umd/src/llm-providers/ollama/register-constructor.d.ts +0 -4
  1171. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
  1172. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
  1173. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
  1174. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
  1175. package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
  1176. package/umd/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
  1177. package/umd/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
  1178. package/umd/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
  1179. package/umd/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
  1180. package/umd/src/llm-providers/openai/openai-models.d.ts +1 -0
  1181. package/umd/src/llm-providers/openai/openai-models.test.d.ts +0 -3
  1182. package/umd/src/llm-providers/openai/playground/playground.d.ts +0 -4
  1183. package/umd/src/llm-providers/openai/register-configuration.d.ts +0 -3
  1184. package/umd/src/llm-providers/openai/register-constructor.d.ts +0 -4
  1185. package/umd/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
  1186. package/umd/src/llm-providers/remote/playground/playground.d.ts +0 -3
  1187. package/umd/src/llm-providers/vercel/playground/playground.d.ts +0 -4
  1188. package/umd/src/other/templates/getBookTemplates.d.ts +2 -5
  1189. package/umd/src/personas/preparePersona.d.ts +1 -7
  1190. package/umd/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
  1191. package/umd/src/pipeline/PipelineInterface/constants.d.ts +0 -3
  1192. package/umd/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
  1193. package/umd/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
  1194. package/umd/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
  1195. package/umd/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
  1196. package/umd/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
  1197. package/umd/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
  1198. package/umd/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
  1199. package/umd/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
  1200. package/umd/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
  1201. package/umd/src/pipeline/book-notation.d.ts +1 -4
  1202. package/umd/src/pipeline/isValidPipelineString.d.ts +1 -3
  1203. package/umd/src/pipeline/isValidPipelineString.test.d.ts +0 -3
  1204. package/umd/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
  1205. package/umd/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
  1206. package/umd/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
  1207. package/umd/src/pipeline/prompt-notation.d.ts +2 -5
  1208. package/umd/src/pipeline/prompt-notation.test.d.ts +0 -3
  1209. package/umd/src/pipeline/validatePipelineString.d.ts +1 -3
  1210. package/umd/src/playground/permanent/_boilerplate.d.ts +0 -3
  1211. package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +0 -3
  1212. package/umd/src/playground/permanent/error-handling-playground.d.ts +0 -3
  1213. package/umd/src/playground/playground.d.ts +0 -4
  1214. package/umd/src/postprocessing/utils/extractBlock.d.ts +2 -1
  1215. package/umd/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
  1216. package/umd/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
  1217. package/umd/src/prepare/preparePipeline.d.ts +3 -2
  1218. package/umd/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
  1219. package/umd/src/prepare/prepareTasks.d.ts +6 -10
  1220. package/umd/src/prepare/unpreparePipeline.d.ts +1 -5
  1221. package/umd/src/remote-server/RemoteServer.d.ts +3 -0
  1222. package/umd/src/remote-server/openapi.d.ts +3 -4
  1223. package/umd/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
  1224. package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
  1225. package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
  1226. package/umd/src/remote-server/startAgentServer.d.ts +6 -4
  1227. package/umd/src/remote-server/startRemoteServer.d.ts +1 -16
  1228. package/umd/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
  1229. package/umd/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
  1230. package/umd/src/remote-server/ui/ServerApp.d.ts +1 -0
  1231. package/umd/src/remote-server/ui/types.d.ts +3 -0
  1232. package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -6
  1233. package/umd/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
  1234. package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -3
  1235. package/umd/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
  1236. package/umd/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
  1237. package/umd/src/scrapers/_common/Scraper.d.ts +0 -5
  1238. package/umd/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
  1239. package/umd/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
  1240. package/umd/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -4
  1241. package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -4
  1242. package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -4
  1243. package/umd/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
  1244. package/umd/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
  1245. package/umd/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
  1246. package/umd/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
  1247. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
  1248. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
  1249. package/umd/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
  1250. package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -6
  1251. package/umd/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
  1252. package/umd/src/scrapers/document/createDocumentScraper.d.ts +0 -3
  1253. package/umd/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -3
  1254. package/umd/src/scrapers/document/register-constructor.d.ts +0 -4
  1255. package/umd/src/scrapers/document/register-metadata.d.ts +0 -3
  1256. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
  1257. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
  1258. package/umd/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
  1259. package/umd/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -3
  1260. package/umd/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
  1261. package/umd/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
  1262. package/umd/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
  1263. package/umd/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
  1264. package/umd/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
  1265. package/umd/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -3
  1266. package/umd/src/scrapers/markdown/register-constructor.d.ts +0 -4
  1267. package/umd/src/scrapers/markdown/register-metadata.d.ts +0 -3
  1268. package/umd/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
  1269. package/umd/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
  1270. package/umd/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -3
  1271. package/umd/src/scrapers/markitdown/register-constructor.d.ts +0 -5
  1272. package/umd/src/scrapers/markitdown/register-metadata.d.ts +0 -3
  1273. package/umd/src/scrapers/pdf/PdfScraper.d.ts +1 -6
  1274. package/umd/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
  1275. package/umd/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -3
  1276. package/umd/src/scrapers/pdf/register-constructor.d.ts +0 -4
  1277. package/umd/src/scrapers/pdf/register-metadata.d.ts +0 -3
  1278. package/umd/src/scrapers/website/WebsiteScraper.d.ts +1 -6
  1279. package/umd/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
  1280. package/umd/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -3
  1281. package/umd/src/scrapers/website/register-constructor.d.ts +0 -4
  1282. package/umd/src/scrapers/website/register-metadata.d.ts +0 -3
  1283. package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
  1284. package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
  1285. package/umd/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
  1286. package/umd/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
  1287. package/umd/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
  1288. package/umd/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
  1289. package/umd/src/search-engines/SearchEngine.d.ts +3 -0
  1290. package/umd/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -4
  1291. package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
  1292. package/umd/src/storage/_common/PromptbookStorage.d.ts +0 -4
  1293. package/umd/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
  1294. package/umd/src/storage/env-storage/$EnvStorage.d.ts +0 -3
  1295. package/umd/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -4
  1296. package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -3
  1297. package/umd/src/storage/local-storage/getLocalStorage.d.ts +0 -3
  1298. package/umd/src/storage/local-storage/getSessionStorage.d.ts +0 -3
  1299. package/umd/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
  1300. package/umd/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
  1301. package/umd/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
  1302. package/umd/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
  1303. package/umd/src/transpilers/openai-sdk/playground/playground.d.ts +0 -3
  1304. package/umd/src/transpilers/openai-sdk/register.d.ts +2 -5
  1305. package/umd/src/types/Arrayable.d.ts +1 -0
  1306. package/umd/src/types/InputParameters_private.d.ts +13 -0
  1307. package/umd/src/types/IntermediateFilesStrategy.d.ts +0 -3
  1308. package/umd/src/types/LlmCall.d.ts +0 -3
  1309. package/umd/src/types/ModelRequirements.d.ts +1 -0
  1310. package/umd/src/types/ModelVariant.d.ts +3 -0
  1311. package/umd/src/types/Parameters.d.ts +31 -0
  1312. package/umd/src/types/Parameters_private.d.ts +18 -0
  1313. package/umd/src/types/Prompt.d.ts +1 -6
  1314. package/umd/src/types/ReservedParameters_private.d.ts +11 -0
  1315. package/umd/src/types/ToolCall.d.ts +0 -2
  1316. package/umd/src/types/Updatable.d.ts +1 -3
  1317. package/umd/src/types/number_bytes.d.ts +21 -0
  1318. package/umd/src/types/number_id.d.ts +13 -0
  1319. package/umd/src/types/number_likeness.d.ts +8 -0
  1320. package/umd/src/types/number_milliseconds.d.ts +33 -0
  1321. package/umd/src/types/number_percent.d.ts +18 -0
  1322. package/umd/src/types/number_positive.d.ts +16 -0
  1323. package/umd/src/types/number_usd.d.ts +6 -106
  1324. package/umd/src/types/string_agent_hash_private.d.ts +9 -0
  1325. package/umd/src/types/string_agent_name.d.ts +32 -0
  1326. package/umd/src/types/string_agent_name_in_book_private.d.ts +8 -0
  1327. package/umd/src/types/string_agent_name_private.d.ts +10 -0
  1328. package/umd/src/types/string_agent_permanent_id_private.d.ts +11 -0
  1329. package/umd/src/types/string_base64_private.d.ts +17 -0
  1330. package/umd/src/types/string_business_category_name.d.ts +5 -0
  1331. package/umd/src/types/string_business_category_name_private.d.ts +6 -0
  1332. package/umd/src/types/string_char_private.d.ts +8 -0
  1333. package/umd/src/types/string_chat_prompt_private.d.ts +9 -0
  1334. package/umd/src/types/string_completion_prompt_private.d.ts +9 -0
  1335. package/umd/src/types/string_email_private.d.ts +16 -0
  1336. package/umd/src/types/string_host_private.d.ts +55 -0
  1337. package/umd/src/types/string_markdown.d.ts +0 -1
  1338. package/umd/src/types/string_mime_type_private.d.ts +18 -0
  1339. package/umd/src/types/string_model_description_private.d.ts +8 -0
  1340. package/umd/src/types/string_model_name.d.ts +7 -0
  1341. package/umd/src/types/string_model_name_private.d.ts +8 -0
  1342. package/umd/src/types/string_name.d.ts +31 -0
  1343. package/umd/src/types/string_name_private.d.ts +9 -0
  1344. package/umd/src/types/string_page.d.ts +15 -0
  1345. package/umd/src/types/string_page_private.d.ts +9 -0
  1346. package/umd/src/types/string_parameter_name.d.ts +11 -167
  1347. package/umd/src/types/string_parameter_value_private.d.ts +9 -0
  1348. package/umd/src/types/string_persona_description.d.ts +14 -0
  1349. package/umd/src/types/string_persona_description_private.d.ts +8 -0
  1350. package/umd/src/types/string_prompt.d.ts +49 -0
  1351. package/umd/src/types/string_prompt_image_private.d.ts +8 -0
  1352. package/umd/src/types/string_prompt_private.d.ts +8 -0
  1353. package/umd/src/types/string_reserved_parameter_name_private.d.ts +11 -0
  1354. package/umd/src/types/string_sha256.d.ts +2 -2
  1355. package/umd/src/types/string_system_message_private.d.ts +9 -0
  1356. package/umd/src/types/string_template_private.d.ts +8 -0
  1357. package/umd/src/types/string_text_prompt_private.d.ts +9 -0
  1358. package/umd/src/types/string_title.d.ts +8 -0
  1359. package/umd/src/types/string_title_private.d.ts +9 -0
  1360. package/umd/src/types/string_url.d.ts +50 -46
  1361. package/umd/src/types/string_url_private.d.ts +88 -0
  1362. package/umd/src/types/typeAliasEmoji.d.ts +0 -3
  1363. package/umd/src/types/typeAliases.d.ts +7 -7
  1364. package/umd/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
  1365. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
  1366. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
  1367. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
  1368. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
  1369. package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
  1370. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
  1371. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
  1372. package/umd/src/utils/chat/chatAttachments.d.ts +0 -3
  1373. package/umd/src/utils/chat/constants.d.ts +0 -3
  1374. package/umd/src/utils/clientVersion.d.ts +0 -3
  1375. package/umd/src/utils/color/$randomColor.d.ts +0 -5
  1376. package/umd/src/utils/color/css-colors.d.ts +0 -3
  1377. package/umd/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
  1378. package/umd/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
  1379. package/umd/src/utils/color/operators/ColorTransformer.d.ts +2 -0
  1380. package/umd/src/utils/color/operators/lighten.d.ts +0 -3
  1381. package/umd/src/utils/color/operators/saturate.d.ts +0 -3
  1382. package/umd/src/utils/color/utils/areColorsEqual.d.ts +0 -3
  1383. package/umd/src/utils/color/utils/colorDistance.d.ts +2 -2
  1384. package/umd/src/utils/color/utils/colorHue.d.ts +0 -1
  1385. package/umd/src/utils/color/utils/colorHueDistance.d.ts +0 -1
  1386. package/umd/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
  1387. package/umd/src/utils/database/uniqueConstraint.d.ts +1 -3
  1388. package/umd/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
  1389. package/umd/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
  1390. package/umd/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
  1391. package/umd/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
  1392. package/umd/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
  1393. package/umd/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
  1394. package/umd/src/utils/environment/$getGlobalScope.d.ts +1 -1
  1395. package/umd/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
  1396. package/umd/src/utils/environment/$isRunningInJest.d.ts +0 -3
  1397. package/umd/src/utils/environment/$isRunningInNode.d.ts +0 -3
  1398. package/umd/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
  1399. package/umd/src/utils/execCommand/$execCommand.d.ts +0 -4
  1400. package/umd/src/utils/execCommand/$execCommands.d.ts +0 -3
  1401. package/umd/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
  1402. package/umd/src/utils/expectation-counters/constants.d.ts +0 -4
  1403. package/umd/src/utils/expectation-counters/countCharacters.d.ts +0 -4
  1404. package/umd/src/utils/expectation-counters/countLines.d.ts +0 -4
  1405. package/umd/src/utils/expectation-counters/countPages.d.ts +0 -4
  1406. package/umd/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
  1407. package/umd/src/utils/expectation-counters/countSentences.d.ts +0 -4
  1408. package/umd/src/utils/expectation-counters/countWords.d.ts +0 -5
  1409. package/umd/src/utils/expectation-counters/index.d.ts +0 -4
  1410. package/umd/src/utils/files/$induceBookDownload.d.ts +0 -3
  1411. package/umd/src/utils/files/$induceFileDownload.d.ts +0 -3
  1412. package/umd/src/utils/files/ObjectUrl.d.ts +0 -3
  1413. package/umd/src/utils/files/isDirectoryExisting.d.ts +0 -6
  1414. package/umd/src/utils/files/isExecutable.d.ts +0 -4
  1415. package/umd/src/utils/files/isFileExisting.d.ts +0 -5
  1416. package/umd/src/utils/files/listAllFiles.d.ts +1 -5
  1417. package/umd/src/utils/files/readResponseBytes.d.ts +1 -0
  1418. package/umd/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
  1419. package/umd/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
  1420. package/umd/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
  1421. package/umd/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
  1422. package/umd/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
  1423. package/umd/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
  1424. package/umd/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
  1425. package/umd/src/utils/markdown/createMarkdownTable.d.ts +0 -3
  1426. package/umd/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
  1427. package/umd/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
  1428. package/umd/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
  1429. package/umd/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
  1430. package/umd/src/utils/markdown/humanizeAiText.d.ts +0 -3
  1431. package/umd/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
  1432. package/umd/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
  1433. package/umd/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
  1434. package/umd/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
  1435. package/umd/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
  1436. package/umd/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
  1437. package/umd/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
  1438. package/umd/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
  1439. package/umd/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
  1440. package/umd/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
  1441. package/umd/src/utils/markdown/trimCodeBlock.d.ts +1 -1
  1442. package/umd/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
  1443. package/umd/src/utils/misc/$getCurrentDate.d.ts +1 -0
  1444. package/umd/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
  1445. package/umd/src/utils/misc/computeHash.d.ts +0 -3
  1446. package/umd/src/utils/misc/debounce.d.ts +2 -0
  1447. package/umd/src/utils/misc/emojis.d.ts +3 -8
  1448. package/umd/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
  1449. package/umd/src/utils/misc/parseNumber.d.ts +0 -4
  1450. package/umd/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
  1451. package/umd/src/utils/normalization/IKeywords.d.ts +0 -3
  1452. package/umd/src/utils/normalization/nameToUriPart.d.ts +1 -0
  1453. package/umd/src/utils/normalization/nameToUriParts.d.ts +1 -0
  1454. package/umd/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
  1455. package/umd/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
  1456. package/umd/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
  1457. package/umd/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
  1458. package/umd/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  1459. package/umd/src/utils/normalization/orderJson.d.ts +1 -0
  1460. package/umd/src/utils/normalization/orderJson.test.d.ts +0 -3
  1461. package/umd/src/utils/normalization/parseKeywords.d.ts +1 -4
  1462. package/umd/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
  1463. package/umd/src/utils/normalization/removeDiacritics.d.ts +1 -3
  1464. package/umd/src/utils/normalization/removeEmojis.d.ts +1 -0
  1465. package/umd/src/utils/normalization/removeQuotes.d.ts +1 -0
  1466. package/umd/src/utils/normalization/searchKeywords.d.ts +1 -3
  1467. package/umd/src/utils/normalization/titleToName.d.ts +1 -0
  1468. package/umd/src/utils/normalization/unwrapResult.d.ts +1 -3
  1469. package/umd/src/utils/organization/$sideEffect.d.ts +1 -0
  1470. package/umd/src/utils/organization/TODO_USE.d.ts +1 -0
  1471. package/umd/src/utils/organization/just.d.ts +1 -0
  1472. package/umd/src/utils/organization/keepImported.d.ts +1 -0
  1473. package/umd/src/utils/organization/keepTypeImported.d.ts +1 -0
  1474. package/umd/src/utils/organization/keepUnused.d.ts +1 -0
  1475. package/umd/src/utils/organization/preserve.d.ts +1 -3
  1476. package/umd/src/utils/organization/really_any.d.ts +1 -0
  1477. package/umd/src/utils/organization/spaceTrim.d.ts +3 -2
  1478. package/umd/src/utils/parameters/extractParameterNames.d.ts +1 -0
  1479. package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
  1480. package/umd/src/utils/parameters/templateParameters.d.ts +2 -1
  1481. package/umd/src/utils/parameters/valueToString.d.ts +2 -2
  1482. package/umd/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
  1483. package/umd/src/utils/random/$randomAgentPersona.d.ts +1 -3
  1484. package/umd/src/utils/random/$randomAgentRule.d.ts +1 -3
  1485. package/umd/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
  1486. package/umd/src/utils/random/$randomItem.d.ts +0 -3
  1487. package/umd/src/utils/random/$randomSeed.d.ts +0 -3
  1488. package/umd/src/utils/random/$randomToken.d.ts +2 -5
  1489. package/umd/src/utils/random/EnglishNamePool.d.ts +1 -0
  1490. package/umd/src/utils/serialization/$deepFreeze.d.ts +1 -3
  1491. package/umd/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
  1492. package/umd/src/utils/serialization/clonePipeline.d.ts +1 -3
  1493. package/umd/src/utils/serialization/deepClone.d.ts +1 -3
  1494. package/umd/src/utils/serialization/exportJson.d.ts +1 -3
  1495. package/umd/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
  1496. package/umd/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
  1497. package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
  1498. package/umd/src/utils/sets/difference.d.ts +1 -3
  1499. package/umd/src/utils/sets/intersection.d.ts +1 -0
  1500. package/umd/src/utils/sets/union.d.ts +1 -0
  1501. package/umd/src/utils/take/classes/TakeChain.d.ts +4 -1
  1502. package/umd/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
  1503. package/umd/src/utils/take/interfaces/Takeable.d.ts +2 -1
  1504. package/umd/src/utils/take/take.d.ts +1 -1
  1505. package/umd/src/utils/validators/filePath/isRootPath.d.ts +1 -3
  1506. package/umd/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
  1507. package/umd/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
  1508. package/umd/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
  1509. package/umd/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
  1510. package/umd/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  1511. package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
  1512. package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
  1513. package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
  1514. package/umd/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
  1515. package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
  1516. package/umd/src/version.d.ts +1 -1
  1517. package/umd/src/wizard/$getCompiledBook.d.ts +0 -4
  1518. package/umd/src/wizard/wizard.d.ts +1 -4
package/esm/index.es.js CHANGED
@@ -35,7 +35,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
35
35
  * @generated
36
36
  * @see https://github.com/webgptorg/promptbook
37
37
  */
38
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-32';
38
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
39
39
  /**
40
40
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
41
41
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -45,16 +45,20 @@ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-32';
45
45
  * Trims string from all 4 sides
46
46
  *
47
47
  * Note: This is a re-exported function from the `spacetrim` package which is
48
- * Developed by same author @hejny as this package
48
+ * Developed by same author @hejny as this package
49
49
  *
50
- * @public exported from `@promptbook/utils`
51
50
  * @see https://github.com/hejny/spacetrim#usage
51
+ *
52
+ * @public exported from `@promptbook/utils`
52
53
  */
53
54
  const spaceTrim = spaceTrim$1;
54
55
 
55
56
  /**
56
- * @private util of `@promptbook/color`
57
+ * Class implementing take chain.
58
+ *
57
59
  * @de
60
+ *
61
+ * @private util of `@promptbook/color`
58
62
  */
59
63
  class TakeChain {
60
64
  constructor(value) {
@@ -71,9 +75,9 @@ class TakeChain {
71
75
  *
72
76
  * @param {*} initialValue - The initial value.
73
77
  * @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
78
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
74
79
  *
75
80
  * @private util of `@promptbook/color`
76
- * @deprecated [🤡] Use some better functional library instead of `TakeChain`
77
81
  */
78
82
  function take(initialValue) {
79
83
  if (initialValue instanceof TakeChain) {
@@ -251,9 +255,7 @@ const CSS_COLORS = {
251
255
  yellow: '#ffff00',
252
256
  yellowgreen: '#9acd32',
253
257
  };
254
- /**
255
- * Note: [💞] Ignore a discrepancy between file name and entity name
256
- */
258
+ // Note: [💞] Ignore a discrepancy between file name and entity name
257
259
 
258
260
  /**
259
261
  * Validates that a channel value is a valid number within the range of 0 to 255.
@@ -283,7 +285,13 @@ function checkChannelValue(channelName, value) {
283
285
  }
284
286
  }
285
287
 
288
+ /**
289
+ * Constant for short hex lengths.
290
+ */
286
291
  const SHORT_HEX_LENGTHS = new Set([3, 4]);
292
+ /**
293
+ * Constant for long hex lengths.
294
+ */
287
295
  const LONG_HEX_LENGTHS = new Set([6, 8]);
288
296
  /**
289
297
  * Parses a hex string into RGBA channel values.
@@ -316,6 +324,9 @@ function parseHexColor(hex) {
316
324
  }
317
325
  return throwInvalidHex();
318
326
  }
327
+ /**
328
+ * Parses short hex channel.
329
+ */
319
330
  function parseShortHexChannel(char, onError) {
320
331
  if (!char) {
321
332
  return onError();
@@ -326,6 +337,9 @@ function parseShortHexChannel(char, onError) {
326
337
  }
327
338
  return parsed * 16;
328
339
  }
340
+ /**
341
+ * Parses long hex channel.
342
+ */
329
343
  function parseLongHexChannel(hex, start, onError) {
330
344
  const segment = hex.substr(start, 2);
331
345
  if (segment.length < 2) {
@@ -338,6 +352,9 @@ function parseLongHexChannel(hex, start, onError) {
338
352
  return parsed;
339
353
  }
340
354
 
355
+ /**
356
+ * Pattern matching hsl.
357
+ */
341
358
  const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
342
359
  /**
343
360
  * Parses an HSL string into RGBA channel values.
@@ -363,6 +380,9 @@ function parseHslColor(hsl) {
363
380
  alpha: 255,
364
381
  };
365
382
  }
383
+ /**
384
+ * Handles convert hsl to Rgb.
385
+ */
366
386
  function convertHslToRgb(h, s, l) {
367
387
  const c = (1 - Math.abs(2 * l - 1)) * s;
368
388
  const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
@@ -401,7 +421,13 @@ function convertHslToRgb(h, s, l) {
401
421
  };
402
422
  }
403
423
 
424
+ /**
425
+ * Pattern matching RGB.
426
+ */
404
427
  const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
428
+ /**
429
+ * Pattern matching rgba.
430
+ */
405
431
  const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
406
432
  /**
407
433
  * Parses an RGB string into RGBA channel values.
@@ -443,6 +469,9 @@ function parseRgbaColor(rgba) {
443
469
  alpha: parseAlphaValue(match[4]),
444
470
  };
445
471
  }
472
+ /**
473
+ * Parses channel value.
474
+ */
446
475
  function parseChannelValue(value) {
447
476
  if (value.endsWith('%')) {
448
477
  const percent = parseFloat(value);
@@ -450,6 +479,9 @@ function parseChannelValue(value) {
450
479
  }
451
480
  return Math.round(parseFloat(value));
452
481
  }
482
+ /**
483
+ * Parses alpha value.
484
+ */
453
485
  function parseAlphaValue(value) {
454
486
  if (value.endsWith('%')) {
455
487
  const percent = parseFloat(value);
@@ -462,8 +494,17 @@ function parseAlphaValue(value) {
462
494
  return Math.round(parsed);
463
495
  }
464
496
 
497
+ /**
498
+ * Pattern matching hsl regex.
499
+ */
465
500
  const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
501
+ /**
502
+ * Pattern matching RGB regex.
503
+ */
466
504
  const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
505
+ /**
506
+ * Pattern matching rgba regex.
507
+ */
467
508
  const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
468
509
  /**
469
510
  * Color object represents an RGB color with alpha channel
@@ -829,9 +870,7 @@ function hslToRgb(hue, saturation, lightness) {
829
870
  }
830
871
  return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
831
872
  }
832
- /**
833
- * TODO: Properly name all used internal variables
834
- */
873
+ // TODO: Properly name all used internal variables
835
874
 
836
875
  /**
837
876
  * Converts RGB values to HSL values
@@ -877,9 +916,7 @@ function rgbToHsl(red, green, blue) {
877
916
  }
878
917
  return [hue, saturation, lightness];
879
918
  }
880
- /**
881
- * TODO: Properly name all used internal variables
882
- */
919
+ // TODO: Properly name all used internal variables
883
920
 
884
921
  /**
885
922
  * Makes color transformer which lighten the given color
@@ -897,9 +934,7 @@ function lighten(amount) {
897
934
  return Color.fromValues(r, g, b, alpha);
898
935
  };
899
936
  }
900
- /**
901
- * TODO: Maybe implement by mix+hsl
902
- */
937
+ // TODO: Maybe implement by mix+hsl
903
938
 
904
939
  /**
905
940
  * Makes color transformer which saturate the given color
@@ -917,9 +952,7 @@ function saturate(amount) {
917
952
  return Color.fromValues(r, g, b, alpha);
918
953
  };
919
954
  }
920
- /**
921
- * TODO: Maybe implement by mix+hsl
922
- */
955
+ // TODO: Maybe implement by mix+hsl
923
956
 
924
957
  /**
925
958
  * Returns the same value that is passed as argument.
@@ -932,6 +965,7 @@ function saturate(amount) {
932
965
  *
933
966
  * @param value any values
934
967
  * @returns the same values
968
+ *
935
969
  * @private within the repository
936
970
  */
937
971
  function just(value) {
@@ -1313,6 +1347,7 @@ function jsonParse(value) {
1313
1347
  * Orders JSON object by keys
1314
1348
  *
1315
1349
  * @returns The same type of object as the input re-ordered
1350
+ *
1316
1351
  * @public exported from `@promptbook/utils`
1317
1352
  */
1318
1353
  function orderJson(options) {
@@ -1331,6 +1366,7 @@ function orderJson(options) {
1331
1366
  * Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
1332
1367
  *
1333
1368
  * @returns The same object as the input, but deeply frozen
1369
+ *
1334
1370
  * @public exported from `@promptbook/utils`
1335
1371
  */
1336
1372
  function $deepFreeze(objectValue) {
@@ -1347,9 +1383,7 @@ function $deepFreeze(objectValue) {
1347
1383
  Object.freeze(objectValue);
1348
1384
  return objectValue;
1349
1385
  }
1350
- /**
1351
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1352
- */
1386
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
1353
1387
 
1354
1388
  /**
1355
1389
  * This error type indicates that somewhere in the code non-Error object was thrown and it was wrapped into the `WrappedError`
@@ -1417,6 +1451,7 @@ function assertsError(whatWasThrown) {
1417
1451
  * - And much more...
1418
1452
  *
1419
1453
  * @throws UnexpectedError if the value is not serializable as JSON
1454
+ *
1420
1455
  * @public exported from `@promptbook/utils`
1421
1456
  */
1422
1457
  function checkSerializableAsJson(options) {
@@ -1531,11 +1566,9 @@ function checkSerializableAsJson(options) {
1531
1566
  `));
1532
1567
  }
1533
1568
  }
1534
- /**
1535
- * TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
1536
- * TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
1537
- * Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
1538
- */
1569
+ // TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
1570
+ // TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
1571
+ // Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
1539
1572
 
1540
1573
  /**
1541
1574
  * Creates a deep clone of the given object
@@ -1545,6 +1578,7 @@ function checkSerializableAsJson(options) {
1545
1578
  *
1546
1579
  * @param objectValue The object to clone.
1547
1580
  * @returns A deep, writable clone of the input object.
1581
+ *
1548
1582
  * @public exported from `@promptbook/utils`
1549
1583
  */
1550
1584
  function deepClone(objectValue) {
@@ -1561,9 +1595,7 @@ function deepClone(objectValue) {
1561
1595
  > return Object.assign({}, objectValue);
1562
1596
  */
1563
1597
  }
1564
- /**
1565
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1566
- */
1598
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
1567
1599
 
1568
1600
  /**
1569
1601
  * Utility to export a JSON object from a function
@@ -1576,6 +1608,7 @@ function deepClone(objectValue) {
1576
1608
  * Note: This function does not mutates the given object
1577
1609
  *
1578
1610
  * @returns The same type of object as the input but read-only and re-ordered
1611
+ *
1579
1612
  * @public exported from `@promptbook/utils`
1580
1613
  */
1581
1614
  function exportJson(options) {
@@ -1595,9 +1628,7 @@ function exportJson(options) {
1595
1628
  $deepFreeze(orderedValue);
1596
1629
  return orderedValue;
1597
1630
  }
1598
- /**
1599
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1600
- */
1631
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
1601
1632
 
1602
1633
  /**
1603
1634
  * Order of keys in the pipeline JSON
@@ -1708,9 +1739,7 @@ const LIMITS = {
1708
1739
  */
1709
1740
  SHORT_NAME_LENGTH: 6,
1710
1741
  };
1711
- /**
1712
- * Note: [💞] Ignore a discrepancy between file name and entity name
1713
- */
1742
+ // Note: [💞] Ignore a discrepancy between file name and entity name
1714
1743
 
1715
1744
  /**
1716
1745
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -1724,9 +1753,7 @@ class ParseError extends Error {
1724
1753
  Object.setPrototypeOf(this, ParseError.prototype);
1725
1754
  }
1726
1755
  }
1727
- /**
1728
- * TODO: Maybe split `ParseError` and `ApplyError`
1729
- */
1756
+ // TODO: Maybe split `ParseError` and `ApplyError`
1730
1757
 
1731
1758
  /**
1732
1759
  * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
@@ -1764,12 +1791,13 @@ function isValidSemanticVersion(version) {
1764
1791
  * Tests if given string is valid promptbook version
1765
1792
  * It looks into list of known promptbook versions.
1766
1793
  *
1767
- * @see https://www.npmjs.com/package/promptbook?activeTab=versions
1768
1794
  * Note: When you are using for example promptbook 2.0.0 and there already is promptbook 3.0.0 it don`t know about it.
1769
1795
  * Note: There are two similar functions:
1770
1796
  * - `isValidSemanticVersion` which tests any semantic version
1771
1797
  * - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
1772
1798
  *
1799
+ * @see https://www.npmjs.com/package/promptbook?activeTab=versions
1800
+ *
1773
1801
  * @public exported from `@promptbook/utils`
1774
1802
  */
1775
1803
  function isValidPromptbookVersion(version) {
@@ -1843,9 +1871,7 @@ function isValidPipelineUrl(url) {
1843
1871
  */
1844
1872
  return true;
1845
1873
  }
1846
- /**
1847
- * TODO: [🐠] Maybe more info why the URL is invalid
1848
- */
1874
+ // TODO: [🐠] Maybe more info why the URL is invalid
1849
1875
 
1850
1876
  /**
1851
1877
  * Validates PipelineJson if it is logically valid
@@ -1862,6 +1888,7 @@ function isValidPipelineUrl(url) {
1862
1888
  * @param pipeline valid or invalid PipelineJson
1863
1889
  * @returns the same pipeline if it is logically valid
1864
1890
  * @throws {PipelineLogicError} on logical error in the pipeline
1891
+ *
1865
1892
  * @public exported from `@promptbook/core`
1866
1893
  */
1867
1894
  function validatePipeline(pipeline) {
@@ -1886,6 +1913,8 @@ function validatePipeline(pipeline) {
1886
1913
  return pipeline;
1887
1914
  }
1888
1915
  /**
1916
+ * Validates pipeline inner function.
1917
+ *
1889
1918
  * @private internal function for `validatePipeline`
1890
1919
  */
1891
1920
  function validatePipeline_InnerFunction(pipeline) {
@@ -2130,15 +2159,13 @@ function validatePipeline_InnerFunction(pipeline) {
2130
2159
  * > * - ...
2131
2160
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
2132
2161
  */
2133
- /**
2134
- * TODO: [🧳][main] !!4 Validate that all examples match expectations
2135
- * TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2136
- * TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2137
- * TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2138
- * TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2139
- * TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2140
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2141
- */
2162
+ // TODO: [🧳][main] !!4 Validate that all examples match expectations
2163
+ // TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2164
+ // TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2165
+ // TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2166
+ // TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2167
+ // TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2168
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2142
2169
 
2143
2170
  /**
2144
2171
  * Loads the books from the archive file with `.bookc` extension
@@ -2165,9 +2192,7 @@ async function loadArchive(filePath, fs) {
2165
2192
  }
2166
2193
  return collectionJson;
2167
2194
  }
2168
- /**
2169
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2170
- */
2195
+ // 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
2171
2196
 
2172
2197
  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"}];
2173
2198
 
@@ -2190,6 +2215,7 @@ function isValidEmail(email) {
2190
2215
  * Tests if given string is valid file path.
2191
2216
  *
2192
2217
  * Note: This does not check if the file exists only if the path is valid
2218
+ *
2193
2219
  * @public exported from `@promptbook/utils`
2194
2220
  */
2195
2221
  function isValidFilePath(filename) {
@@ -2238,9 +2264,7 @@ function isValidFilePath(filename) {
2238
2264
  }
2239
2265
  return false;
2240
2266
  }
2241
- /**
2242
- * TODO: [🍏] Implement for MacOs
2243
- */
2267
+ // TODO: [🍏] Implement for MacOs
2244
2268
 
2245
2269
  /**
2246
2270
  * Function isValidJsonString will tell you if the string is valid JSON or not
@@ -2273,6 +2297,7 @@ function isValidJsonString(value /* <- [👨‍⚖️] */) {
2273
2297
  * @param {string} pipelineString the candidate for a pipeline string
2274
2298
  * @returns {PipelineString} the same string as input, but validated as valid
2275
2299
  * @throws {ParseError} if the string is not a valid pipeline string
2300
+ *
2276
2301
  * @public exported from `@promptbook/core`
2277
2302
  */
2278
2303
  function validatePipelineString(pipelineString) {
@@ -2291,17 +2316,16 @@ function validatePipelineString(pipelineString) {
2291
2316
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
2292
2317
  return pipelineString;
2293
2318
  }
2294
- /**
2295
- * TODO: [🧠][🈴] Where is the best location for this file
2296
- */
2319
+ // TODO: [🧠][🈴] Where is the best location for this file
2297
2320
 
2298
2321
  /**
2299
2322
  * Prettify the html code
2300
2323
  *
2301
2324
  * @param content raw html code
2302
2325
  * @returns formatted html code
2303
- * @private withing the package because of HUGE size of prettier dependency
2304
2326
  * @deprecated Prettier removed from Promptbook due to package size
2327
+ *
2328
+ * @private withing the package because of HUGE size of prettier dependency
2305
2329
  */
2306
2330
  function prettifyMarkdown(content) {
2307
2331
  return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
@@ -2324,6 +2348,7 @@ function capitalize(word) {
2324
2348
  * @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
2325
2349
  * @param pipelineJson Promptbook in JSON format (.bookc)
2326
2350
  * @returns Promptbook in string format (.book.md)
2351
+ *
2327
2352
  * @public exported from `@promptbook/core`
2328
2353
  */
2329
2354
  function pipelineJsonToString(pipelineJson) {
@@ -2440,6 +2465,8 @@ function pipelineJsonToString(pipelineJson) {
2440
2465
  return validatePipelineString(pipelineString);
2441
2466
  }
2442
2467
  /**
2468
+ * Handles task parameter Json to string.
2469
+ *
2443
2470
  * @private internal utility of `pipelineJsonToString`
2444
2471
  */
2445
2472
  function taskParameterJsonToString(taskParameterJson) {
@@ -2450,13 +2477,11 @@ function taskParameterJsonToString(taskParameterJson) {
2450
2477
  }
2451
2478
  return parameterString;
2452
2479
  }
2453
- /**
2454
- * TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
2455
- * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
2456
- * TODO: [🏛] Maybe make some markdown builder
2457
- * TODO: [🏛] Escape all
2458
- * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
2459
- */
2480
+ // TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
2481
+ // TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
2482
+ // TODO: [🏛] Maybe make some markdown builder
2483
+ // TODO: [🏛] Escape all
2484
+ // TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
2460
2485
 
2461
2486
  /**
2462
2487
  * This error indicates that promptbook not found in the collection
@@ -2489,6 +2514,7 @@ class PipelineUrlError extends Error {
2489
2514
  *
2490
2515
  * @param template the string template with parameters in {curly} braces
2491
2516
  * @returns the list of parameter names
2517
+ *
2492
2518
  * @public exported from `@promptbook/utils`
2493
2519
  */
2494
2520
  function extractParameterNames(template) {
@@ -2505,6 +2531,7 @@ function extractParameterNames(template) {
2505
2531
  * Unprepare just strips the preparation data of the pipeline
2506
2532
  *
2507
2533
  * @deprecated In future version this function will be removed or deprecated
2534
+ *
2508
2535
  * @public exported from `@promptbook/core`
2509
2536
  */
2510
2537
  function unpreparePipeline(pipeline) {
@@ -2533,18 +2560,17 @@ function unpreparePipeline(pipeline) {
2533
2560
  },
2534
2561
  });
2535
2562
  }
2536
- /**
2537
- * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
2538
- * TODO: Write tests for `preparePipeline`
2539
- * TODO: [🍙] Make some standard order of json properties
2540
- */
2563
+ // TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
2564
+ // TODO: Write tests for `preparePipeline`
2565
+ // TODO: [🍙] Make some standard order of json properties
2541
2566
 
2542
2567
  /**
2543
2568
  * Library of pipelines that groups together pipelines for an application.
2544
2569
  * This implementation is a very thin wrapper around the Array / Map of pipelines.
2545
2570
  *
2546
- * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
2547
2571
  * @see https://github.com/webgptorg/pipeline#pipeline-collection
2572
+ *
2573
+ * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
2548
2574
  */
2549
2575
  class SimplePipelineCollection {
2550
2576
  /**
@@ -2648,6 +2674,7 @@ class SimplePipelineCollection {
2648
2674
  *
2649
2675
  * @param promptbookSources
2650
2676
  * @returns PipelineCollection
2677
+ *
2651
2678
  * @public exported from `@promptbook/core`
2652
2679
  */
2653
2680
  function createPipelineCollectionFromJson(...promptbooks) {
@@ -2793,9 +2820,7 @@ class DatabaseError extends Error {
2793
2820
  Object.setPrototypeOf(this, DatabaseError.prototype);
2794
2821
  }
2795
2822
  }
2796
- /**
2797
- * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
2798
- */
2823
+ // TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
2799
2824
 
2800
2825
  /**
2801
2826
  * This error type indicates that you try to use a feature that is not available in the current environment
@@ -2813,10 +2838,11 @@ class EnvironmentMismatchError extends Error {
2813
2838
  /**
2814
2839
  * This error occurs when some expectation is not met in the execution of the pipeline
2815
2840
  *
2816
- * @public exported from `@promptbook/core`
2817
2841
  * Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
2818
2842
  * Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
2819
2843
  * Note: This is a kindof subtype of PipelineExecutionError
2844
+ *
2845
+ * @public exported from `@promptbook/core`
2820
2846
  */
2821
2847
  class ExpectError extends Error {
2822
2848
  constructor(message) {
@@ -2894,16 +2920,15 @@ class NotYetImplementedError extends Error {
2894
2920
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
2895
2921
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
2896
2922
  *
2897
- * @private internal helper function
2898
2923
  * @returns secure random token
2924
+ *
2925
+ * @private internal helper function
2899
2926
  */
2900
2927
  function $randomToken(randomness) {
2901
2928
  return randomBytes(randomness).toString('hex');
2902
2929
  }
2903
- /**
2904
- * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
2905
- * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
2906
- */
2930
+ // TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
2931
+ // TODO: Maybe use nanoid instead https://github.com/ai/nanoid
2907
2932
 
2908
2933
  /**
2909
2934
  * This error indicates errors during the execution of the pipeline
@@ -2920,9 +2945,7 @@ class PipelineExecutionError extends Error {
2920
2945
  Object.setPrototypeOf(this, PipelineExecutionError.prototype);
2921
2946
  }
2922
2947
  }
2923
- /**
2924
- * TODO: [🧠][🌂] Add id to all errors
2925
- */
2948
+ // TODO: [🧠][🌂] Add id to all errors
2926
2949
 
2927
2950
  /**
2928
2951
  * Error thrown when a fetch request fails
@@ -2998,9 +3021,7 @@ const ALL_ERRORS = {
2998
3021
  ...PROMPTBOOK_ERRORS,
2999
3022
  ...COMMON_JAVASCRIPT_ERRORS,
3000
3023
  };
3001
- /**
3002
- * Note: [💞] Ignore a discrepancy between file name and entity name
3003
- */
3024
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3004
3025
 
3005
3026
  /**
3006
3027
  * Serializes an error into a [🚉] JSON-serializable object
@@ -3033,7 +3054,7 @@ function serializeError(error) {
3033
3054
 
3034
3055
  /**
3035
3056
  * Recursively converts JSON strings to JSON objects
3036
-
3057
+ *
3037
3058
  * @public exported from `@promptbook/utils`
3038
3059
  */
3039
3060
  function jsonStringsToJsons(object) {
@@ -3057,9 +3078,7 @@ function jsonStringsToJsons(object) {
3057
3078
  }
3058
3079
  return newObject;
3059
3080
  }
3060
- /**
3061
- * TODO: Type the return type correctly
3062
- */
3081
+ // TODO: Type the return type correctly
3063
3082
 
3064
3083
  /**
3065
3084
  * Deserializes the error object
@@ -3094,6 +3113,7 @@ function deserializeError(error, isStackAddedToMessage = true) {
3094
3113
  *
3095
3114
  * @param executionResult - The partial result of the Promptbook execution
3096
3115
  * @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
3116
+ *
3097
3117
  * @private internal helper function of `asPromise` method of `ExecutionTask`
3098
3118
  */
3099
3119
  function assertsTaskSuccessful(executionResult) {
@@ -3124,9 +3144,7 @@ function assertsTaskSuccessful(executionResult) {
3124
3144
  `));
3125
3145
  }
3126
3146
  }
3127
- /**
3128
- * TODO: [🧠] Can this return type be better typed than void
3129
- */
3147
+ // TODO: [🧠] Can this return type be better typed than void
3130
3148
 
3131
3149
  /**
3132
3150
  * Helper to create a new task
@@ -3317,10 +3335,8 @@ function createTask(options) {
3317
3335
  },
3318
3336
  };
3319
3337
  }
3320
- /**
3321
- * TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3322
- * TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3323
- */
3338
+ // TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3339
+ // TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3324
3340
 
3325
3341
  /**
3326
3342
  * Represents the uncertain value
@@ -3388,9 +3404,7 @@ const UNCERTAIN_USAGE = $deepFreeze({
3388
3404
  pagesCount: UNCERTAIN_ZERO_VALUE,
3389
3405
  },
3390
3406
  });
3391
- /**
3392
- * Note: [💞] Ignore a discrepancy between file name and entity name
3393
- */
3407
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3394
3408
 
3395
3409
  /**
3396
3410
  * Format either small or big number
@@ -3425,8 +3439,8 @@ function numberToString(value) {
3425
3439
  * This is useful and used in the `templateParameters` function
3426
3440
  *
3427
3441
  * Note: This function is not just calling `toString` method
3428
- * It's more complex and can handle this conversion specifically for LLM models
3429
- * See `VALUE_STRINGS`
3442
+ * It's more complex and can handle this conversion specifically for LLM models
3443
+ * See `VALUE_STRINGS`
3430
3444
  *
3431
3445
  * Note: There are 2 similar functions
3432
3446
  * - `valueToString` converts value to string for LLM models as human-readable string
@@ -3533,6 +3547,7 @@ function addUsage(...usageItems) {
3533
3547
  * @param script from which to extract the variables
3534
3548
  * @returns the list of variable names
3535
3549
  * @throws {ParseError} if the script is invalid
3550
+ *
3536
3551
  * @public exported from `@promptbook/javascript`
3537
3552
  */
3538
3553
  function extractVariablesFromJavascript(script) {
@@ -3598,9 +3613,7 @@ function extractVariablesFromJavascript(script) {
3598
3613
  }
3599
3614
  return variables;
3600
3615
  }
3601
- /**
3602
- * TODO: [🔣] Support for multiple languages - python, java,...
3603
- */
3616
+ // TODO: [🔣] Support for multiple languages - python, java,...
3604
3617
 
3605
3618
  /**
3606
3619
  * Parses the task and returns the set of all used parameters
@@ -3608,6 +3621,7 @@ function extractVariablesFromJavascript(script) {
3608
3621
  * @param task the task with used parameters
3609
3622
  * @returns the set of parameter names
3610
3623
  * @throws {ParseError} if the script is invalid
3624
+ *
3611
3625
  * @public exported from `@promptbook/core` <- Note: [👖] This utility is so tightly interconnected with the Promptbook that it is not exported as util but in core
3612
3626
  */
3613
3627
  function extractParameterNamesFromTask(task) {
@@ -3648,14 +3662,13 @@ function extractParameterNamesFromTask(task) {
3648
3662
  }
3649
3663
  return parameterNames;
3650
3664
  }
3651
- /**
3652
- * TODO: [🔣] If script require contentLanguage
3653
- */
3665
+ // TODO: [🔣] If script require contentLanguage
3654
3666
 
3655
3667
  /**
3656
3668
  * Create difference set of two sets.
3657
3669
  *
3658
3670
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
3671
+ *
3659
3672
  * @public exported from `@promptbook/utils`
3660
3673
  */
3661
3674
  function difference(a, b, isEqual = (a, b) => a === b) {
@@ -3667,14 +3680,13 @@ function difference(a, b, isEqual = (a, b) => a === b) {
3667
3680
  }
3668
3681
  return diff;
3669
3682
  }
3670
- /**
3671
- * TODO: [🧠][💯] Maybe also implement symmetricDifference
3672
- */
3683
+ // TODO: [🧠][💯] Maybe also implement symmetricDifference
3673
3684
 
3674
3685
  /**
3675
3686
  * Creates a new set with all elements that are present in either set
3676
3687
  *
3677
3688
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
3689
+ *
3678
3690
  * @public exported from `@promptbook/utils`
3679
3691
  */
3680
3692
  function union(...sets) {
@@ -3740,8 +3752,9 @@ function isValidCsvString(value) {
3740
3752
  /**
3741
3753
  * Definition for CSV spreadsheet
3742
3754
  *
3755
+ * TODO: [🏢] Export from package `@promptbook/csv`
3756
+ *
3743
3757
  * @public exported from `@promptbook/core`
3744
- * <- TODO: [🏢] Export from package `@promptbook/csv`
3745
3758
  */
3746
3759
  const CsvFormatParser = {
3747
3760
  formatName: 'CSV',
@@ -3831,13 +3844,11 @@ const CsvFormatParser = {
3831
3844
  },
3832
3845
  ],
3833
3846
  };
3834
- /**
3835
- * TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
3836
- * TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
3837
- * TODO: [🍓] In `CsvFormatParser` implement `heal
3838
- * TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
3839
- * TODO: [🏢] Allow to expect something inside CSV objects and other formats
3840
- */
3847
+ // TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
3848
+ // TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
3849
+ // TODO: [🍓] In `CsvFormatParser` implement `heal
3850
+ // TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
3851
+ // TODO: [🏢] Allow to expect something inside CSV objects and other formats
3841
3852
 
3842
3853
  /**
3843
3854
  * Definition for JSON format
@@ -3858,17 +3869,15 @@ const JsonFormatParser = {
3858
3869
  },
3859
3870
  subvalueParsers: [],
3860
3871
  };
3861
- /**
3862
- * TODO: [🧠] Maybe proper instance of object
3863
- * TODO: [0] Make string_serialized_json
3864
- * TODO: [1] Make type for JSON Settings and Schema
3865
- * TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
3866
- * TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
3867
- * TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
3868
- * TODO: [🍓] In `JsonFormatParser` implement `heal
3869
- * TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
3870
- * TODO: [🏢] Allow to expect something inside JSON objects and other formats
3871
- */
3872
+ // TODO: [🧠] Maybe proper instance of object
3873
+ // TODO: [0] Make string_serialized_json
3874
+ // TODO: [1] Make type for JSON Settings and Schema
3875
+ // TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
3876
+ // TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
3877
+ // TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
3878
+ // TODO: [🍓] In `JsonFormatParser` implement `heal
3879
+ // TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
3880
+ // TODO: [🏢] Allow to expect something inside JSON objects and other formats
3872
3881
 
3873
3882
  /**
3874
3883
  * Definition for any text - this will be always valid
@@ -3906,15 +3915,13 @@ const TextFormatParser = {
3906
3915
  // <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
3907
3916
  ],
3908
3917
  };
3909
- /**
3910
- * TODO: [1] Make type for XML Text and Schema
3911
- * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
3912
- * TODO: [🍓] In `TextFormatParser` implement simple `isValid`
3913
- * TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
3914
- * TODO: [🍓] In `TextFormatParser` implement `heal
3915
- * TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
3916
- * TODO: [🏢] Allow to expect something inside each item of list and other formats
3917
- */
3918
+ // TODO: [1] Make type for XML Text and Schema
3919
+ // TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
3920
+ // TODO: [🍓] In `TextFormatParser` implement simple `isValid`
3921
+ // TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
3922
+ // TODO: [🍓] In `TextFormatParser` implement `heal
3923
+ // TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
3924
+ // TODO: [🏢] Allow to expect something inside each item of list and other formats
3918
3925
 
3919
3926
  /**
3920
3927
  * Function to check if a string is valid XML
@@ -3959,17 +3966,15 @@ const XmlFormatParser = {
3959
3966
  },
3960
3967
  subvalueParsers: [],
3961
3968
  };
3962
- /**
3963
- * TODO: [🧠] Maybe proper instance of object
3964
- * TODO: [0] Make string_serialized_xml
3965
- * TODO: [1] Make type for XML Settings and Schema
3966
- * TODO: [🧠] What to use for validating XMLs - XSD,...
3967
- * TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
3968
- * TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
3969
- * TODO: [🍓] In `XmlFormatParser` implement `heal
3970
- * TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
3971
- * TODO: [🏢] Allow to expect something inside XML and other formats
3972
- */
3969
+ // TODO: [🧠] Maybe proper instance of object
3970
+ // TODO: [0] Make string_serialized_xml
3971
+ // TODO: [1] Make type for XML Settings and Schema
3972
+ // TODO: [🧠] What to use for validating XMLs - XSD,...
3973
+ // TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
3974
+ // TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
3975
+ // TODO: [🍓] In `XmlFormatParser` implement `heal
3976
+ // TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
3977
+ // TODO: [🏢] Allow to expect something inside XML and other formats
3973
3978
 
3974
3979
  /**
3975
3980
  * Definitions for all formats supported by Promptbook
@@ -3977,9 +3982,7 @@ const XmlFormatParser = {
3977
3982
  * @private internal index of `...` <- TODO [🏢]
3978
3983
  */
3979
3984
  const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
3980
- /**
3981
- * Note: [💞] Ignore a discrepancy between file name and entity name
3982
- */
3985
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3983
3986
 
3984
3987
  /**
3985
3988
  * Maps available parameters to expected parameters for a pipeline task.
@@ -3989,6 +3992,7 @@ const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser,
3989
3992
  * 2) Then, if there are unmatched expected and available parameters, map them by order.
3990
3993
  *
3991
3994
  * @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
3995
+ *
3992
3996
  * @private within the repository used in `createPipelineExecutor`
3993
3997
  */
3994
3998
  function mapAvailableToExpectedParameters(options) {
@@ -4078,6 +4082,7 @@ const MULTIPLE_PROVIDER_PROFILE = {
4078
4082
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
4079
4083
  *
4080
4084
  * Note: Internal utility of `joinLlmExecutionTools` but exposed type
4085
+ *
4081
4086
  * @public exported from `@promptbook/core`
4082
4087
  */
4083
4088
  class MultipleLlmExecutionTools {
@@ -4240,16 +4245,16 @@ class MultipleLlmExecutionTools {
4240
4245
  * `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
4241
4246
  *
4242
4247
  * 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
4243
- * If the first provider doesn't support the requested model or fails, it tries the next one.
4248
+ * If the first provider doesn't support the requested model or fails, it tries the next one.
4244
4249
  * 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
4245
4250
  * 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
4246
4251
  *
4252
+ * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4253
+ *
4247
4254
  * @param title - A descriptive title for this collection of joined tools
4248
4255
  * @param llmExecutionTools - An array of execution tools to be joined
4249
4256
  * @returns A single unified execution tool wrapper
4250
4257
  *
4251
- * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4252
- *
4253
4258
  * @public exported from `@promptbook/core`
4254
4259
  */
4255
4260
  function joinLlmExecutionTools(title, ...llmExecutionTools) {
@@ -4286,10 +4291,8 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
4286
4291
  }
4287
4292
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4288
4293
  }
4289
- /**
4290
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4291
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4292
- */
4294
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4295
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4293
4296
 
4294
4297
  /**
4295
4298
  * Just returns the given `LlmExecutionTools` or joins multiple into one
@@ -4303,10 +4306,8 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
4303
4306
  : joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
4304
4307
  return llmTools;
4305
4308
  }
4306
- /**
4307
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4308
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4309
- */
4309
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4310
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4310
4311
 
4311
4312
  /**
4312
4313
  * Just says that the variable is not used but should be kept
@@ -4320,6 +4321,7 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
4320
4321
  *
4321
4322
  * @param value any values
4322
4323
  * @returns void
4324
+ *
4323
4325
  * @private within the repository
4324
4326
  */
4325
4327
  function keepUnused(...valuesToKeep) {
@@ -4329,12 +4331,13 @@ function keepUnused(...valuesToKeep) {
4329
4331
  * Replaces parameters in template with values from parameters object
4330
4332
  *
4331
4333
  * Note: This function is not places strings into string,
4332
- * It's more complex and can handle this operation specifically for LLM models
4334
+ * It's more complex and can handle this operation specifically for LLM models
4333
4335
  *
4334
4336
  * @param template the template with parameters in {curly} braces
4335
4337
  * @param parameters the object with parameters
4336
4338
  * @returns the template with replaced parameters
4337
4339
  * @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
4340
+ *
4338
4341
  * @public exported from `@promptbook/utils`
4339
4342
  */
4340
4343
  function templateParameters(template, parameters) {
@@ -4408,6 +4411,7 @@ function templateParameters(template, parameters) {
4408
4411
  * @param markdown any valid markdown
4409
4412
  * @returns code blocks with language and content
4410
4413
  * @throws {ParseError} if block is not closed properly
4414
+ *
4411
4415
  * @public exported from `@promptbook/markdown-utils`
4412
4416
  */
4413
4417
  function extractAllBlocksFromMarkdown(markdown) {
@@ -4458,9 +4462,7 @@ function extractAllBlocksFromMarkdown(markdown) {
4458
4462
  }
4459
4463
  return codeBlocks;
4460
4464
  }
4461
- /**
4462
- * TODO: Maybe name for `blockNotation` instead of '```' and '>'
4463
- */
4465
+ // TODO: Maybe name for `blockNotation` instead of '```' and '>'
4464
4466
 
4465
4467
  /**
4466
4468
  * Extracts extracts exactly one valid JSON code block
@@ -4476,8 +4478,9 @@ function extractAllBlocksFromMarkdown(markdown) {
4476
4478
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
4477
4479
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
4478
4480
  *
4479
- * @public exported from `@promptbook/markdown-utils`
4480
4481
  * @throws {ParseError} if there is no valid JSON block in the markdown
4482
+ *
4483
+ * @public exported from `@promptbook/markdown-utils`
4481
4484
  */
4482
4485
  function extractJsonBlock(markdown) {
4483
4486
  if (isValidJsonString(markdown)) {
@@ -4493,10 +4496,8 @@ function extractJsonBlock(markdown) {
4493
4496
  }
4494
4497
  return jsonBlocks[0].content;
4495
4498
  }
4496
- /**
4497
- * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
4498
- * TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
4499
- */
4499
+ // TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
4500
+ // TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
4500
4501
 
4501
4502
  /**
4502
4503
  * Counts number of characters in the text
@@ -4512,10 +4513,8 @@ function countCharacters(text) {
4512
4513
  text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
4513
4514
  return text.length;
4514
4515
  }
4515
- /**
4516
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4517
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4518
- */
4516
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4517
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4519
4518
 
4520
4519
  /**
4521
4520
  * Number of characters per standard line with 11pt Arial font size.
@@ -4529,10 +4528,8 @@ const CHARACTERS_PER_STANDARD_LINE = 63;
4529
4528
  * @public exported from `@promptbook/utils`
4530
4529
  */
4531
4530
  const LINES_PER_STANDARD_PAGE = 44;
4532
- /**
4533
- * TODO: [🧠] Should be this `constants.ts` or `config.ts`?
4534
- * Note: [💞] Ignore a discrepancy between file name and entity name
4535
- */
4531
+ // TODO: [🧠] Should be this `constants.ts` or `config.ts`?
4532
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4536
4533
 
4537
4534
  /**
4538
4535
  * Counts number of lines in the text
@@ -4550,10 +4547,8 @@ function countLines(text) {
4550
4547
  const lines = text.split(/\r?\n/);
4551
4548
  return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
4552
4549
  }
4553
- /**
4554
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4555
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4556
- */
4550
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4551
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4557
4552
 
4558
4553
  /**
4559
4554
  * Counts number of pages in the text
@@ -4565,10 +4560,8 @@ function countLines(text) {
4565
4560
  function countPages(text) {
4566
4561
  return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
4567
4562
  }
4568
- /**
4569
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4570
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4571
- */
4563
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4564
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4572
4565
 
4573
4566
  /**
4574
4567
  * Counts number of paragraphs in the text
@@ -4578,10 +4571,8 @@ function countPages(text) {
4578
4571
  function countParagraphs(text) {
4579
4572
  return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
4580
4573
  }
4581
- /**
4582
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4583
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4584
- */
4574
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4575
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4585
4576
 
4586
4577
  /**
4587
4578
  * Split text into sentences
@@ -4599,11 +4590,12 @@ function splitIntoSentences(text) {
4599
4590
  function countSentences(text) {
4600
4591
  return splitIntoSentences(text).length;
4601
4592
  }
4593
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4594
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4595
+
4602
4596
  /**
4603
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4604
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4597
+ * Collection of default diacritics removal map.
4605
4598
  */
4606
-
4607
4599
  const defaultDiacriticsRemovalMap = [
4608
4600
  {
4609
4601
  base: 'A',
@@ -4855,6 +4847,7 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
4855
4847
  *
4856
4848
  * @param input The string containing diacritics to be normalized.
4857
4849
  * @returns The string with diacritics removed or normalized.
4850
+ *
4858
4851
  * @public exported from `@promptbook/utils`
4859
4852
  */
4860
4853
  function removeDiacritics(input) {
@@ -4863,9 +4856,7 @@ function removeDiacritics(input) {
4863
4856
  return DIACRITIC_VARIANTS_LETTERS[character] || character;
4864
4857
  });
4865
4858
  }
4866
- /**
4867
- * TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4868
- */
4859
+ // TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4869
4860
 
4870
4861
  /**
4871
4862
  * Counts number of words in the text
@@ -4879,11 +4870,9 @@ function countWords(text) {
4879
4870
  text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
4880
4871
  return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
4881
4872
  }
4882
- /**
4883
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4884
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4885
- * TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
4886
- */
4873
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4874
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4875
+ // TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
4887
4876
 
4888
4877
  /**
4889
4878
  * Index of all counter functions
@@ -4898,10 +4887,8 @@ const CountUtils = {
4898
4887
  LINES: countLines,
4899
4888
  PAGES: countPages,
4900
4889
  };
4901
- /**
4902
- * TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
4903
- * Note: [💞] Ignore a discrepancy between file name and entity name
4904
- */
4890
+ // TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
4891
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4905
4892
 
4906
4893
  /**
4907
4894
  * Function checkExpectations will check if the expectations on given value are met
@@ -4912,6 +4899,7 @@ const CountUtils = {
4912
4899
  *
4913
4900
  * @throws {ExpectError} if the expectations are not met
4914
4901
  * @returns {void} Nothing
4902
+ *
4915
4903
  * @private internal function of `createPipelineExecutor`
4916
4904
  */
4917
4905
  function checkExpectations(expectations, value) {
@@ -4925,11 +4913,9 @@ function checkExpectations(expectations, value) {
4925
4913
  }
4926
4914
  }
4927
4915
  }
4928
- /**
4929
- * TODO: [💝] Unite object for expecting amount and format
4930
- * TODO: [🧠][🤠] This should be part of `TextFormatParser`
4931
- * Note: [💝] and [🤠] are interconnected together
4932
- */
4916
+ // TODO: [💝] Unite object for expecting amount and format
4917
+ // TODO: [🧠][🤠] This should be part of `TextFormatParser`
4918
+ // Note: [💝] and [🤠] are interconnected together
4933
4919
 
4934
4920
  /**
4935
4921
  * Validates a prompt result against expectations and format requirements.
@@ -4940,6 +4926,7 @@ function checkExpectations(expectations, value) {
4940
4926
  *
4941
4927
  * @param options - The validation options including result string, expectations, and format
4942
4928
  * @returns Validation result with processed string and validity status
4929
+ *
4943
4930
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
4944
4931
  */
4945
4932
  function validatePromptResult(options) {
@@ -5002,6 +4989,7 @@ function validatePromptResult(options) {
5002
4989
  *
5003
4990
  * @param options - The options for execution, including task, parameters, pipeline, and configuration.
5004
4991
  * @returns The result string of the executed task.
4992
+ *
5005
4993
  * @private internal utility of `createPipelineExecutor`
5006
4994
  */
5007
4995
  async function executeAttempts(options) {
@@ -5325,9 +5313,7 @@ async function executeAttempts(options) {
5325
5313
  }
5326
5314
  return $ongoingTaskResult.$resultString;
5327
5315
  }
5328
- /**
5329
- * TODO: Break into smaller functions
5330
- */
5316
+ // TODO: Break into smaller functions
5331
5317
 
5332
5318
  /**
5333
5319
  * Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
@@ -5470,6 +5456,7 @@ async function executeFormatSubvalues(options) {
5470
5456
  *
5471
5457
  * @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
5472
5458
  * @returns The context as a string, formatted as markdown and parameter value.
5459
+ *
5473
5460
  * @private internal utility of `createPipelineExecutor`
5474
5461
  */
5475
5462
  async function getContextForTask(task) {
@@ -5507,7 +5494,6 @@ function computeCosineSimilarity(embeddingVector1, embeddingVector2) {
5507
5494
  }
5508
5495
 
5509
5496
  /**
5510
- *
5511
5497
  * @param knowledgePieces
5512
5498
  * @returns
5513
5499
  *
@@ -5588,10 +5574,8 @@ async function getKnowledgeForTask(options) {
5588
5574
  return knowledgePiecesToString(preparedPipeline.knowledgePieces);
5589
5575
  }
5590
5576
  }
5591
- /**
5592
- * TODO: [♨] Implement Better - use keyword search
5593
- * TODO: [♨] Examples of values
5594
- */
5577
+ // TODO: [♨] Implement Better - use keyword search
5578
+ // TODO: [♨] Examples of values
5595
5579
 
5596
5580
  /**
5597
5581
  * Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
@@ -5744,9 +5728,7 @@ async function executeTask(options) {
5744
5728
  resultString,
5745
5729
  });
5746
5730
  }
5747
- /**
5748
- * TODO: [🤹‍♂️]
5749
- */
5731
+ // TODO: [🤹‍♂️]
5750
5732
 
5751
5733
  /**
5752
5734
  * Filters and returns only the output parameters from the provided pipeline execution options.
@@ -6076,6 +6058,7 @@ async function executePipeline(options) {
6076
6058
  *
6077
6059
  * @returns The executor function
6078
6060
  * @throws {PipelineLogicError} on logical error in the pipeline
6061
+ *
6079
6062
  * @public exported from `@promptbook/core`
6080
6063
  */
6081
6064
  function createPipelineExecutor(options) {
@@ -6231,8 +6214,9 @@ function createPipelineExecutor(options) {
6231
6214
  * @param array - Array to iterate over
6232
6215
  * @param options - Options for the function
6233
6216
  * @param callbackfunction - Function to call for each item
6234
- * @public exported from `@promptbook/utils`
6235
6217
  * @deprecated [🪂] Use queues instead
6218
+ *
6219
+ * @public exported from `@promptbook/utils`
6236
6220
  */
6237
6221
  async function forEachAsync(array, options, callbackfunction) {
6238
6222
  const { maxParallelCount = Infinity } = options;
@@ -6263,6 +6247,7 @@ async function forEachAsync(array, options, callbackfunction) {
6263
6247
  *
6264
6248
  * @param llmTools - The LLM tools to be intercepted and tracked
6265
6249
  * @returns Full proxy of the tools with added usage tracking capabilities
6250
+ *
6266
6251
  * @public exported from `@promptbook/core`
6267
6252
  */
6268
6253
  function countUsage(llmTools) {
@@ -6360,6 +6345,7 @@ function countUsage(llmTools) {
6360
6345
  * Prepares the persona for the pipeline
6361
6346
  *
6362
6347
  * @see https://github.com/webgptorg/promptbook/discussions/22
6348
+ *
6363
6349
  * @public exported from `@promptbook/core`
6364
6350
  */
6365
6351
  async function preparePersona(personaDescription, tools, options) {
@@ -6416,13 +6402,11 @@ async function preparePersona(personaDescription, tools, options) {
6416
6402
  modelsRequirements,
6417
6403
  };
6418
6404
  }
6419
- /**
6420
- * TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
6421
- * TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
6422
- * TODO: [🏢] Check validity of `modelName` in pipeline
6423
- * TODO: [🏢] Check validity of `systemMessage` in pipeline
6424
- * TODO: [🏢] Check validity of `temperature` in pipeline
6425
- */
6405
+ // TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
6406
+ // TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
6407
+ // TODO: [🏢] Check validity of `modelName` in pipeline
6408
+ // TODO: [🏢] Check validity of `systemMessage` in pipeline
6409
+ // TODO: [🏢] Check validity of `temperature` in pipeline
6426
6410
 
6427
6411
  /**
6428
6412
  * Safely retrieves the global scope object (window in browser, global in Node.js)
@@ -6430,7 +6414,7 @@ async function preparePersona(personaDescription, tools, options) {
6430
6414
  *
6431
6415
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
6432
6416
  *
6433
- * @private internal function of `$Register`
6417
+ * @private internal function of `$Register`
6434
6418
  */
6435
6419
  function $getGlobalScope() {
6436
6420
  return Function('return this')();
@@ -6445,6 +6429,7 @@ function $getGlobalScope() {
6445
6429
  * @returns The normalized text in SCREAMING_CASE format.
6446
6430
  * @example 'HELLO_WORLD'
6447
6431
  * @example 'I_LOVE_PROMPTBOOK'
6432
+ *
6448
6433
  * @public exported from `@promptbook/utils`
6449
6434
  */
6450
6435
  function normalizeTo_SCREAMING_CASE(text) {
@@ -6502,6 +6487,7 @@ function normalizeTo_SCREAMING_CASE(text) {
6502
6487
  * @returns The normalized text in snake_case format.
6503
6488
  * @example 'hello_world'
6504
6489
  * @example 'i_love_promptbook'
6490
+ *
6505
6491
  * @public exported from `@promptbook/utils`
6506
6492
  */
6507
6493
  function normalizeTo_snake_case(text) {
@@ -6560,26 +6546,26 @@ class $Register {
6560
6546
  * Global registry for storing metadata about all available scrapers and converters.
6561
6547
  *
6562
6548
  * Note: `$` is used to indicate that this interacts with the global scope.
6549
+ *
6563
6550
  * @singleton Only one instance of each register is created per build, but there can be more in different contexts (e.g., tests).
6551
+ *
6564
6552
  * @public exported from `@promptbook/core`
6565
6553
  */
6566
6554
  const $scrapersMetadataRegister = new $Register('scrapers_metadata');
6567
- /**
6568
- * TODO: [®] DRY Register logic
6569
- */
6555
+ // TODO: [®] DRY Register logic
6570
6556
 
6571
6557
  /**
6572
6558
  * Registry for all available scrapers in the system.
6573
6559
  * Central point for registering and accessing different types of content scrapers.
6574
6560
  *
6575
6561
  * Note: `$` is used to indicate that this interacts with the global scope
6562
+ *
6576
6563
  * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
6564
+ *
6577
6565
  * @public exported from `@promptbook/core`
6578
6566
  */
6579
6567
  const $scrapersRegister = new $Register('scraper_constructors');
6580
- /**
6581
- * TODO: [®] DRY Register logic
6582
- */
6568
+ // TODO: [®] DRY Register logic
6583
6569
 
6584
6570
  /**
6585
6571
  * Creates a message with all registered scrapers
@@ -6664,9 +6650,7 @@ function $registeredScrapersMessage(availableScrapers) {
6664
6650
 
6665
6651
  `);
6666
6652
  }
6667
- /**
6668
- * TODO: [®] DRY Register logic
6669
- */
6653
+ // TODO: [®] DRY Register logic
6670
6654
 
6671
6655
  /**
6672
6656
  * Converts a given text to kebab-case format.
@@ -6677,6 +6661,7 @@ function $registeredScrapersMessage(availableScrapers) {
6677
6661
  * @returns The kebab-case formatted string.
6678
6662
  * @example 'hello-world'
6679
6663
  * @example 'i-love-promptbook'
6664
+ *
6680
6665
  * @public exported from `@promptbook/utils`
6681
6666
  */
6682
6667
  function normalizeToKebabCase(text) {
@@ -6717,9 +6702,7 @@ function normalizeToKebabCase(text) {
6717
6702
  normalizedName = normalizedName.replace(/-$/, '');
6718
6703
  return normalizedName;
6719
6704
  }
6720
- /**
6721
- * Note: [💞] Ignore a discrepancy between file name and entity name
6722
- */
6705
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6723
6706
 
6724
6707
  /**
6725
6708
  * Creates unique name for the source
@@ -6738,9 +6721,7 @@ function knowledgeSourceContentToName(knowledgeSourceContent) {
6738
6721
  // <- TODO: Use MAX_FILENAME_LENGTH
6739
6722
  return name;
6740
6723
  }
6741
- /**
6742
- * TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
6743
- */
6724
+ // TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
6744
6725
 
6745
6726
  /**
6746
6727
  * Converts a name to a properly formatted subfolder path for cache storage.
@@ -6790,11 +6771,9 @@ async function isFileExisting(filename, fs) {
6790
6771
  .catch(() => false);
6791
6772
  return isFile;
6792
6773
  }
6793
- /**
6794
- * Note: Not [~🟢~] because it is not directly dependent on `fs
6795
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
6796
- * TODO: [🖇] What about symlinks?
6797
- */
6774
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
6775
+ // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
6776
+ // TODO: [🖇] What about symlinks?
6798
6777
 
6799
6778
  /**
6800
6779
  * Convert mime type to file extension
@@ -6814,6 +6793,7 @@ function mimeTypeToExtension(value) {
6814
6793
  *
6815
6794
  * @param text with emojis
6816
6795
  * @returns text without emojis
6796
+ *
6817
6797
  * @public exported from `@promptbook/utils`
6818
6798
  */
6819
6799
  function removeEmojis(text) {
@@ -6833,6 +6813,7 @@ function removeEmojis(text) {
6833
6813
  * @param value The title string to be converted to a name.
6834
6814
  * @returns A normalized name derived from the input title.
6835
6815
  * @example 'Hello World!' -> 'hello-world'
6816
+ *
6836
6817
  * @public exported from `@promptbook/utils`
6837
6818
  */
6838
6819
  function titleToName(value) {
@@ -6878,9 +6859,7 @@ const promptbookFetch = async (urlOrRequest, init) => {
6878
6859
  `));
6879
6860
  }
6880
6861
  };
6881
- /**
6882
- * TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
6883
- */
6862
+ // TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
6884
6863
 
6885
6864
  /**
6886
6865
  * Factory function that creates a handler for processing knowledge sources.
@@ -7100,6 +7079,7 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
7100
7079
  * Prepares the knowledge pieces
7101
7080
  *
7102
7081
  * @see https://github.com/webgptorg/promptbook/discussions/41
7082
+ *
7103
7083
  * @public exported from `@promptbook/core`
7104
7084
  */
7105
7085
  async function prepareKnowledgePieces(knowledgeSources, tools, options) {
@@ -7241,25 +7221,24 @@ async function prepareTasks(pipeline, tools, options) {
7241
7221
  });
7242
7222
  return { tasksPrepared };
7243
7223
  }
7244
- /**
7245
- * TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
7246
- * TODO: [🧠] Add context to each task (if missing)
7247
- * TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
7248
- * TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
7249
- * TODO: Write tests for `preparePipeline`
7250
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
7251
- * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
7252
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
7253
- */
7224
+ // TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
7225
+ // TODO: [🧠] Add context to each task (if missing)
7226
+ // TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
7227
+ // TODO: [][main] !!3 Prepare index the examples and maybe tasks
7228
+ // TODO: Write tests for `preparePipeline`
7229
+ // TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
7230
+ // TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
7231
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
7254
7232
 
7255
7233
  /**
7256
7234
  * Prepare pipeline locally
7257
7235
  *
7258
- * @see https://github.com/webgptorg/promptbook/discussions/196
7259
- *
7260
7236
  * Note: This function does not validate logic of the pipeline
7261
7237
  * Note: This function acts as part of compilation process
7262
7238
  * Note: When the pipeline is already prepared, it returns the same pipeline
7239
+ *
7240
+ * @see https://github.com/webgptorg/promptbook/discussions/196
7241
+ *
7263
7242
  * @public exported from `@promptbook/core`
7264
7243
  */
7265
7244
  async function preparePipeline(pipeline, tools, options) {
@@ -7438,6 +7417,7 @@ const SectionTypes = [
7438
7417
  * Parses the knowledge command
7439
7418
  *
7440
7419
  * @see `documentationUrl` for more details
7420
+ *
7441
7421
  * @public exported from `@promptbook/editable`
7442
7422
  */
7443
7423
  const knowledgeCommandParser = {
@@ -7524,14 +7504,13 @@ const knowledgeCommandParser = {
7524
7504
  throw new NotYetImplementedError(`[🛋] Not implemented yet`); // <- TODO: [🛋] Implement
7525
7505
  },
7526
7506
  };
7527
- /**
7528
- * Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
7529
- */
7507
+ // Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
7530
7508
 
7531
7509
  /**
7532
7510
  * Parses the section command
7533
7511
  *
7534
7512
  * @see `documentationUrl` for more details
7513
+ *
7535
7514
  * @public exported from `@promptbook/editable`
7536
7515
  */
7537
7516
  const sectionCommandParser = {
@@ -7723,6 +7702,7 @@ const sectionCommandParser = {
7723
7702
  * Note: @@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
7724
7703
  *
7725
7704
  * @see `documentationUrl` for more details
7705
+ *
7726
7706
  * @private within the commands folder
7727
7707
  */
7728
7708
  const boilerplateCommandParser = {
@@ -7814,6 +7794,7 @@ const boilerplateCommandParser = {
7814
7794
  * Parses the BOOK_VERSION command
7815
7795
  *
7816
7796
  * @see `documentationUrl` for more details
7797
+ *
7817
7798
  * @public exported from `@promptbook/editable`
7818
7799
  */
7819
7800
  const bookVersionCommandParser = {
@@ -7890,12 +7871,11 @@ const bookVersionCommandParser = {
7890
7871
  * Units of text measurement
7891
7872
  *
7892
7873
  * @see https://github.com/webgptorg/promptbook/discussions/30
7874
+ *
7893
7875
  * @public exported from `@promptbook/core`
7894
7876
  */
7895
7877
  const EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPHS', 'PAGES'];
7896
- /**
7897
- * TODO: [💝] Unite object for expecting amount and format - remove format
7898
- */
7878
+ // TODO: [💝] Unite object for expecting amount and format - remove format
7899
7879
 
7900
7880
  /**
7901
7881
  * Function parseNumber will parse number from string
@@ -7964,17 +7944,16 @@ function parseNumber(value) {
7964
7944
  }
7965
7945
  return num;
7966
7946
  }
7967
- /**
7968
- * TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
7969
- * TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
7970
- */
7947
+ // TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
7948
+ // TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
7971
7949
 
7972
7950
  /**
7973
- import { WrappedError } from '../../errors/WrappedError';
7974
- import { assertsError } from '../../errors/assertsError';
7951
+ * import { WrappedError } from '../../errors/WrappedError';
7952
+ * import { assertsError } from '../../errors/assertsError';
7975
7953
  * Parses the expect command
7976
7954
  *
7977
7955
  * @see `documentationUrl` for more details
7956
+ *
7978
7957
  * @public exported from `@promptbook/editable`
7979
7958
  */
7980
7959
  const expectCommandParser = {
@@ -8121,6 +8100,7 @@ const expectCommandParser = {
8121
8100
  * @returns The camelCase formatted string.
8122
8101
  * @example 'helloWorld'
8123
8102
  * @example 'iLovePromptbook'
8103
+ *
8124
8104
  * @public exported from `@promptbook/utils`
8125
8105
  */
8126
8106
  function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
@@ -8161,9 +8141,7 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
8161
8141
  }
8162
8142
  return normalizedName;
8163
8143
  }
8164
- /**
8165
- * TODO: [🌺] Use some intermediate util splitWords
8166
- */
8144
+ // TODO: [🌺] Use some intermediate util splitWords
8167
8145
 
8168
8146
  /**
8169
8147
  * Removes quotes from a string
@@ -8177,6 +8155,7 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
8177
8155
  *
8178
8156
  * @param text optionally quoted text
8179
8157
  * @returns text without quotes
8158
+ *
8180
8159
  * @public exported from `@promptbook/utils`
8181
8160
  */
8182
8161
  function removeQuotes(text) {
@@ -8198,6 +8177,7 @@ function removeQuotes(text) {
8198
8177
  * @param parameterName The parameter name to validate and normalize.
8199
8178
  * @returns The validated and normalized parameter name.
8200
8179
  * @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
8180
+ *
8201
8181
  * @private within the repository
8202
8182
  */
8203
8183
  function validateParameterName(parameterName) {
@@ -8268,6 +8248,7 @@ function validateParameterName(parameterName) {
8268
8248
  * Parses the foreach command
8269
8249
  *
8270
8250
  * @see `documentationUrl` for more details
8251
+ *
8271
8252
  * @public exported from `@promptbook/editable`
8272
8253
  */
8273
8254
  const foreachCommandParser = {
@@ -8426,14 +8407,13 @@ const foreachCommandParser = {
8426
8407
  throw new NotYetImplementedError(`[🛋] Not implemented yet`); // <- TODO: [🛋] Implement
8427
8408
  },
8428
8409
  };
8429
- /**
8430
- * TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
8431
- */
8410
+ // TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
8432
8411
 
8433
8412
  /**
8434
8413
  * Parses the format command
8435
8414
  *
8436
8415
  * @see `documentationUrl` for more details
8416
+ *
8437
8417
  * @public exported from `@promptbook/editable`
8438
8418
  */
8439
8419
  const formatCommandParser = {
@@ -8618,9 +8598,7 @@ const GENERIC_PIPELINE_INTERFACE = {
8618
8598
  inputParameters: [],
8619
8599
  outputParameters: [],
8620
8600
  };
8621
- /**
8622
- * Note: [💞] Ignore a discrepancy between file name and entity name
8623
- */
8601
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8624
8602
 
8625
8603
  /**
8626
8604
  * A generic pipeline
@@ -8772,9 +8750,7 @@ const FORMFACTOR_DEFINITIONS = [
8772
8750
  CompletionFormfactorDefinition,
8773
8751
  // <- [🛬] When making new formfactor, copy the _boilerplate and link it here
8774
8752
  ];
8775
- /**
8776
- * Note: [💞] Ignore a discrepancy between file name and entity name
8777
- */
8753
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8778
8754
 
8779
8755
  /**
8780
8756
  * Parses the formfactor command
@@ -8782,6 +8758,7 @@ const FORMFACTOR_DEFINITIONS = [
8782
8758
  * Note: This command is used as a formfactor for new commands and defines the app type format - it should NOT be used in any `.book` file
8783
8759
  *
8784
8760
  * @see `documentationUrl` for more details
8761
+ *
8785
8762
  * @public exported from `@promptbook/editable`
8786
8763
  */
8787
8764
  const formfactorCommandParser = {
@@ -8877,6 +8854,7 @@ const formfactorCommandParser = {
8877
8854
  * Parses the joker command
8878
8855
  *
8879
8856
  * @see `documentationUrl` for more details
8857
+ *
8880
8858
  * @public exported from `@promptbook/editable`
8881
8859
  */
8882
8860
  const jokerCommandParser = {
@@ -8944,7 +8922,10 @@ const jokerCommandParser = {
8944
8922
  };
8945
8923
 
8946
8924
  /**
8925
+ * Constant for model variants.
8926
+ *
8947
8927
  * @see {@link ModelVariant}
8928
+ *
8948
8929
  * @public exported from `@promptbook/core`
8949
8930
  */
8950
8931
  const MODEL_VARIANTS = [
@@ -8959,6 +8940,7 @@ const MODEL_VARIANTS = [
8959
8940
  *
8960
8941
  * @see `documentationUrl` for more details
8961
8942
  * @deprecated Option to manually set the model requirements is not recommended to use, use `PERSONA` instead
8943
+ *
8962
8944
  * @public exported from `@promptbook/editable`
8963
8945
  */
8964
8946
  const modelCommandParser = {
@@ -9139,6 +9121,7 @@ const modelCommandParser = {
9139
9121
  * Parses the parameter command
9140
9122
  *
9141
9123
  * @see `documentationUrl` for more details
9124
+ *
9142
9125
  * @public exported from `@promptbook/editable`
9143
9126
  */
9144
9127
  const parameterCommandParser = {
@@ -9249,6 +9232,7 @@ const parameterCommandParser = {
9249
9232
  * Parses the persona command
9250
9233
  *
9251
9234
  * @see `documentationUrl` for more details
9235
+ *
9252
9236
  * @public exported from `@promptbook/editable`
9253
9237
  */
9254
9238
  const personaCommandParser = {
@@ -9381,6 +9365,7 @@ function $applyToTaskJson(command, $taskJson, $pipelineJson) {
9381
9365
  *
9382
9366
  * @param javascriptName The value to check for JavaScript identifier validity.
9383
9367
  * @returns `true` if the value is a valid JavaScript name, false otherwise.
9368
+ *
9384
9369
  * @public exported from `@promptbook/utils`
9385
9370
  */
9386
9371
  function isValidJavascriptName(javascriptName) {
@@ -9394,6 +9379,7 @@ function isValidJavascriptName(javascriptName) {
9394
9379
  * Parses the postprocess command
9395
9380
  *
9396
9381
  * @see `documentationUrl` for more details
9382
+ *
9397
9383
  * @public exported from `@promptbook/editable`
9398
9384
  */
9399
9385
  const postprocessCommandParser = {
@@ -9472,6 +9458,7 @@ const postprocessCommandParser = {
9472
9458
  * Parses the url command
9473
9459
  *
9474
9460
  * @see `documentationUrl` for more details
9461
+ *
9475
9462
  * @public exported from `@promptbook/editable`
9476
9463
  */
9477
9464
  const urlCommandParser = {
@@ -9573,6 +9560,7 @@ const urlCommandParser = {
9573
9560
  * Parses the action command
9574
9561
  *
9575
9562
  * @see `documentationUrl` for more details
9563
+ *
9576
9564
  * @public exported from `@promptbook/editable`
9577
9565
  */
9578
9566
  const actionCommandParser = {
@@ -9630,14 +9618,13 @@ const actionCommandParser = {
9630
9618
  throw new NotYetImplementedError('[🛠] Actions are not implemented yet');
9631
9619
  },
9632
9620
  };
9633
- /**
9634
- * Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
9635
- */
9621
+ // Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
9636
9622
 
9637
9623
  /**
9638
9624
  * Parses the instrument command
9639
9625
  *
9640
9626
  * @see `documentationUrl` for more details
9627
+ *
9641
9628
  * @public exported from `@promptbook/editable`
9642
9629
  */
9643
9630
  const instrumentCommandParser = {
@@ -9695,9 +9682,7 @@ const instrumentCommandParser = {
9695
9682
  throw new NotYetImplementedError('[🛠] Instruments are not implemented yet');
9696
9683
  },
9697
9684
  };
9698
- /**
9699
- * Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
9700
- */
9685
+ // Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
9701
9686
 
9702
9687
  /**
9703
9688
  * All available command parsers
@@ -9723,9 +9708,7 @@ const COMMANDS = [
9723
9708
  boilerplateCommandParser, // <- TODO: Only in development, remove in production
9724
9709
  // <- Note: [♓️][💩] This is the order of the commands in the pipeline, BUT its not used in parsing and before usage maybe it should be done better
9725
9710
  ];
9726
- /**
9727
- * Note: [💞] Ignore a discrepancy between file name and entity name
9728
- */
9711
+ // Note: [💞] Ignore a discrepancy between file name and entity name
9729
9712
 
9730
9713
  /**
9731
9714
  * Gets the parser for the command
@@ -9755,6 +9738,7 @@ function getParserForCommand(command) {
9755
9738
  *
9756
9739
  * @param {string} str - The string to remove Markdown tags from.
9757
9740
  * @returns {string} The input string with all Markdown tags removed.
9741
+ *
9758
9742
  * @public exported from `@promptbook/markdown-utils`
9759
9743
  */
9760
9744
  function removeMarkdownFormatting(str) {
@@ -10140,9 +10124,7 @@ const QuickChatbotHla = {
10140
10124
  });
10141
10125
  },
10142
10126
  };
10143
- /**
10144
- * TODO: [🧠][📛] Should this be here?
10145
- */
10127
+ // TODO: [🧠][📛] Should this be here?
10146
10128
 
10147
10129
  /**
10148
10130
  * All high-level abstractions
@@ -10154,10 +10136,8 @@ const HIGH_LEVEL_ABSTRACTIONS = [
10154
10136
  QuickChatbotHla,
10155
10137
  // <- Note: [♓️][💩] This is the order of the application of high-level abstractions application on pipeline JSON
10156
10138
  ];
10157
- /**
10158
- * TODO: Test that all sync high-level abstractions are before async high-level abstractions
10159
- * Note: [💞] Ignore a discrepancy between file name and entity name
10160
- */
10139
+ // TODO: Test that all sync high-level abstractions are before async high-level abstractions
10140
+ // Note: [💞] Ignore a discrepancy between file name and entity name
10161
10141
 
10162
10142
  /**
10163
10143
  * Supported script languages
@@ -10168,7 +10148,7 @@ const SUPPORTED_SCRIPT_LANGUAGES = ['javascript', 'typescript', 'python'];
10168
10148
  // <- TODO: [🏥] DRY
10169
10149
 
10170
10150
  /**
10171
- * Number of padding lines to add at the end of the book content
10151
+ * Number of padding lines to add at the end of the book content
10172
10152
  *
10173
10153
  * @public exported from `@promptbook/core`
10174
10154
  */
@@ -10205,15 +10185,14 @@ function padBook(content) {
10205
10185
  const linesToAdd = PADDING_LINES - trailingEmptyLines;
10206
10186
  return (content + '\n'.repeat(linesToAdd));
10207
10187
  }
10208
- /**
10209
- * TODO: [🧠] Maybe export
10210
- */
10188
+ // TODO: [🧠] Maybe export
10211
10189
 
10212
10190
  /**
10213
10191
  * Removes Markdown (or HTML) comments
10214
10192
  *
10215
10193
  * @param {string} content - The string to remove comments from.
10216
10194
  * @returns {string} The input string with all comments removed.
10195
+ *
10217
10196
  * @public exported from `@promptbook/markdown-utils`
10218
10197
  */
10219
10198
  function removeMarkdownComments(content) {
@@ -10291,9 +10270,7 @@ function deflatePipeline(pipelineString) {
10291
10270
  // <- TODO: Maybe use book` notation
10292
10271
  return padBook(pipelineString);
10293
10272
  }
10294
- /**
10295
- * TODO: Unit test
10296
- */
10273
+ // TODO: Unit test
10297
10274
 
10298
10275
  /**
10299
10276
  * Utility function to extract all list items from markdown
@@ -10305,6 +10282,7 @@ function deflatePipeline(pipelineString) {
10305
10282
  *
10306
10283
  * @param markdown any valid markdown
10307
10284
  * @returns An array of strings, each representing an individual list item found in the markdown
10285
+ *
10308
10286
  * @public exported from `@promptbook/markdown-utils`
10309
10287
  */
10310
10288
  function extractAllListItemsFromMarkdown(markdown) {
@@ -10337,8 +10315,9 @@ function extractAllListItemsFromMarkdown(markdown) {
10337
10315
  *
10338
10316
  * @param markdown any valid markdown
10339
10317
  * @returns code block with language and content
10340
- * @public exported from `@promptbook/markdown-utils`
10341
10318
  * @throws {ParseError} if there is not exactly one code block in the markdown
10319
+ *
10320
+ * @public exported from `@promptbook/markdown-utils`
10342
10321
  */
10343
10322
  function extractOneBlockFromMarkdown(markdown) {
10344
10323
  const codeBlocks = extractAllBlocksFromMarkdown(markdown);
@@ -10351,9 +10330,7 @@ function extractOneBlockFromMarkdown(markdown) {
10351
10330
  }
10352
10331
  return codeBlocks[0];
10353
10332
  }
10354
- /***
10355
- * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
10356
- */
10333
+ // TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
10357
10334
 
10358
10335
  /**
10359
10336
  * Parses markdown section to title its level and content
@@ -10495,6 +10472,7 @@ function flattenMarkdown(markdown) {
10495
10472
  * @param pipelineString {Promptbook} in string markdown format (.book.md)
10496
10473
  * @returns {Promptbook} compiled in JSON format (.bookc)
10497
10474
  * @throws {ParseError} if the promptbook string is not valid
10475
+ *
10498
10476
  * @public exported from `@promptbook/core`
10499
10477
  */
10500
10478
  function parsePipeline(pipelineString) {
@@ -10915,31 +10893,29 @@ function parsePipeline(pipelineString) {
10915
10893
  },
10916
10894
  });
10917
10895
  }
10918
- /**
10919
- * TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
10920
- * TODO: [main] !!4 Warn if used only sync version
10921
- * TODO: [🚞] Report here line/column of error
10922
- * TODO: Use spaceTrim more effectively
10923
- * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
10924
- * TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
10925
- * TODO: [] Probably move expectations from tasks to parameters
10926
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10927
- * TODO: [🍙] Make some standard order of json properties
10928
- */
10896
+ // TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
10897
+ // TODO: [main] !!4 Warn if used only sync version
10898
+ // TODO: [🚞] Report here line/column of error
10899
+ // TODO: Use spaceTrim more effectively
10900
+ // TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
10901
+ // TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
10902
+ // TODO: [] Probably move expectations from tasks to parameters
10903
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10904
+ // TODO: [🍙] Make some standard order of json properties
10929
10905
 
10930
10906
  /**
10931
10907
  * Compile pipeline from string (markdown) format to JSON format
10932
10908
  *
10933
- * @see https://github.com/webgptorg/promptbook/discussions/196
10934
- *
10935
10909
  * Note: This function does not validate logic of the pipeline only the parsing
10936
10910
  * Note: This function acts as compilation process
10937
10911
  *
10912
+ * @see https://github.com/webgptorg/promptbook/discussions/196
10938
10913
  * @param pipelineString {Promptbook} in string markdown format (.book.md)
10939
10914
  * @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
10940
10915
  * @param options - Options and tools for the compilation
10941
10916
  * @returns {Promptbook} compiled in JSON format (.bookc)
10942
10917
  * @throws {ParseError} if the promptbook string is not valid
10918
+ *
10943
10919
  * @public exported from `@promptbook/core`
10944
10920
  */
10945
10921
  async function compilePipeline(pipelineString, tools, options) {
@@ -10952,11 +10928,9 @@ async function compilePipeline(pipelineString, tools, options) {
10952
10928
  // Note: No need to use `$exportJson` because `parsePipeline` and `preparePipeline` already do that
10953
10929
  return pipelineJson;
10954
10930
  }
10955
- /**
10956
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
10957
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10958
- * TODO: [🧠] Should be in generated JSON file GENERATOR_WARNING
10959
- */
10931
+ // TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
10932
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10933
+ // TODO: [🧠] Should be in generated JSON file GENERATOR_WARNING
10960
10934
 
10961
10935
  /**
10962
10936
  * Unsafe characters that prevent an inline parameter.
@@ -10980,6 +10954,7 @@ const PROMPT_PARAMETER_ESCAPE_WITH_BRACES_PATTERN = /[{}$`]/g;
10980
10954
  * Normalizes a JSON string so it can be safely rendered without double escaping.
10981
10955
  *
10982
10956
  * @param value Candidate JSON string.
10957
+ *
10983
10958
  * @private function of ParameterEscaping
10984
10959
  */
10985
10960
  function normalizeJsonString(value) {
@@ -10994,6 +10969,7 @@ function normalizeJsonString(value) {
10994
10969
  * Hides brackets in a string to avoid confusion with template parameters.
10995
10970
  *
10996
10971
  * @param value Input string with literal brackets.
10972
+ *
10997
10973
  * @private function of ParameterEscaping
10998
10974
  */
10999
10975
  function hideBrackets(value) {
@@ -11003,6 +10979,7 @@ function hideBrackets(value) {
11003
10979
  * Restores hidden brackets.
11004
10980
  *
11005
10981
  * @param value String with hidden brackets.
10982
+ *
11006
10983
  * @private function of ParameterEscaping
11007
10984
  */
11008
10985
  function restoreBrackets(value) {
@@ -11012,6 +10989,7 @@ function restoreBrackets(value) {
11012
10989
  * Decides whether a parameter can be inlined safely.
11013
10990
  *
11014
10991
  * @param value Parameter rendered as string.
10992
+ *
11015
10993
  * @private function of ParameterEscaping
11016
10994
  */
11017
10995
  function shouldInlineParameterValue(value) {
@@ -11025,6 +11003,7 @@ function shouldInlineParameterValue(value) {
11025
11003
  *
11026
11004
  * @param value Parameter value to escape.
11027
11005
  * @param options Escape options for additional characters.
11006
+ *
11028
11007
  * @private function of ParameterEscaping
11029
11008
  */
11030
11009
  function escapePromptParameterValue(value, options) {
@@ -11050,6 +11029,7 @@ const ParameterEscaping = {
11050
11029
  * Builds numeric parameter names (1, 2, ...).
11051
11030
  *
11052
11031
  * @param index Zero-based parameter index.
11032
+ *
11053
11033
  * @private function of ParameterNaming
11054
11034
  */
11055
11035
  function buildNumericParameterName(index) {
@@ -11059,6 +11039,7 @@ function buildNumericParameterName(index) {
11059
11039
  * Builds alphabetic parameter names (a, b, ..., aa).
11060
11040
  *
11061
11041
  * @param index Zero-based parameter index.
11042
+ *
11062
11043
  * @private function of ParameterNaming
11063
11044
  */
11064
11045
  function buildAlphabeticParameterName(index) {
@@ -11075,6 +11056,7 @@ function buildAlphabeticParameterName(index) {
11075
11056
  * Converts a positive integer into a Roman numeral string.
11076
11057
  *
11077
11058
  * @param value Positive integer value.
11059
+ *
11078
11060
  * @private function of ParameterNaming
11079
11061
  */
11080
11062
  function toRomanNumeral(value) {
@@ -11107,6 +11089,7 @@ function toRomanNumeral(value) {
11107
11089
  * Builds Roman numeral parameter names (I, II, ...).
11108
11090
  *
11109
11091
  * @param index Zero-based parameter index.
11092
+ *
11110
11093
  * @private function of ParameterNaming
11111
11094
  */
11112
11095
  function buildRomanParameterName(index) {
@@ -11117,6 +11100,7 @@ function buildRomanParameterName(index) {
11117
11100
  *
11118
11101
  * @param prefix Prefix string.
11119
11102
  * @param builder Base builder function.
11103
+ *
11120
11104
  * @private function of ParameterNaming
11121
11105
  */
11122
11106
  function buildPrefixedParameterName(prefix, builder) {
@@ -11138,6 +11122,7 @@ const PARAMETER_NAME_STRATEGIES = [
11138
11122
  * Collects bracketed tokens from parameter values to avoid placeholder collisions.
11139
11123
  *
11140
11124
  * @param values Parameter values to scan.
11125
+ *
11141
11126
  * @private function of ParameterNaming
11142
11127
  */
11143
11128
  function collectBracketedParameterTokens(values) {
@@ -11158,6 +11143,7 @@ function collectBracketedParameterTokens(values) {
11158
11143
  * Builds placeholder names while avoiding collisions with parameter content.
11159
11144
  *
11160
11145
  * @param values Parameter values to scan for conflicting tokens.
11146
+ *
11161
11147
  * @private function of ParameterNaming
11162
11148
  */
11163
11149
  function buildParameterNames(values) {
@@ -11188,6 +11174,7 @@ const ParameterNaming = {
11188
11174
  * Formats the placeholder used in the prompt body for a parameter.
11189
11175
  *
11190
11176
  * @param name Parameter placeholder name.
11177
+ *
11191
11178
  * @private function of ParameterSection
11192
11179
  */
11193
11180
  function formatParameterPlaceholder(name) {
@@ -11197,6 +11184,7 @@ function formatParameterPlaceholder(name) {
11197
11184
  * Formats a single line entry for structured parameters.
11198
11185
  *
11199
11186
  * @param item Parameter entry data.
11187
+ *
11200
11188
  * @private function of ParameterSection
11201
11189
  */
11202
11190
  function formatParameterListItem(item) {
@@ -11208,6 +11196,7 @@ function formatParameterListItem(item) {
11208
11196
  * Builds the structured parameters section appended to the prompt.
11209
11197
  *
11210
11198
  * @param items Parameter entries to include.
11199
+ *
11211
11200
  * @private function of ParameterSection
11212
11201
  */
11213
11202
  function buildParametersSection(items) {
@@ -11283,6 +11272,7 @@ function isPromptString(value) {
11283
11272
  * @param strings
11284
11273
  * @param values
11285
11274
  * @returns prompt content wrapped as a PromptString
11275
+ *
11286
11276
  * @public exported from `@promptbook/utils`
11287
11277
  */
11288
11278
  function prompt(strings, ...values) {
@@ -11367,11 +11357,9 @@ function prompt(strings, ...values) {
11367
11357
  }
11368
11358
  return new PromptString(pipelineString);
11369
11359
  }
11370
- /**
11371
- * TODO: Maybe split into multiple files
11372
- * TODO: [🧠][🈴] Where is the best location for this file
11373
- * Note: [💞] Ignore a discrepancy between file name and entity name
11374
- */
11360
+ // TODO: Maybe split into multiple files
11361
+ // TODO: [🧠][🈴] Where is the best location for this file
11362
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11375
11363
 
11376
11364
  /**
11377
11365
  * @@@
@@ -11408,9 +11396,7 @@ function attachClientVersionHeader(headers) {
11408
11396
  [CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
11409
11397
  };
11410
11398
  }
11411
- /**
11412
- * Note: [💞] Ignore a discrepancy between file name and entity name
11413
- */
11399
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11414
11400
 
11415
11401
  /**
11416
11402
  * Detects if the code is running in a browser environment in main thread (Not in a web worker)
@@ -11427,9 +11413,7 @@ function $isRunningInBrowser() {
11427
11413
  return false;
11428
11414
  }
11429
11415
  }
11430
- /**
11431
- * TODO: [🎺]
11432
- */
11416
+ // TODO: [🎺]
11433
11417
 
11434
11418
  /**
11435
11419
  * Detects if the code is running in a Node.js environment
@@ -11446,9 +11430,7 @@ function $isRunningInNode() {
11446
11430
  return false;
11447
11431
  }
11448
11432
  }
11449
- /**
11450
- * TODO: [🎺]
11451
- */
11433
+ // TODO: [🎺]
11452
11434
 
11453
11435
  /**
11454
11436
  * Detects if the code is running in a web worker
@@ -11468,9 +11450,7 @@ function $isRunningInWebWorker() {
11468
11450
  return false;
11469
11451
  }
11470
11452
  }
11471
- /**
11472
- * TODO: [🎺]
11473
- */
11453
+ // TODO: [🎺]
11474
11454
 
11475
11455
  /**
11476
11456
  * Computes SHA-256 hash of the given object
@@ -11480,9 +11460,7 @@ function $isRunningInWebWorker() {
11480
11460
  function computeHash(value) {
11481
11461
  return SHA256(hexEncoder.parse(spaceTrim$1(valueToString(value)))).toString( /* hex */);
11482
11462
  }
11483
- /**
11484
- * TODO: [🥬][🥬] Use this ACRY
11485
- */
11463
+ // TODO: [🥬][🥬] Use this ACRY
11486
11464
 
11487
11465
  // spell-checker: disable
11488
11466
  /**
@@ -11648,6 +11626,9 @@ const ADJECTIVES$1 = [
11648
11626
  'prvotní',
11649
11627
  'hbitý',
11650
11628
  ];
11629
+ /**
11630
+ * Collection of nouns.
11631
+ */
11651
11632
  const NOUNS$1 = [
11652
11633
  'jablko',
11653
11634
  'nebe',
@@ -11861,6 +11842,9 @@ const NOUNS$1 = [
11861
11842
  'okno',
11862
11843
  'chodba',
11863
11844
  ];
11845
+ /**
11846
+ * Collection of verbs.
11847
+ */
11864
11848
  const VERBS$1 = [
11865
11849
  'skáče',
11866
11850
  'tančí',
@@ -12033,9 +12017,7 @@ const LINGUISTIC_HASH_WORD_LISTS_CS = {
12033
12017
  noun: NOUNS$1,
12034
12018
  verb: VERBS$1,
12035
12019
  };
12036
- /**
12037
- * Note: [💞] Ignore a discrepancy between file name and entity name
12038
- */
12020
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12039
12021
 
12040
12022
  /**
12041
12023
  * @@@
@@ -12291,6 +12273,9 @@ const ADJECTIVES = [
12291
12273
  'macro',
12292
12274
  'mini',
12293
12275
  ];
12276
+ /**
12277
+ * Collection of nouns.
12278
+ */
12294
12279
  const NOUNS = [
12295
12280
  'apple',
12296
12281
  'sky',
@@ -12530,6 +12515,9 @@ const NOUNS = [
12530
12515
  'roof',
12531
12516
  'floor',
12532
12517
  ];
12518
+ /**
12519
+ * Collection of verbs.
12520
+ */
12533
12521
  const VERBS = [
12534
12522
  'jumping',
12535
12523
  'dancing',
@@ -12725,9 +12713,7 @@ const LINGUISTIC_HASH_WORD_LISTS_EN = {
12725
12713
  noun: NOUNS,
12726
12714
  verb: VERBS,
12727
12715
  };
12728
- /**
12729
- * Note: [💞] Ignore a discrepancy between file name and entity name
12730
- */
12716
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12731
12717
 
12732
12718
  /**
12733
12719
  * Default language used for linguistic hashes.
@@ -12902,8 +12888,9 @@ function normalizeLinguisticHashWordCount(wordCount) {
12902
12888
  /**
12903
12889
  * Creates a human-readable hash as a short, story-like phrase.
12904
12890
  *
12905
- * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
12906
12891
  * {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
12892
+ *
12893
+ * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
12907
12894
  * @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
12908
12895
  *
12909
12896
  * @public exported from `@promptbook/utils`
@@ -12922,6 +12909,7 @@ async function linguisticHash(input, wordCount, language) {
12922
12909
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
12923
12910
  *
12924
12911
  * @returns string_date branded type
12912
+ *
12925
12913
  * @public exported from `@promptbook/utils`
12926
12914
  */
12927
12915
  function $getCurrentDate() {
@@ -12944,6 +12932,7 @@ function decapitalize(word) {
12944
12932
  *
12945
12933
  * @param {string} input
12946
12934
  * @returns {Set} of keywords without diacritics in lowercase
12935
+ *
12947
12936
  * @public exported from `@promptbook/utils`
12948
12937
  */
12949
12938
  function parseKeywordsFromString(input) {
@@ -12960,6 +12949,7 @@ function parseKeywordsFromString(input) {
12960
12949
  * @param name The string to be converted to a URI-compatible format.
12961
12950
  * @returns A URI-compatible string derived from the input name.
12962
12951
  * @example 'Hello World' -> 'hello-world'
12952
+ *
12963
12953
  * @public exported from `@promptbook/utils`
12964
12954
  */
12965
12955
  function nameToUriPart(name) {
@@ -12978,6 +12968,7 @@ function nameToUriPart(name) {
12978
12968
  * @param name The name to be converted into URI parts.
12979
12969
  * @returns An array of URI-compatible parts derived from the name.
12980
12970
  * @example 'Example Name' -> ['example', 'name']
12971
+ *
12981
12972
  * @public exported from `@promptbook/utils`
12982
12973
  */
12983
12974
  function nameToUriParts(name) {
@@ -13007,6 +12998,7 @@ function normalizeMessageText(text) {
13007
12998
  * @returns
13008
12999
  * @example 'HelloWorld'
13009
13000
  * @example 'ILovePromptbook'
13001
+ *
13010
13002
  * @public exported from `@promptbook/utils`
13011
13003
  */
13012
13004
  function normalizeTo_PascalCase(text) {
@@ -13035,6 +13027,7 @@ function normalizeWhitespaces(sentence) {
13035
13027
  *
13036
13028
  * @param text optionally quoted text
13037
13029
  * @returns text without quotes
13030
+ *
13038
13031
  * @public exported from `@promptbook/utils`
13039
13032
  */
13040
13033
  function unwrapResult(text, options) {
@@ -13109,9 +13102,7 @@ function unwrapResult(text, options) {
13109
13102
  return processedText;
13110
13103
  }
13111
13104
  }
13112
- /**
13113
- * TODO: [🧠] Should this also unwrap the (parenthesis)
13114
- */
13105
+ // TODO: [🧠] Should this also unwrap the (parenthesis)
13115
13106
 
13116
13107
  // <- TODO: Auto convert to type `import { ... } from 'type-fest';`
13117
13108
  /**
@@ -13130,7 +13121,6 @@ function unwrapResult(text, options) {
13130
13121
  * - `Symbol` objects are not serializable
13131
13122
  * - And much more...
13132
13123
  *
13133
- *
13134
13124
  * @public exported from `@promptbook/utils`
13135
13125
  */
13136
13126
  function isSerializableAsJson(value) {
@@ -13142,15 +13132,14 @@ function isSerializableAsJson(value) {
13142
13132
  return false;
13143
13133
  }
13144
13134
  }
13145
- /**
13146
- * TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
13147
- * TODO: [🧠][💺] Can be done this on type-level?
13148
- */
13135
+ // TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
13136
+ // TODO: [🧠][💺] Can be done this on type-level?
13149
13137
 
13150
13138
  /**
13151
13139
  * Determines if the given path is a root path.
13152
13140
  *
13153
13141
  * Note: This does not check if the file exists only if the path is valid
13142
+ *
13154
13143
  * @public exported from `@promptbook/utils`
13155
13144
  */
13156
13145
  function isRootPath(value) {
@@ -13162,9 +13151,7 @@ function isRootPath(value) {
13162
13151
  }
13163
13152
  return false;
13164
13153
  }
13165
- /**
13166
- * TODO: [🍏] Make for MacOS paths
13167
- */
13154
+ // TODO: [🍏] Make for MacOS paths
13168
13155
 
13169
13156
  /**
13170
13157
  * Checks if an URL is reserved for private networks or localhost.
@@ -13210,6 +13197,7 @@ function isHostnameOnPrivateNetwork(hostname, options = {}) {
13210
13197
  * @param {string} url - The URL to check.
13211
13198
  * @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
13212
13199
  * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
13200
+ *
13213
13201
  * @public exported from `@promptbook/utils`
13214
13202
  */
13215
13203
  function isUrlOnPrivateNetwork(url, options = {}) {
@@ -13248,9 +13236,7 @@ function isValidAgentUrl(url) {
13248
13236
  */
13249
13237
  return true;
13250
13238
  }
13251
- /**
13252
- * TODO: [🐠] Maybe more info why the URL is invalid
13253
- */
13239
+ // TODO: [🐠] Maybe more info why the URL is invalid
13254
13240
 
13255
13241
  /**
13256
13242
  * Provides filesystem access (for example for Node.js-based scrapers)
@@ -13273,10 +13259,8 @@ function $provideFilesystemForNode(options) {
13273
13259
  watch,
13274
13260
  };
13275
13261
  }
13276
- /**
13277
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13278
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
13279
- */
13262
+ // 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
13263
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
13280
13264
 
13281
13265
  /**
13282
13266
  * Retrieves an intermediate source for a scraper based on the knowledge source.
@@ -13340,13 +13324,11 @@ async function getScraperIntermediateSource(source, options) {
13340
13324
  };
13341
13325
  return fileHandler;
13342
13326
  }
13343
- /**
13344
- * Note: Not using `FileCacheStorage` for two reasons:
13345
- * 1) Need to store more than serialized JSONs
13346
- * 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
13347
- * TODO: [🐱‍🐉][🧠] Make some smart crop
13348
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13349
- */
13327
+ // 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
13328
+ // Note: Not using `FileCacheStorage` for two reasons:
13329
+ // 1. Need to store more than serialized JSONs.
13330
+ // 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
13331
+ // TODO: [🐱‍🐉][🧠] Make some smart crop
13350
13332
 
13351
13333
  /**
13352
13334
  * Metadata of the scraper
@@ -13373,14 +13355,13 @@ const markdownScraperMetadata = $deepFreeze({
13373
13355
  * @public exported from `@promptbook/cli`
13374
13356
  */
13375
13357
  $scrapersMetadataRegister.register(markdownScraperMetadata);
13376
- /**
13377
- * Note: [💞] Ignore a discrepancy between file name and entity name
13378
- */
13358
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13379
13359
 
13380
13360
  /**
13381
13361
  * Scraper for markdown files
13382
13362
  *
13383
13363
  * @see `documentationUrl` for more details
13364
+ *
13384
13365
  * @public exported from `@promptbook/markdown-utils`
13385
13366
  */
13386
13367
  class MarkdownScraper {
@@ -13513,10 +13494,8 @@ class MarkdownScraper {
13513
13494
  return knowledge;
13514
13495
  }
13515
13496
  }
13516
- /**
13517
- * TODO: [🪂] Do it in parallel 11:11
13518
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
13519
- */
13497
+ // TODO: [🪂] Do it in parallel 11:11
13498
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
13520
13499
 
13521
13500
  /**
13522
13501
  * Metadata of the scraper
@@ -13543,9 +13522,7 @@ const websiteScraperMetadata = $deepFreeze({
13543
13522
  * @public exported from `@promptbook/cli`
13544
13523
  */
13545
13524
  $scrapersMetadataRegister.register(websiteScraperMetadata);
13546
- /**
13547
- * Note: [💞] Ignore a discrepancy between file name and entity name
13548
- */
13525
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13549
13526
 
13550
13527
  /**
13551
13528
  * Create a new showdown converter instance
@@ -13574,6 +13551,7 @@ function createShowdownConverter() {
13574
13551
  * Scraper for websites
13575
13552
  *
13576
13553
  * @see `documentationUrl` for more details
13554
+ *
13577
13555
  * @public exported from `@promptbook/website-crawler`
13578
13556
  */
13579
13557
  class WebsiteScraper {
@@ -13677,12 +13655,10 @@ class WebsiteScraper {
13677
13655
  return knowledge;
13678
13656
  }
13679
13657
  }
13680
- /**
13681
- * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
13682
- * TODO: [🪂] Do it in parallel 11:11
13683
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
13684
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13685
- */
13658
+ // 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
13659
+ // TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
13660
+ // TODO: [🪂] Do it in parallel 11:11
13661
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
13686
13662
 
13687
13663
  /**
13688
13664
  * Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
@@ -13693,14 +13669,14 @@ class WebsiteScraper {
13693
13669
  * 3. Uses the appropriate scraper to convert to markdown
13694
13670
  * 4. Returns the scraped markdown content
13695
13671
  *
13672
+ * WARNING: This function should NOT be used directly in browser environments.
13673
+ * For browser environments, use fetchUrlContentViaBrowser which proxies through
13674
+ * the Agents Server API endpoint at /api/scrape
13675
+ *
13696
13676
  * @param url The URL to fetch and scrape
13697
13677
  * @returns Markdown content from the URL
13698
13678
  *
13699
13679
  * @private internal utility for USE BROWSER commitment
13700
- *
13701
- * WARNING: This function should NOT be used directly in browser environments.
13702
- * For browser environments, use fetchUrlContentViaBrowser which proxies through
13703
- * the Agents Server API endpoint at /api/scrape
13704
13680
  */
13705
13681
  async function fetchUrlContent(url) {
13706
13682
  try {
@@ -13804,9 +13780,7 @@ async function fetchUrlContent(url) {
13804
13780
  `);
13805
13781
  }
13806
13782
  }
13807
- /**
13808
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13809
- */
13783
+ // 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
13810
13784
 
13811
13785
  /**
13812
13786
  * Cached implementation of `run_browser` when it can be resolved.
@@ -13824,6 +13798,7 @@ let cachedRunBrowserToolError = null;
13824
13798
  * Attempts to load the server-side `run_browser` tool lazily.
13825
13799
  *
13826
13800
  * @returns Loaded `run_browser` implementation
13801
+ *
13827
13802
  * @private internal utility for USE BROWSER commitment
13828
13803
  */
13829
13804
  function loadRunBrowserToolForNode() {
@@ -14193,9 +14168,7 @@ class ActionCommitmentDefinition extends BaseCommitmentDefinition {
14193
14168
  return this.appendToSystemMessage(requirements, actionSection, '\n\n');
14194
14169
  }
14195
14170
  }
14196
- /**
14197
- * Note: [💞] Ignore a discrepancy between file name and entity name
14198
- */
14171
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14199
14172
 
14200
14173
  /**
14201
14174
  * CLOSED commitment definition
@@ -14261,9 +14234,7 @@ class ClosedCommitmentDefinition extends BaseCommitmentDefinition {
14261
14234
  };
14262
14235
  }
14263
14236
  }
14264
- /**
14265
- * Note: [💞] Ignore a discrepancy between file name and entity name
14266
- */
14237
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14267
14238
 
14268
14239
  /**
14269
14240
  * COMPONENT commitment definition
@@ -14322,9 +14293,7 @@ class ComponentCommitmentDefinition extends BaseCommitmentDefinition {
14322
14293
  return this.appendToSystemMessage(requirements, componentSection, '\n\n');
14323
14294
  }
14324
14295
  }
14325
- /**
14326
- * Note: [💞] Ignore a discrepancy between file name and entity name
14327
- */
14296
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14328
14297
 
14329
14298
  /**
14330
14299
  * DELETE commitment definition
@@ -14446,9 +14415,7 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
14446
14415
  return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
14447
14416
  }
14448
14417
  }
14449
- /**
14450
- * Note: [💞] Ignore a discrepancy between file name and entity name
14451
- */
14418
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14452
14419
 
14453
14420
  /**
14454
14421
  * DICTIONARY commitment definition
@@ -14552,9 +14519,7 @@ class DictionaryCommitmentDefinition extends BaseCommitmentDefinition {
14552
14519
  };
14553
14520
  }
14554
14521
  }
14555
- /**
14556
- * Note: [💞] Ignore a discrepancy between file name and entity name
14557
- */
14522
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14558
14523
 
14559
14524
  /**
14560
14525
  * FORMAT commitment definition
@@ -14633,10 +14598,11 @@ class FormatCommitmentDefinition extends BaseCommitmentDefinition {
14633
14598
  return this.appendToSystemMessage(requirements, formatSection, '\n\n');
14634
14599
  }
14635
14600
  }
14601
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14602
+
14636
14603
  /**
14637
- * Note: [💞] Ignore a discrepancy between file name and entity name
14604
+ * Collection of firstnames.
14638
14605
  */
14639
-
14640
14606
  const FIRSTNAMES = [
14641
14607
  'Paul',
14642
14608
  'George',
@@ -14673,6 +14639,9 @@ const FIRSTNAMES = [
14673
14639
  'Anthony',
14674
14640
  'Christopher',
14675
14641
  ];
14642
+ /**
14643
+ * Collection of lastnames with colors.
14644
+ */
14676
14645
  const LASTNAMES_WITH_COLORS = [
14677
14646
  { lastname: 'Green', color: '#008000' },
14678
14647
  { lastname: 'Brown', color: '#A52A2A' },
@@ -14700,6 +14669,7 @@ function pickDeterministicItem(hash, startIndex, list) {
14700
14669
  *
14701
14670
  * @param seed - Input seed used to derive a stable pseudonym.
14702
14671
  * @returns Deterministic English full name with color metadata.
14672
+ *
14703
14673
  * @private internal helper for deterministic pseudonym generation
14704
14674
  */
14705
14675
  function generateDeterministicEnglishName(seed) {
@@ -14741,6 +14711,9 @@ const VOID_PSEUDO_AGENT_ALIAS_KEYS = ['void', 'null', 'none', 'nil'];
14741
14711
  * Legacy aliases that historically behaved like `FROM VOID`.
14742
14712
  */
14743
14713
  const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
14714
+ /**
14715
+ * Constant for void alias entries.
14716
+ */
14744
14717
  const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
14745
14718
  alias,
14746
14719
  'VOID',
@@ -14789,6 +14762,7 @@ function normalizePseudoReferenceKey(rawReference) {
14789
14762
  *
14790
14763
  * @param rawReference - Raw reference token or payload.
14791
14764
  * @returns Pseudo-agent kind or `null` when the reference is not pseudo.
14765
+ *
14792
14766
  * @private internal utility of pseudo-agent resolution
14793
14767
  */
14794
14768
  function resolvePseudoAgentKindFromReference(rawReference) {
@@ -14803,6 +14777,7 @@ function resolvePseudoAgentKindFromReference(rawReference) {
14803
14777
  *
14804
14778
  * @param agentUrl - URL to inspect.
14805
14779
  * @returns Pseudo-agent kind or `null` when the URL is not pseudo.
14780
+ *
14806
14781
  * @private internal utility of pseudo-agent resolution
14807
14782
  */
14808
14783
  function resolvePseudoAgentKindFromUrl(agentUrl) {
@@ -14823,6 +14798,7 @@ function resolvePseudoAgentKindFromUrl(agentUrl) {
14823
14798
  *
14824
14799
  * @param teamCommitmentContent - TEAM commitment content after reference resolution.
14825
14800
  * @returns Deterministic English full name representing pseudo-user in that TEAM context.
14801
+ *
14826
14802
  * @private internal utility of TEAM commitment rendering
14827
14803
  */
14828
14804
  function createPseudoUserTeammateLabel(teamCommitmentContent) {
@@ -14838,6 +14814,7 @@ function createPseudoUserTeammateLabel(teamCommitmentContent) {
14838
14814
  *
14839
14815
  * @param rawReference - Raw reference content.
14840
14816
  * @returns True when the reference maps to void.
14817
+ *
14841
14818
  * @private internal utility of pseudo-agent resolution
14842
14819
  */
14843
14820
  function isVoidPseudoAgentReference(rawReference) {
@@ -14851,9 +14828,7 @@ function isVoidPseudoAgentReference(rawReference) {
14851
14828
  const normalizedReference = normalizePseudoReferenceKey(rawReference);
14852
14829
  return LEGACY_VOID_ALIASES.has(normalizedReference);
14853
14830
  }
14854
- /**
14855
- * Note: [💞] Ignore a discrepancy between file name and entity name
14856
- */
14831
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14857
14832
 
14858
14833
  /**
14859
14834
  * FROM commitment definition
@@ -14932,9 +14907,7 @@ class FromCommitmentDefinition extends BaseCommitmentDefinition {
14932
14907
  };
14933
14908
  }
14934
14909
  }
14935
- /**
14936
- * Note: [💞] Ignore a discrepancy between file name and entity name
14937
- */
14910
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14938
14911
 
14939
14912
  /**
14940
14913
  * GOAL commitment definition
@@ -15032,9 +15005,7 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
15032
15005
  return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
15033
15006
  }
15034
15007
  }
15035
- /**
15036
- * Note: [💞] Ignore a discrepancy between file name and entity name
15037
- */
15008
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15038
15009
 
15039
15010
  /**
15040
15011
  * IMPORT commitment definition
@@ -15113,19 +15084,26 @@ class ImportCommitmentDefinition extends BaseCommitmentDefinition {
15113
15084
  `));
15114
15085
  }
15115
15086
  }
15087
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15088
+
15116
15089
  /**
15117
- * Note: [💞] Ignore a discrepancy between file name and entity name
15090
+ * Matches URL-like candidates inside arbitrary text.
15091
+ *
15092
+ * @private
15118
15093
  */
15119
-
15120
- /** @private Matches URL-like candidates inside arbitrary text. */
15121
15094
  const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
15122
- /** @private Trims punctuation that commonly trails URLs in prose. */
15095
+ /**
15096
+ * Trims punctuation that commonly trails URLs in prose.
15097
+ *
15098
+ * @private
15099
+ */
15123
15100
  const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
15124
15101
  /**
15125
15102
  * Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
15126
15103
  *
15127
15104
  * @param text - Input text that may contain one or more URLs.
15128
15105
  * @returns Unique URLs in their first-seen order.
15106
+ *
15129
15107
  * @private utility of KNOWLEDGE parsing
15130
15108
  */
15131
15109
  function extractUrlsFromText(text) {
@@ -15155,7 +15133,9 @@ function extractUrlsFromText(text) {
15155
15133
  return urls;
15156
15134
  }
15157
15135
  /**
15158
- * @private Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
15136
+ * Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
15137
+ *
15138
+ * @private
15159
15139
  */
15160
15140
  function normalizeUrlCandidate(candidate) {
15161
15141
  let normalized = candidate.trim();
@@ -15175,7 +15155,9 @@ function normalizeUrlCandidate(candidate) {
15175
15155
  return normalized;
15176
15156
  }
15177
15157
  /**
15178
- * @private Removes trailing closing wrappers when they are unmatched in the candidate.
15158
+ * Removes trailing closing wrappers when they are unmatched in the candidate.
15159
+ *
15160
+ * @private
15179
15161
  */
15180
15162
  function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
15181
15163
  let normalized = candidate;
@@ -15190,7 +15172,9 @@ function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
15190
15172
  return normalized;
15191
15173
  }
15192
15174
  /**
15193
- * @private Counts character occurrences in a string.
15175
+ * Counts character occurrences in a string.
15176
+ *
15177
+ * @private
15194
15178
  */
15195
15179
  function countOccurrences(value, searchedChar) {
15196
15180
  let count = 0;
@@ -15202,14 +15186,28 @@ function countOccurrences(value, searchedChar) {
15202
15186
  return count;
15203
15187
  }
15204
15188
 
15205
- /** @private The default base name for inline knowledge files when the content lacks identifying text */
15189
+ /**
15190
+ * The default base name for inline knowledge files when the content lacks identifying text.
15191
+ *
15192
+ * @private
15193
+ */
15206
15194
  const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
15207
- /** @private The default file extension used for inline knowledge uploads */
15195
+ /**
15196
+ * The default file extension used for inline knowledge uploads.
15197
+ *
15198
+ * @private
15199
+ */
15208
15200
  const INLINE_KNOWLEDGE_EXTENSION = '.txt';
15209
- /** @private Prefix that identifies base64 data URLs */
15201
+ /**
15202
+ * Prefix that identifies base64 data URLs.
15203
+ *
15204
+ * @private
15205
+ */
15210
15206
  const DATA_URL_PREFIX = 'data:';
15211
15207
  /**
15212
- * @private Retrieves the first meaningful line from the inline content.
15208
+ * Retrieves the first meaningful line from the inline content.
15209
+ *
15210
+ * @private
15213
15211
  */
15214
15212
  function getFirstNonEmptyLine(content) {
15215
15213
  const lines = content.split(/\r?\n/);
@@ -15222,7 +15220,9 @@ function getFirstNonEmptyLine(content) {
15222
15220
  return null;
15223
15221
  }
15224
15222
  /**
15225
- * @private Determines the base file name by normalizing the first non-empty line.
15223
+ * Determines the base file name by normalizing the first non-empty line.
15224
+ *
15225
+ * @private
15226
15226
  */
15227
15227
  function deriveBaseFilename(content) {
15228
15228
  const firstLine = getFirstNonEmptyLine(content);
@@ -15233,7 +15233,9 @@ function deriveBaseFilename(content) {
15233
15233
  return normalized || INLINE_KNOWLEDGE_BASE_NAME;
15234
15234
  }
15235
15235
  /**
15236
- * @private Converts inline knowledge into the internal metadata form used for uploads.
15236
+ * Converts inline knowledge into the internal metadata form used for uploads.
15237
+ *
15238
+ * @private
15237
15239
  */
15238
15240
  function createInlineKnowledgeSourceFile(content) {
15239
15241
  const trimmedContent = content.trim();
@@ -15256,7 +15258,9 @@ function isDataUrlKnowledgeSource(source) {
15256
15258
  return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
15257
15259
  }
15258
15260
  /**
15259
- * @private Converts a stored inline knowledge file into a data URL for backwards compatibility.
15261
+ * Converts a stored inline knowledge file into a data URL for backwards compatibility.
15262
+ *
15263
+ * @private
15260
15264
  */
15261
15265
  function inlineKnowledgeSourceToDataUrl(source) {
15262
15266
  const base64 = source.buffer.toString('base64');
@@ -15316,9 +15320,7 @@ function parseDataUrlKnowledgeSource(source) {
15316
15320
  return null;
15317
15321
  }
15318
15322
  }
15319
- /**
15320
- * Note: [💞] Ignore a discrepancy between file name and entity name
15321
- */
15323
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15322
15324
 
15323
15325
  /**
15324
15326
  * KNOWLEDGE commitment definition
@@ -15522,9 +15524,7 @@ class LanguageCommitmentDefinition extends BaseCommitmentDefinition {
15522
15524
  return this.appendToSystemMessage(requirements, languageSection, '\n\n');
15523
15525
  }
15524
15526
  }
15525
- /**
15526
- * Note: [💞] Ignore a discrepancy between file name and entity name
15527
- */
15527
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15528
15528
 
15529
15529
  /**
15530
15530
  * @@@
@@ -15790,6 +15790,7 @@ function serializeToolRuntimeContext(context) {
15790
15790
  *
15791
15791
  * @param listener - Listener notified about tool progress.
15792
15792
  * @returns Hidden token used to route progress updates.
15793
+ *
15793
15794
  * @private internal runtime wiring for commitment tools
15794
15795
  */
15795
15796
  function registerToolCallProgressListener(listener) {
@@ -15802,14 +15803,13 @@ function registerToolCallProgressListener(listener) {
15802
15803
  * Unregisters one in-memory progress listener.
15803
15804
  *
15804
15805
  * @param token - Token previously created by `registerToolCallProgressListener`.
15806
+ *
15805
15807
  * @private internal runtime wiring for commitment tools
15806
15808
  */
15807
15809
  function unregisterToolCallProgressListener(token) {
15808
15810
  toolCallProgressListeners.delete(token);
15809
15811
  }
15810
- /**
15811
- * Note: [💞] Ignore a discrepancy between file name and entity name
15812
- */
15812
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15813
15813
 
15814
15814
  /**
15815
15815
  * Resolves runtime context from hidden tool arguments.
@@ -16170,9 +16170,7 @@ class MemoryCommitmentDefinition extends BaseCommitmentDefinition {
16170
16170
  return createMemoryToolFunctions();
16171
16171
  }
16172
16172
  }
16173
- /**
16174
- * Note: [💞] Ignore a discrepancy between file name and entity name
16175
- */
16173
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16176
16174
 
16177
16175
  /**
16178
16176
  * AGENT MESSAGE commitment definition
@@ -16502,9 +16500,7 @@ class MessageCommitmentDefinition extends BaseCommitmentDefinition {
16502
16500
  return this.appendToSystemMessage(requirements, messageSection, '\n\n');
16503
16501
  }
16504
16502
  }
16505
- /**
16506
- * Note: [💞] Ignore a discrepancy between file name and entity name
16507
- */
16503
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16508
16504
 
16509
16505
  /**
16510
16506
  * USER MESSAGE commitment definition
@@ -16635,9 +16631,7 @@ class MessageSuffixCommitmentDefinition extends BaseCommitmentDefinition {
16635
16631
  return requirements;
16636
16632
  }
16637
16633
  }
16638
- /**
16639
- * Note: [💞] Ignore a discrepancy between file name and entity name
16640
- */
16634
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16641
16635
 
16642
16636
  /**
16643
16637
  * META commitment definition
@@ -16784,9 +16778,7 @@ class MetaCommitmentDefinition extends BaseCommitmentDefinition {
16784
16778
  return knownTypes.includes(metaType.toUpperCase());
16785
16779
  }
16786
16780
  }
16787
- /**
16788
- * Note: [💞] Ignore a discrepancy between file name and entity name
16789
- */
16781
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16790
16782
 
16791
16783
  /**
16792
16784
  * META COLOR commitment definition
@@ -16882,9 +16874,7 @@ class MetaColorCommitmentDefinition extends BaseCommitmentDefinition {
16882
16874
  return trimmedContent || null;
16883
16875
  }
16884
16876
  }
16885
- /**
16886
- * Note: [💞] Ignore a discrepancy between file name and entity name
16887
- */
16877
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16888
16878
 
16889
16879
  /**
16890
16880
  * META DOMAIN commitment definition
@@ -16949,9 +16939,7 @@ class MetaDomainCommitmentDefinition extends BaseCommitmentDefinition {
16949
16939
  return trimmedContent || null;
16950
16940
  }
16951
16941
  }
16952
- /**
16953
- * Note: [💞] Ignore a discrepancy between file name and entity name
16954
- */
16942
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16955
16943
 
16956
16944
  /**
16957
16945
  * META DISCLAIMER commitment definition
@@ -17019,9 +17007,7 @@ class MetaDisclaimerCommitmentDefinition extends BaseCommitmentDefinition {
17019
17007
  return requirements;
17020
17008
  }
17021
17009
  }
17022
- /**
17023
- * Note: [💞] Ignore a discrepancy between file name and entity name
17024
- */
17010
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17025
17011
 
17026
17012
  /**
17027
17013
  * META FONT commitment definition
@@ -17104,9 +17090,7 @@ class MetaFontCommitmentDefinition extends BaseCommitmentDefinition {
17104
17090
  return trimmedContent || null;
17105
17091
  }
17106
17092
  }
17107
- /**
17108
- * Note: [💞] Ignore a discrepancy between file name and entity name
17109
- */
17093
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17110
17094
 
17111
17095
  /**
17112
17096
  * META IMAGE commitment definition
@@ -17191,9 +17175,7 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
17191
17175
  return trimmedContent || null;
17192
17176
  }
17193
17177
  }
17194
- /**
17195
- * Note: [💞] Ignore a discrepancy between file name and entity name
17196
- */
17178
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17197
17179
 
17198
17180
  /**
17199
17181
  * META INPUT PLACEHOLDER commitment definition.
@@ -17256,9 +17238,7 @@ class MetaInputPlaceholderCommitmentDefinition extends BaseCommitmentDefinition
17256
17238
  return trimmedContent || null;
17257
17239
  }
17258
17240
  }
17259
- /**
17260
- * Note: [💞] Ignore a discrepancy between file name and entity name
17261
- */
17241
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17262
17242
 
17263
17243
  /**
17264
17244
  * META LINK commitment definition
@@ -17365,9 +17345,7 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
17365
17345
  }
17366
17346
  }
17367
17347
  }
17368
- /**
17369
- * Note: [💞] Ignore a discrepancy between file name and entity name
17370
- */
17348
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17371
17349
 
17372
17350
  /**
17373
17351
  * META VOICE commitment definition
@@ -17436,9 +17414,7 @@ class MetaVoiceCommitmentDefinition extends BaseCommitmentDefinition {
17436
17414
  return trimmedContent || null;
17437
17415
  }
17438
17416
  }
17439
- /**
17440
- * Note: [💞] Ignore a discrepancy between file name and entity name
17441
- */
17417
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17442
17418
 
17443
17419
  /**
17444
17420
  * MODEL commitment definition
@@ -17676,9 +17652,7 @@ class ModelCommitmentDefinition extends BaseCommitmentDefinition {
17676
17652
  return result;
17677
17653
  }
17678
17654
  }
17679
- /**
17680
- * Note: [💞] Ignore a discrepancy between file name and entity name
17681
- */
17655
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17682
17656
 
17683
17657
  /**
17684
17658
  * NOTE commitment definition
@@ -17840,9 +17814,7 @@ class OpenCommitmentDefinition extends BaseCommitmentDefinition {
17840
17814
  };
17841
17815
  }
17842
17816
  }
17843
- /**
17844
- * Note: [💞] Ignore a discrepancy between file name and entity name
17845
- */
17817
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17846
17818
 
17847
17819
  /**
17848
17820
  * PERSONA commitment definition
@@ -17981,9 +17953,7 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
17981
17953
  };
17982
17954
  }
17983
17955
  }
17984
- /**
17985
- * Note: [💞] Ignore a discrepancy between file name and entity name
17986
- */
17956
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17987
17957
 
17988
17958
  /**
17989
17959
  * RULE commitment definition
@@ -18064,15 +18034,14 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
18064
18034
  return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
18065
18035
  }
18066
18036
  }
18067
- /**
18068
- * Note: [💞] Ignore a discrepancy between file name and entity name
18069
- */
18037
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18070
18038
 
18071
18039
  /**
18072
18040
  * Creates the canonical system-message body for one writing-sample commitment.
18073
18041
  *
18074
18042
  * @param content - Explicit 1:1 sample text.
18075
18043
  * @returns Writing-sample guidance ready for one system-message section.
18044
+ *
18076
18045
  * @private internal utility of writing commitments
18077
18046
  */
18078
18047
  function createWritingSampleSection(content) {
@@ -18090,6 +18059,7 @@ function createWritingSampleSection(content) {
18090
18059
  *
18091
18060
  * @param content - Writing-only instructions.
18092
18061
  * @returns Writing-rules guidance ready for one system-message section.
18062
+ *
18093
18063
  * @private internal utility of writing commitments
18094
18064
  */
18095
18065
  function createWritingRulesSection(content) {
@@ -18102,9 +18072,7 @@ function createWritingRulesSection(content) {
18102
18072
  ${content}
18103
18073
  `);
18104
18074
  }
18105
- /**
18106
- * Note: [💞] Ignore a discrepancy between file name and entity name
18107
- */
18075
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18108
18076
 
18109
18077
  /**
18110
18078
  * Legacy `SAMPLE` / `EXAMPLE` commitment definition.
@@ -18183,9 +18151,7 @@ class SampleCommitmentDefinition extends BaseCommitmentDefinition {
18183
18151
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
18184
18152
  }
18185
18153
  }
18186
- /**
18187
- * Note: [💞] Ignore a discrepancy between file name and entity name
18188
- */
18154
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18189
18155
 
18190
18156
  /**
18191
18157
  * SCENARIO commitment definition
@@ -18307,9 +18273,7 @@ class ScenarioCommitmentDefinition extends BaseCommitmentDefinition {
18307
18273
  return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
18308
18274
  }
18309
18275
  }
18310
- /**
18311
- * Note: [💞] Ignore a discrepancy between file name and entity name
18312
- */
18276
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18313
18277
 
18314
18278
  /**
18315
18279
  * STYLE commitment definition
@@ -18406,6 +18370,7 @@ const TEAM_TOOL_FALLBACK_NAME = 'teammate';
18406
18370
  *
18407
18371
  * @param teammateLabel - Human-readable teammate label.
18408
18372
  * @returns Normalized teammate identifier for TEAM tool names.
18373
+ *
18409
18374
  * @private internal helper of TEAM tool-name generation
18410
18375
  */
18411
18376
  function normalizeTeammateToolNamePart(teammateLabel) {
@@ -18421,6 +18386,7 @@ function normalizeTeammateToolNamePart(teammateLabel) {
18421
18386
  * @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
18422
18387
  * @param teammateLabel - Human-readable teammate label used as the basis for the name.
18423
18388
  * @returns TEAM tool name derived from the label.
18389
+ *
18424
18390
  * @private internal utility of TEAM commitments and chat UI mapping
18425
18391
  */
18426
18392
  function createTeamToolName(_teammateUrl, teammateLabel) {
@@ -18428,9 +18394,21 @@ function createTeamToolName(_teammateUrl, teammateLabel) {
18428
18394
  return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
18429
18395
  }
18430
18396
 
18397
+ /**
18398
+ * Pattern matching agent URLs inside TEAM commitment content.
18399
+ */
18431
18400
  const urlRegex = /https?:\/\/[^\s]+/gi;
18401
+ /**
18402
+ * Pattern matching punctuation that often trails teammate URLs in prose.
18403
+ */
18432
18404
  const trailingPunctuationRegex = /[),.;!?]+$/;
18405
+ /**
18406
+ * Clause separators used while splitting TEAM instruction context.
18407
+ */
18433
18408
  const clauseSeparators = ['.', '?', '!', ';', ','];
18409
+ /**
18410
+ * Conjunction separators used while splitting TEAM instruction context.
18411
+ */
18434
18412
  const conjunctionSeparators = [' and ', ' or '];
18435
18413
  /**
18436
18414
  * Parses TEAM commitment content into teammates with instructions.
@@ -18478,6 +18456,9 @@ function parseTeamCommitmentContent(content, options = {}) {
18478
18456
  }
18479
18457
  return teammates;
18480
18458
  }
18459
+ /**
18460
+ * Extracts the instruction fragment associated with one teammate URL.
18461
+ */
18481
18462
  function extractInstructionContext(line, matches, matchIndex) {
18482
18463
  var _a;
18483
18464
  const match = matches[matchIndex];
@@ -18503,6 +18484,9 @@ function extractInstructionContext(line, matches, matchIndex) {
18503
18484
  }
18504
18485
  return `${prefix} ${suffix}`.trim();
18505
18486
  }
18487
+ /**
18488
+ * Trims content after the last detected clause delimiter.
18489
+ */
18506
18490
  function trimAfterLastDelimiter(text) {
18507
18491
  const match = findLastDelimiter(text);
18508
18492
  if (!match) {
@@ -18510,6 +18494,9 @@ function trimAfterLastDelimiter(text) {
18510
18494
  }
18511
18495
  return text.slice(match.index + match.length);
18512
18496
  }
18497
+ /**
18498
+ * Trims content before the last detected clause delimiter.
18499
+ */
18513
18500
  function trimBeforeLastDelimiter(text) {
18514
18501
  const cleaned = text.replace(/^[,;:]\s*/g, '');
18515
18502
  const match = findLastDelimiter(cleaned);
@@ -18518,6 +18505,9 @@ function trimBeforeLastDelimiter(text) {
18518
18505
  }
18519
18506
  return cleaned.slice(0, match.index);
18520
18507
  }
18508
+ /**
18509
+ * Finds the last clause or conjunction delimiter in a string.
18510
+ */
18521
18511
  function findLastDelimiter(text) {
18522
18512
  let bestIndex = -1;
18523
18513
  let bestLength = 0;
@@ -18541,6 +18531,9 @@ function findLastDelimiter(text) {
18541
18531
  }
18542
18532
  return { index: bestIndex, length: bestLength };
18543
18533
  }
18534
+ /**
18535
+ * Normalizes teammate instruction text after URL extraction.
18536
+ */
18544
18537
  function normalizeInstructionText(text) {
18545
18538
  if (!text) {
18546
18539
  return '';
@@ -18554,6 +18547,9 @@ function normalizeInstructionText(text) {
18554
18547
  normalized = normalizeWhitespaces(normalized).trim();
18555
18548
  return normalized;
18556
18549
  }
18550
+ /**
18551
+ * Creates a readable teammate label from an agent URL.
18552
+ */
18557
18553
  function createTeammateLabel(url) {
18558
18554
  try {
18559
18555
  const parsed = new URL(url);
@@ -18573,12 +18569,19 @@ function createTeammateLabel(url) {
18573
18569
  return url;
18574
18570
  }
18575
18571
  }
18572
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18573
+
18576
18574
  /**
18577
- * Note: [💞] Ignore a discrepancy between file name and entity name
18575
+ * Map of team tool functions.
18578
18576
  */
18579
-
18580
18577
  const teamToolFunctions = {};
18578
+ /**
18579
+ * Map of team tool titles.
18580
+ */
18581
18581
  const teamToolTitles = {};
18582
+ /**
18583
+ * Constant for remote agents by Url.
18584
+ */
18582
18585
  const remoteAgentsByUrl = new Map();
18583
18586
  /**
18584
18587
  * TEAM commitment definition
@@ -18942,9 +18945,7 @@ function createTeamToolFunction(entry) {
18942
18945
  return JSON.stringify(result);
18943
18946
  };
18944
18947
  }
18945
- /**
18946
- * Note: [💞] Ignore a discrepancy between file name and entity name
18947
- */
18948
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18948
18949
 
18949
18950
  /**
18950
18951
  * TEMPLATE commitment definition
@@ -19065,9 +19066,7 @@ class TemplateCommitmentDefinition extends BaseCommitmentDefinition {
19065
19066
  };
19066
19067
  }
19067
19068
  }
19068
- /**
19069
- * Note: [💞] Ignore a discrepancy between file name and entity name
19070
- */
19069
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19071
19070
 
19072
19071
  /**
19073
19072
  * USE commitment definition
@@ -19179,9 +19178,7 @@ class UseCommitmentDefinition extends BaseCommitmentDefinition {
19179
19178
  return knownTypes.includes(useType.toUpperCase());
19180
19179
  }
19181
19180
  }
19182
- /**
19183
- * Note: [💞] Ignore a discrepancy between file name and entity name
19184
- */
19181
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19185
19182
 
19186
19183
  /**
19187
19184
  * All `USE` commitment types currently participating in final system-message aggregation.
@@ -19204,6 +19201,7 @@ const AGGREGATED_USE_COMMITMENT_PLACEHOLDER_PREFIX = '# AGGREGATED USE COMMITMEN
19204
19201
  *
19205
19202
  * @param type - Commitment type to check.
19206
19203
  * @returns `true` when the commitment participates in `USE` system-message aggregation.
19204
+ *
19207
19205
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
19208
19206
  */
19209
19207
  function isAggregatedUseCommitmentType(type) {
@@ -19214,6 +19212,7 @@ function isAggregatedUseCommitmentType(type) {
19214
19212
  *
19215
19213
  * @param type - Aggregated `USE` commitment type.
19216
19214
  * @returns Single-line placeholder comment stored in the interim system message.
19215
+ *
19217
19216
  * @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
19218
19217
  */
19219
19218
  function getAggregatedUseCommitmentPlaceholder(type) {
@@ -19224,6 +19223,7 @@ function getAggregatedUseCommitmentPlaceholder(type) {
19224
19223
  *
19225
19224
  * @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
19226
19225
  * @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
19226
+ *
19227
19227
  * @private internal utility of `createAggregatedUseCommitmentSystemMessage`
19228
19228
  */
19229
19229
  function combineAdditionalInstructions(additionalInstructions) {
@@ -19235,6 +19235,7 @@ function combineAdditionalInstructions(additionalInstructions) {
19235
19235
  * @param type - Aggregated `USE` commitment type.
19236
19236
  * @param additionalInstructions - Distinct additional instructions in source order.
19237
19237
  * @returns Final system-message block for the commitment type.
19238
+ *
19238
19239
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
19239
19240
  */
19240
19241
  function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
@@ -19273,6 +19274,7 @@ function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions
19273
19274
  * @param requirements - Current model requirements.
19274
19275
  * @param type - Aggregated `USE` commitment type being applied.
19275
19276
  * @returns Requirements with the placeholder inserted when it was not already present.
19277
+ *
19276
19278
  * @private internal utility of `USE` commitments
19277
19279
  */
19278
19280
  function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
@@ -19296,6 +19298,7 @@ function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
19296
19298
  * @param requirements - Model requirements produced by commitment-by-commitment application.
19297
19299
  * @param commitments - Filtered commitments in their original source order.
19298
19300
  * @returns Requirements with aggregated `USE` system-message sections.
19301
+ *
19299
19302
  * @private internal utility of `createAgentModelRequirementsWithCommitments`
19300
19303
  */
19301
19304
  function aggregateUseCommitmentSystemMessages(requirements, commitments) {
@@ -19588,9 +19591,7 @@ class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition {
19588
19591
  };
19589
19592
  }
19590
19593
  }
19591
- /**
19592
- * Note: [💞] Ignore a discrepancy between file name and entity name
19593
- */
19594
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19594
19595
 
19595
19596
  /**
19596
19597
  * Base Google Calendar API URL.
@@ -19861,9 +19862,7 @@ function removeTokenFromLine(line, token) {
19861
19862
  const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
19862
19863
  return filteredTokens.join(' ').trim();
19863
19864
  }
19864
- /**
19865
- * Note: [💞] Ignore a discrepancy between file name and entity name
19866
- */
19865
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19867
19866
 
19868
19867
  /**
19869
19868
  * Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
@@ -20814,9 +20813,7 @@ function addConfiguredCalendarIfMissing(configuredCalendars, calendarReference)
20814
20813
  ...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
20815
20814
  });
20816
20815
  }
20817
- /**
20818
- * Note: [💞] Ignore a discrepancy between file name and entity name
20819
- */
20816
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20820
20817
 
20821
20818
  /**
20822
20819
  * Lightweight email token matcher used for `USE EMAIL` first-line parsing.
@@ -21082,9 +21079,7 @@ function addUseEmailTools(existingTools) {
21082
21079
  },
21083
21080
  ];
21084
21081
  }
21085
- /**
21086
- * Note: [💞] Ignore a discrepancy between file name and entity name
21087
- */
21082
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21088
21083
 
21089
21084
  /**
21090
21085
  * USE IMAGE GENERATOR commitment definition
@@ -21175,9 +21170,7 @@ class UseImageGeneratorCommitmentDefinition extends BaseCommitmentDefinition {
21175
21170
  `));
21176
21171
  }
21177
21172
  }
21178
- /**
21179
- * Note: [💞] Ignore a discrepancy between file name and entity name
21180
- */
21173
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21181
21174
 
21182
21175
  /**
21183
21176
  * USE MCP commitment definition
@@ -21252,9 +21245,7 @@ class UseMcpCommitmentDefinition extends BaseCommitmentDefinition {
21252
21245
  };
21253
21246
  }
21254
21247
  }
21255
- /**
21256
- * Note: [💞] Ignore a discrepancy between file name and entity name
21257
- */
21248
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21258
21249
 
21259
21250
  /**
21260
21251
  * USE POPUP commitment definition
@@ -21390,9 +21381,7 @@ class UsePopupCommitmentDefinition extends BaseCommitmentDefinition {
21390
21381
  };
21391
21382
  }
21392
21383
  }
21393
- /**
21394
- * Note: [💞] Ignore a discrepancy between file name and entity name
21395
- */
21384
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21396
21385
 
21397
21386
  /**
21398
21387
  * Tool name used by the USE PRIVACY commitment.
@@ -21564,9 +21553,7 @@ class UsePrivacyCommitmentDefinition extends BaseCommitmentDefinition {
21564
21553
  };
21565
21554
  }
21566
21555
  }
21567
- /**
21568
- * Note: [💞] Ignore a discrepancy between file name and entity name
21569
- */
21556
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21570
21557
 
21571
21558
  /* eslint-disable no-magic-numbers */
21572
21559
  /**
@@ -22354,9 +22341,7 @@ function createGitHubRepositoryReference(owner, repository, defaultBranch) {
22354
22341
  defaultBranch,
22355
22342
  };
22356
22343
  }
22357
- /**
22358
- * Note: [💞] Ignore a discrepancy between file name and entity name
22359
- */
22344
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22360
22345
 
22361
22346
  /**
22362
22347
  * Wallet metadata used by USE PROJECT when resolving GitHub credentials.
@@ -23215,9 +23200,7 @@ function addConfiguredProjectIfMissing(configuredProjects, repositoryReference)
23215
23200
  defaultBranch: repositoryReference.defaultBranch,
23216
23201
  });
23217
23202
  }
23218
- /**
23219
- * Note: [💞] Ignore a discrepancy between file name and entity name
23220
- */
23203
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23221
23204
 
23222
23205
  /**
23223
23206
  * A search engine implementation that uses the SerpApi to fetch Google search results.
@@ -23428,9 +23411,7 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
23428
23411
  };
23429
23412
  }
23430
23413
  }
23431
- /**
23432
- * Note: [💞] Ignore a discrepancy between file name and entity name
23433
- */
23414
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23434
23415
 
23435
23416
  /**
23436
23417
  * Maximum allowed source length for create-agent payloads.
@@ -23627,9 +23608,7 @@ class UseSpawnCommitmentDefinition extends BaseCommitmentDefinition {
23627
23608
  };
23628
23609
  }
23629
23610
  }
23630
- /**
23631
- * Note: [💞] Ignore a discrepancy between file name and entity name
23632
- */
23611
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23633
23612
 
23634
23613
  /**
23635
23614
  * Creates system-message instructions for `USE TIMEOUT`.
@@ -23694,9 +23673,7 @@ function parseToolExecutionEnvelope(rawValue) {
23694
23673
  return null;
23695
23674
  }
23696
23675
  }
23697
- /**
23698
- * Note: [💞] Ignore a discrepancy between file name and entity name
23699
- */
23676
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23700
23677
 
23701
23678
  /**
23702
23679
  * Builds a disabled timeout-tool payload.
@@ -24430,9 +24407,7 @@ class UseTimeoutCommitmentDefinition extends BaseCommitmentDefinition {
24430
24407
  return createTimeoutToolFunctions();
24431
24408
  }
24432
24409
  }
24433
- /**
24434
- * Note: [💞] Ignore a discrepancy between file name and entity name
24435
- */
24410
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24436
24411
 
24437
24412
  /**
24438
24413
  * USE TIME commitment definition
@@ -24579,9 +24554,7 @@ class UseTimeCommitmentDefinition extends BaseCommitmentDefinition {
24579
24554
  };
24580
24555
  }
24581
24556
  }
24582
- /**
24583
- * Note: [💞] Ignore a discrepancy between file name and entity name
24584
- */
24557
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24585
24558
 
24586
24559
  /**
24587
24560
  * Tool name used by the USE USER LOCATION commitment.
@@ -24794,9 +24767,7 @@ class UseUserLocationCommitmentDefinition extends BaseCommitmentDefinition {
24794
24767
  };
24795
24768
  }
24796
24769
  }
24797
- /**
24798
- * Note: [💞] Ignore a discrepancy between file name and entity name
24799
- */
24770
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24800
24771
 
24801
24772
  /**
24802
24773
  * `WRITING RULES` commitment definition.
@@ -24872,9 +24843,7 @@ class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
24872
24843
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
24873
24844
  }
24874
24845
  }
24875
- /**
24876
- * Note: [💞] Ignore a discrepancy between file name and entity name
24877
- */
24846
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24878
24847
 
24879
24848
  /**
24880
24849
  * `WRITING SAMPLE` commitment definition.
@@ -24944,9 +24913,7 @@ class WritingSampleCommitmentDefinition extends BaseCommitmentDefinition {
24944
24913
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
24945
24914
  }
24946
24915
  }
24947
- /**
24948
- * Note: [💞] Ignore a discrepancy between file name and entity name
24949
- */
24916
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24950
24917
 
24951
24918
  /**
24952
24919
  * Placeholder commitment definition for commitments that are not yet implemented
@@ -25108,13 +25075,12 @@ const COMMITMENT_REGISTRY = [
25108
25075
  new NotYetImplementedCommitmentDefinition('CONTEXT'),
25109
25076
  // <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
25110
25077
  ];
25111
- /**
25112
- * TODO: [🧠] Maybe create through standardized $register
25113
- * Note: [💞] Ignore a discrepancy between file name and entity name
25114
- */
25078
+ // TODO: [🧠] Maybe create through standardized $register
25079
+ // Note: [💞] Ignore a discrepancy between file name and entity name
25115
25080
 
25116
25081
  /**
25117
25082
  * Gets all available commitment definitions
25083
+ *
25118
25084
  * @returns Array of all commitment definitions
25119
25085
  *
25120
25086
  * @public exported from `@promptbook/core`
@@ -25127,6 +25093,7 @@ function getAllCommitmentDefinitions() {
25127
25093
  * Collects tool functions from all commitment definitions.
25128
25094
  *
25129
25095
  * @returns Map of tool function implementations.
25096
+ *
25130
25097
  * @private internal helper for commitment tool registry
25131
25098
  */
25132
25099
  function collectCommitmentToolFunctions() {
@@ -25148,6 +25115,7 @@ function collectCommitmentToolFunctions() {
25148
25115
  *
25149
25116
  * @param getFunctions - Provider of current tool functions.
25150
25117
  * @returns Proxy exposing tool functions as properties.
25118
+ *
25151
25119
  * @private internal helper for commitment tool registry
25152
25120
  */
25153
25121
  function createToolFunctionsProxy(getFunctions) {
@@ -25185,10 +25153,11 @@ function createToolFunctionsProxy(getFunctions) {
25185
25153
  },
25186
25154
  });
25187
25155
  }
25156
+ // Note: [💞] Ignore a discrepancy between file name and entity name
25157
+
25188
25158
  /**
25189
- * Note: [💞] Ignore a discrepancy between file name and entity name
25159
+ * Map of node tool functions.
25190
25160
  */
25191
-
25192
25161
  const nodeToolFunctions = {
25193
25162
  /**
25194
25163
  * @@@
@@ -25220,6 +25189,9 @@ const nodeToolFunctions = {
25220
25189
  spawn_agent: resolveSpawnAgentToolForNode(),
25221
25190
  // TODO: !!!! Unhardcode, make proper server function register from definitions
25222
25191
  };
25192
+ /**
25193
+ * Constant for node tool functions proxy.
25194
+ */
25223
25195
  const nodeToolFunctionsProxy = createToolFunctionsProxy(() => ({
25224
25196
  ...collectCommitmentToolFunctions(),
25225
25197
  ...nodeToolFunctions,
@@ -25243,10 +25215,8 @@ function getAllCommitmentsToolFunctionsForNode() {
25243
25215
  }
25244
25216
  return nodeToolFunctionsProxy;
25245
25217
  }
25246
- /**
25247
- * Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
25248
- * TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
25249
- */
25218
+ // Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
25219
+ // TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
25250
25220
 
25251
25221
  /**
25252
25222
  * Normalize options for `execCommand` and `execCommands`
@@ -25314,7 +25284,6 @@ function $execCommandNormalizeOptions(options) {
25314
25284
  /**
25315
25285
  * Run one command in a shell
25316
25286
  *
25317
- *
25318
25287
  * Note: There are 2 similar functions in the codebase:
25319
25288
  * - `$execCommand` which runs a single command
25320
25289
  * - `$execCommands` which runs multiple commands
@@ -25413,9 +25382,7 @@ function $execCommand(options) {
25413
25382
  }
25414
25383
  });
25415
25384
  }
25416
- /**
25417
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25418
- */
25385
+ // 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
25419
25386
 
25420
25387
  /**
25421
25388
  * Attempts to locate the specified application on a Linux system using the 'which' command.
@@ -25433,10 +25400,8 @@ async function locateAppOnLinux({ linuxWhich, }) {
25433
25400
  return null;
25434
25401
  }
25435
25402
  }
25436
- /**
25437
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25438
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25439
- */
25403
+ // 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
25404
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25440
25405
 
25441
25406
  /**
25442
25407
  * Checks if the file is executable
@@ -25452,15 +25417,15 @@ async function isExecutable(path, fs) {
25452
25417
  return false;
25453
25418
  }
25454
25419
  }
25455
- /**
25456
- * Note: Not [~🟢~] because it is not directly dependent on `fs
25457
- * TODO: [🖇] What about symlinks?
25458
- */
25420
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
25421
+ // TODO: [🖇] What about symlinks?
25459
25422
 
25460
25423
  // Note: Module `userhome` has no types available, so it is imported using `require`
25461
25424
  // @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
25462
- // eslint-disable-next-line @typescript-eslint/no-var-requires
25463
- const userhome = require('userhome');
25425
+ /**
25426
+ * Constant for userhome.
25427
+ */
25428
+ const userhome = require('userhome'); // eslint-disable-line @typescript-eslint/no-var-requires
25464
25429
  /**
25465
25430
  * Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
25466
25431
  * Returns the path to the executable if found, or null otherwise.
@@ -25489,10 +25454,8 @@ async function locateAppOnMacOs({ macOsName, }) {
25489
25454
  return null;
25490
25455
  }
25491
25456
  }
25492
- /**
25493
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25494
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25495
- */
25457
+ // 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
25458
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25496
25459
 
25497
25460
  /**
25498
25461
  * Attempts to locate the specified application on a Windows system by searching common installation directories.
@@ -25521,10 +25484,8 @@ async function locateAppOnWindows({ appName, windowsSuffix, }) {
25521
25484
  return null;
25522
25485
  }
25523
25486
  }
25524
- /**
25525
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25526
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25527
- */
25487
+ // 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
25488
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25528
25489
 
25529
25490
  /**
25530
25491
  * Locates an application on the system
@@ -25561,10 +25522,8 @@ function locateApp(options) {
25561
25522
  }
25562
25523
  }
25563
25524
  }
25564
- /**
25565
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25566
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25567
- */
25525
+ // Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment
25526
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25568
25527
 
25569
25528
  /**
25570
25529
  * Locates the LibreOffice executable on the current system by searching platform-specific paths.
@@ -25580,10 +25539,8 @@ function locateLibreoffice() {
25580
25539
  macOsName: 'LibreOffice',
25581
25540
  });
25582
25541
  }
25583
- /**
25584
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
25585
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25586
- */
25542
+ // 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
25543
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
25587
25544
 
25588
25545
  /**
25589
25546
  * Locates the Pandoc executable on the current system by searching platform-specific paths.
@@ -25599,10 +25556,8 @@ function locatePandoc() {
25599
25556
  macOsName: 'Pandoc',
25600
25557
  });
25601
25558
  }
25602
- /**
25603
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
25604
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25605
- */
25559
+ // 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
25560
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
25606
25561
 
25607
25562
  /**
25608
25563
  * Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
@@ -25619,35 +25574,33 @@ async function $provideExecutablesForNode(options) {
25619
25574
  // <- TODO: [🧠] `null` vs `undefined`
25620
25575
  };
25621
25576
  }
25622
- /**
25623
- * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
25624
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25625
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
25626
- */
25577
+ // Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment
25578
+ // TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
25579
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
25627
25580
 
25628
25581
  /**
25629
25582
  * Register for LLM tools metadata.
25630
25583
  *
25631
25584
  * Note: `$` is used to indicate that this interacts with the global scope
25585
+ *
25632
25586
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
25587
+ *
25633
25588
  * @public exported from `@promptbook/core`
25634
25589
  */
25635
25590
  const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
25636
- /**
25637
- * TODO: [®] DRY Register logic
25638
- */
25591
+ // TODO: [®] DRY Register logic
25639
25592
 
25640
25593
  /**
25641
25594
  * Register for LLM tools.
25642
25595
  *
25643
25596
  * Note: `$` is used to indicate that this interacts with the global scope
25597
+ *
25644
25598
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
25599
+ *
25645
25600
  * @public exported from `@promptbook/core`
25646
25601
  */
25647
25602
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
25648
- /**
25649
- * TODO: [®] DRY Register logic
25650
- */
25603
+ // TODO: [®] DRY Register logic
25651
25604
 
25652
25605
  /**
25653
25606
  * Path to the `.env` file which was used to configure LLM tools
@@ -25784,10 +25737,8 @@ function $registeredLlmToolsMessage() {
25784
25737
  .join('\n'))}
25785
25738
  `);
25786
25739
  }
25787
- /**
25788
- * TODO: [®] DRY Register logic
25789
- * TODO: [🧠][⚛] Maybe pass env as argument
25790
- */
25740
+ // TODO: [®] DRY Register logic
25741
+ // TODO: [🧠][⚛] Maybe pass env as argument
25791
25742
 
25792
25743
  /**
25793
25744
  * Provides the path to the `.env` file
@@ -25829,9 +25780,7 @@ async function $provideEnvFilename() {
25829
25780
  }
25830
25781
  return null;
25831
25782
  }
25832
- /**
25833
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25834
- */
25783
+ // 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
25835
25784
 
25836
25785
  /**
25837
25786
  * Provides LLM tools configuration by reading environment variables.
@@ -25845,6 +25794,7 @@ async function $provideEnvFilename() {
25845
25794
  *
25846
25795
  * @see Environment variables documentation or .env file for required variables.
25847
25796
  * @returns A promise that resolves to the LLM tools configuration, or null if configuration is incomplete or missing.
25797
+ *
25848
25798
  * @public exported from `@promptbook/node`
25849
25799
  */
25850
25800
  async function $provideLlmToolsConfigurationFromEnv() {
@@ -25861,9 +25811,7 @@ async function $provideLlmToolsConfigurationFromEnv() {
25861
25811
  .filter((configuration) => configuration !== null);
25862
25812
  return llmToolsConfiguration;
25863
25813
  }
25864
- /**
25865
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25866
- */
25814
+ // 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
25867
25815
 
25868
25816
  /**
25869
25817
  * Creates LLM execution tools from provided configuration objects
@@ -25876,6 +25824,7 @@ async function $provideLlmToolsConfigurationFromEnv() {
25876
25824
  * @param configuration Array of LLM tool configurations to instantiate
25877
25825
  * @param options Additional options for configuring the LLM tools
25878
25826
  * @returns A unified interface combining all successfully instantiated LLM tools
25827
+ *
25879
25828
  * @public exported from `@promptbook/core`
25880
25829
  */
25881
25830
  function createLlmToolsFromConfiguration(configuration, options = {}) {
@@ -25945,6 +25894,7 @@ function createLlmToolsFromConfiguration(configuration, options = {}) {
25945
25894
  *
25946
25895
  * @param options Configuration options for the LLM tools
25947
25896
  * @returns A unified interface containing all detected and configured LLM tools
25897
+ *
25948
25898
  * @public exported from `@promptbook/node`
25949
25899
  */
25950
25900
  async function $provideLlmToolsFromEnv(options = {}) {
@@ -25969,29 +25919,26 @@ async function $provideLlmToolsFromEnv(options = {}) {
25969
25919
  }
25970
25920
  return createLlmToolsFromConfiguration(configuration, options);
25971
25921
  }
25972
- /**
25973
- * TODO: The architecture for LLM tools configuration consists of three key functions:
25974
- * 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
25975
- * 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
25976
- * 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
25977
- *
25978
- * This layered approach allows flexibility in how tools are configured:
25979
- * - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
25980
- * - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
25981
- * - Use createLlmToolsFromConfiguration for explicit control over tool configurations
25982
- *
25983
- * TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
25984
- * TODO: [🧠] Is there some meaningfull way how to test this util
25985
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25986
- * TODO: [🥃] Allow `ptbk make` without llm tools
25987
- * TODO: This should be maybe not under `_common` but under `utils`
25988
- * TODO: [®] DRY Register logic
25989
- */
25922
+ // 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
25923
+ // TODO: The architecture for LLM tools configuration consists of three key functions:
25924
+ // 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
25925
+ // 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
25926
+ // 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
25927
+ // This layered approach allows flexibility in how tools are configured:
25928
+ // - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
25929
+ // - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
25930
+ // - Use createLlmToolsFromConfiguration for explicit control over tool configurations
25931
+ // TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
25932
+ // TODO: [🧠] Is there some meaningfull way how to test this util
25933
+ // TODO: [🥃] Allow `ptbk make` without llm tools
25934
+ // TODO: This should be maybe not under `_common` but under `utils`
25935
+ // TODO: [®] DRY Register logic
25990
25936
 
25991
25937
  /**
25992
25938
  * Provides a collection of scrapers optimized for Node.js environment.
25993
25939
  * 1) `provideScrapersForNode` use as default
25994
25940
  * 2) `provideScrapersForBrowser` use in limited browser environment *
25941
+ *
25995
25942
  * @public exported from `@promptbook/node`
25996
25943
  */
25997
25944
  async function $provideScrapersForNode(tools, options) {
@@ -26011,10 +25958,8 @@ async function $provideScrapersForNode(tools, options) {
26011
25958
  }
26012
25959
  return scrapers;
26013
25960
  }
26014
- /**
26015
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26016
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26017
- */
25961
+ // 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
25962
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26018
25963
 
26019
25964
  /**
26020
25965
  * Extracts code block from markdown.
@@ -26027,8 +25972,9 @@ async function $provideScrapersForNode(tools, options) {
26027
25972
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
26028
25973
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
26029
25974
  *
26030
- * @public exported from `@promptbook/markdown-utils`
26031
25975
  * @throws {ParseError} if there is not exactly one code block in the markdown
25976
+ *
25977
+ * @public exported from `@promptbook/markdown-utils`
26032
25978
  */
26033
25979
  function extractBlock(markdown) {
26034
25980
  const { content } = extractOneBlockFromMarkdown(markdown);
@@ -26040,7 +25986,7 @@ function extractBlock(markdown) {
26040
25986
  *
26041
25987
  * Note: [🔂] This function is idempotent.
26042
25988
  * Note: This is useful for post-processing of the result of the chat LLM model
26043
- * when the model wraps the result in the (markdown) code block.
25989
+ * when the model wraps the result in the (markdown) code block.
26044
25990
  *
26045
25991
  * @public exported from `@promptbook/markdown-utils`
26046
25992
  */
@@ -26059,7 +26005,7 @@ function trimCodeBlock(value) {
26059
26005
  * Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
26060
26006
  *
26061
26007
  * Note: This is useful for post-processing of the result of the completion LLM model
26062
- * if you want to start code block in the prompt but you don't want to end it in the result.
26008
+ * if you want to start code block in the prompt but you don't want to end it in the result.
26063
26009
  *
26064
26010
  * @public exported from `@promptbook/markdown-utils`
26065
26011
  */
@@ -26071,6 +26017,8 @@ function trimEndOfCodeBlock(value) {
26071
26017
  }
26072
26018
 
26073
26019
  /**
26020
+ * Collection of preserved.
26021
+ *
26074
26022
  * @private internal for `preserve`
26075
26023
  */
26076
26024
  const _preserved = [];
@@ -26080,21 +26028,20 @@ const _preserved = [];
26080
26028
  *
26081
26029
  * @param value any function to preserve
26082
26030
  * @returns nothing
26031
+ *
26083
26032
  * @private within the repository
26084
26033
  */
26085
26034
  function $preserve(...value) {
26086
26035
  _preserved.push(...value);
26087
26036
  }
26088
- /**
26089
- * Note: [💞] Ignore a discrepancy between file name and entity name
26090
- */
26037
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26091
26038
 
26092
26039
  // Note: [💎]
26093
26040
  /**
26094
26041
  * ScriptExecutionTools for JavaScript implemented via eval
26095
26042
  *
26096
26043
  * Warning: It is used for testing and mocking
26097
- * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
26044
+ * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
26098
26045
  *
26099
26046
  * @public exported from `@promptbook/javascript`
26100
26047
  */
@@ -26289,23 +26236,22 @@ class JavascriptEvalExecutionTools {
26289
26236
  return result;
26290
26237
  }
26291
26238
  }
26292
- /**
26293
- * TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
26294
- * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
26295
- */
26239
+ // TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
26240
+ // TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
26296
26241
 
26297
26242
  /**
26298
26243
  * Placeholder for better implementation of JavascriptExecutionTools - some proper sandboxing
26299
26244
  *
26300
26245
  * @alias JavascriptExecutionTools
26246
+ *
26301
26247
  * @public exported from `@promptbook/javascript`
26302
26248
  */
26303
26249
  const JavascriptExecutionTools = JavascriptEvalExecutionTools;
26304
26250
 
26305
26251
  /**
26306
26252
  * Note: There is unfortunately no equivalent for this function in the browser environment
26307
- * because it is not possible automatically detect configured LLM providers
26308
- * you need to provide them manually BUT you can help by utilities like `$provideScrapersForBrowser`
26253
+ * because it is not possible automatically detect configured LLM providers
26254
+ * you need to provide them manually BUT you can help by utilities like `$provideScrapersForBrowser`
26309
26255
  *
26310
26256
  * @public exported from `@promptbook/node`
26311
26257
  */
@@ -26330,10 +26276,8 @@ async function $provideExecutionToolsForNode(options) {
26330
26276
  };
26331
26277
  return tools;
26332
26278
  }
26333
- /**
26334
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26335
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26336
- */
26279
+ // 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
26280
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26337
26281
 
26338
26282
  /**
26339
26283
  * Checks if the directory exists
@@ -26354,12 +26298,10 @@ async function isDirectoryExisting(directoryPath, fs) {
26354
26298
  .catch(() => false);
26355
26299
  return isDirectory;
26356
26300
  }
26357
- /**
26358
- * Note: Not [~🟢~] because it is not directly dependent on `fs
26359
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
26360
- * TODO: [🧠][📂] "directory" vs "folder"
26361
- * TODO: [🖇] What about symlinks?
26362
- */
26301
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
26302
+ // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
26303
+ // TODO: [🧠][📂] "directory" vs "folder"
26304
+ // TODO: [🖇] What about symlinks?
26363
26305
 
26364
26306
  /**
26365
26307
  * Reads all files in the directory
@@ -26367,6 +26309,7 @@ async function isDirectoryExisting(directoryPath, fs) {
26367
26309
  * @param path
26368
26310
  * @param isRecursive
26369
26311
  * @returns List of all files in the directory
26312
+ *
26370
26313
  * @private internal function of `AgentCollectionInDirectory` and `createPipelineCollectionFromDirectory`
26371
26314
  */
26372
26315
  async function listAllFiles(path, isRecursive, fs) {
@@ -26388,11 +26331,9 @@ async function listAllFiles(path, isRecursive, fs) {
26388
26331
  }
26389
26332
  return fileNames;
26390
26333
  }
26391
- /**
26392
- * TODO: [😶] Unite folder listing
26393
- * Note: Not [~🟢~] because it is not directly dependent on `fs
26394
- * TODO: [🖇] What about symlinks?
26395
- */
26334
+ // TODO: [😶] Unite folder listing
26335
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
26336
+ // TODO: [🖇] What about symlinks?
26396
26337
 
26397
26338
  /**
26398
26339
  * Constructs `PipelineCollection` from async sources
@@ -26402,17 +26343,18 @@ async function listAllFiles(path, isRecursive, fs) {
26402
26343
  * - Factory function that returns Promise of array of PipelineJson or PipelineString
26403
26344
  *
26404
26345
  * Note: This is useful as internal tool for other constructor functions like
26405
- * `createPipelineCollectionFromUrl` or `createPipelineCollectionFromDirectory`
26406
- * Consider using those functions instead of this one
26346
+ * `createPipelineCollectionFromUrl` or `createPipelineCollectionFromDirectory`
26347
+ * Consider using those functions instead of this one
26407
26348
  *
26408
26349
  * Note: The function does NOT return promise it returns the collection directly which waits for the sources to be resolved
26409
- * when error occurs in given promise or factory function, it is thrown during `listPipelines` or `getPipelineByUrl` call
26350
+ * when error occurs in given promise or factory function, it is thrown during `listPipelines` or `getPipelineByUrl` call
26410
26351
  *
26411
26352
  * Note: Consider using `createPipelineCollectionFromDirectory` or `createPipelineCollectionFromUrl`
26412
26353
  *
26413
26354
  * @param promptbookSourcesPromiseOrFactory
26414
26355
  * @returns PipelineCollection
26415
26356
  * @deprecated Do not use, it will became internal tool for other constructor functions
26357
+ *
26416
26358
  * @public exported from `@promptbook/core`
26417
26359
  */
26418
26360
  function createPipelineCollectionFromPromise(promptbookSourcesPromiseOrFactory) {
@@ -26456,6 +26398,7 @@ function createPipelineCollectionFromPromise(promptbookSourcesPromiseOrFactory)
26456
26398
  * @param tools - Execution tools to be used for pipeline preparation if needed - If not provided, `$provideExecutionToolsForNode` will be used
26457
26399
  * @param options - Options for the collection creation
26458
26400
  * @returns PipelineCollection
26401
+ *
26459
26402
  * @public exported from `@promptbook/node`
26460
26403
  */
26461
26404
  async function createPipelineCollectionFromDirectory(rootPath, tools, options) {
@@ -26639,10 +26582,8 @@ async function createPipelineCollectionFromDirectory(rootPath, tools, options) {
26639
26582
  }
26640
26583
  return collection;
26641
26584
  }
26642
- /**
26643
- * TODO: [🖇] What about symlinks? Maybe option `isSymlinksFollowed`
26644
- * TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
26645
- */
26585
+ // TODO: [🖇] What about symlinks? Maybe option `isSymlinksFollowed`
26586
+ // TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
26646
26587
 
26647
26588
  /**
26648
26589
  * Provides script execution tools
@@ -26656,10 +26597,8 @@ async function $provideScriptingForNode(options) {
26656
26597
  // TODO: [🔱] Do here auto-installation
26657
26598
  return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
26658
26599
  }
26659
- /**
26660
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26661
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26662
- */
26600
+ // Note: [🟢] Code for Node scraper registration helper [$provideScriptingForNode](src/scrapers/_common/register/$provideScriptingForNode.ts) should never be published into packages that could be imported into browser environment
26601
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26663
26602
 
26664
26603
  /**
26665
26604
  * Stringify the PipelineJson with proper formatting
@@ -26687,12 +26626,10 @@ function stringifyPipelineJson(pipeline) {
26687
26626
  pipelineJsonStringified += '\n';
26688
26627
  return pipelineJsonStringified;
26689
26628
  }
26690
- /**
26691
- * TODO: [🐝] Not Working properly @see https://promptbook.studio/examples/mixed-knowledge.book
26692
- * TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
26693
- * TODO: [🧠] Maybe more elegant solution than replacing via regex
26694
- * TODO: [🍙] Make some standard order of json properties
26695
- */
26629
+ // TODO: [🐝] Not Working properly @see https://promptbook.studio/examples/mixed-knowledge.book
26630
+ // TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
26631
+ // TODO: [🧠] Maybe more elegant solution than replacing via regex
26632
+ // TODO: [🍙] Make some standard order of json properties
26696
26633
 
26697
26634
  /**
26698
26635
  * A storage implementation that caches data in files organized in a directory structure.
@@ -26782,10 +26719,8 @@ class FileCacheStorage {
26782
26719
  // [0] When `setItem` and `removeItem` called, the state of the file system should be the same
26783
26720
  }
26784
26721
  }
26785
- /**
26786
- * TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
26787
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26788
- */
26722
+ // 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
26723
+ // TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
26789
26724
 
26790
26725
  /**
26791
26726
  * Run multiple commands in a shell in sequence
@@ -26802,9 +26737,7 @@ async function $execCommands({ commands, cwd, crashOnError, }) {
26802
26737
  await $execCommand({ command, cwd, crashOnError });
26803
26738
  }
26804
26739
  }
26805
- /**
26806
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26807
- */
26740
+ // Note: [🟢] Code for Node command-execution helper [$execCommands](src/utils/execCommand/$execCommands.ts) should never be published into packages that could be imported into browser environment
26808
26741
 
26809
26742
  /**
26810
26743
  * Keep-alive helpers used for streaming chat responses.
@@ -26816,9 +26749,7 @@ async function $execCommands({ commands, cwd, crashOnError, }) {
26816
26749
  * @private internal streaming helper for Promptbook chat connections
26817
26750
  */
26818
26751
  const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
26819
- /**
26820
- * Note: [💞] Ignore a discrepancy between file name and entity name
26821
- */
26752
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26822
26753
 
26823
26754
  /**
26824
26755
  * Type guard to check if a string is a valid agent source
@@ -26848,6 +26779,7 @@ function validateBook(source) {
26848
26779
  * Default book
26849
26780
  *
26850
26781
  * @deprecated Use `$generateBookBoilerplate` instead
26782
+ *
26851
26783
  * @public exported from `@promptbook/core`
26852
26784
  */
26853
26785
  padBook(validateBook(spaceTrim$1(`
@@ -26866,6 +26798,7 @@ padBook(validateBook(spaceTrim$1(`
26866
26798
  *
26867
26799
  * @param {string} pipelineString the candidate for a pipeline string
26868
26800
  * @returns {boolean} if the string is a valid pipeline string
26801
+ *
26869
26802
  * @public exported from `@promptbook/core`
26870
26803
  */
26871
26804
  function isValidPipelineString(pipelineString) {
@@ -26878,9 +26811,7 @@ function isValidPipelineString(pipelineString) {
26878
26811
  return false;
26879
26812
  }
26880
26813
  }
26881
- /**
26882
- * TODO: [🧠][🈴] Where is the best location for this file
26883
- */
26814
+ // TODO: [🧠][🈴] Where is the best location for this file
26884
26815
 
26885
26816
  /**
26886
26817
  * Tag function for notating a pipeline with a book\`...\ notation as template literal
@@ -26893,6 +26824,7 @@ function isValidPipelineString(pipelineString) {
26893
26824
  * @param strings The static string parts of the template literal
26894
26825
  * @param values The dynamic values embedded within the template literal used as data
26895
26826
  * @returns the pipeline string
26827
+ *
26896
26828
  * @public exported from `@promptbook/core`
26897
26829
  */
26898
26830
  function book(strings, ...values) {
@@ -26919,10 +26851,8 @@ function book(strings, ...values) {
26919
26851
  }
26920
26852
  return padBook(bookString);
26921
26853
  }
26922
- /**
26923
- * TODO: [🧠][🈴] Where is the best location for this file
26924
- * Note: [💞] Ignore a discrepancy between file name and entity name
26925
- */
26854
+ // TODO: [🧠][🈴] Where is the best location for this file
26855
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26926
26856
 
26927
26857
  /**
26928
26858
  * Tool call name emitted while preparing a GPT assistant for an agent.
@@ -26967,9 +26897,7 @@ const CHAT_STREAM_WHITESPACE_DECODERS = [
26967
26897
  { token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
26968
26898
  { token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
26969
26899
  ];
26970
- /**
26971
- * Note: [💞] Ignore a discrepancy between file name and entity name
26972
- */
26900
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26973
26901
 
26974
26902
  /**
26975
26903
  * Converts encoded whitespace markers back into real whitespace so the UI can render the message
@@ -26987,6 +26915,9 @@ function decodeChatStreamWhitespaceFromTransport(content) {
26987
26915
  }, content);
26988
26916
  }
26989
26917
 
26918
+ /**
26919
+ * Constant for raw tool call ID fields.
26920
+ */
26990
26921
  const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
26991
26922
  /**
26992
26923
  * Builds a deterministic idempotency key for tool calls so the UI can track updates.
@@ -27017,6 +26948,9 @@ function resolveToolCallIdempotencyKey(toolCall) {
27017
26948
  }
27018
26949
  return `fallback:${toolCall.name}`;
27019
26950
  }
26951
+ /**
26952
+ * Gets arguments key.
26953
+ */
27020
26954
  function getArgumentsKey(value) {
27021
26955
  if (typeof value === 'string') {
27022
26956
  return value;
@@ -27090,6 +27024,7 @@ function mergeToolCalls(existingToolCalls, incomingToolCalls) {
27090
27024
  * @param existingToolCall - Previous snapshot.
27091
27025
  * @param incomingToolCall - New snapshot.
27092
27026
  * @returns One merged snapshot.
27027
+ *
27093
27028
  * @private helper of `mergeToolCalls`
27094
27029
  */
27095
27030
  function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
@@ -27112,6 +27047,7 @@ function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
27112
27047
  * @param existingToolCall - Previous snapshot.
27113
27048
  * @param incomingToolCall - New snapshot.
27114
27049
  * @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
27050
+ *
27115
27051
  * @private helper of `mergeToolCalls`
27116
27052
  */
27117
27053
  function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
@@ -27125,6 +27061,7 @@ function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
27125
27061
  *
27126
27062
  * @param toolCall - Tool call snapshot to inspect.
27127
27063
  * @returns Inferred lifecycle state or `undefined`.
27064
+ *
27128
27065
  * @private helper of `mergeToolCalls`
27129
27066
  */
27130
27067
  function inferToolCallState(toolCall) {
@@ -27148,6 +27085,7 @@ function inferToolCallState(toolCall) {
27148
27085
  * @param existingValues - Previous list.
27149
27086
  * @param incomingValues - Incoming list.
27150
27087
  * @returns Deduplicated merged list or `undefined`.
27088
+ *
27151
27089
  * @private helper of `mergeToolCalls`
27152
27090
  */
27153
27091
  function mergeUnknownLists(existingValues, incomingValues) {
@@ -27174,6 +27112,7 @@ function mergeUnknownLists(existingValues, incomingValues) {
27174
27112
  *
27175
27113
  * @param value - Value to serialize.
27176
27114
  * @returns String signature.
27115
+ *
27177
27116
  * @private helper of `mergeToolCalls`
27178
27117
  */
27179
27118
  function serializeValueForMerge(value) {
@@ -27191,6 +27130,7 @@ function serializeValueForMerge(value) {
27191
27130
  *
27192
27131
  * @param toolCalls - Mutable list to deduplicate in-place.
27193
27132
  * @returns The same array after removing redundant preparation entries.
27133
+ *
27194
27134
  * @private helper of `mergeToolCalls`
27195
27135
  */
27196
27136
  function deduplicatePreparationToolCalls(toolCalls) {
@@ -27248,6 +27188,7 @@ function createDefaultAgentName(agentSource) {
27248
27188
  *
27249
27189
  * @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
27250
27190
  * @returns Normalized hostname or `null` when the value cannot be normalized.
27191
+ *
27251
27192
  * @private utility for host/domain matching
27252
27193
  */
27253
27194
  function normalizeDomainForMatching(rawDomain) {
@@ -27270,6 +27211,7 @@ function normalizeDomainForMatching(rawDomain) {
27270
27211
  *
27271
27212
  * @param value - Raw value to inspect.
27272
27213
  * @returns True when the value starts with `http://` or `https://`.
27214
+ *
27273
27215
  * @private utility for host/domain matching
27274
27216
  */
27275
27217
  function hasHttpProtocol(value) {
@@ -27285,6 +27227,7 @@ function hasHttpProtocol(value) {
27285
27227
  *
27286
27228
  * @param agentSource - Raw agent source.
27287
27229
  * @returns Parsed prelude with shared line metadata.
27230
+ *
27288
27231
  * @private internal utility of book agent-source parsing
27289
27232
  */
27290
27233
  function parseAgentSourcePrelude(agentSource) {
@@ -27460,6 +27403,7 @@ function parseAgentSourceWithCommitments(agentSource) {
27460
27403
  *
27461
27404
  * @param text - Text to extract parameters from
27462
27405
  * @returns Array of parsed parameters with unified representation
27406
+ *
27463
27407
  * @public exported from `@promptbook/core`
27464
27408
  */
27465
27409
  function parseParameters(text) {
@@ -27888,9 +27832,7 @@ function normalizeMetaDomain(content) {
27888
27832
  const trimmed = spaceTrim$1(content);
27889
27833
  return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
27890
27834
  }
27891
- /**
27892
- * TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
27893
- */
27835
+ // TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
27894
27836
 
27895
27837
  /**
27896
27838
  * Gets all tool titles provided by all commitments
@@ -27916,6 +27858,7 @@ function getAllCommitmentsToolTitles() {
27916
27858
  * Restricts an Updatable to a (2) BehaviorSubject variant
27917
27859
  *
27918
27860
  * @see Updatable
27861
+ *
27919
27862
  * @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
27920
27863
  */
27921
27864
  function asUpdatableSubject(value) {
@@ -27940,9 +27883,7 @@ function asUpdatableSubject(value) {
27940
27883
  return new BehaviorSubject(value);
27941
27884
  }
27942
27885
  }
27943
- /**
27944
- * TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
27945
- */
27886
+ // TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
27946
27887
 
27947
27888
  /**
27948
27889
  * Creates an empty/basic agent model requirements object
@@ -27977,12 +27918,11 @@ function createBasicAgentModelRequirements(agentName) {
27977
27918
  systemMessage: `You are ${agentName || 'AI Agent'}`,
27978
27919
  };
27979
27920
  }
27980
- /**
27981
- * TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
27982
- */
27921
+ // TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
27983
27922
 
27984
27923
  /**
27985
27924
  * Gets a commitment definition by its type
27925
+ *
27986
27926
  * @param type The commitment type to look up
27987
27927
  * @returns The commitment definition or null if not found
27988
27928
  *
@@ -28361,7 +28301,9 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
28361
28301
  };
28362
28302
  }
28363
28303
  /**
28364
- * @private Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
28304
+ * Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
28305
+ *
28306
+ * @private
28365
28307
  */
28366
28308
  async function applyPendingInlineKnowledgeSources(requirements, uploader) {
28367
28309
  var _a;
@@ -28382,6 +28324,9 @@ async function applyPendingInlineKnowledgeSources(requirements, uploader) {
28382
28324
  _metadata: stripInlineKnowledgeMetadata(requirements._metadata),
28383
28325
  };
28384
28326
  }
28327
+ /**
28328
+ * Handles upload inline knowledge source with fallback.
28329
+ */
28385
28330
  async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
28386
28331
  try {
28387
28332
  return await uploader(inlineSource);
@@ -28394,6 +28339,9 @@ async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
28394
28339
  return inlineKnowledgeSourceToDataUrl(inlineSource);
28395
28340
  }
28396
28341
  }
28342
+ /**
28343
+ * Extracts inline knowledge sources.
28344
+ */
28397
28345
  function extractInlineKnowledgeSources(metadata) {
28398
28346
  if (!metadata) {
28399
28347
  return [];
@@ -28401,6 +28349,9 @@ function extractInlineKnowledgeSources(metadata) {
28401
28349
  const value = metadata.inlineKnowledgeSources;
28402
28350
  return Array.isArray(value) ? value : [];
28403
28351
  }
28352
+ /**
28353
+ * Strips inline knowledge metadata.
28354
+ */
28404
28355
  function stripInlineKnowledgeMetadata(metadata) {
28405
28356
  if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
28406
28357
  return metadata;
@@ -28451,6 +28402,7 @@ function isBinaryMimeType(mimeType) {
28451
28402
  * @param availableModels - Models that could fulfill the agent.
28452
28403
  * @param llmTools - Execution tools used when selecting a best model.
28453
28404
  * @param options - Optional hooks such as the agent reference resolver.
28405
+ *
28454
28406
  * @public exported from `@promptbook/core`
28455
28407
  */
28456
28408
  async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
@@ -28470,6 +28422,7 @@ async function createAgentModelRequirements(agentSource, modelName, availableMod
28470
28422
  * @param agentSource The agent source to derive persona description from
28471
28423
  * @param llmTools LLM tools for preparing persona
28472
28424
  * @returns The name of the best selected model
28425
+ *
28473
28426
  * @private function of `createAgentModelRequirements`
28474
28427
  */
28475
28428
  async function selectBestModelUsingPersona(agentSource, llmTools) {
@@ -28605,6 +28558,7 @@ function normalizeChatAttachment(rawAttachment) {
28605
28558
  *
28606
28559
  * @param {unknown} rawAttachments - The raw attachments to normalize.
28607
28560
  * @returns {Array<ChatAttachment>} The normalized attachments.
28561
+ *
28608
28562
  * @public exported from `@promptbook/core`
28609
28563
  */
28610
28564
  function normalizeChatAttachments(rawAttachments) {
@@ -28649,6 +28603,7 @@ function formatChatAttachmentLine(attachment) {
28649
28603
  *
28650
28604
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
28651
28605
  * @returns {string} The formatted context.
28606
+ *
28652
28607
  * @public exported from `@promptbook/core`
28653
28608
  */
28654
28609
  function formatChatAttachmentContext(attachments) {
@@ -28669,6 +28624,7 @@ function formatChatAttachmentContext(attachments) {
28669
28624
  * @param {number} maxBytes - Maximum number of bytes to capture.
28670
28625
  * @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
28671
28626
  * @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
28627
+ *
28672
28628
  * @private internal utility for bounded response reads
28673
28629
  */
28674
28630
  async function readResponseBytes(response, maxBytes, options = {}) {
@@ -28765,6 +28721,7 @@ function createAttachmentContentFailure(attachment, reason, options = {}) {
28765
28721
  * @param {number} maxInlineCharacters - Maximum number of characters to inline.
28766
28722
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
28767
28723
  * @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
28724
+ *
28768
28725
  * @private function of resolveChatAttachmentContents
28769
28726
  */
28770
28727
  async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
@@ -28856,6 +28813,7 @@ const CHAT_ATTACHMENT_MAX_INLINE_CHARACTERS_TOTAL = 24000;
28856
28813
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
28857
28814
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
28858
28815
  * @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
28816
+ *
28859
28817
  * @public exported from `@promptbook/core`
28860
28818
  */
28861
28819
  async function resolveChatAttachmentContents(attachments, options = {}) {
@@ -28921,6 +28879,7 @@ function formatResolvedChatAttachmentContent(contentResolution) {
28921
28879
  *
28922
28880
  * @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
28923
28881
  * @returns {string} The formatted context.
28882
+ *
28924
28883
  * @public exported from `@promptbook/core`
28925
28884
  */
28926
28885
  function formatChatAttachmentContentContext(resolvedContents) {
@@ -28961,6 +28920,7 @@ function appendChatContextSections(messageContent, contextSections) {
28961
28920
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
28962
28921
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
28963
28922
  * @returns {Promise<string>} The updated message content.
28923
+ *
28964
28924
  * @public exported from `@promptbook/core`
28965
28925
  */
28966
28926
  async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
@@ -28989,9 +28949,7 @@ async function appendChatAttachmentContextWithContent(messageContent, attachment
28989
28949
  function humanizeAiTextEllipsis(aiText) {
28990
28950
  return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
28991
28951
  }
28992
- /**
28993
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
28994
- */
28952
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
28995
28953
 
28996
28954
  /**
28997
28955
  * Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
@@ -29004,9 +28962,7 @@ function humanizeAiTextEllipsis(aiText) {
29004
28962
  function humanizeAiTextEmdashed(aiText) {
29005
28963
  return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
29006
28964
  }
29007
- /**
29008
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29009
- */
28965
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29010
28966
 
29011
28967
  /**
29012
28968
  * Change smart quotes to regular quotes
@@ -29019,9 +28975,7 @@ function humanizeAiTextEmdashed(aiText) {
29019
28975
  function humanizeAiTextQuotes(aiText) {
29020
28976
  return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
29021
28977
  }
29022
- /**
29023
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29024
- */
28978
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29025
28979
 
29026
28980
  /**
29027
28981
  * Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
@@ -29034,9 +28988,7 @@ function humanizeAiTextQuotes(aiText) {
29034
28988
  function humanizeAiTextSources(aiText) {
29035
28989
  return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
29036
28990
  }
29037
- /**
29038
- * Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29039
- */
28991
+ // Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29040
28992
 
29041
28993
  /**
29042
28994
  * Change unprintable hard spaces to regular spaces and drop zero-width spaces
@@ -29049,9 +29001,7 @@ function humanizeAiTextSources(aiText) {
29049
29001
  function humanizeAiTextWhitespace(aiText) {
29050
29002
  return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
29051
29003
  }
29052
- /**
29053
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29054
- */
29004
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29055
29005
 
29056
29006
  /**
29057
29007
  * Function `humanizeAiText` will remove traces of AI text generation artifacts
@@ -29070,11 +29020,11 @@ function humanizeAiText(aiText) {
29070
29020
  cleanedText = humanizeAiTextWhitespace(cleanedText);
29071
29021
  return cleanedText;
29072
29022
  }
29073
- /**
29074
- * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
29075
- */
29023
+ // TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
29076
29024
 
29077
29025
  /**
29026
+ * Map of promptbook pseudotoken substitution.
29027
+ *
29078
29028
  * @private
29079
29029
  */
29080
29030
  const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
@@ -29122,9 +29072,7 @@ function promptbookifyAiText(text) {
29122
29072
  }
29123
29073
  return promptbookifiedTextTokens.join('');
29124
29074
  }
29125
- /**
29126
- * TODO: [🧠][✌️] Make some Promptbook-native token system
29127
- */
29075
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
29128
29076
 
29129
29077
  /**
29130
29078
  * Make UncertainNumber
@@ -29180,6 +29128,7 @@ function pricing(value) {
29180
29128
  *
29181
29129
  * @see https://platform.openai.com/docs/models/
29182
29130
  * @see https://openai.com/api/pricing/
29131
+ *
29183
29132
  * @public exported from `@promptbook/openai`
29184
29133
  */
29185
29134
  const OPENAI_MODELS = exportJson({
@@ -29856,6 +29805,7 @@ const OPENAI_MODELS = exportJson({
29856
29805
  * @param rawResponse The raw response from OpenAI API
29857
29806
  * @param duration The duration of the execution
29858
29807
  * @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
29808
+ *
29859
29809
  * @private internal utility of `OpenAiExecutionTools`
29860
29810
  */
29861
29811
  function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
@@ -29898,15 +29848,14 @@ resultContent, rawResponse, duration = ZERO_VALUE) {
29898
29848
  },
29899
29849
  };
29900
29850
  }
29901
- /**
29902
- * TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
29903
- */
29851
+ // TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
29904
29852
 
29905
29853
  /**
29906
29854
  * Parses an OpenAI error message to identify which parameter is unsupported
29907
29855
  *
29908
29856
  * @param errorMessage The error message from OpenAI API
29909
29857
  * @returns The parameter name that is unsupported, or null if not an unsupported parameter error
29858
+ *
29910
29859
  * @private utility of LLM Tools
29911
29860
  */
29912
29861
  function parseUnsupportedParameterError(errorMessage) {
@@ -29928,6 +29877,7 @@ function parseUnsupportedParameterError(errorMessage) {
29928
29877
  * @param modelRequirements Original model requirements
29929
29878
  * @param unsupportedParameter The parameter to remove
29930
29879
  * @returns New model requirements without the unsupported parameter
29880
+ *
29931
29881
  * @private utility of LLM Tools
29932
29882
  */
29933
29883
  function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
@@ -29947,8 +29897,10 @@ function removeUnsupportedModelRequirement(modelRequirements, unsupportedParamet
29947
29897
  }
29948
29898
  /**
29949
29899
  * Checks if an error is an "Unsupported value" error from OpenAI
29900
+ *
29950
29901
  * @param error The error to check
29951
29902
  * @returns true if this is an unsupported parameter error
29903
+ *
29952
29904
  * @private utility of LLM Tools
29953
29905
  */
29954
29906
  function isUnsupportedParameterError(error) {
@@ -31054,13 +31006,11 @@ class OpenAiCompatibleExecutionTools {
31054
31006
  return false;
31055
31007
  }
31056
31008
  }
31057
- /**
31058
- * TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
31059
- * TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
31060
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
31061
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
31062
- * TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
31063
- */
31009
+ // TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
31010
+ // TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
31011
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
31012
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
31013
+ // TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
31064
31014
 
31065
31015
  /**
31066
31016
  * Profile for OpenAI provider
@@ -31128,9 +31078,21 @@ class OpenAiExecutionTools extends OpenAiCompatibleExecutionTools {
31128
31078
  }
31129
31079
  }
31130
31080
 
31081
+ /**
31082
+ * Constant for default knowledge source download timeout ms.
31083
+ */
31131
31084
  const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
31085
+ /**
31086
+ * Constant for default knowledge source upload timeout ms.
31087
+ */
31132
31088
  const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
31089
+ /**
31090
+ * Constant for vector store progress log interval min ms.
31091
+ */
31133
31092
  const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
31093
+ /**
31094
+ * Constant for vector store stall log threshold ms.
31095
+ */
31134
31096
  const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
31135
31097
  /**
31136
31098
  * Base class for OpenAI execution tools that need hosted vector stores.
@@ -31897,6 +31859,9 @@ class OpenAiVectorStoreHandler extends OpenAiExecutionTools {
31897
31859
  }
31898
31860
  }
31899
31861
 
31862
+ /**
31863
+ * Constant for default agent kit model name.
31864
+ */
31900
31865
  const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
31901
31866
  /**
31902
31867
  * Creates one structured log entry for streamed tool-call updates.
@@ -31940,6 +31905,9 @@ function resolveFinalToolCallState$1(options) {
31940
31905
  }
31941
31906
  return 'COMPLETE';
31942
31907
  }
31908
+ /**
31909
+ * Constant for default JSON schema name.
31910
+ */
31943
31911
  const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
31944
31912
  /**
31945
31913
  * File extensions considered image inputs when MIME type is missing or generic.
@@ -32095,6 +32063,7 @@ function buildJsonSchemaDefinition(jsonSchema) {
32095
32063
  *
32096
32064
  * @param responseFormat - The OpenAI `response_format` payload from the user request.
32097
32065
  * @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
32066
+ *
32098
32067
  * @private utility of Open AI
32099
32068
  */
32100
32069
  function mapResponseFormatToAgentOutputType(responseFormat) {
@@ -32853,6 +32822,7 @@ function resolveFinalToolCallState(options) {
32853
32822
  * - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
32854
32823
  *
32855
32824
  * @deprecated Use `OpenAiAgentKitExecutionTools` instead.
32825
+ *
32856
32826
  * @public exported from `@promptbook/openai`
32857
32827
  */
32858
32828
  class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
@@ -33544,14 +33514,12 @@ class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
33544
33514
  * @private const of `OpenAiAssistantExecutionTools`
33545
33515
  */
33546
33516
  const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
33547
- /**
33548
- * TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
33549
- * TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
33550
- * TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
33551
- * TODO: Maybe make custom OpenAiError
33552
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
33553
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
33554
- */
33517
+ // TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
33518
+ // TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
33519
+ // TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
33520
+ // TODO: Maybe make custom OpenAiError
33521
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
33522
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
33555
33523
 
33556
33524
  /**
33557
33525
  * Emits a progress update to signal assistant preparation before long setup work.
@@ -34028,10 +33996,8 @@ AgentLlmExecutionTools.assistantCache = new Map();
34028
33996
  * Cache of OpenAI vector stores to avoid creating duplicates
34029
33997
  */
34030
33998
  AgentLlmExecutionTools.vectorStoreCache = new Map();
34031
- /**
34032
- * TODO: [🍚] Implement Destroyable pattern to free resources
34033
- * TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
34034
- */
33999
+ // TODO: [🍚] Implement Destroyable pattern to free resources
34000
+ // TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
34035
34001
 
34036
34002
  /**
34037
34003
  * Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
@@ -34041,6 +34007,7 @@ AgentLlmExecutionTools.vectorStoreCache = new Map();
34041
34007
  *
34042
34008
  * @param agentSource - The raw agent book source
34043
34009
  * @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
34010
+ *
34044
34011
  * @private Internal helper shared between self-learning and related features.
34045
34012
  */
34046
34013
  function extractOpenTeacherInstructions(agentSource) {
@@ -34248,6 +34215,7 @@ class SelfLearningManager {
34248
34215
  *
34249
34216
  * @param section Raw fragment from self-learning workflow.
34250
34217
  * @returns Trimmed fragment, or empty string when nothing remains.
34218
+ *
34251
34219
  * @private function of Agent
34252
34220
  */
34253
34221
  function normalizeBookSection(section) {
@@ -34259,6 +34227,7 @@ function normalizeBookSection(section) {
34259
34227
  * @param agentSource Current source.
34260
34228
  * @param normalizedSection Candidate fragment expected to be normalized first.
34261
34229
  * @returns True when appending would duplicate an existing fragment.
34230
+ *
34262
34231
  * @private function of Agent
34263
34232
  */
34264
34233
  function containsNormalizedBookSection(agentSource, normalizedSection) {
@@ -34273,6 +34242,7 @@ function containsNormalizedBookSection(agentSource, normalizedSection) {
34273
34242
  *
34274
34243
  * @param responseFormat Prompt response format requirements
34275
34244
  * @returns True when JSON schema mode is active
34245
+ *
34276
34246
  * @private function of Agent
34277
34247
  */
34278
34248
  function isJsonSchemaResponseFormat(responseFormat) {
@@ -34284,6 +34254,7 @@ function isJsonSchemaResponseFormat(responseFormat) {
34284
34254
  * @param content Original agent answer content
34285
34255
  * @param isJsonMode Whether the interaction requested JSON schema output
34286
34256
  * @returns Agent answer, wrapped in a formatted JSON code block when possible
34257
+ *
34287
34258
  * @private function of Agent
34288
34259
  */
34289
34260
  function formatAgentMessageForJsonMode(content, isJsonMode) {
@@ -34309,6 +34280,7 @@ function formatAgentMessageForJsonMode(content, isJsonMode) {
34309
34280
  *
34310
34281
  * @param content Text to parse as JSON
34311
34282
  * @returns Parsed JSON value or null when parsing fails
34283
+ *
34312
34284
  * @private function of Agent
34313
34285
  */
34314
34286
  function tryParseJson(content) {
@@ -34324,6 +34296,7 @@ function tryParseJson(content) {
34324
34296
  *
34325
34297
  * @param options - Normalized sample parts.
34326
34298
  * @returns Book-language sample section ready to append into agent source.
34299
+ *
34327
34300
  * @private function of Agent
34328
34301
  */
34329
34302
  function formatSelfLearningSample(options) {
@@ -34345,6 +34318,7 @@ function formatSelfLearningSample(options) {
34345
34318
  *
34346
34319
  * @param internalMessage Internal trace payload.
34347
34320
  * @returns Book-language INTERNAL MESSAGE block.
34321
+ *
34348
34322
  * @private function of Agent
34349
34323
  */
34350
34324
  function formatInternalLearningMessage(internalMessage) {
@@ -34358,6 +34332,7 @@ function formatInternalLearningMessage(internalMessage) {
34358
34332
  *
34359
34333
  * @param result Final chat result used in self-learning.
34360
34334
  * @returns Internal payloads that capture request/response/tool-call context.
34335
+ *
34361
34336
  * @private function of Agent
34362
34337
  */
34363
34338
  function buildInternalLearningMessages(result) {
@@ -34387,6 +34362,7 @@ function buildInternalLearningMessages(result) {
34387
34362
  *
34388
34363
  * @param toolCall Tool call produced during execution.
34389
34364
  * @returns Sanitized and serializable tool-call payload.
34365
+ *
34390
34366
  * @private function of Agent
34391
34367
  */
34392
34368
  function sanitizeToolCallForLearning(toolCall) {
@@ -34406,6 +34382,7 @@ function sanitizeToolCallForLearning(toolCall) {
34406
34382
  *
34407
34383
  * @param payload Internal payload to serialize.
34408
34384
  * @returns Pretty JSON string that can be embedded in BOOK.
34385
+ *
34409
34386
  * @private function of Agent
34410
34387
  */
34411
34388
  function stringifyInternalLearningPayload(payload) {
@@ -34455,6 +34432,7 @@ function createEmptySelfLearningCommitmentCounts() {
34455
34432
  * Normalizes teacher commitments into trimmed, display-ready lines.
34456
34433
  *
34457
34434
  * @param commitments Raw teacher output
34435
+ *
34458
34436
  * @private function of Agent
34459
34437
  */
34460
34438
  function getTeacherCommitmentLines(commitments) {
@@ -34467,6 +34445,7 @@ function getTeacherCommitmentLines(commitments) {
34467
34445
  * Summarizes teacher commitment lines into user-friendly counts for self-learning.
34468
34446
  *
34469
34447
  * @param lines Parsed teacher commitment lines
34448
+ *
34470
34449
  * @private function of Agent
34471
34450
  */
34472
34451
  function summarizeTeacherCommitmentLines(lines) {
@@ -34499,6 +34478,7 @@ function summarizeTeacherCommitmentLines(lines) {
34499
34478
  * @param commitments Raw teacher commitments
34500
34479
  * @param used Whether the teacher was invoked
34501
34480
  * @returns Summary of learned commitments
34481
+ *
34502
34482
  * @private function of Agent
34503
34483
  */
34504
34484
  function buildTeacherSummary(commitments, used) {
@@ -34735,9 +34715,7 @@ class Agent extends AgentLlmExecutionTools {
34735
34715
  return finalResult;
34736
34716
  }
34737
34717
  }
34738
- /**
34739
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
34740
- */
34718
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
34741
34719
 
34742
34720
  /**
34743
34721
  * Parses one failed remote agent response into a structured error.
@@ -35203,10 +35181,8 @@ class RemoteAgent extends Agent {
35203
35181
  return agentResult;
35204
35182
  }
35205
35183
  }
35206
- /**
35207
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
35208
- * TODO: !!! Agent on remote server
35209
- */
35184
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
35185
+ // TODO: !!! Agent on remote server
35210
35186
 
35211
35187
  var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
35212
35188
  __proto__: null,