@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/umd/index.umd.js CHANGED
@@ -48,7 +48,7 @@
48
48
  * @generated
49
49
  * @see https://github.com/webgptorg/promptbook
50
50
  */
51
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-32';
51
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
52
52
  /**
53
53
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
54
54
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -58,16 +58,20 @@
58
58
  * Trims string from all 4 sides
59
59
  *
60
60
  * Note: This is a re-exported function from the `spacetrim` package which is
61
- * Developed by same author @hejny as this package
61
+ * Developed by same author @hejny as this package
62
62
  *
63
- * @public exported from `@promptbook/utils`
64
63
  * @see https://github.com/hejny/spacetrim#usage
64
+ *
65
+ * @public exported from `@promptbook/utils`
65
66
  */
66
67
  const spaceTrim = _spaceTrim.spaceTrim;
67
68
 
68
69
  /**
69
- * @private util of `@promptbook/color`
70
+ * Class implementing take chain.
71
+ *
70
72
  * @de
73
+ *
74
+ * @private util of `@promptbook/color`
71
75
  */
72
76
  class TakeChain {
73
77
  constructor(value) {
@@ -84,9 +88,9 @@
84
88
  *
85
89
  * @param {*} initialValue - The initial value.
86
90
  * @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
91
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
87
92
  *
88
93
  * @private util of `@promptbook/color`
89
- * @deprecated [🤡] Use some better functional library instead of `TakeChain`
90
94
  */
91
95
  function take(initialValue) {
92
96
  if (initialValue instanceof TakeChain) {
@@ -264,9 +268,7 @@
264
268
  yellow: '#ffff00',
265
269
  yellowgreen: '#9acd32',
266
270
  };
267
- /**
268
- * Note: [💞] Ignore a discrepancy between file name and entity name
269
- */
271
+ // Note: [💞] Ignore a discrepancy between file name and entity name
270
272
 
271
273
  /**
272
274
  * Validates that a channel value is a valid number within the range of 0 to 255.
@@ -296,7 +298,13 @@
296
298
  }
297
299
  }
298
300
 
301
+ /**
302
+ * Constant for short hex lengths.
303
+ */
299
304
  const SHORT_HEX_LENGTHS = new Set([3, 4]);
305
+ /**
306
+ * Constant for long hex lengths.
307
+ */
300
308
  const LONG_HEX_LENGTHS = new Set([6, 8]);
301
309
  /**
302
310
  * Parses a hex string into RGBA channel values.
@@ -329,6 +337,9 @@
329
337
  }
330
338
  return throwInvalidHex();
331
339
  }
340
+ /**
341
+ * Parses short hex channel.
342
+ */
332
343
  function parseShortHexChannel(char, onError) {
333
344
  if (!char) {
334
345
  return onError();
@@ -339,6 +350,9 @@
339
350
  }
340
351
  return parsed * 16;
341
352
  }
353
+ /**
354
+ * Parses long hex channel.
355
+ */
342
356
  function parseLongHexChannel(hex, start, onError) {
343
357
  const segment = hex.substr(start, 2);
344
358
  if (segment.length < 2) {
@@ -351,6 +365,9 @@
351
365
  return parsed;
352
366
  }
353
367
 
368
+ /**
369
+ * Pattern matching hsl.
370
+ */
354
371
  const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
355
372
  /**
356
373
  * Parses an HSL string into RGBA channel values.
@@ -376,6 +393,9 @@
376
393
  alpha: 255,
377
394
  };
378
395
  }
396
+ /**
397
+ * Handles convert hsl to Rgb.
398
+ */
379
399
  function convertHslToRgb(h, s, l) {
380
400
  const c = (1 - Math.abs(2 * l - 1)) * s;
381
401
  const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
@@ -414,7 +434,13 @@
414
434
  };
415
435
  }
416
436
 
437
+ /**
438
+ * Pattern matching RGB.
439
+ */
417
440
  const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
441
+ /**
442
+ * Pattern matching rgba.
443
+ */
418
444
  const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
419
445
  /**
420
446
  * Parses an RGB string into RGBA channel values.
@@ -456,6 +482,9 @@
456
482
  alpha: parseAlphaValue(match[4]),
457
483
  };
458
484
  }
485
+ /**
486
+ * Parses channel value.
487
+ */
459
488
  function parseChannelValue(value) {
460
489
  if (value.endsWith('%')) {
461
490
  const percent = parseFloat(value);
@@ -463,6 +492,9 @@
463
492
  }
464
493
  return Math.round(parseFloat(value));
465
494
  }
495
+ /**
496
+ * Parses alpha value.
497
+ */
466
498
  function parseAlphaValue(value) {
467
499
  if (value.endsWith('%')) {
468
500
  const percent = parseFloat(value);
@@ -475,8 +507,17 @@
475
507
  return Math.round(parsed);
476
508
  }
477
509
 
510
+ /**
511
+ * Pattern matching hsl regex.
512
+ */
478
513
  const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
514
+ /**
515
+ * Pattern matching RGB regex.
516
+ */
479
517
  const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
518
+ /**
519
+ * Pattern matching rgba regex.
520
+ */
480
521
  const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
481
522
  /**
482
523
  * Color object represents an RGB color with alpha channel
@@ -842,9 +883,7 @@
842
883
  }
843
884
  return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
844
885
  }
845
- /**
846
- * TODO: Properly name all used internal variables
847
- */
886
+ // TODO: Properly name all used internal variables
848
887
 
849
888
  /**
850
889
  * Converts RGB values to HSL values
@@ -890,9 +929,7 @@
890
929
  }
891
930
  return [hue, saturation, lightness];
892
931
  }
893
- /**
894
- * TODO: Properly name all used internal variables
895
- */
932
+ // TODO: Properly name all used internal variables
896
933
 
897
934
  /**
898
935
  * Makes color transformer which lighten the given color
@@ -910,9 +947,7 @@
910
947
  return Color.fromValues(r, g, b, alpha);
911
948
  };
912
949
  }
913
- /**
914
- * TODO: Maybe implement by mix+hsl
915
- */
950
+ // TODO: Maybe implement by mix+hsl
916
951
 
917
952
  /**
918
953
  * Makes color transformer which saturate the given color
@@ -930,9 +965,7 @@
930
965
  return Color.fromValues(r, g, b, alpha);
931
966
  };
932
967
  }
933
- /**
934
- * TODO: Maybe implement by mix+hsl
935
- */
968
+ // TODO: Maybe implement by mix+hsl
936
969
 
937
970
  /**
938
971
  * Returns the same value that is passed as argument.
@@ -945,6 +978,7 @@
945
978
  *
946
979
  * @param value any values
947
980
  * @returns the same values
981
+ *
948
982
  * @private within the repository
949
983
  */
950
984
  function just(value) {
@@ -1326,6 +1360,7 @@
1326
1360
  * Orders JSON object by keys
1327
1361
  *
1328
1362
  * @returns The same type of object as the input re-ordered
1363
+ *
1329
1364
  * @public exported from `@promptbook/utils`
1330
1365
  */
1331
1366
  function orderJson(options) {
@@ -1344,6 +1379,7 @@
1344
1379
  * Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
1345
1380
  *
1346
1381
  * @returns The same object as the input, but deeply frozen
1382
+ *
1347
1383
  * @public exported from `@promptbook/utils`
1348
1384
  */
1349
1385
  function $deepFreeze(objectValue) {
@@ -1360,9 +1396,7 @@
1360
1396
  Object.freeze(objectValue);
1361
1397
  return objectValue;
1362
1398
  }
1363
- /**
1364
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1365
- */
1399
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
1366
1400
 
1367
1401
  /**
1368
1402
  * This error type indicates that somewhere in the code non-Error object was thrown and it was wrapped into the `WrappedError`
@@ -1430,6 +1464,7 @@
1430
1464
  * - And much more...
1431
1465
  *
1432
1466
  * @throws UnexpectedError if the value is not serializable as JSON
1467
+ *
1433
1468
  * @public exported from `@promptbook/utils`
1434
1469
  */
1435
1470
  function checkSerializableAsJson(options) {
@@ -1544,11 +1579,9 @@
1544
1579
  `));
1545
1580
  }
1546
1581
  }
1547
- /**
1548
- * TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
1549
- * TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
1550
- * Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
1551
- */
1582
+ // TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
1583
+ // TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
1584
+ // Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
1552
1585
 
1553
1586
  /**
1554
1587
  * Creates a deep clone of the given object
@@ -1558,6 +1591,7 @@
1558
1591
  *
1559
1592
  * @param objectValue The object to clone.
1560
1593
  * @returns A deep, writable clone of the input object.
1594
+ *
1561
1595
  * @public exported from `@promptbook/utils`
1562
1596
  */
1563
1597
  function deepClone(objectValue) {
@@ -1574,9 +1608,7 @@
1574
1608
  > return Object.assign({}, objectValue);
1575
1609
  */
1576
1610
  }
1577
- /**
1578
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1579
- */
1611
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
1580
1612
 
1581
1613
  /**
1582
1614
  * Utility to export a JSON object from a function
@@ -1589,6 +1621,7 @@
1589
1621
  * Note: This function does not mutates the given object
1590
1622
  *
1591
1623
  * @returns The same type of object as the input but read-only and re-ordered
1624
+ *
1592
1625
  * @public exported from `@promptbook/utils`
1593
1626
  */
1594
1627
  function exportJson(options) {
@@ -1608,9 +1641,7 @@
1608
1641
  $deepFreeze(orderedValue);
1609
1642
  return orderedValue;
1610
1643
  }
1611
- /**
1612
- * TODO: [🧠] Is there a way how to meaningfully test this utility
1613
- */
1644
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
1614
1645
 
1615
1646
  /**
1616
1647
  * Order of keys in the pipeline JSON
@@ -1721,9 +1752,7 @@
1721
1752
  */
1722
1753
  SHORT_NAME_LENGTH: 6,
1723
1754
  };
1724
- /**
1725
- * Note: [💞] Ignore a discrepancy between file name and entity name
1726
- */
1755
+ // Note: [💞] Ignore a discrepancy between file name and entity name
1727
1756
 
1728
1757
  /**
1729
1758
  * This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
@@ -1737,9 +1766,7 @@
1737
1766
  Object.setPrototypeOf(this, ParseError.prototype);
1738
1767
  }
1739
1768
  }
1740
- /**
1741
- * TODO: Maybe split `ParseError` and `ApplyError`
1742
- */
1769
+ // TODO: Maybe split `ParseError` and `ApplyError`
1743
1770
 
1744
1771
  /**
1745
1772
  * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
@@ -1777,12 +1804,13 @@
1777
1804
  * Tests if given string is valid promptbook version
1778
1805
  * It looks into list of known promptbook versions.
1779
1806
  *
1780
- * @see https://www.npmjs.com/package/promptbook?activeTab=versions
1781
1807
  * 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.
1782
1808
  * Note: There are two similar functions:
1783
1809
  * - `isValidSemanticVersion` which tests any semantic version
1784
1810
  * - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
1785
1811
  *
1812
+ * @see https://www.npmjs.com/package/promptbook?activeTab=versions
1813
+ *
1786
1814
  * @public exported from `@promptbook/utils`
1787
1815
  */
1788
1816
  function isValidPromptbookVersion(version) {
@@ -1856,9 +1884,7 @@
1856
1884
  */
1857
1885
  return true;
1858
1886
  }
1859
- /**
1860
- * TODO: [🐠] Maybe more info why the URL is invalid
1861
- */
1887
+ // TODO: [🐠] Maybe more info why the URL is invalid
1862
1888
 
1863
1889
  /**
1864
1890
  * Validates PipelineJson if it is logically valid
@@ -1875,6 +1901,7 @@
1875
1901
  * @param pipeline valid or invalid PipelineJson
1876
1902
  * @returns the same pipeline if it is logically valid
1877
1903
  * @throws {PipelineLogicError} on logical error in the pipeline
1904
+ *
1878
1905
  * @public exported from `@promptbook/core`
1879
1906
  */
1880
1907
  function validatePipeline(pipeline) {
@@ -1899,6 +1926,8 @@
1899
1926
  return pipeline;
1900
1927
  }
1901
1928
  /**
1929
+ * Validates pipeline inner function.
1930
+ *
1902
1931
  * @private internal function for `validatePipeline`
1903
1932
  */
1904
1933
  function validatePipeline_InnerFunction(pipeline) {
@@ -2143,15 +2172,13 @@
2143
2172
  * > * - ...
2144
2173
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
2145
2174
  */
2146
- /**
2147
- * TODO: [🧳][main] !!4 Validate that all examples match expectations
2148
- * TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2149
- * TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2150
- * TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2151
- * TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2152
- * TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2153
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2154
- */
2175
+ // TODO: [🧳][main] !!4 Validate that all examples match expectations
2176
+ // TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2177
+ // TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2178
+ // TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2179
+ // TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2180
+ // TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2181
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2155
2182
 
2156
2183
  /**
2157
2184
  * Loads the books from the archive file with `.bookc` extension
@@ -2178,9 +2205,7 @@
2178
2205
  }
2179
2206
  return collectionJson;
2180
2207
  }
2181
- /**
2182
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2183
- */
2208
+ // 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
2184
2209
 
2185
2210
  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"}];
2186
2211
 
@@ -2203,6 +2228,7 @@
2203
2228
  * Tests if given string is valid file path.
2204
2229
  *
2205
2230
  * Note: This does not check if the file exists only if the path is valid
2231
+ *
2206
2232
  * @public exported from `@promptbook/utils`
2207
2233
  */
2208
2234
  function isValidFilePath(filename) {
@@ -2251,9 +2277,7 @@
2251
2277
  }
2252
2278
  return false;
2253
2279
  }
2254
- /**
2255
- * TODO: [🍏] Implement for MacOs
2256
- */
2280
+ // TODO: [🍏] Implement for MacOs
2257
2281
 
2258
2282
  /**
2259
2283
  * Function isValidJsonString will tell you if the string is valid JSON or not
@@ -2286,6 +2310,7 @@
2286
2310
  * @param {string} pipelineString the candidate for a pipeline string
2287
2311
  * @returns {PipelineString} the same string as input, but validated as valid
2288
2312
  * @throws {ParseError} if the string is not a valid pipeline string
2313
+ *
2289
2314
  * @public exported from `@promptbook/core`
2290
2315
  */
2291
2316
  function validatePipelineString(pipelineString) {
@@ -2304,17 +2329,16 @@
2304
2329
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
2305
2330
  return pipelineString;
2306
2331
  }
2307
- /**
2308
- * TODO: [🧠][🈴] Where is the best location for this file
2309
- */
2332
+ // TODO: [🧠][🈴] Where is the best location for this file
2310
2333
 
2311
2334
  /**
2312
2335
  * Prettify the html code
2313
2336
  *
2314
2337
  * @param content raw html code
2315
2338
  * @returns formatted html code
2316
- * @private withing the package because of HUGE size of prettier dependency
2317
2339
  * @deprecated Prettier removed from Promptbook due to package size
2340
+ *
2341
+ * @private withing the package because of HUGE size of prettier dependency
2318
2342
  */
2319
2343
  function prettifyMarkdown(content) {
2320
2344
  return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
@@ -2337,6 +2361,7 @@
2337
2361
  * @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
2338
2362
  * @param pipelineJson Promptbook in JSON format (.bookc)
2339
2363
  * @returns Promptbook in string format (.book.md)
2364
+ *
2340
2365
  * @public exported from `@promptbook/core`
2341
2366
  */
2342
2367
  function pipelineJsonToString(pipelineJson) {
@@ -2453,6 +2478,8 @@
2453
2478
  return validatePipelineString(pipelineString);
2454
2479
  }
2455
2480
  /**
2481
+ * Handles task parameter Json to string.
2482
+ *
2456
2483
  * @private internal utility of `pipelineJsonToString`
2457
2484
  */
2458
2485
  function taskParameterJsonToString(taskParameterJson) {
@@ -2463,13 +2490,11 @@
2463
2490
  }
2464
2491
  return parameterString;
2465
2492
  }
2466
- /**
2467
- * TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
2468
- * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
2469
- * TODO: [🏛] Maybe make some markdown builder
2470
- * TODO: [🏛] Escape all
2471
- * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
2472
- */
2493
+ // TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
2494
+ // TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
2495
+ // TODO: [🏛] Maybe make some markdown builder
2496
+ // TODO: [🏛] Escape all
2497
+ // TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
2473
2498
 
2474
2499
  /**
2475
2500
  * This error indicates that promptbook not found in the collection
@@ -2502,6 +2527,7 @@
2502
2527
  *
2503
2528
  * @param template the string template with parameters in {curly} braces
2504
2529
  * @returns the list of parameter names
2530
+ *
2505
2531
  * @public exported from `@promptbook/utils`
2506
2532
  */
2507
2533
  function extractParameterNames(template) {
@@ -2518,6 +2544,7 @@
2518
2544
  * Unprepare just strips the preparation data of the pipeline
2519
2545
  *
2520
2546
  * @deprecated In future version this function will be removed or deprecated
2547
+ *
2521
2548
  * @public exported from `@promptbook/core`
2522
2549
  */
2523
2550
  function unpreparePipeline(pipeline) {
@@ -2546,18 +2573,17 @@
2546
2573
  },
2547
2574
  });
2548
2575
  }
2549
- /**
2550
- * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
2551
- * TODO: Write tests for `preparePipeline`
2552
- * TODO: [🍙] Make some standard order of json properties
2553
- */
2576
+ // TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
2577
+ // TODO: Write tests for `preparePipeline`
2578
+ // TODO: [🍙] Make some standard order of json properties
2554
2579
 
2555
2580
  /**
2556
2581
  * Library of pipelines that groups together pipelines for an application.
2557
2582
  * This implementation is a very thin wrapper around the Array / Map of pipelines.
2558
2583
  *
2559
- * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
2560
2584
  * @see https://github.com/webgptorg/pipeline#pipeline-collection
2585
+ *
2586
+ * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
2561
2587
  */
2562
2588
  class SimplePipelineCollection {
2563
2589
  /**
@@ -2661,6 +2687,7 @@
2661
2687
  *
2662
2688
  * @param promptbookSources
2663
2689
  * @returns PipelineCollection
2690
+ *
2664
2691
  * @public exported from `@promptbook/core`
2665
2692
  */
2666
2693
  function createPipelineCollectionFromJson(...promptbooks) {
@@ -2806,9 +2833,7 @@
2806
2833
  Object.setPrototypeOf(this, DatabaseError.prototype);
2807
2834
  }
2808
2835
  }
2809
- /**
2810
- * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
2811
- */
2836
+ // TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
2812
2837
 
2813
2838
  /**
2814
2839
  * This error type indicates that you try to use a feature that is not available in the current environment
@@ -2826,10 +2851,11 @@
2826
2851
  /**
2827
2852
  * This error occurs when some expectation is not met in the execution of the pipeline
2828
2853
  *
2829
- * @public exported from `@promptbook/core`
2830
2854
  * Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
2831
2855
  * Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
2832
2856
  * Note: This is a kindof subtype of PipelineExecutionError
2857
+ *
2858
+ * @public exported from `@promptbook/core`
2833
2859
  */
2834
2860
  class ExpectError extends Error {
2835
2861
  constructor(message) {
@@ -2907,16 +2933,15 @@
2907
2933
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
2908
2934
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
2909
2935
  *
2910
- * @private internal helper function
2911
2936
  * @returns secure random token
2937
+ *
2938
+ * @private internal helper function
2912
2939
  */
2913
2940
  function $randomToken(randomness) {
2914
2941
  return crypto.randomBytes(randomness).toString('hex');
2915
2942
  }
2916
- /**
2917
- * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
2918
- * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
2919
- */
2943
+ // TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
2944
+ // TODO: Maybe use nanoid instead https://github.com/ai/nanoid
2920
2945
 
2921
2946
  /**
2922
2947
  * This error indicates errors during the execution of the pipeline
@@ -2933,9 +2958,7 @@
2933
2958
  Object.setPrototypeOf(this, PipelineExecutionError.prototype);
2934
2959
  }
2935
2960
  }
2936
- /**
2937
- * TODO: [🧠][🌂] Add id to all errors
2938
- */
2961
+ // TODO: [🧠][🌂] Add id to all errors
2939
2962
 
2940
2963
  /**
2941
2964
  * Error thrown when a fetch request fails
@@ -3011,9 +3034,7 @@
3011
3034
  ...PROMPTBOOK_ERRORS,
3012
3035
  ...COMMON_JAVASCRIPT_ERRORS,
3013
3036
  };
3014
- /**
3015
- * Note: [💞] Ignore a discrepancy between file name and entity name
3016
- */
3037
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3017
3038
 
3018
3039
  /**
3019
3040
  * Serializes an error into a [🚉] JSON-serializable object
@@ -3046,7 +3067,7 @@
3046
3067
 
3047
3068
  /**
3048
3069
  * Recursively converts JSON strings to JSON objects
3049
-
3070
+ *
3050
3071
  * @public exported from `@promptbook/utils`
3051
3072
  */
3052
3073
  function jsonStringsToJsons(object) {
@@ -3070,9 +3091,7 @@
3070
3091
  }
3071
3092
  return newObject;
3072
3093
  }
3073
- /**
3074
- * TODO: Type the return type correctly
3075
- */
3094
+ // TODO: Type the return type correctly
3076
3095
 
3077
3096
  /**
3078
3097
  * Deserializes the error object
@@ -3107,6 +3126,7 @@
3107
3126
  *
3108
3127
  * @param executionResult - The partial result of the Promptbook execution
3109
3128
  * @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
3129
+ *
3110
3130
  * @private internal helper function of `asPromise` method of `ExecutionTask`
3111
3131
  */
3112
3132
  function assertsTaskSuccessful(executionResult) {
@@ -3137,9 +3157,7 @@
3137
3157
  `));
3138
3158
  }
3139
3159
  }
3140
- /**
3141
- * TODO: [🧠] Can this return type be better typed than void
3142
- */
3160
+ // TODO: [🧠] Can this return type be better typed than void
3143
3161
 
3144
3162
  /**
3145
3163
  * Helper to create a new task
@@ -3330,10 +3348,8 @@
3330
3348
  },
3331
3349
  };
3332
3350
  }
3333
- /**
3334
- * TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3335
- * TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3336
- */
3351
+ // TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3352
+ // TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3337
3353
 
3338
3354
  /**
3339
3355
  * Represents the uncertain value
@@ -3401,9 +3417,7 @@
3401
3417
  pagesCount: UNCERTAIN_ZERO_VALUE,
3402
3418
  },
3403
3419
  });
3404
- /**
3405
- * Note: [💞] Ignore a discrepancy between file name and entity name
3406
- */
3420
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3407
3421
 
3408
3422
  /**
3409
3423
  * Format either small or big number
@@ -3438,8 +3452,8 @@
3438
3452
  * This is useful and used in the `templateParameters` function
3439
3453
  *
3440
3454
  * Note: This function is not just calling `toString` method
3441
- * It's more complex and can handle this conversion specifically for LLM models
3442
- * See `VALUE_STRINGS`
3455
+ * It's more complex and can handle this conversion specifically for LLM models
3456
+ * See `VALUE_STRINGS`
3443
3457
  *
3444
3458
  * Note: There are 2 similar functions
3445
3459
  * - `valueToString` converts value to string for LLM models as human-readable string
@@ -3546,6 +3560,7 @@
3546
3560
  * @param script from which to extract the variables
3547
3561
  * @returns the list of variable names
3548
3562
  * @throws {ParseError} if the script is invalid
3563
+ *
3549
3564
  * @public exported from `@promptbook/javascript`
3550
3565
  */
3551
3566
  function extractVariablesFromJavascript(script) {
@@ -3611,9 +3626,7 @@
3611
3626
  }
3612
3627
  return variables;
3613
3628
  }
3614
- /**
3615
- * TODO: [🔣] Support for multiple languages - python, java,...
3616
- */
3629
+ // TODO: [🔣] Support for multiple languages - python, java,...
3617
3630
 
3618
3631
  /**
3619
3632
  * Parses the task and returns the set of all used parameters
@@ -3621,6 +3634,7 @@
3621
3634
  * @param task the task with used parameters
3622
3635
  * @returns the set of parameter names
3623
3636
  * @throws {ParseError} if the script is invalid
3637
+ *
3624
3638
  * @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
3625
3639
  */
3626
3640
  function extractParameterNamesFromTask(task) {
@@ -3661,14 +3675,13 @@
3661
3675
  }
3662
3676
  return parameterNames;
3663
3677
  }
3664
- /**
3665
- * TODO: [🔣] If script require contentLanguage
3666
- */
3678
+ // TODO: [🔣] If script require contentLanguage
3667
3679
 
3668
3680
  /**
3669
3681
  * Create difference set of two sets.
3670
3682
  *
3671
3683
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
3684
+ *
3672
3685
  * @public exported from `@promptbook/utils`
3673
3686
  */
3674
3687
  function difference(a, b, isEqual = (a, b) => a === b) {
@@ -3680,14 +3693,13 @@
3680
3693
  }
3681
3694
  return diff;
3682
3695
  }
3683
- /**
3684
- * TODO: [🧠][💯] Maybe also implement symmetricDifference
3685
- */
3696
+ // TODO: [🧠][💯] Maybe also implement symmetricDifference
3686
3697
 
3687
3698
  /**
3688
3699
  * Creates a new set with all elements that are present in either set
3689
3700
  *
3690
3701
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
3702
+ *
3691
3703
  * @public exported from `@promptbook/utils`
3692
3704
  */
3693
3705
  function union(...sets) {
@@ -3753,8 +3765,9 @@
3753
3765
  /**
3754
3766
  * Definition for CSV spreadsheet
3755
3767
  *
3768
+ * TODO: [🏢] Export from package `@promptbook/csv`
3769
+ *
3756
3770
  * @public exported from `@promptbook/core`
3757
- * <- TODO: [🏢] Export from package `@promptbook/csv`
3758
3771
  */
3759
3772
  const CsvFormatParser = {
3760
3773
  formatName: 'CSV',
@@ -3844,13 +3857,11 @@
3844
3857
  },
3845
3858
  ],
3846
3859
  };
3847
- /**
3848
- * TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
3849
- * TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
3850
- * TODO: [🍓] In `CsvFormatParser` implement `heal
3851
- * TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
3852
- * TODO: [🏢] Allow to expect something inside CSV objects and other formats
3853
- */
3860
+ // TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
3861
+ // TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
3862
+ // TODO: [🍓] In `CsvFormatParser` implement `heal
3863
+ // TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
3864
+ // TODO: [🏢] Allow to expect something inside CSV objects and other formats
3854
3865
 
3855
3866
  /**
3856
3867
  * Definition for JSON format
@@ -3871,17 +3882,15 @@
3871
3882
  },
3872
3883
  subvalueParsers: [],
3873
3884
  };
3874
- /**
3875
- * TODO: [🧠] Maybe proper instance of object
3876
- * TODO: [0] Make string_serialized_json
3877
- * TODO: [1] Make type for JSON Settings and Schema
3878
- * TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
3879
- * TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
3880
- * TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
3881
- * TODO: [🍓] In `JsonFormatParser` implement `heal
3882
- * TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
3883
- * TODO: [🏢] Allow to expect something inside JSON objects and other formats
3884
- */
3885
+ // TODO: [🧠] Maybe proper instance of object
3886
+ // TODO: [0] Make string_serialized_json
3887
+ // TODO: [1] Make type for JSON Settings and Schema
3888
+ // TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
3889
+ // TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
3890
+ // TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
3891
+ // TODO: [🍓] In `JsonFormatParser` implement `heal
3892
+ // TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
3893
+ // TODO: [🏢] Allow to expect something inside JSON objects and other formats
3885
3894
 
3886
3895
  /**
3887
3896
  * Definition for any text - this will be always valid
@@ -3919,15 +3928,13 @@
3919
3928
  // <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
3920
3929
  ],
3921
3930
  };
3922
- /**
3923
- * TODO: [1] Make type for XML Text and Schema
3924
- * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
3925
- * TODO: [🍓] In `TextFormatParser` implement simple `isValid`
3926
- * TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
3927
- * TODO: [🍓] In `TextFormatParser` implement `heal
3928
- * TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
3929
- * TODO: [🏢] Allow to expect something inside each item of list and other formats
3930
- */
3931
+ // TODO: [1] Make type for XML Text and Schema
3932
+ // TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
3933
+ // TODO: [🍓] In `TextFormatParser` implement simple `isValid`
3934
+ // TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
3935
+ // TODO: [🍓] In `TextFormatParser` implement `heal
3936
+ // TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
3937
+ // TODO: [🏢] Allow to expect something inside each item of list and other formats
3931
3938
 
3932
3939
  /**
3933
3940
  * Function to check if a string is valid XML
@@ -3972,17 +3979,15 @@
3972
3979
  },
3973
3980
  subvalueParsers: [],
3974
3981
  };
3975
- /**
3976
- * TODO: [🧠] Maybe proper instance of object
3977
- * TODO: [0] Make string_serialized_xml
3978
- * TODO: [1] Make type for XML Settings and Schema
3979
- * TODO: [🧠] What to use for validating XMLs - XSD,...
3980
- * TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
3981
- * TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
3982
- * TODO: [🍓] In `XmlFormatParser` implement `heal
3983
- * TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
3984
- * TODO: [🏢] Allow to expect something inside XML and other formats
3985
- */
3982
+ // TODO: [🧠] Maybe proper instance of object
3983
+ // TODO: [0] Make string_serialized_xml
3984
+ // TODO: [1] Make type for XML Settings and Schema
3985
+ // TODO: [🧠] What to use for validating XMLs - XSD,...
3986
+ // TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
3987
+ // TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
3988
+ // TODO: [🍓] In `XmlFormatParser` implement `heal
3989
+ // TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
3990
+ // TODO: [🏢] Allow to expect something inside XML and other formats
3986
3991
 
3987
3992
  /**
3988
3993
  * Definitions for all formats supported by Promptbook
@@ -3990,9 +3995,7 @@
3990
3995
  * @private internal index of `...` <- TODO [🏢]
3991
3996
  */
3992
3997
  const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
3993
- /**
3994
- * Note: [💞] Ignore a discrepancy between file name and entity name
3995
- */
3998
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3996
3999
 
3997
4000
  /**
3998
4001
  * Maps available parameters to expected parameters for a pipeline task.
@@ -4002,6 +4005,7 @@
4002
4005
  * 2) Then, if there are unmatched expected and available parameters, map them by order.
4003
4006
  *
4004
4007
  * @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
4008
+ *
4005
4009
  * @private within the repository used in `createPipelineExecutor`
4006
4010
  */
4007
4011
  function mapAvailableToExpectedParameters(options) {
@@ -4091,6 +4095,7 @@
4091
4095
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
4092
4096
  *
4093
4097
  * Note: Internal utility of `joinLlmExecutionTools` but exposed type
4098
+ *
4094
4099
  * @public exported from `@promptbook/core`
4095
4100
  */
4096
4101
  class MultipleLlmExecutionTools {
@@ -4253,16 +4258,16 @@
4253
4258
  * `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
4254
4259
  *
4255
4260
  * 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
4256
- * If the first provider doesn't support the requested model or fails, it tries the next one.
4261
+ * If the first provider doesn't support the requested model or fails, it tries the next one.
4257
4262
  * 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
4258
4263
  * 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
4259
4264
  *
4265
+ * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4266
+ *
4260
4267
  * @param title - A descriptive title for this collection of joined tools
4261
4268
  * @param llmExecutionTools - An array of execution tools to be joined
4262
4269
  * @returns A single unified execution tool wrapper
4263
4270
  *
4264
- * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4265
- *
4266
4271
  * @public exported from `@promptbook/core`
4267
4272
  */
4268
4273
  function joinLlmExecutionTools(title, ...llmExecutionTools) {
@@ -4299,10 +4304,8 @@
4299
4304
  }
4300
4305
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4301
4306
  }
4302
- /**
4303
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4304
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4305
- */
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
4306
4309
 
4307
4310
  /**
4308
4311
  * Just returns the given `LlmExecutionTools` or joins multiple into one
@@ -4316,10 +4319,8 @@
4316
4319
  : joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
4317
4320
  return llmTools;
4318
4321
  }
4319
- /**
4320
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4321
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4322
- */
4322
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4323
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4323
4324
 
4324
4325
  /**
4325
4326
  * Just says that the variable is not used but should be kept
@@ -4333,6 +4334,7 @@
4333
4334
  *
4334
4335
  * @param value any values
4335
4336
  * @returns void
4337
+ *
4336
4338
  * @private within the repository
4337
4339
  */
4338
4340
  function keepUnused(...valuesToKeep) {
@@ -4342,12 +4344,13 @@
4342
4344
  * Replaces parameters in template with values from parameters object
4343
4345
  *
4344
4346
  * Note: This function is not places strings into string,
4345
- * It's more complex and can handle this operation specifically for LLM models
4347
+ * It's more complex and can handle this operation specifically for LLM models
4346
4348
  *
4347
4349
  * @param template the template with parameters in {curly} braces
4348
4350
  * @param parameters the object with parameters
4349
4351
  * @returns the template with replaced parameters
4350
4352
  * @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
4353
+ *
4351
4354
  * @public exported from `@promptbook/utils`
4352
4355
  */
4353
4356
  function templateParameters(template, parameters) {
@@ -4421,6 +4424,7 @@
4421
4424
  * @param markdown any valid markdown
4422
4425
  * @returns code blocks with language and content
4423
4426
  * @throws {ParseError} if block is not closed properly
4427
+ *
4424
4428
  * @public exported from `@promptbook/markdown-utils`
4425
4429
  */
4426
4430
  function extractAllBlocksFromMarkdown(markdown) {
@@ -4471,9 +4475,7 @@
4471
4475
  }
4472
4476
  return codeBlocks;
4473
4477
  }
4474
- /**
4475
- * TODO: Maybe name for `blockNotation` instead of '```' and '>'
4476
- */
4478
+ // TODO: Maybe name for `blockNotation` instead of '```' and '>'
4477
4479
 
4478
4480
  /**
4479
4481
  * Extracts extracts exactly one valid JSON code block
@@ -4489,8 +4491,9 @@
4489
4491
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
4490
4492
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
4491
4493
  *
4492
- * @public exported from `@promptbook/markdown-utils`
4493
4494
  * @throws {ParseError} if there is no valid JSON block in the markdown
4495
+ *
4496
+ * @public exported from `@promptbook/markdown-utils`
4494
4497
  */
4495
4498
  function extractJsonBlock(markdown) {
4496
4499
  if (isValidJsonString(markdown)) {
@@ -4506,10 +4509,8 @@
4506
4509
  }
4507
4510
  return jsonBlocks[0].content;
4508
4511
  }
4509
- /**
4510
- * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
4511
- * TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
4512
- */
4512
+ // TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
4513
+ // TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
4513
4514
 
4514
4515
  /**
4515
4516
  * Counts number of characters in the text
@@ -4525,10 +4526,8 @@
4525
4526
  text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
4526
4527
  return text.length;
4527
4528
  }
4528
- /**
4529
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4530
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4531
- */
4529
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4530
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4532
4531
 
4533
4532
  /**
4534
4533
  * Number of characters per standard line with 11pt Arial font size.
@@ -4542,10 +4541,8 @@
4542
4541
  * @public exported from `@promptbook/utils`
4543
4542
  */
4544
4543
  const LINES_PER_STANDARD_PAGE = 44;
4545
- /**
4546
- * TODO: [🧠] Should be this `constants.ts` or `config.ts`?
4547
- * Note: [💞] Ignore a discrepancy between file name and entity name
4548
- */
4544
+ // TODO: [🧠] Should be this `constants.ts` or `config.ts`?
4545
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4549
4546
 
4550
4547
  /**
4551
4548
  * Counts number of lines in the text
@@ -4563,10 +4560,8 @@
4563
4560
  const lines = text.split(/\r?\n/);
4564
4561
  return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
4565
4562
  }
4566
- /**
4567
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4568
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4569
- */
4563
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4564
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4570
4565
 
4571
4566
  /**
4572
4567
  * Counts number of pages in the text
@@ -4578,10 +4573,8 @@
4578
4573
  function countPages(text) {
4579
4574
  return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
4580
4575
  }
4581
- /**
4582
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4583
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4584
- */
4576
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4577
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4585
4578
 
4586
4579
  /**
4587
4580
  * Counts number of paragraphs in the text
@@ -4591,10 +4584,8 @@
4591
4584
  function countParagraphs(text) {
4592
4585
  return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
4593
4586
  }
4594
- /**
4595
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4596
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4597
- */
4587
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4588
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4598
4589
 
4599
4590
  /**
4600
4591
  * Split text into sentences
@@ -4612,11 +4603,12 @@
4612
4603
  function countSentences(text) {
4613
4604
  return splitIntoSentences(text).length;
4614
4605
  }
4606
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4607
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4608
+
4615
4609
  /**
4616
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4617
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4610
+ * Collection of default diacritics removal map.
4618
4611
  */
4619
-
4620
4612
  const defaultDiacriticsRemovalMap = [
4621
4613
  {
4622
4614
  base: 'A',
@@ -4868,6 +4860,7 @@
4868
4860
  *
4869
4861
  * @param input The string containing diacritics to be normalized.
4870
4862
  * @returns The string with diacritics removed or normalized.
4863
+ *
4871
4864
  * @public exported from `@promptbook/utils`
4872
4865
  */
4873
4866
  function removeDiacritics(input) {
@@ -4876,9 +4869,7 @@
4876
4869
  return DIACRITIC_VARIANTS_LETTERS[character] || character;
4877
4870
  });
4878
4871
  }
4879
- /**
4880
- * TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4881
- */
4872
+ // TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4882
4873
 
4883
4874
  /**
4884
4875
  * Counts number of words in the text
@@ -4892,11 +4883,9 @@
4892
4883
  text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
4893
4884
  return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
4894
4885
  }
4895
- /**
4896
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4897
- * TODO: [🧠][✌️] Make some Promptbook-native token system
4898
- * TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
4899
- */
4886
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
4887
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
4888
+ // TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
4900
4889
 
4901
4890
  /**
4902
4891
  * Index of all counter functions
@@ -4911,10 +4900,8 @@
4911
4900
  LINES: countLines,
4912
4901
  PAGES: countPages,
4913
4902
  };
4914
- /**
4915
- * TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
4916
- * Note: [💞] Ignore a discrepancy between file name and entity name
4917
- */
4903
+ // TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
4904
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4918
4905
 
4919
4906
  /**
4920
4907
  * Function checkExpectations will check if the expectations on given value are met
@@ -4925,6 +4912,7 @@
4925
4912
  *
4926
4913
  * @throws {ExpectError} if the expectations are not met
4927
4914
  * @returns {void} Nothing
4915
+ *
4928
4916
  * @private internal function of `createPipelineExecutor`
4929
4917
  */
4930
4918
  function checkExpectations(expectations, value) {
@@ -4938,11 +4926,9 @@
4938
4926
  }
4939
4927
  }
4940
4928
  }
4941
- /**
4942
- * TODO: [💝] Unite object for expecting amount and format
4943
- * TODO: [🧠][🤠] This should be part of `TextFormatParser`
4944
- * Note: [💝] and [🤠] are interconnected together
4945
- */
4929
+ // TODO: [💝] Unite object for expecting amount and format
4930
+ // TODO: [🧠][🤠] This should be part of `TextFormatParser`
4931
+ // Note: [💝] and [🤠] are interconnected together
4946
4932
 
4947
4933
  /**
4948
4934
  * Validates a prompt result against expectations and format requirements.
@@ -4953,6 +4939,7 @@
4953
4939
  *
4954
4940
  * @param options - The validation options including result string, expectations, and format
4955
4941
  * @returns Validation result with processed string and validity status
4942
+ *
4956
4943
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
4957
4944
  */
4958
4945
  function validatePromptResult(options) {
@@ -5015,6 +5002,7 @@
5015
5002
  *
5016
5003
  * @param options - The options for execution, including task, parameters, pipeline, and configuration.
5017
5004
  * @returns The result string of the executed task.
5005
+ *
5018
5006
  * @private internal utility of `createPipelineExecutor`
5019
5007
  */
5020
5008
  async function executeAttempts(options) {
@@ -5338,9 +5326,7 @@
5338
5326
  }
5339
5327
  return $ongoingTaskResult.$resultString;
5340
5328
  }
5341
- /**
5342
- * TODO: Break into smaller functions
5343
- */
5329
+ // TODO: Break into smaller functions
5344
5330
 
5345
5331
  /**
5346
5332
  * Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
@@ -5483,6 +5469,7 @@
5483
5469
  *
5484
5470
  * @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
5485
5471
  * @returns The context as a string, formatted as markdown and parameter value.
5472
+ *
5486
5473
  * @private internal utility of `createPipelineExecutor`
5487
5474
  */
5488
5475
  async function getContextForTask(task) {
@@ -5520,7 +5507,6 @@
5520
5507
  }
5521
5508
 
5522
5509
  /**
5523
- *
5524
5510
  * @param knowledgePieces
5525
5511
  * @returns
5526
5512
  *
@@ -5601,10 +5587,8 @@
5601
5587
  return knowledgePiecesToString(preparedPipeline.knowledgePieces);
5602
5588
  }
5603
5589
  }
5604
- /**
5605
- * TODO: [♨] Implement Better - use keyword search
5606
- * TODO: [♨] Examples of values
5607
- */
5590
+ // TODO: [♨] Implement Better - use keyword search
5591
+ // TODO: [♨] Examples of values
5608
5592
 
5609
5593
  /**
5610
5594
  * Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
@@ -5757,9 +5741,7 @@
5757
5741
  resultString,
5758
5742
  });
5759
5743
  }
5760
- /**
5761
- * TODO: [🤹‍♂️]
5762
- */
5744
+ // TODO: [🤹‍♂️]
5763
5745
 
5764
5746
  /**
5765
5747
  * Filters and returns only the output parameters from the provided pipeline execution options.
@@ -6089,6 +6071,7 @@
6089
6071
  *
6090
6072
  * @returns The executor function
6091
6073
  * @throws {PipelineLogicError} on logical error in the pipeline
6074
+ *
6092
6075
  * @public exported from `@promptbook/core`
6093
6076
  */
6094
6077
  function createPipelineExecutor(options) {
@@ -6244,8 +6227,9 @@
6244
6227
  * @param array - Array to iterate over
6245
6228
  * @param options - Options for the function
6246
6229
  * @param callbackfunction - Function to call for each item
6247
- * @public exported from `@promptbook/utils`
6248
6230
  * @deprecated [🪂] Use queues instead
6231
+ *
6232
+ * @public exported from `@promptbook/utils`
6249
6233
  */
6250
6234
  async function forEachAsync(array, options, callbackfunction) {
6251
6235
  const { maxParallelCount = Infinity } = options;
@@ -6276,6 +6260,7 @@
6276
6260
  *
6277
6261
  * @param llmTools - The LLM tools to be intercepted and tracked
6278
6262
  * @returns Full proxy of the tools with added usage tracking capabilities
6263
+ *
6279
6264
  * @public exported from `@promptbook/core`
6280
6265
  */
6281
6266
  function countUsage(llmTools) {
@@ -6373,6 +6358,7 @@
6373
6358
  * Prepares the persona for the pipeline
6374
6359
  *
6375
6360
  * @see https://github.com/webgptorg/promptbook/discussions/22
6361
+ *
6376
6362
  * @public exported from `@promptbook/core`
6377
6363
  */
6378
6364
  async function preparePersona(personaDescription, tools, options) {
@@ -6429,13 +6415,11 @@
6429
6415
  modelsRequirements,
6430
6416
  };
6431
6417
  }
6432
- /**
6433
- * TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
6434
- * TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
6435
- * TODO: [🏢] Check validity of `modelName` in pipeline
6436
- * TODO: [🏢] Check validity of `systemMessage` in pipeline
6437
- * TODO: [🏢] Check validity of `temperature` in pipeline
6438
- */
6418
+ // TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
6419
+ // TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
6420
+ // TODO: [🏢] Check validity of `modelName` in pipeline
6421
+ // TODO: [🏢] Check validity of `systemMessage` in pipeline
6422
+ // TODO: [🏢] Check validity of `temperature` in pipeline
6439
6423
 
6440
6424
  /**
6441
6425
  * Safely retrieves the global scope object (window in browser, global in Node.js)
@@ -6443,7 +6427,7 @@
6443
6427
  *
6444
6428
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
6445
6429
  *
6446
- * @private internal function of `$Register`
6430
+ * @private internal function of `$Register`
6447
6431
  */
6448
6432
  function $getGlobalScope() {
6449
6433
  return Function('return this')();
@@ -6458,6 +6442,7 @@
6458
6442
  * @returns The normalized text in SCREAMING_CASE format.
6459
6443
  * @example 'HELLO_WORLD'
6460
6444
  * @example 'I_LOVE_PROMPTBOOK'
6445
+ *
6461
6446
  * @public exported from `@promptbook/utils`
6462
6447
  */
6463
6448
  function normalizeTo_SCREAMING_CASE(text) {
@@ -6515,6 +6500,7 @@
6515
6500
  * @returns The normalized text in snake_case format.
6516
6501
  * @example 'hello_world'
6517
6502
  * @example 'i_love_promptbook'
6503
+ *
6518
6504
  * @public exported from `@promptbook/utils`
6519
6505
  */
6520
6506
  function normalizeTo_snake_case(text) {
@@ -6573,26 +6559,26 @@
6573
6559
  * Global registry for storing metadata about all available scrapers and converters.
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 in different contexts (e.g., tests).
6564
+ *
6577
6565
  * @public exported from `@promptbook/core`
6578
6566
  */
6579
6567
  const $scrapersMetadataRegister = new $Register('scrapers_metadata');
6580
- /**
6581
- * TODO: [®] DRY Register logic
6582
- */
6568
+ // TODO: [®] DRY Register logic
6583
6569
 
6584
6570
  /**
6585
6571
  * Registry for all available scrapers in the system.
6586
6572
  * Central point for registering and accessing different types of content scrapers.
6587
6573
  *
6588
6574
  * Note: `$` is used to indicate that this interacts with the global scope
6575
+ *
6589
6576
  * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
6577
+ *
6590
6578
  * @public exported from `@promptbook/core`
6591
6579
  */
6592
6580
  const $scrapersRegister = new $Register('scraper_constructors');
6593
- /**
6594
- * TODO: [®] DRY Register logic
6595
- */
6581
+ // TODO: [®] DRY Register logic
6596
6582
 
6597
6583
  /**
6598
6584
  * Creates a message with all registered scrapers
@@ -6677,9 +6663,7 @@
6677
6663
 
6678
6664
  `);
6679
6665
  }
6680
- /**
6681
- * TODO: [®] DRY Register logic
6682
- */
6666
+ // TODO: [®] DRY Register logic
6683
6667
 
6684
6668
  /**
6685
6669
  * Converts a given text to kebab-case format.
@@ -6690,6 +6674,7 @@
6690
6674
  * @returns The kebab-case formatted string.
6691
6675
  * @example 'hello-world'
6692
6676
  * @example 'i-love-promptbook'
6677
+ *
6693
6678
  * @public exported from `@promptbook/utils`
6694
6679
  */
6695
6680
  function normalizeToKebabCase(text) {
@@ -6730,9 +6715,7 @@
6730
6715
  normalizedName = normalizedName.replace(/-$/, '');
6731
6716
  return normalizedName;
6732
6717
  }
6733
- /**
6734
- * Note: [💞] Ignore a discrepancy between file name and entity name
6735
- */
6718
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6736
6719
 
6737
6720
  /**
6738
6721
  * Creates unique name for the source
@@ -6751,9 +6734,7 @@
6751
6734
  // <- TODO: Use MAX_FILENAME_LENGTH
6752
6735
  return name;
6753
6736
  }
6754
- /**
6755
- * TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
6756
- */
6737
+ // TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
6757
6738
 
6758
6739
  /**
6759
6740
  * Converts a name to a properly formatted subfolder path for cache storage.
@@ -6803,11 +6784,9 @@
6803
6784
  .catch(() => false);
6804
6785
  return isFile;
6805
6786
  }
6806
- /**
6807
- * Note: Not [~🟢~] because it is not directly dependent on `fs
6808
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
6809
- * TODO: [🖇] What about symlinks?
6810
- */
6787
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
6788
+ // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
6789
+ // TODO: [🖇] What about symlinks?
6811
6790
 
6812
6791
  /**
6813
6792
  * Convert mime type to file extension
@@ -6827,6 +6806,7 @@
6827
6806
  *
6828
6807
  * @param text with emojis
6829
6808
  * @returns text without emojis
6809
+ *
6830
6810
  * @public exported from `@promptbook/utils`
6831
6811
  */
6832
6812
  function removeEmojis(text) {
@@ -6846,6 +6826,7 @@
6846
6826
  * @param value The title string to be converted to a name.
6847
6827
  * @returns A normalized name derived from the input title.
6848
6828
  * @example 'Hello World!' -> 'hello-world'
6829
+ *
6849
6830
  * @public exported from `@promptbook/utils`
6850
6831
  */
6851
6832
  function titleToName(value) {
@@ -6891,9 +6872,7 @@
6891
6872
  `));
6892
6873
  }
6893
6874
  };
6894
- /**
6895
- * TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
6896
- */
6875
+ // TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
6897
6876
 
6898
6877
  /**
6899
6878
  * Factory function that creates a handler for processing knowledge sources.
@@ -7113,6 +7092,7 @@
7113
7092
  * Prepares the knowledge pieces
7114
7093
  *
7115
7094
  * @see https://github.com/webgptorg/promptbook/discussions/41
7095
+ *
7116
7096
  * @public exported from `@promptbook/core`
7117
7097
  */
7118
7098
  async function prepareKnowledgePieces(knowledgeSources, tools, options) {
@@ -7254,25 +7234,24 @@
7254
7234
  });
7255
7235
  return { tasksPrepared };
7256
7236
  }
7257
- /**
7258
- * TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
7259
- * TODO: [🧠] Add context to each task (if missing)
7260
- * TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
7261
- * TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
7262
- * TODO: Write tests for `preparePipeline`
7263
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
7264
- * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
7265
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
7266
- */
7237
+ // TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
7238
+ // TODO: [🧠] Add context to each task (if missing)
7239
+ // TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
7240
+ // TODO: [][main] !!3 Prepare index the examples and maybe tasks
7241
+ // TODO: Write tests for `preparePipeline`
7242
+ // TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
7243
+ // TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
7244
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
7267
7245
 
7268
7246
  /**
7269
7247
  * Prepare pipeline locally
7270
7248
  *
7271
- * @see https://github.com/webgptorg/promptbook/discussions/196
7272
- *
7273
7249
  * Note: This function does not validate logic of the pipeline
7274
7250
  * Note: This function acts as part of compilation process
7275
7251
  * Note: When the pipeline is already prepared, it returns the same pipeline
7252
+ *
7253
+ * @see https://github.com/webgptorg/promptbook/discussions/196
7254
+ *
7276
7255
  * @public exported from `@promptbook/core`
7277
7256
  */
7278
7257
  async function preparePipeline(pipeline, tools, options) {
@@ -7451,6 +7430,7 @@
7451
7430
  * Parses the knowledge command
7452
7431
  *
7453
7432
  * @see `documentationUrl` for more details
7433
+ *
7454
7434
  * @public exported from `@promptbook/editable`
7455
7435
  */
7456
7436
  const knowledgeCommandParser = {
@@ -7537,14 +7517,13 @@
7537
7517
  throw new NotYetImplementedError(`[🛋] Not implemented yet`); // <- TODO: [🛋] Implement
7538
7518
  },
7539
7519
  };
7540
- /**
7541
- * Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
7542
- */
7520
+ // Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
7543
7521
 
7544
7522
  /**
7545
7523
  * Parses the section command
7546
7524
  *
7547
7525
  * @see `documentationUrl` for more details
7526
+ *
7548
7527
  * @public exported from `@promptbook/editable`
7549
7528
  */
7550
7529
  const sectionCommandParser = {
@@ -7736,6 +7715,7 @@
7736
7715
  * Note: @@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
7737
7716
  *
7738
7717
  * @see `documentationUrl` for more details
7718
+ *
7739
7719
  * @private within the commands folder
7740
7720
  */
7741
7721
  const boilerplateCommandParser = {
@@ -7827,6 +7807,7 @@
7827
7807
  * Parses the BOOK_VERSION command
7828
7808
  *
7829
7809
  * @see `documentationUrl` for more details
7810
+ *
7830
7811
  * @public exported from `@promptbook/editable`
7831
7812
  */
7832
7813
  const bookVersionCommandParser = {
@@ -7903,12 +7884,11 @@
7903
7884
  * Units of text measurement
7904
7885
  *
7905
7886
  * @see https://github.com/webgptorg/promptbook/discussions/30
7887
+ *
7906
7888
  * @public exported from `@promptbook/core`
7907
7889
  */
7908
7890
  const EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPHS', 'PAGES'];
7909
- /**
7910
- * TODO: [💝] Unite object for expecting amount and format - remove format
7911
- */
7891
+ // TODO: [💝] Unite object for expecting amount and format - remove format
7912
7892
 
7913
7893
  /**
7914
7894
  * Function parseNumber will parse number from string
@@ -7977,17 +7957,16 @@
7977
7957
  }
7978
7958
  return num;
7979
7959
  }
7980
- /**
7981
- * TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
7982
- * TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
7983
- */
7960
+ // TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
7961
+ // TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
7984
7962
 
7985
7963
  /**
7986
- import { WrappedError } from '../../errors/WrappedError';
7987
- import { assertsError } from '../../errors/assertsError';
7964
+ * import { WrappedError } from '../../errors/WrappedError';
7965
+ * import { assertsError } from '../../errors/assertsError';
7988
7966
  * Parses the expect command
7989
7967
  *
7990
7968
  * @see `documentationUrl` for more details
7969
+ *
7991
7970
  * @public exported from `@promptbook/editable`
7992
7971
  */
7993
7972
  const expectCommandParser = {
@@ -8134,6 +8113,7 @@
8134
8113
  * @returns The camelCase formatted string.
8135
8114
  * @example 'helloWorld'
8136
8115
  * @example 'iLovePromptbook'
8116
+ *
8137
8117
  * @public exported from `@promptbook/utils`
8138
8118
  */
8139
8119
  function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
@@ -8174,9 +8154,7 @@
8174
8154
  }
8175
8155
  return normalizedName;
8176
8156
  }
8177
- /**
8178
- * TODO: [🌺] Use some intermediate util splitWords
8179
- */
8157
+ // TODO: [🌺] Use some intermediate util splitWords
8180
8158
 
8181
8159
  /**
8182
8160
  * Removes quotes from a string
@@ -8190,6 +8168,7 @@
8190
8168
  *
8191
8169
  * @param text optionally quoted text
8192
8170
  * @returns text without quotes
8171
+ *
8193
8172
  * @public exported from `@promptbook/utils`
8194
8173
  */
8195
8174
  function removeQuotes(text) {
@@ -8211,6 +8190,7 @@
8211
8190
  * @param parameterName The parameter name to validate and normalize.
8212
8191
  * @returns The validated and normalized parameter name.
8213
8192
  * @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
8193
+ *
8214
8194
  * @private within the repository
8215
8195
  */
8216
8196
  function validateParameterName(parameterName) {
@@ -8281,6 +8261,7 @@
8281
8261
  * Parses the foreach command
8282
8262
  *
8283
8263
  * @see `documentationUrl` for more details
8264
+ *
8284
8265
  * @public exported from `@promptbook/editable`
8285
8266
  */
8286
8267
  const foreachCommandParser = {
@@ -8439,14 +8420,13 @@
8439
8420
  throw new NotYetImplementedError(`[🛋] Not implemented yet`); // <- TODO: [🛋] Implement
8440
8421
  },
8441
8422
  };
8442
- /**
8443
- * TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
8444
- */
8423
+ // TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
8445
8424
 
8446
8425
  /**
8447
8426
  * Parses the format command
8448
8427
  *
8449
8428
  * @see `documentationUrl` for more details
8429
+ *
8450
8430
  * @public exported from `@promptbook/editable`
8451
8431
  */
8452
8432
  const formatCommandParser = {
@@ -8631,9 +8611,7 @@
8631
8611
  inputParameters: [],
8632
8612
  outputParameters: [],
8633
8613
  };
8634
- /**
8635
- * Note: [💞] Ignore a discrepancy between file name and entity name
8636
- */
8614
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8637
8615
 
8638
8616
  /**
8639
8617
  * A generic pipeline
@@ -8785,9 +8763,7 @@
8785
8763
  CompletionFormfactorDefinition,
8786
8764
  // <- [🛬] When making new formfactor, copy the _boilerplate and link it here
8787
8765
  ];
8788
- /**
8789
- * Note: [💞] Ignore a discrepancy between file name and entity name
8790
- */
8766
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8791
8767
 
8792
8768
  /**
8793
8769
  * Parses the formfactor command
@@ -8795,6 +8771,7 @@
8795
8771
  * 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
8796
8772
  *
8797
8773
  * @see `documentationUrl` for more details
8774
+ *
8798
8775
  * @public exported from `@promptbook/editable`
8799
8776
  */
8800
8777
  const formfactorCommandParser = {
@@ -8890,6 +8867,7 @@
8890
8867
  * Parses the joker command
8891
8868
  *
8892
8869
  * @see `documentationUrl` for more details
8870
+ *
8893
8871
  * @public exported from `@promptbook/editable`
8894
8872
  */
8895
8873
  const jokerCommandParser = {
@@ -8957,7 +8935,10 @@
8957
8935
  };
8958
8936
 
8959
8937
  /**
8938
+ * Constant for model variants.
8939
+ *
8960
8940
  * @see {@link ModelVariant}
8941
+ *
8961
8942
  * @public exported from `@promptbook/core`
8962
8943
  */
8963
8944
  const MODEL_VARIANTS = [
@@ -8972,6 +8953,7 @@
8972
8953
  *
8973
8954
  * @see `documentationUrl` for more details
8974
8955
  * @deprecated Option to manually set the model requirements is not recommended to use, use `PERSONA` instead
8956
+ *
8975
8957
  * @public exported from `@promptbook/editable`
8976
8958
  */
8977
8959
  const modelCommandParser = {
@@ -9152,6 +9134,7 @@
9152
9134
  * Parses the parameter command
9153
9135
  *
9154
9136
  * @see `documentationUrl` for more details
9137
+ *
9155
9138
  * @public exported from `@promptbook/editable`
9156
9139
  */
9157
9140
  const parameterCommandParser = {
@@ -9262,6 +9245,7 @@
9262
9245
  * Parses the persona command
9263
9246
  *
9264
9247
  * @see `documentationUrl` for more details
9248
+ *
9265
9249
  * @public exported from `@promptbook/editable`
9266
9250
  */
9267
9251
  const personaCommandParser = {
@@ -9394,6 +9378,7 @@
9394
9378
  *
9395
9379
  * @param javascriptName The value to check for JavaScript identifier validity.
9396
9380
  * @returns `true` if the value is a valid JavaScript name, false otherwise.
9381
+ *
9397
9382
  * @public exported from `@promptbook/utils`
9398
9383
  */
9399
9384
  function isValidJavascriptName(javascriptName) {
@@ -9407,6 +9392,7 @@
9407
9392
  * Parses the postprocess command
9408
9393
  *
9409
9394
  * @see `documentationUrl` for more details
9395
+ *
9410
9396
  * @public exported from `@promptbook/editable`
9411
9397
  */
9412
9398
  const postprocessCommandParser = {
@@ -9485,6 +9471,7 @@
9485
9471
  * Parses the url command
9486
9472
  *
9487
9473
  * @see `documentationUrl` for more details
9474
+ *
9488
9475
  * @public exported from `@promptbook/editable`
9489
9476
  */
9490
9477
  const urlCommandParser = {
@@ -9586,6 +9573,7 @@
9586
9573
  * Parses the action command
9587
9574
  *
9588
9575
  * @see `documentationUrl` for more details
9576
+ *
9589
9577
  * @public exported from `@promptbook/editable`
9590
9578
  */
9591
9579
  const actionCommandParser = {
@@ -9643,14 +9631,13 @@
9643
9631
  throw new NotYetImplementedError('[🛠] Actions are not implemented yet');
9644
9632
  },
9645
9633
  };
9646
- /**
9647
- * Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
9648
- */
9634
+ // Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
9649
9635
 
9650
9636
  /**
9651
9637
  * Parses the instrument command
9652
9638
  *
9653
9639
  * @see `documentationUrl` for more details
9640
+ *
9654
9641
  * @public exported from `@promptbook/editable`
9655
9642
  */
9656
9643
  const instrumentCommandParser = {
@@ -9708,9 +9695,7 @@
9708
9695
  throw new NotYetImplementedError('[🛠] Instruments are not implemented yet');
9709
9696
  },
9710
9697
  };
9711
- /**
9712
- * Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
9713
- */
9698
+ // Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
9714
9699
 
9715
9700
  /**
9716
9701
  * All available command parsers
@@ -9736,9 +9721,7 @@
9736
9721
  boilerplateCommandParser, // <- TODO: Only in development, remove in production
9737
9722
  // <- 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
9738
9723
  ];
9739
- /**
9740
- * Note: [💞] Ignore a discrepancy between file name and entity name
9741
- */
9724
+ // Note: [💞] Ignore a discrepancy between file name and entity name
9742
9725
 
9743
9726
  /**
9744
9727
  * Gets the parser for the command
@@ -9768,6 +9751,7 @@
9768
9751
  *
9769
9752
  * @param {string} str - The string to remove Markdown tags from.
9770
9753
  * @returns {string} The input string with all Markdown tags removed.
9754
+ *
9771
9755
  * @public exported from `@promptbook/markdown-utils`
9772
9756
  */
9773
9757
  function removeMarkdownFormatting(str) {
@@ -10153,9 +10137,7 @@
10153
10137
  });
10154
10138
  },
10155
10139
  };
10156
- /**
10157
- * TODO: [🧠][📛] Should this be here?
10158
- */
10140
+ // TODO: [🧠][📛] Should this be here?
10159
10141
 
10160
10142
  /**
10161
10143
  * All high-level abstractions
@@ -10167,10 +10149,8 @@
10167
10149
  QuickChatbotHla,
10168
10150
  // <- Note: [♓️][💩] This is the order of the application of high-level abstractions application on pipeline JSON
10169
10151
  ];
10170
- /**
10171
- * TODO: Test that all sync high-level abstractions are before async high-level abstractions
10172
- * Note: [💞] Ignore a discrepancy between file name and entity name
10173
- */
10152
+ // TODO: Test that all sync high-level abstractions are before async high-level abstractions
10153
+ // Note: [💞] Ignore a discrepancy between file name and entity name
10174
10154
 
10175
10155
  /**
10176
10156
  * Supported script languages
@@ -10181,7 +10161,7 @@
10181
10161
  // <- TODO: [🏥] DRY
10182
10162
 
10183
10163
  /**
10184
- * Number of padding lines to add at the end of the book content
10164
+ * Number of padding lines to add at the end of the book content
10185
10165
  *
10186
10166
  * @public exported from `@promptbook/core`
10187
10167
  */
@@ -10218,15 +10198,14 @@
10218
10198
  const linesToAdd = PADDING_LINES - trailingEmptyLines;
10219
10199
  return (content + '\n'.repeat(linesToAdd));
10220
10200
  }
10221
- /**
10222
- * TODO: [🧠] Maybe export
10223
- */
10201
+ // TODO: [🧠] Maybe export
10224
10202
 
10225
10203
  /**
10226
10204
  * Removes Markdown (or HTML) comments
10227
10205
  *
10228
10206
  * @param {string} content - The string to remove comments from.
10229
10207
  * @returns {string} The input string with all comments removed.
10208
+ *
10230
10209
  * @public exported from `@promptbook/markdown-utils`
10231
10210
  */
10232
10211
  function removeMarkdownComments(content) {
@@ -10304,9 +10283,7 @@
10304
10283
  // <- TODO: Maybe use book` notation
10305
10284
  return padBook(pipelineString);
10306
10285
  }
10307
- /**
10308
- * TODO: Unit test
10309
- */
10286
+ // TODO: Unit test
10310
10287
 
10311
10288
  /**
10312
10289
  * Utility function to extract all list items from markdown
@@ -10318,6 +10295,7 @@
10318
10295
  *
10319
10296
  * @param markdown any valid markdown
10320
10297
  * @returns An array of strings, each representing an individual list item found in the markdown
10298
+ *
10321
10299
  * @public exported from `@promptbook/markdown-utils`
10322
10300
  */
10323
10301
  function extractAllListItemsFromMarkdown(markdown) {
@@ -10350,8 +10328,9 @@
10350
10328
  *
10351
10329
  * @param markdown any valid markdown
10352
10330
  * @returns code block with language and content
10353
- * @public exported from `@promptbook/markdown-utils`
10354
10331
  * @throws {ParseError} if there is not exactly one code block in the markdown
10332
+ *
10333
+ * @public exported from `@promptbook/markdown-utils`
10355
10334
  */
10356
10335
  function extractOneBlockFromMarkdown(markdown) {
10357
10336
  const codeBlocks = extractAllBlocksFromMarkdown(markdown);
@@ -10364,9 +10343,7 @@
10364
10343
  }
10365
10344
  return codeBlocks[0];
10366
10345
  }
10367
- /***
10368
- * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
10369
- */
10346
+ // TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
10370
10347
 
10371
10348
  /**
10372
10349
  * Parses markdown section to title its level and content
@@ -10508,6 +10485,7 @@
10508
10485
  * @param pipelineString {Promptbook} in string markdown format (.book.md)
10509
10486
  * @returns {Promptbook} compiled in JSON format (.bookc)
10510
10487
  * @throws {ParseError} if the promptbook string is not valid
10488
+ *
10511
10489
  * @public exported from `@promptbook/core`
10512
10490
  */
10513
10491
  function parsePipeline(pipelineString) {
@@ -10928,31 +10906,29 @@
10928
10906
  },
10929
10907
  });
10930
10908
  }
10931
- /**
10932
- * TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
10933
- * TODO: [main] !!4 Warn if used only sync version
10934
- * TODO: [🚞] Report here line/column of error
10935
- * TODO: Use spaceTrim more effectively
10936
- * TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
10937
- * TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
10938
- * TODO: [] Probably move expectations from tasks to parameters
10939
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10940
- * TODO: [🍙] Make some standard order of json properties
10941
- */
10909
+ // TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
10910
+ // TODO: [main] !!4 Warn if used only sync version
10911
+ // TODO: [🚞] Report here line/column of error
10912
+ // TODO: Use spaceTrim more effectively
10913
+ // TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
10914
+ // TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
10915
+ // TODO: [] Probably move expectations from tasks to parameters
10916
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10917
+ // TODO: [🍙] Make some standard order of json properties
10942
10918
 
10943
10919
  /**
10944
10920
  * Compile pipeline from string (markdown) format to JSON format
10945
10921
  *
10946
- * @see https://github.com/webgptorg/promptbook/discussions/196
10947
- *
10948
10922
  * Note: This function does not validate logic of the pipeline only the parsing
10949
10923
  * Note: This function acts as compilation process
10950
10924
  *
10925
+ * @see https://github.com/webgptorg/promptbook/discussions/196
10951
10926
  * @param pipelineString {Promptbook} in string markdown format (.book.md)
10952
10927
  * @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
10953
10928
  * @param options - Options and tools for the compilation
10954
10929
  * @returns {Promptbook} compiled in JSON format (.bookc)
10955
10930
  * @throws {ParseError} if the promptbook string is not valid
10931
+ *
10956
10932
  * @public exported from `@promptbook/core`
10957
10933
  */
10958
10934
  async function compilePipeline(pipelineString, tools, options) {
@@ -10965,11 +10941,9 @@
10965
10941
  // Note: No need to use `$exportJson` because `parsePipeline` and `preparePipeline` already do that
10966
10942
  return pipelineJson;
10967
10943
  }
10968
- /**
10969
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
10970
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10971
- * TODO: [🧠] Should be in generated JSON file GENERATOR_WARNING
10972
- */
10944
+ // TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
10945
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
10946
+ // TODO: [🧠] Should be in generated JSON file GENERATOR_WARNING
10973
10947
 
10974
10948
  /**
10975
10949
  * Unsafe characters that prevent an inline parameter.
@@ -10993,6 +10967,7 @@
10993
10967
  * Normalizes a JSON string so it can be safely rendered without double escaping.
10994
10968
  *
10995
10969
  * @param value Candidate JSON string.
10970
+ *
10996
10971
  * @private function of ParameterEscaping
10997
10972
  */
10998
10973
  function normalizeJsonString(value) {
@@ -11007,6 +10982,7 @@
11007
10982
  * Hides brackets in a string to avoid confusion with template parameters.
11008
10983
  *
11009
10984
  * @param value Input string with literal brackets.
10985
+ *
11010
10986
  * @private function of ParameterEscaping
11011
10987
  */
11012
10988
  function hideBrackets(value) {
@@ -11016,6 +10992,7 @@
11016
10992
  * Restores hidden brackets.
11017
10993
  *
11018
10994
  * @param value String with hidden brackets.
10995
+ *
11019
10996
  * @private function of ParameterEscaping
11020
10997
  */
11021
10998
  function restoreBrackets(value) {
@@ -11025,6 +11002,7 @@
11025
11002
  * Decides whether a parameter can be inlined safely.
11026
11003
  *
11027
11004
  * @param value Parameter rendered as string.
11005
+ *
11028
11006
  * @private function of ParameterEscaping
11029
11007
  */
11030
11008
  function shouldInlineParameterValue(value) {
@@ -11038,6 +11016,7 @@
11038
11016
  *
11039
11017
  * @param value Parameter value to escape.
11040
11018
  * @param options Escape options for additional characters.
11019
+ *
11041
11020
  * @private function of ParameterEscaping
11042
11021
  */
11043
11022
  function escapePromptParameterValue(value, options) {
@@ -11063,6 +11042,7 @@
11063
11042
  * Builds numeric parameter names (1, 2, ...).
11064
11043
  *
11065
11044
  * @param index Zero-based parameter index.
11045
+ *
11066
11046
  * @private function of ParameterNaming
11067
11047
  */
11068
11048
  function buildNumericParameterName(index) {
@@ -11072,6 +11052,7 @@
11072
11052
  * Builds alphabetic parameter names (a, b, ..., aa).
11073
11053
  *
11074
11054
  * @param index Zero-based parameter index.
11055
+ *
11075
11056
  * @private function of ParameterNaming
11076
11057
  */
11077
11058
  function buildAlphabeticParameterName(index) {
@@ -11088,6 +11069,7 @@
11088
11069
  * Converts a positive integer into a Roman numeral string.
11089
11070
  *
11090
11071
  * @param value Positive integer value.
11072
+ *
11091
11073
  * @private function of ParameterNaming
11092
11074
  */
11093
11075
  function toRomanNumeral(value) {
@@ -11120,6 +11102,7 @@
11120
11102
  * Builds Roman numeral parameter names (I, II, ...).
11121
11103
  *
11122
11104
  * @param index Zero-based parameter index.
11105
+ *
11123
11106
  * @private function of ParameterNaming
11124
11107
  */
11125
11108
  function buildRomanParameterName(index) {
@@ -11130,6 +11113,7 @@
11130
11113
  *
11131
11114
  * @param prefix Prefix string.
11132
11115
  * @param builder Base builder function.
11116
+ *
11133
11117
  * @private function of ParameterNaming
11134
11118
  */
11135
11119
  function buildPrefixedParameterName(prefix, builder) {
@@ -11151,6 +11135,7 @@
11151
11135
  * Collects bracketed tokens from parameter values to avoid placeholder collisions.
11152
11136
  *
11153
11137
  * @param values Parameter values to scan.
11138
+ *
11154
11139
  * @private function of ParameterNaming
11155
11140
  */
11156
11141
  function collectBracketedParameterTokens(values) {
@@ -11171,6 +11156,7 @@
11171
11156
  * Builds placeholder names while avoiding collisions with parameter content.
11172
11157
  *
11173
11158
  * @param values Parameter values to scan for conflicting tokens.
11159
+ *
11174
11160
  * @private function of ParameterNaming
11175
11161
  */
11176
11162
  function buildParameterNames(values) {
@@ -11201,6 +11187,7 @@
11201
11187
  * Formats the placeholder used in the prompt body for a parameter.
11202
11188
  *
11203
11189
  * @param name Parameter placeholder name.
11190
+ *
11204
11191
  * @private function of ParameterSection
11205
11192
  */
11206
11193
  function formatParameterPlaceholder(name) {
@@ -11210,6 +11197,7 @@
11210
11197
  * Formats a single line entry for structured parameters.
11211
11198
  *
11212
11199
  * @param item Parameter entry data.
11200
+ *
11213
11201
  * @private function of ParameterSection
11214
11202
  */
11215
11203
  function formatParameterListItem(item) {
@@ -11221,6 +11209,7 @@
11221
11209
  * Builds the structured parameters section appended to the prompt.
11222
11210
  *
11223
11211
  * @param items Parameter entries to include.
11212
+ *
11224
11213
  * @private function of ParameterSection
11225
11214
  */
11226
11215
  function buildParametersSection(items) {
@@ -11296,6 +11285,7 @@
11296
11285
  * @param strings
11297
11286
  * @param values
11298
11287
  * @returns prompt content wrapped as a PromptString
11288
+ *
11299
11289
  * @public exported from `@promptbook/utils`
11300
11290
  */
11301
11291
  function prompt(strings, ...values) {
@@ -11380,11 +11370,9 @@
11380
11370
  }
11381
11371
  return new PromptString(pipelineString);
11382
11372
  }
11383
- /**
11384
- * TODO: Maybe split into multiple files
11385
- * TODO: [🧠][🈴] Where is the best location for this file
11386
- * Note: [💞] Ignore a discrepancy between file name and entity name
11387
- */
11373
+ // TODO: Maybe split into multiple files
11374
+ // TODO: [🧠][🈴] Where is the best location for this file
11375
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11388
11376
 
11389
11377
  /**
11390
11378
  * @@@
@@ -11421,9 +11409,7 @@
11421
11409
  [CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
11422
11410
  };
11423
11411
  }
11424
- /**
11425
- * Note: [💞] Ignore a discrepancy between file name and entity name
11426
- */
11412
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11427
11413
 
11428
11414
  /**
11429
11415
  * Detects if the code is running in a browser environment in main thread (Not in a web worker)
@@ -11440,9 +11426,7 @@
11440
11426
  return false;
11441
11427
  }
11442
11428
  }
11443
- /**
11444
- * TODO: [🎺]
11445
- */
11429
+ // TODO: [🎺]
11446
11430
 
11447
11431
  /**
11448
11432
  * Detects if the code is running in a Node.js environment
@@ -11459,9 +11443,7 @@
11459
11443
  return false;
11460
11444
  }
11461
11445
  }
11462
- /**
11463
- * TODO: [🎺]
11464
- */
11446
+ // TODO: [🎺]
11465
11447
 
11466
11448
  /**
11467
11449
  * Detects if the code is running in a web worker
@@ -11481,9 +11463,7 @@
11481
11463
  return false;
11482
11464
  }
11483
11465
  }
11484
- /**
11485
- * TODO: [🎺]
11486
- */
11466
+ // TODO: [🎺]
11487
11467
 
11488
11468
  /**
11489
11469
  * Computes SHA-256 hash of the given object
@@ -11493,9 +11473,7 @@
11493
11473
  function computeHash(value) {
11494
11474
  return cryptoJs.SHA256(hexEncoder__default["default"].parse(_spaceTrim.spaceTrim(valueToString(value)))).toString( /* hex */);
11495
11475
  }
11496
- /**
11497
- * TODO: [🥬][🥬] Use this ACRY
11498
- */
11476
+ // TODO: [🥬][🥬] Use this ACRY
11499
11477
 
11500
11478
  // spell-checker: disable
11501
11479
  /**
@@ -11661,6 +11639,9 @@
11661
11639
  'prvotní',
11662
11640
  'hbitý',
11663
11641
  ];
11642
+ /**
11643
+ * Collection of nouns.
11644
+ */
11664
11645
  const NOUNS$1 = [
11665
11646
  'jablko',
11666
11647
  'nebe',
@@ -11874,6 +11855,9 @@
11874
11855
  'okno',
11875
11856
  'chodba',
11876
11857
  ];
11858
+ /**
11859
+ * Collection of verbs.
11860
+ */
11877
11861
  const VERBS$1 = [
11878
11862
  'skáče',
11879
11863
  'tančí',
@@ -12046,9 +12030,7 @@
12046
12030
  noun: NOUNS$1,
12047
12031
  verb: VERBS$1,
12048
12032
  };
12049
- /**
12050
- * Note: [💞] Ignore a discrepancy between file name and entity name
12051
- */
12033
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12052
12034
 
12053
12035
  /**
12054
12036
  * @@@
@@ -12304,6 +12286,9 @@
12304
12286
  'macro',
12305
12287
  'mini',
12306
12288
  ];
12289
+ /**
12290
+ * Collection of nouns.
12291
+ */
12307
12292
  const NOUNS = [
12308
12293
  'apple',
12309
12294
  'sky',
@@ -12543,6 +12528,9 @@
12543
12528
  'roof',
12544
12529
  'floor',
12545
12530
  ];
12531
+ /**
12532
+ * Collection of verbs.
12533
+ */
12546
12534
  const VERBS = [
12547
12535
  'jumping',
12548
12536
  'dancing',
@@ -12738,9 +12726,7 @@
12738
12726
  noun: NOUNS,
12739
12727
  verb: VERBS,
12740
12728
  };
12741
- /**
12742
- * Note: [💞] Ignore a discrepancy between file name and entity name
12743
- */
12729
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12744
12730
 
12745
12731
  /**
12746
12732
  * Default language used for linguistic hashes.
@@ -12915,8 +12901,9 @@
12915
12901
  /**
12916
12902
  * Creates a human-readable hash as a short, story-like phrase.
12917
12903
  *
12918
- * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
12919
12904
  * {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
12905
+ *
12906
+ * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
12920
12907
  * @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
12921
12908
  *
12922
12909
  * @public exported from `@promptbook/utils`
@@ -12935,6 +12922,7 @@
12935
12922
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
12936
12923
  *
12937
12924
  * @returns string_date branded type
12925
+ *
12938
12926
  * @public exported from `@promptbook/utils`
12939
12927
  */
12940
12928
  function $getCurrentDate() {
@@ -12957,6 +12945,7 @@
12957
12945
  *
12958
12946
  * @param {string} input
12959
12947
  * @returns {Set} of keywords without diacritics in lowercase
12948
+ *
12960
12949
  * @public exported from `@promptbook/utils`
12961
12950
  */
12962
12951
  function parseKeywordsFromString(input) {
@@ -12973,6 +12962,7 @@
12973
12962
  * @param name The string to be converted to a URI-compatible format.
12974
12963
  * @returns A URI-compatible string derived from the input name.
12975
12964
  * @example 'Hello World' -> 'hello-world'
12965
+ *
12976
12966
  * @public exported from `@promptbook/utils`
12977
12967
  */
12978
12968
  function nameToUriPart(name) {
@@ -12991,6 +12981,7 @@
12991
12981
  * @param name The name to be converted into URI parts.
12992
12982
  * @returns An array of URI-compatible parts derived from the name.
12993
12983
  * @example 'Example Name' -> ['example', 'name']
12984
+ *
12994
12985
  * @public exported from `@promptbook/utils`
12995
12986
  */
12996
12987
  function nameToUriParts(name) {
@@ -13020,6 +13011,7 @@
13020
13011
  * @returns
13021
13012
  * @example 'HelloWorld'
13022
13013
  * @example 'ILovePromptbook'
13014
+ *
13023
13015
  * @public exported from `@promptbook/utils`
13024
13016
  */
13025
13017
  function normalizeTo_PascalCase(text) {
@@ -13048,6 +13040,7 @@
13048
13040
  *
13049
13041
  * @param text optionally quoted text
13050
13042
  * @returns text without quotes
13043
+ *
13051
13044
  * @public exported from `@promptbook/utils`
13052
13045
  */
13053
13046
  function unwrapResult(text, options) {
@@ -13122,9 +13115,7 @@
13122
13115
  return processedText;
13123
13116
  }
13124
13117
  }
13125
- /**
13126
- * TODO: [🧠] Should this also unwrap the (parenthesis)
13127
- */
13118
+ // TODO: [🧠] Should this also unwrap the (parenthesis)
13128
13119
 
13129
13120
  // <- TODO: Auto convert to type `import { ... } from 'type-fest';`
13130
13121
  /**
@@ -13143,7 +13134,6 @@
13143
13134
  * - `Symbol` objects are not serializable
13144
13135
  * - And much more...
13145
13136
  *
13146
- *
13147
13137
  * @public exported from `@promptbook/utils`
13148
13138
  */
13149
13139
  function isSerializableAsJson(value) {
@@ -13155,15 +13145,14 @@
13155
13145
  return false;
13156
13146
  }
13157
13147
  }
13158
- /**
13159
- * TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
13160
- * TODO: [🧠][💺] Can be done this on type-level?
13161
- */
13148
+ // TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
13149
+ // TODO: [🧠][💺] Can be done this on type-level?
13162
13150
 
13163
13151
  /**
13164
13152
  * Determines if the given path is a root path.
13165
13153
  *
13166
13154
  * Note: This does not check if the file exists only if the path is valid
13155
+ *
13167
13156
  * @public exported from `@promptbook/utils`
13168
13157
  */
13169
13158
  function isRootPath(value) {
@@ -13175,9 +13164,7 @@
13175
13164
  }
13176
13165
  return false;
13177
13166
  }
13178
- /**
13179
- * TODO: [🍏] Make for MacOS paths
13180
- */
13167
+ // TODO: [🍏] Make for MacOS paths
13181
13168
 
13182
13169
  /**
13183
13170
  * Checks if an URL is reserved for private networks or localhost.
@@ -13223,6 +13210,7 @@
13223
13210
  * @param {string} url - The URL to check.
13224
13211
  * @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
13225
13212
  * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
13213
+ *
13226
13214
  * @public exported from `@promptbook/utils`
13227
13215
  */
13228
13216
  function isUrlOnPrivateNetwork(url, options = {}) {
@@ -13261,9 +13249,7 @@
13261
13249
  */
13262
13250
  return true;
13263
13251
  }
13264
- /**
13265
- * TODO: [🐠] Maybe more info why the URL is invalid
13266
- */
13252
+ // TODO: [🐠] Maybe more info why the URL is invalid
13267
13253
 
13268
13254
  /**
13269
13255
  * Provides filesystem access (for example for Node.js-based scrapers)
@@ -13286,10 +13272,8 @@
13286
13272
  watch: promises.watch,
13287
13273
  };
13288
13274
  }
13289
- /**
13290
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13291
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
13292
- */
13275
+ // 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
13276
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
13293
13277
 
13294
13278
  /**
13295
13279
  * Retrieves an intermediate source for a scraper based on the knowledge source.
@@ -13353,13 +13337,11 @@
13353
13337
  };
13354
13338
  return fileHandler;
13355
13339
  }
13356
- /**
13357
- * Note: Not using `FileCacheStorage` for two reasons:
13358
- * 1) Need to store more than serialized JSONs
13359
- * 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
13360
- * TODO: [🐱‍🐉][🧠] Make some smart crop
13361
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13362
- */
13340
+ // 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
13341
+ // Note: Not using `FileCacheStorage` for two reasons:
13342
+ // 1. Need to store more than serialized JSONs.
13343
+ // 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
13344
+ // TODO: [🐱‍🐉][🧠] Make some smart crop
13363
13345
 
13364
13346
  /**
13365
13347
  * Metadata of the scraper
@@ -13386,14 +13368,13 @@
13386
13368
  * @public exported from `@promptbook/cli`
13387
13369
  */
13388
13370
  $scrapersMetadataRegister.register(markdownScraperMetadata);
13389
- /**
13390
- * Note: [💞] Ignore a discrepancy between file name and entity name
13391
- */
13371
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13392
13372
 
13393
13373
  /**
13394
13374
  * Scraper for markdown files
13395
13375
  *
13396
13376
  * @see `documentationUrl` for more details
13377
+ *
13397
13378
  * @public exported from `@promptbook/markdown-utils`
13398
13379
  */
13399
13380
  class MarkdownScraper {
@@ -13526,10 +13507,8 @@
13526
13507
  return knowledge;
13527
13508
  }
13528
13509
  }
13529
- /**
13530
- * TODO: [🪂] Do it in parallel 11:11
13531
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
13532
- */
13510
+ // TODO: [🪂] Do it in parallel 11:11
13511
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
13533
13512
 
13534
13513
  /**
13535
13514
  * Metadata of the scraper
@@ -13556,9 +13535,7 @@
13556
13535
  * @public exported from `@promptbook/cli`
13557
13536
  */
13558
13537
  $scrapersMetadataRegister.register(websiteScraperMetadata);
13559
- /**
13560
- * Note: [💞] Ignore a discrepancy between file name and entity name
13561
- */
13538
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13562
13539
 
13563
13540
  /**
13564
13541
  * Create a new showdown converter instance
@@ -13587,6 +13564,7 @@
13587
13564
  * Scraper for websites
13588
13565
  *
13589
13566
  * @see `documentationUrl` for more details
13567
+ *
13590
13568
  * @public exported from `@promptbook/website-crawler`
13591
13569
  */
13592
13570
  class WebsiteScraper {
@@ -13690,12 +13668,10 @@
13690
13668
  return knowledge;
13691
13669
  }
13692
13670
  }
13693
- /**
13694
- * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
13695
- * TODO: [🪂] Do it in parallel 11:11
13696
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
13697
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13698
- */
13671
+ // 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
13672
+ // TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
13673
+ // TODO: [🪂] Do it in parallel 11:11
13674
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
13699
13675
 
13700
13676
  /**
13701
13677
  * Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
@@ -13706,14 +13682,14 @@
13706
13682
  * 3. Uses the appropriate scraper to convert to markdown
13707
13683
  * 4. Returns the scraped markdown content
13708
13684
  *
13685
+ * WARNING: This function should NOT be used directly in browser environments.
13686
+ * For browser environments, use fetchUrlContentViaBrowser which proxies through
13687
+ * the Agents Server API endpoint at /api/scrape
13688
+ *
13709
13689
  * @param url The URL to fetch and scrape
13710
13690
  * @returns Markdown content from the URL
13711
13691
  *
13712
13692
  * @private internal utility for USE BROWSER commitment
13713
- *
13714
- * WARNING: This function should NOT be used directly in browser environments.
13715
- * For browser environments, use fetchUrlContentViaBrowser which proxies through
13716
- * the Agents Server API endpoint at /api/scrape
13717
13693
  */
13718
13694
  async function fetchUrlContent(url) {
13719
13695
  try {
@@ -13817,9 +13793,7 @@
13817
13793
  `);
13818
13794
  }
13819
13795
  }
13820
- /**
13821
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
13822
- */
13796
+ // 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
13823
13797
 
13824
13798
  /**
13825
13799
  * Cached implementation of `run_browser` when it can be resolved.
@@ -13837,6 +13811,7 @@
13837
13811
  * Attempts to load the server-side `run_browser` tool lazily.
13838
13812
  *
13839
13813
  * @returns Loaded `run_browser` implementation
13814
+ *
13840
13815
  * @private internal utility for USE BROWSER commitment
13841
13816
  */
13842
13817
  function loadRunBrowserToolForNode() {
@@ -14206,9 +14181,7 @@
14206
14181
  return this.appendToSystemMessage(requirements, actionSection, '\n\n');
14207
14182
  }
14208
14183
  }
14209
- /**
14210
- * Note: [💞] Ignore a discrepancy between file name and entity name
14211
- */
14184
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14212
14185
 
14213
14186
  /**
14214
14187
  * CLOSED commitment definition
@@ -14274,9 +14247,7 @@
14274
14247
  };
14275
14248
  }
14276
14249
  }
14277
- /**
14278
- * Note: [💞] Ignore a discrepancy between file name and entity name
14279
- */
14250
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14280
14251
 
14281
14252
  /**
14282
14253
  * COMPONENT commitment definition
@@ -14335,9 +14306,7 @@
14335
14306
  return this.appendToSystemMessage(requirements, componentSection, '\n\n');
14336
14307
  }
14337
14308
  }
14338
- /**
14339
- * Note: [💞] Ignore a discrepancy between file name and entity name
14340
- */
14309
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14341
14310
 
14342
14311
  /**
14343
14312
  * DELETE commitment definition
@@ -14459,9 +14428,7 @@
14459
14428
  return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
14460
14429
  }
14461
14430
  }
14462
- /**
14463
- * Note: [💞] Ignore a discrepancy between file name and entity name
14464
- */
14431
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14465
14432
 
14466
14433
  /**
14467
14434
  * DICTIONARY commitment definition
@@ -14565,9 +14532,7 @@
14565
14532
  };
14566
14533
  }
14567
14534
  }
14568
- /**
14569
- * Note: [💞] Ignore a discrepancy between file name and entity name
14570
- */
14535
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14571
14536
 
14572
14537
  /**
14573
14538
  * FORMAT commitment definition
@@ -14646,10 +14611,11 @@
14646
14611
  return this.appendToSystemMessage(requirements, formatSection, '\n\n');
14647
14612
  }
14648
14613
  }
14614
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14615
+
14649
14616
  /**
14650
- * Note: [💞] Ignore a discrepancy between file name and entity name
14617
+ * Collection of firstnames.
14651
14618
  */
14652
-
14653
14619
  const FIRSTNAMES = [
14654
14620
  'Paul',
14655
14621
  'George',
@@ -14686,6 +14652,9 @@
14686
14652
  'Anthony',
14687
14653
  'Christopher',
14688
14654
  ];
14655
+ /**
14656
+ * Collection of lastnames with colors.
14657
+ */
14689
14658
  const LASTNAMES_WITH_COLORS = [
14690
14659
  { lastname: 'Green', color: '#008000' },
14691
14660
  { lastname: 'Brown', color: '#A52A2A' },
@@ -14713,6 +14682,7 @@
14713
14682
  *
14714
14683
  * @param seed - Input seed used to derive a stable pseudonym.
14715
14684
  * @returns Deterministic English full name with color metadata.
14685
+ *
14716
14686
  * @private internal helper for deterministic pseudonym generation
14717
14687
  */
14718
14688
  function generateDeterministicEnglishName(seed) {
@@ -14754,6 +14724,9 @@
14754
14724
  * Legacy aliases that historically behaved like `FROM VOID`.
14755
14725
  */
14756
14726
  const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
14727
+ /**
14728
+ * Constant for void alias entries.
14729
+ */
14757
14730
  const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
14758
14731
  alias,
14759
14732
  'VOID',
@@ -14802,6 +14775,7 @@
14802
14775
  *
14803
14776
  * @param rawReference - Raw reference token or payload.
14804
14777
  * @returns Pseudo-agent kind or `null` when the reference is not pseudo.
14778
+ *
14805
14779
  * @private internal utility of pseudo-agent resolution
14806
14780
  */
14807
14781
  function resolvePseudoAgentKindFromReference(rawReference) {
@@ -14816,6 +14790,7 @@
14816
14790
  *
14817
14791
  * @param agentUrl - URL to inspect.
14818
14792
  * @returns Pseudo-agent kind or `null` when the URL is not pseudo.
14793
+ *
14819
14794
  * @private internal utility of pseudo-agent resolution
14820
14795
  */
14821
14796
  function resolvePseudoAgentKindFromUrl(agentUrl) {
@@ -14836,6 +14811,7 @@
14836
14811
  *
14837
14812
  * @param teamCommitmentContent - TEAM commitment content after reference resolution.
14838
14813
  * @returns Deterministic English full name representing pseudo-user in that TEAM context.
14814
+ *
14839
14815
  * @private internal utility of TEAM commitment rendering
14840
14816
  */
14841
14817
  function createPseudoUserTeammateLabel(teamCommitmentContent) {
@@ -14851,6 +14827,7 @@
14851
14827
  *
14852
14828
  * @param rawReference - Raw reference content.
14853
14829
  * @returns True when the reference maps to void.
14830
+ *
14854
14831
  * @private internal utility of pseudo-agent resolution
14855
14832
  */
14856
14833
  function isVoidPseudoAgentReference(rawReference) {
@@ -14864,9 +14841,7 @@
14864
14841
  const normalizedReference = normalizePseudoReferenceKey(rawReference);
14865
14842
  return LEGACY_VOID_ALIASES.has(normalizedReference);
14866
14843
  }
14867
- /**
14868
- * Note: [💞] Ignore a discrepancy between file name and entity name
14869
- */
14844
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14870
14845
 
14871
14846
  /**
14872
14847
  * FROM commitment definition
@@ -14945,9 +14920,7 @@
14945
14920
  };
14946
14921
  }
14947
14922
  }
14948
- /**
14949
- * Note: [💞] Ignore a discrepancy between file name and entity name
14950
- */
14923
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14951
14924
 
14952
14925
  /**
14953
14926
  * GOAL commitment definition
@@ -15045,9 +15018,7 @@
15045
15018
  return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
15046
15019
  }
15047
15020
  }
15048
- /**
15049
- * Note: [💞] Ignore a discrepancy between file name and entity name
15050
- */
15021
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15051
15022
 
15052
15023
  /**
15053
15024
  * IMPORT commitment definition
@@ -15126,19 +15097,26 @@
15126
15097
  `));
15127
15098
  }
15128
15099
  }
15100
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15101
+
15129
15102
  /**
15130
- * Note: [💞] Ignore a discrepancy between file name and entity name
15103
+ * Matches URL-like candidates inside arbitrary text.
15104
+ *
15105
+ * @private
15131
15106
  */
15132
-
15133
- /** @private Matches URL-like candidates inside arbitrary text. */
15134
15107
  const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
15135
- /** @private Trims punctuation that commonly trails URLs in prose. */
15108
+ /**
15109
+ * Trims punctuation that commonly trails URLs in prose.
15110
+ *
15111
+ * @private
15112
+ */
15136
15113
  const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
15137
15114
  /**
15138
15115
  * Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
15139
15116
  *
15140
15117
  * @param text - Input text that may contain one or more URLs.
15141
15118
  * @returns Unique URLs in their first-seen order.
15119
+ *
15142
15120
  * @private utility of KNOWLEDGE parsing
15143
15121
  */
15144
15122
  function extractUrlsFromText(text) {
@@ -15168,7 +15146,9 @@
15168
15146
  return urls;
15169
15147
  }
15170
15148
  /**
15171
- * @private Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
15149
+ * Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
15150
+ *
15151
+ * @private
15172
15152
  */
15173
15153
  function normalizeUrlCandidate(candidate) {
15174
15154
  let normalized = candidate.trim();
@@ -15188,7 +15168,9 @@
15188
15168
  return normalized;
15189
15169
  }
15190
15170
  /**
15191
- * @private Removes trailing closing wrappers when they are unmatched in the candidate.
15171
+ * Removes trailing closing wrappers when they are unmatched in the candidate.
15172
+ *
15173
+ * @private
15192
15174
  */
15193
15175
  function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
15194
15176
  let normalized = candidate;
@@ -15203,7 +15185,9 @@
15203
15185
  return normalized;
15204
15186
  }
15205
15187
  /**
15206
- * @private Counts character occurrences in a string.
15188
+ * Counts character occurrences in a string.
15189
+ *
15190
+ * @private
15207
15191
  */
15208
15192
  function countOccurrences(value, searchedChar) {
15209
15193
  let count = 0;
@@ -15215,14 +15199,28 @@
15215
15199
  return count;
15216
15200
  }
15217
15201
 
15218
- /** @private The default base name for inline knowledge files when the content lacks identifying text */
15202
+ /**
15203
+ * The default base name for inline knowledge files when the content lacks identifying text.
15204
+ *
15205
+ * @private
15206
+ */
15219
15207
  const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
15220
- /** @private The default file extension used for inline knowledge uploads */
15208
+ /**
15209
+ * The default file extension used for inline knowledge uploads.
15210
+ *
15211
+ * @private
15212
+ */
15221
15213
  const INLINE_KNOWLEDGE_EXTENSION = '.txt';
15222
- /** @private Prefix that identifies base64 data URLs */
15214
+ /**
15215
+ * Prefix that identifies base64 data URLs.
15216
+ *
15217
+ * @private
15218
+ */
15223
15219
  const DATA_URL_PREFIX = 'data:';
15224
15220
  /**
15225
- * @private Retrieves the first meaningful line from the inline content.
15221
+ * Retrieves the first meaningful line from the inline content.
15222
+ *
15223
+ * @private
15226
15224
  */
15227
15225
  function getFirstNonEmptyLine(content) {
15228
15226
  const lines = content.split(/\r?\n/);
@@ -15235,7 +15233,9 @@
15235
15233
  return null;
15236
15234
  }
15237
15235
  /**
15238
- * @private Determines the base file name by normalizing the first non-empty line.
15236
+ * Determines the base file name by normalizing the first non-empty line.
15237
+ *
15238
+ * @private
15239
15239
  */
15240
15240
  function deriveBaseFilename(content) {
15241
15241
  const firstLine = getFirstNonEmptyLine(content);
@@ -15246,7 +15246,9 @@
15246
15246
  return normalized || INLINE_KNOWLEDGE_BASE_NAME;
15247
15247
  }
15248
15248
  /**
15249
- * @private Converts inline knowledge into the internal metadata form used for uploads.
15249
+ * Converts inline knowledge into the internal metadata form used for uploads.
15250
+ *
15251
+ * @private
15250
15252
  */
15251
15253
  function createInlineKnowledgeSourceFile(content) {
15252
15254
  const trimmedContent = content.trim();
@@ -15269,7 +15271,9 @@
15269
15271
  return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
15270
15272
  }
15271
15273
  /**
15272
- * @private Converts a stored inline knowledge file into a data URL for backwards compatibility.
15274
+ * Converts a stored inline knowledge file into a data URL for backwards compatibility.
15275
+ *
15276
+ * @private
15273
15277
  */
15274
15278
  function inlineKnowledgeSourceToDataUrl(source) {
15275
15279
  const base64 = source.buffer.toString('base64');
@@ -15329,9 +15333,7 @@
15329
15333
  return null;
15330
15334
  }
15331
15335
  }
15332
- /**
15333
- * Note: [💞] Ignore a discrepancy between file name and entity name
15334
- */
15336
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15335
15337
 
15336
15338
  /**
15337
15339
  * KNOWLEDGE commitment definition
@@ -15535,9 +15537,7 @@
15535
15537
  return this.appendToSystemMessage(requirements, languageSection, '\n\n');
15536
15538
  }
15537
15539
  }
15538
- /**
15539
- * Note: [💞] Ignore a discrepancy between file name and entity name
15540
- */
15540
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15541
15541
 
15542
15542
  /**
15543
15543
  * @@@
@@ -15803,6 +15803,7 @@
15803
15803
  *
15804
15804
  * @param listener - Listener notified about tool progress.
15805
15805
  * @returns Hidden token used to route progress updates.
15806
+ *
15806
15807
  * @private internal runtime wiring for commitment tools
15807
15808
  */
15808
15809
  function registerToolCallProgressListener(listener) {
@@ -15815,14 +15816,13 @@
15815
15816
  * Unregisters one in-memory progress listener.
15816
15817
  *
15817
15818
  * @param token - Token previously created by `registerToolCallProgressListener`.
15819
+ *
15818
15820
  * @private internal runtime wiring for commitment tools
15819
15821
  */
15820
15822
  function unregisterToolCallProgressListener(token) {
15821
15823
  toolCallProgressListeners.delete(token);
15822
15824
  }
15823
- /**
15824
- * Note: [💞] Ignore a discrepancy between file name and entity name
15825
- */
15825
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15826
15826
 
15827
15827
  /**
15828
15828
  * Resolves runtime context from hidden tool arguments.
@@ -16183,9 +16183,7 @@
16183
16183
  return createMemoryToolFunctions();
16184
16184
  }
16185
16185
  }
16186
- /**
16187
- * Note: [💞] Ignore a discrepancy between file name and entity name
16188
- */
16186
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16189
16187
 
16190
16188
  /**
16191
16189
  * AGENT MESSAGE commitment definition
@@ -16515,9 +16513,7 @@
16515
16513
  return this.appendToSystemMessage(requirements, messageSection, '\n\n');
16516
16514
  }
16517
16515
  }
16518
- /**
16519
- * Note: [💞] Ignore a discrepancy between file name and entity name
16520
- */
16516
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16521
16517
 
16522
16518
  /**
16523
16519
  * USER MESSAGE commitment definition
@@ -16648,9 +16644,7 @@
16648
16644
  return requirements;
16649
16645
  }
16650
16646
  }
16651
- /**
16652
- * Note: [💞] Ignore a discrepancy between file name and entity name
16653
- */
16647
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16654
16648
 
16655
16649
  /**
16656
16650
  * META commitment definition
@@ -16797,9 +16791,7 @@
16797
16791
  return knownTypes.includes(metaType.toUpperCase());
16798
16792
  }
16799
16793
  }
16800
- /**
16801
- * Note: [💞] Ignore a discrepancy between file name and entity name
16802
- */
16794
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16803
16795
 
16804
16796
  /**
16805
16797
  * META COLOR commitment definition
@@ -16895,9 +16887,7 @@
16895
16887
  return trimmedContent || null;
16896
16888
  }
16897
16889
  }
16898
- /**
16899
- * Note: [💞] Ignore a discrepancy between file name and entity name
16900
- */
16890
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16901
16891
 
16902
16892
  /**
16903
16893
  * META DOMAIN commitment definition
@@ -16962,9 +16952,7 @@
16962
16952
  return trimmedContent || null;
16963
16953
  }
16964
16954
  }
16965
- /**
16966
- * Note: [💞] Ignore a discrepancy between file name and entity name
16967
- */
16955
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16968
16956
 
16969
16957
  /**
16970
16958
  * META DISCLAIMER commitment definition
@@ -17032,9 +17020,7 @@
17032
17020
  return requirements;
17033
17021
  }
17034
17022
  }
17035
- /**
17036
- * Note: [💞] Ignore a discrepancy between file name and entity name
17037
- */
17023
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17038
17024
 
17039
17025
  /**
17040
17026
  * META FONT commitment definition
@@ -17117,9 +17103,7 @@
17117
17103
  return trimmedContent || null;
17118
17104
  }
17119
17105
  }
17120
- /**
17121
- * Note: [💞] Ignore a discrepancy between file name and entity name
17122
- */
17106
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17123
17107
 
17124
17108
  /**
17125
17109
  * META IMAGE commitment definition
@@ -17204,9 +17188,7 @@
17204
17188
  return trimmedContent || null;
17205
17189
  }
17206
17190
  }
17207
- /**
17208
- * Note: [💞] Ignore a discrepancy between file name and entity name
17209
- */
17191
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17210
17192
 
17211
17193
  /**
17212
17194
  * META INPUT PLACEHOLDER commitment definition.
@@ -17269,9 +17251,7 @@
17269
17251
  return trimmedContent || null;
17270
17252
  }
17271
17253
  }
17272
- /**
17273
- * Note: [💞] Ignore a discrepancy between file name and entity name
17274
- */
17254
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17275
17255
 
17276
17256
  /**
17277
17257
  * META LINK commitment definition
@@ -17378,9 +17358,7 @@
17378
17358
  }
17379
17359
  }
17380
17360
  }
17381
- /**
17382
- * Note: [💞] Ignore a discrepancy between file name and entity name
17383
- */
17361
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17384
17362
 
17385
17363
  /**
17386
17364
  * META VOICE commitment definition
@@ -17449,9 +17427,7 @@
17449
17427
  return trimmedContent || null;
17450
17428
  }
17451
17429
  }
17452
- /**
17453
- * Note: [💞] Ignore a discrepancy between file name and entity name
17454
- */
17430
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17455
17431
 
17456
17432
  /**
17457
17433
  * MODEL commitment definition
@@ -17689,9 +17665,7 @@
17689
17665
  return result;
17690
17666
  }
17691
17667
  }
17692
- /**
17693
- * Note: [💞] Ignore a discrepancy between file name and entity name
17694
- */
17668
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17695
17669
 
17696
17670
  /**
17697
17671
  * NOTE commitment definition
@@ -17853,9 +17827,7 @@
17853
17827
  };
17854
17828
  }
17855
17829
  }
17856
- /**
17857
- * Note: [💞] Ignore a discrepancy between file name and entity name
17858
- */
17830
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17859
17831
 
17860
17832
  /**
17861
17833
  * PERSONA commitment definition
@@ -17994,9 +17966,7 @@
17994
17966
  };
17995
17967
  }
17996
17968
  }
17997
- /**
17998
- * Note: [💞] Ignore a discrepancy between file name and entity name
17999
- */
17969
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18000
17970
 
18001
17971
  /**
18002
17972
  * RULE commitment definition
@@ -18077,15 +18047,14 @@
18077
18047
  return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
18078
18048
  }
18079
18049
  }
18080
- /**
18081
- * Note: [💞] Ignore a discrepancy between file name and entity name
18082
- */
18050
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18083
18051
 
18084
18052
  /**
18085
18053
  * Creates the canonical system-message body for one writing-sample commitment.
18086
18054
  *
18087
18055
  * @param content - Explicit 1:1 sample text.
18088
18056
  * @returns Writing-sample guidance ready for one system-message section.
18057
+ *
18089
18058
  * @private internal utility of writing commitments
18090
18059
  */
18091
18060
  function createWritingSampleSection(content) {
@@ -18103,6 +18072,7 @@
18103
18072
  *
18104
18073
  * @param content - Writing-only instructions.
18105
18074
  * @returns Writing-rules guidance ready for one system-message section.
18075
+ *
18106
18076
  * @private internal utility of writing commitments
18107
18077
  */
18108
18078
  function createWritingRulesSection(content) {
@@ -18115,9 +18085,7 @@
18115
18085
  ${content}
18116
18086
  `);
18117
18087
  }
18118
- /**
18119
- * Note: [💞] Ignore a discrepancy between file name and entity name
18120
- */
18088
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18121
18089
 
18122
18090
  /**
18123
18091
  * Legacy `SAMPLE` / `EXAMPLE` commitment definition.
@@ -18196,9 +18164,7 @@
18196
18164
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
18197
18165
  }
18198
18166
  }
18199
- /**
18200
- * Note: [💞] Ignore a discrepancy between file name and entity name
18201
- */
18167
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18202
18168
 
18203
18169
  /**
18204
18170
  * SCENARIO commitment definition
@@ -18320,9 +18286,7 @@
18320
18286
  return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
18321
18287
  }
18322
18288
  }
18323
- /**
18324
- * Note: [💞] Ignore a discrepancy between file name and entity name
18325
- */
18289
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18326
18290
 
18327
18291
  /**
18328
18292
  * STYLE commitment definition
@@ -18419,6 +18383,7 @@
18419
18383
  *
18420
18384
  * @param teammateLabel - Human-readable teammate label.
18421
18385
  * @returns Normalized teammate identifier for TEAM tool names.
18386
+ *
18422
18387
  * @private internal helper of TEAM tool-name generation
18423
18388
  */
18424
18389
  function normalizeTeammateToolNamePart(teammateLabel) {
@@ -18434,6 +18399,7 @@
18434
18399
  * @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
18435
18400
  * @param teammateLabel - Human-readable teammate label used as the basis for the name.
18436
18401
  * @returns TEAM tool name derived from the label.
18402
+ *
18437
18403
  * @private internal utility of TEAM commitments and chat UI mapping
18438
18404
  */
18439
18405
  function createTeamToolName(_teammateUrl, teammateLabel) {
@@ -18441,9 +18407,21 @@
18441
18407
  return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
18442
18408
  }
18443
18409
 
18410
+ /**
18411
+ * Pattern matching agent URLs inside TEAM commitment content.
18412
+ */
18444
18413
  const urlRegex = /https?:\/\/[^\s]+/gi;
18414
+ /**
18415
+ * Pattern matching punctuation that often trails teammate URLs in prose.
18416
+ */
18445
18417
  const trailingPunctuationRegex = /[),.;!?]+$/;
18418
+ /**
18419
+ * Clause separators used while splitting TEAM instruction context.
18420
+ */
18446
18421
  const clauseSeparators = ['.', '?', '!', ';', ','];
18422
+ /**
18423
+ * Conjunction separators used while splitting TEAM instruction context.
18424
+ */
18447
18425
  const conjunctionSeparators = [' and ', ' or '];
18448
18426
  /**
18449
18427
  * Parses TEAM commitment content into teammates with instructions.
@@ -18491,6 +18469,9 @@
18491
18469
  }
18492
18470
  return teammates;
18493
18471
  }
18472
+ /**
18473
+ * Extracts the instruction fragment associated with one teammate URL.
18474
+ */
18494
18475
  function extractInstructionContext(line, matches, matchIndex) {
18495
18476
  var _a;
18496
18477
  const match = matches[matchIndex];
@@ -18516,6 +18497,9 @@
18516
18497
  }
18517
18498
  return `${prefix} ${suffix}`.trim();
18518
18499
  }
18500
+ /**
18501
+ * Trims content after the last detected clause delimiter.
18502
+ */
18519
18503
  function trimAfterLastDelimiter(text) {
18520
18504
  const match = findLastDelimiter(text);
18521
18505
  if (!match) {
@@ -18523,6 +18507,9 @@
18523
18507
  }
18524
18508
  return text.slice(match.index + match.length);
18525
18509
  }
18510
+ /**
18511
+ * Trims content before the last detected clause delimiter.
18512
+ */
18526
18513
  function trimBeforeLastDelimiter(text) {
18527
18514
  const cleaned = text.replace(/^[,;:]\s*/g, '');
18528
18515
  const match = findLastDelimiter(cleaned);
@@ -18531,6 +18518,9 @@
18531
18518
  }
18532
18519
  return cleaned.slice(0, match.index);
18533
18520
  }
18521
+ /**
18522
+ * Finds the last clause or conjunction delimiter in a string.
18523
+ */
18534
18524
  function findLastDelimiter(text) {
18535
18525
  let bestIndex = -1;
18536
18526
  let bestLength = 0;
@@ -18554,6 +18544,9 @@
18554
18544
  }
18555
18545
  return { index: bestIndex, length: bestLength };
18556
18546
  }
18547
+ /**
18548
+ * Normalizes teammate instruction text after URL extraction.
18549
+ */
18557
18550
  function normalizeInstructionText(text) {
18558
18551
  if (!text) {
18559
18552
  return '';
@@ -18567,6 +18560,9 @@
18567
18560
  normalized = normalizeWhitespaces(normalized).trim();
18568
18561
  return normalized;
18569
18562
  }
18563
+ /**
18564
+ * Creates a readable teammate label from an agent URL.
18565
+ */
18570
18566
  function createTeammateLabel(url) {
18571
18567
  try {
18572
18568
  const parsed = new URL(url);
@@ -18586,12 +18582,19 @@
18586
18582
  return url;
18587
18583
  }
18588
18584
  }
18585
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18586
+
18589
18587
  /**
18590
- * Note: [💞] Ignore a discrepancy between file name and entity name
18588
+ * Map of team tool functions.
18591
18589
  */
18592
-
18593
18590
  const teamToolFunctions = {};
18591
+ /**
18592
+ * Map of team tool titles.
18593
+ */
18594
18594
  const teamToolTitles = {};
18595
+ /**
18596
+ * Constant for remote agents by Url.
18597
+ */
18595
18598
  const remoteAgentsByUrl = new Map();
18596
18599
  /**
18597
18600
  * TEAM commitment definition
@@ -18955,9 +18958,7 @@
18955
18958
  return JSON.stringify(result);
18956
18959
  };
18957
18960
  }
18958
- /**
18959
- * Note: [💞] Ignore a discrepancy between file name and entity name
18960
- */
18961
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18961
18962
 
18962
18963
  /**
18963
18964
  * TEMPLATE commitment definition
@@ -19078,9 +19079,7 @@
19078
19079
  };
19079
19080
  }
19080
19081
  }
19081
- /**
19082
- * Note: [💞] Ignore a discrepancy between file name and entity name
19083
- */
19082
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19084
19083
 
19085
19084
  /**
19086
19085
  * USE commitment definition
@@ -19192,9 +19191,7 @@
19192
19191
  return knownTypes.includes(useType.toUpperCase());
19193
19192
  }
19194
19193
  }
19195
- /**
19196
- * Note: [💞] Ignore a discrepancy between file name and entity name
19197
- */
19194
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19198
19195
 
19199
19196
  /**
19200
19197
  * All `USE` commitment types currently participating in final system-message aggregation.
@@ -19217,6 +19214,7 @@
19217
19214
  *
19218
19215
  * @param type - Commitment type to check.
19219
19216
  * @returns `true` when the commitment participates in `USE` system-message aggregation.
19217
+ *
19220
19218
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
19221
19219
  */
19222
19220
  function isAggregatedUseCommitmentType(type) {
@@ -19227,6 +19225,7 @@
19227
19225
  *
19228
19226
  * @param type - Aggregated `USE` commitment type.
19229
19227
  * @returns Single-line placeholder comment stored in the interim system message.
19228
+ *
19230
19229
  * @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
19231
19230
  */
19232
19231
  function getAggregatedUseCommitmentPlaceholder(type) {
@@ -19237,6 +19236,7 @@
19237
19236
  *
19238
19237
  * @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
19239
19238
  * @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
19239
+ *
19240
19240
  * @private internal utility of `createAggregatedUseCommitmentSystemMessage`
19241
19241
  */
19242
19242
  function combineAdditionalInstructions(additionalInstructions) {
@@ -19248,6 +19248,7 @@
19248
19248
  * @param type - Aggregated `USE` commitment type.
19249
19249
  * @param additionalInstructions - Distinct additional instructions in source order.
19250
19250
  * @returns Final system-message block for the commitment type.
19251
+ *
19251
19252
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
19252
19253
  */
19253
19254
  function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
@@ -19286,6 +19287,7 @@
19286
19287
  * @param requirements - Current model requirements.
19287
19288
  * @param type - Aggregated `USE` commitment type being applied.
19288
19289
  * @returns Requirements with the placeholder inserted when it was not already present.
19290
+ *
19289
19291
  * @private internal utility of `USE` commitments
19290
19292
  */
19291
19293
  function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
@@ -19309,6 +19311,7 @@
19309
19311
  * @param requirements - Model requirements produced by commitment-by-commitment application.
19310
19312
  * @param commitments - Filtered commitments in their original source order.
19311
19313
  * @returns Requirements with aggregated `USE` system-message sections.
19314
+ *
19312
19315
  * @private internal utility of `createAgentModelRequirementsWithCommitments`
19313
19316
  */
19314
19317
  function aggregateUseCommitmentSystemMessages(requirements, commitments) {
@@ -19601,9 +19604,7 @@
19601
19604
  };
19602
19605
  }
19603
19606
  }
19604
- /**
19605
- * Note: [💞] Ignore a discrepancy between file name and entity name
19606
- */
19607
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19607
19608
 
19608
19609
  /**
19609
19610
  * Base Google Calendar API URL.
@@ -19874,9 +19875,7 @@
19874
19875
  const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
19875
19876
  return filteredTokens.join(' ').trim();
19876
19877
  }
19877
- /**
19878
- * Note: [💞] Ignore a discrepancy between file name and entity name
19879
- */
19878
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19880
19879
 
19881
19880
  /**
19882
19881
  * Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
@@ -20827,9 +20826,7 @@
20827
20826
  ...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
20828
20827
  });
20829
20828
  }
20830
- /**
20831
- * Note: [💞] Ignore a discrepancy between file name and entity name
20832
- */
20829
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20833
20830
 
20834
20831
  /**
20835
20832
  * Lightweight email token matcher used for `USE EMAIL` first-line parsing.
@@ -21095,9 +21092,7 @@
21095
21092
  },
21096
21093
  ];
21097
21094
  }
21098
- /**
21099
- * Note: [💞] Ignore a discrepancy between file name and entity name
21100
- */
21095
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21101
21096
 
21102
21097
  /**
21103
21098
  * USE IMAGE GENERATOR commitment definition
@@ -21188,9 +21183,7 @@
21188
21183
  `));
21189
21184
  }
21190
21185
  }
21191
- /**
21192
- * Note: [💞] Ignore a discrepancy between file name and entity name
21193
- */
21186
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21194
21187
 
21195
21188
  /**
21196
21189
  * USE MCP commitment definition
@@ -21265,9 +21258,7 @@
21265
21258
  };
21266
21259
  }
21267
21260
  }
21268
- /**
21269
- * Note: [💞] Ignore a discrepancy between file name and entity name
21270
- */
21261
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21271
21262
 
21272
21263
  /**
21273
21264
  * USE POPUP commitment definition
@@ -21403,9 +21394,7 @@
21403
21394
  };
21404
21395
  }
21405
21396
  }
21406
- /**
21407
- * Note: [💞] Ignore a discrepancy between file name and entity name
21408
- */
21397
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21409
21398
 
21410
21399
  /**
21411
21400
  * Tool name used by the USE PRIVACY commitment.
@@ -21577,9 +21566,7 @@
21577
21566
  };
21578
21567
  }
21579
21568
  }
21580
- /**
21581
- * Note: [💞] Ignore a discrepancy between file name and entity name
21582
- */
21569
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21583
21570
 
21584
21571
  /* eslint-disable no-magic-numbers */
21585
21572
  /**
@@ -22367,9 +22354,7 @@
22367
22354
  defaultBranch,
22368
22355
  };
22369
22356
  }
22370
- /**
22371
- * Note: [💞] Ignore a discrepancy between file name and entity name
22372
- */
22357
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22373
22358
 
22374
22359
  /**
22375
22360
  * Wallet metadata used by USE PROJECT when resolving GitHub credentials.
@@ -23228,9 +23213,7 @@
23228
23213
  defaultBranch: repositoryReference.defaultBranch,
23229
23214
  });
23230
23215
  }
23231
- /**
23232
- * Note: [💞] Ignore a discrepancy between file name and entity name
23233
- */
23216
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23234
23217
 
23235
23218
  /**
23236
23219
  * A search engine implementation that uses the SerpApi to fetch Google search results.
@@ -23441,9 +23424,7 @@
23441
23424
  };
23442
23425
  }
23443
23426
  }
23444
- /**
23445
- * Note: [💞] Ignore a discrepancy between file name and entity name
23446
- */
23427
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23447
23428
 
23448
23429
  /**
23449
23430
  * Maximum allowed source length for create-agent payloads.
@@ -23640,9 +23621,7 @@
23640
23621
  };
23641
23622
  }
23642
23623
  }
23643
- /**
23644
- * Note: [💞] Ignore a discrepancy between file name and entity name
23645
- */
23624
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23646
23625
 
23647
23626
  /**
23648
23627
  * Creates system-message instructions for `USE TIMEOUT`.
@@ -23707,9 +23686,7 @@
23707
23686
  return null;
23708
23687
  }
23709
23688
  }
23710
- /**
23711
- * Note: [💞] Ignore a discrepancy between file name and entity name
23712
- */
23689
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23713
23690
 
23714
23691
  /**
23715
23692
  * Builds a disabled timeout-tool payload.
@@ -24443,9 +24420,7 @@
24443
24420
  return createTimeoutToolFunctions();
24444
24421
  }
24445
24422
  }
24446
- /**
24447
- * Note: [💞] Ignore a discrepancy between file name and entity name
24448
- */
24423
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24449
24424
 
24450
24425
  /**
24451
24426
  * USE TIME commitment definition
@@ -24592,9 +24567,7 @@
24592
24567
  };
24593
24568
  }
24594
24569
  }
24595
- /**
24596
- * Note: [💞] Ignore a discrepancy between file name and entity name
24597
- */
24570
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24598
24571
 
24599
24572
  /**
24600
24573
  * Tool name used by the USE USER LOCATION commitment.
@@ -24807,9 +24780,7 @@
24807
24780
  };
24808
24781
  }
24809
24782
  }
24810
- /**
24811
- * Note: [💞] Ignore a discrepancy between file name and entity name
24812
- */
24783
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24813
24784
 
24814
24785
  /**
24815
24786
  * `WRITING RULES` commitment definition.
@@ -24885,9 +24856,7 @@
24885
24856
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
24886
24857
  }
24887
24858
  }
24888
- /**
24889
- * Note: [💞] Ignore a discrepancy between file name and entity name
24890
- */
24859
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24891
24860
 
24892
24861
  /**
24893
24862
  * `WRITING SAMPLE` commitment definition.
@@ -24957,9 +24926,7 @@
24957
24926
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
24958
24927
  }
24959
24928
  }
24960
- /**
24961
- * Note: [💞] Ignore a discrepancy between file name and entity name
24962
- */
24929
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24963
24930
 
24964
24931
  /**
24965
24932
  * Placeholder commitment definition for commitments that are not yet implemented
@@ -25121,13 +25088,12 @@
25121
25088
  new NotYetImplementedCommitmentDefinition('CONTEXT'),
25122
25089
  // <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
25123
25090
  ];
25124
- /**
25125
- * TODO: [🧠] Maybe create through standardized $register
25126
- * Note: [💞] Ignore a discrepancy between file name and entity name
25127
- */
25091
+ // TODO: [🧠] Maybe create through standardized $register
25092
+ // Note: [💞] Ignore a discrepancy between file name and entity name
25128
25093
 
25129
25094
  /**
25130
25095
  * Gets all available commitment definitions
25096
+ *
25131
25097
  * @returns Array of all commitment definitions
25132
25098
  *
25133
25099
  * @public exported from `@promptbook/core`
@@ -25140,6 +25106,7 @@
25140
25106
  * Collects tool functions from all commitment definitions.
25141
25107
  *
25142
25108
  * @returns Map of tool function implementations.
25109
+ *
25143
25110
  * @private internal helper for commitment tool registry
25144
25111
  */
25145
25112
  function collectCommitmentToolFunctions() {
@@ -25161,6 +25128,7 @@
25161
25128
  *
25162
25129
  * @param getFunctions - Provider of current tool functions.
25163
25130
  * @returns Proxy exposing tool functions as properties.
25131
+ *
25164
25132
  * @private internal helper for commitment tool registry
25165
25133
  */
25166
25134
  function createToolFunctionsProxy(getFunctions) {
@@ -25198,10 +25166,11 @@
25198
25166
  },
25199
25167
  });
25200
25168
  }
25169
+ // Note: [💞] Ignore a discrepancy between file name and entity name
25170
+
25201
25171
  /**
25202
- * Note: [💞] Ignore a discrepancy between file name and entity name
25172
+ * Map of node tool functions.
25203
25173
  */
25204
-
25205
25174
  const nodeToolFunctions = {
25206
25175
  /**
25207
25176
  * @@@
@@ -25233,6 +25202,9 @@
25233
25202
  spawn_agent: resolveSpawnAgentToolForNode(),
25234
25203
  // TODO: !!!! Unhardcode, make proper server function register from definitions
25235
25204
  };
25205
+ /**
25206
+ * Constant for node tool functions proxy.
25207
+ */
25236
25208
  const nodeToolFunctionsProxy = createToolFunctionsProxy(() => ({
25237
25209
  ...collectCommitmentToolFunctions(),
25238
25210
  ...nodeToolFunctions,
@@ -25256,10 +25228,8 @@
25256
25228
  }
25257
25229
  return nodeToolFunctionsProxy;
25258
25230
  }
25259
- /**
25260
- * Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
25261
- * TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
25262
- */
25231
+ // Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
25232
+ // TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
25263
25233
 
25264
25234
  /**
25265
25235
  * Normalize options for `execCommand` and `execCommands`
@@ -25327,7 +25297,6 @@
25327
25297
  /**
25328
25298
  * Run one command in a shell
25329
25299
  *
25330
- *
25331
25300
  * Note: There are 2 similar functions in the codebase:
25332
25301
  * - `$execCommand` which runs a single command
25333
25302
  * - `$execCommands` which runs multiple commands
@@ -25426,9 +25395,7 @@
25426
25395
  }
25427
25396
  });
25428
25397
  }
25429
- /**
25430
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25431
- */
25398
+ // 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
25432
25399
 
25433
25400
  /**
25434
25401
  * Attempts to locate the specified application on a Linux system using the 'which' command.
@@ -25446,10 +25413,8 @@
25446
25413
  return null;
25447
25414
  }
25448
25415
  }
25449
- /**
25450
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25451
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25452
- */
25416
+ // 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
25417
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25453
25418
 
25454
25419
  /**
25455
25420
  * Checks if the file is executable
@@ -25465,15 +25430,15 @@
25465
25430
  return false;
25466
25431
  }
25467
25432
  }
25468
- /**
25469
- * Note: Not [~🟢~] because it is not directly dependent on `fs
25470
- * TODO: [🖇] What about symlinks?
25471
- */
25433
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
25434
+ // TODO: [🖇] What about symlinks?
25472
25435
 
25473
25436
  // Note: Module `userhome` has no types available, so it is imported using `require`
25474
25437
  // @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
25475
- // eslint-disable-next-line @typescript-eslint/no-var-requires
25476
- const userhome = require('userhome');
25438
+ /**
25439
+ * Constant for userhome.
25440
+ */
25441
+ const userhome = require('userhome'); // eslint-disable-line @typescript-eslint/no-var-requires
25477
25442
  /**
25478
25443
  * Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
25479
25444
  * Returns the path to the executable if found, or null otherwise.
@@ -25502,10 +25467,8 @@
25502
25467
  return null;
25503
25468
  }
25504
25469
  }
25505
- /**
25506
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25507
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25508
- */
25470
+ // 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
25471
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25509
25472
 
25510
25473
  /**
25511
25474
  * Attempts to locate the specified application on a Windows system by searching common installation directories.
@@ -25534,10 +25497,8 @@
25534
25497
  return null;
25535
25498
  }
25536
25499
  }
25537
- /**
25538
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25539
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25540
- */
25500
+ // 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
25501
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25541
25502
 
25542
25503
  /**
25543
25504
  * Locates an application on the system
@@ -25574,10 +25535,8 @@
25574
25535
  }
25575
25536
  }
25576
25537
  }
25577
- /**
25578
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
25579
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25580
- */
25538
+ // Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment
25539
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
25581
25540
 
25582
25541
  /**
25583
25542
  * Locates the LibreOffice executable on the current system by searching platform-specific paths.
@@ -25593,10 +25552,8 @@
25593
25552
  macOsName: 'LibreOffice',
25594
25553
  });
25595
25554
  }
25596
- /**
25597
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
25598
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25599
- */
25555
+ // 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
25556
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
25600
25557
 
25601
25558
  /**
25602
25559
  * Locates the Pandoc executable on the current system by searching platform-specific paths.
@@ -25612,10 +25569,8 @@
25612
25569
  macOsName: 'Pandoc',
25613
25570
  });
25614
25571
  }
25615
- /**
25616
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
25617
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25618
- */
25572
+ // 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
25573
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
25619
25574
 
25620
25575
  /**
25621
25576
  * Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
@@ -25632,35 +25587,33 @@
25632
25587
  // <- TODO: [🧠] `null` vs `undefined`
25633
25588
  };
25634
25589
  }
25635
- /**
25636
- * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
25637
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25638
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
25639
- */
25590
+ // Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment
25591
+ // TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
25592
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
25640
25593
 
25641
25594
  /**
25642
25595
  * Register for LLM tools metadata.
25643
25596
  *
25644
25597
  * Note: `$` is used to indicate that this interacts with the global scope
25598
+ *
25645
25599
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
25600
+ *
25646
25601
  * @public exported from `@promptbook/core`
25647
25602
  */
25648
25603
  const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
25649
- /**
25650
- * TODO: [®] DRY Register logic
25651
- */
25604
+ // TODO: [®] DRY Register logic
25652
25605
 
25653
25606
  /**
25654
25607
  * Register for LLM tools.
25655
25608
  *
25656
25609
  * Note: `$` is used to indicate that this interacts with the global scope
25610
+ *
25657
25611
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
25612
+ *
25658
25613
  * @public exported from `@promptbook/core`
25659
25614
  */
25660
25615
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
25661
- /**
25662
- * TODO: [®] DRY Register logic
25663
- */
25616
+ // TODO: [®] DRY Register logic
25664
25617
 
25665
25618
  /**
25666
25619
  * Path to the `.env` file which was used to configure LLM tools
@@ -25797,10 +25750,8 @@
25797
25750
  .join('\n'))}
25798
25751
  `);
25799
25752
  }
25800
- /**
25801
- * TODO: [®] DRY Register logic
25802
- * TODO: [🧠][⚛] Maybe pass env as argument
25803
- */
25753
+ // TODO: [®] DRY Register logic
25754
+ // TODO: [🧠][⚛] Maybe pass env as argument
25804
25755
 
25805
25756
  /**
25806
25757
  * Provides the path to the `.env` file
@@ -25842,9 +25793,7 @@
25842
25793
  }
25843
25794
  return null;
25844
25795
  }
25845
- /**
25846
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25847
- */
25796
+ // 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
25848
25797
 
25849
25798
  /**
25850
25799
  * Provides LLM tools configuration by reading environment variables.
@@ -25858,6 +25807,7 @@
25858
25807
  *
25859
25808
  * @see Environment variables documentation or .env file for required variables.
25860
25809
  * @returns A promise that resolves to the LLM tools configuration, or null if configuration is incomplete or missing.
25810
+ *
25861
25811
  * @public exported from `@promptbook/node`
25862
25812
  */
25863
25813
  async function $provideLlmToolsConfigurationFromEnv() {
@@ -25874,9 +25824,7 @@
25874
25824
  .filter((configuration) => configuration !== null);
25875
25825
  return llmToolsConfiguration;
25876
25826
  }
25877
- /**
25878
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25879
- */
25827
+ // 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
25880
25828
 
25881
25829
  /**
25882
25830
  * Creates LLM execution tools from provided configuration objects
@@ -25889,6 +25837,7 @@
25889
25837
  * @param configuration Array of LLM tool configurations to instantiate
25890
25838
  * @param options Additional options for configuring the LLM tools
25891
25839
  * @returns A unified interface combining all successfully instantiated LLM tools
25840
+ *
25892
25841
  * @public exported from `@promptbook/core`
25893
25842
  */
25894
25843
  function createLlmToolsFromConfiguration(configuration, options = {}) {
@@ -25958,6 +25907,7 @@
25958
25907
  *
25959
25908
  * @param options Configuration options for the LLM tools
25960
25909
  * @returns A unified interface containing all detected and configured LLM tools
25910
+ *
25961
25911
  * @public exported from `@promptbook/node`
25962
25912
  */
25963
25913
  async function $provideLlmToolsFromEnv(options = {}) {
@@ -25982,29 +25932,26 @@
25982
25932
  }
25983
25933
  return createLlmToolsFromConfiguration(configuration, options);
25984
25934
  }
25985
- /**
25986
- * TODO: The architecture for LLM tools configuration consists of three key functions:
25987
- * 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
25988
- * 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
25989
- * 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
25990
- *
25991
- * This layered approach allows flexibility in how tools are configured:
25992
- * - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
25993
- * - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
25994
- * - Use createLlmToolsFromConfiguration for explicit control over tool configurations
25995
- *
25996
- * TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
25997
- * TODO: [🧠] Is there some meaningfull way how to test this util
25998
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
25999
- * TODO: [🥃] Allow `ptbk make` without llm tools
26000
- * TODO: This should be maybe not under `_common` but under `utils`
26001
- * TODO: [®] DRY Register logic
26002
- */
25935
+ // 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
25936
+ // TODO: The architecture for LLM tools configuration consists of three key functions:
25937
+ // 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
25938
+ // 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
25939
+ // 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
25940
+ // This layered approach allows flexibility in how tools are configured:
25941
+ // - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
25942
+ // - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
25943
+ // - Use createLlmToolsFromConfiguration for explicit control over tool configurations
25944
+ // TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
25945
+ // TODO: [🧠] Is there some meaningfull way how to test this util
25946
+ // TODO: [🥃] Allow `ptbk make` without llm tools
25947
+ // TODO: This should be maybe not under `_common` but under `utils`
25948
+ // TODO: [®] DRY Register logic
26003
25949
 
26004
25950
  /**
26005
25951
  * Provides a collection of scrapers optimized for Node.js environment.
26006
25952
  * 1) `provideScrapersForNode` use as default
26007
25953
  * 2) `provideScrapersForBrowser` use in limited browser environment *
25954
+ *
26008
25955
  * @public exported from `@promptbook/node`
26009
25956
  */
26010
25957
  async function $provideScrapersForNode(tools, options) {
@@ -26024,10 +25971,8 @@
26024
25971
  }
26025
25972
  return scrapers;
26026
25973
  }
26027
- /**
26028
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26029
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26030
- */
25974
+ // 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
25975
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26031
25976
 
26032
25977
  /**
26033
25978
  * Extracts code block from markdown.
@@ -26040,8 +25985,9 @@
26040
25985
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
26041
25986
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
26042
25987
  *
26043
- * @public exported from `@promptbook/markdown-utils`
26044
25988
  * @throws {ParseError} if there is not exactly one code block in the markdown
25989
+ *
25990
+ * @public exported from `@promptbook/markdown-utils`
26045
25991
  */
26046
25992
  function extractBlock(markdown) {
26047
25993
  const { content } = extractOneBlockFromMarkdown(markdown);
@@ -26053,7 +25999,7 @@
26053
25999
  *
26054
26000
  * Note: [🔂] This function is idempotent.
26055
26001
  * Note: This is useful for post-processing of the result of the chat LLM model
26056
- * when the model wraps the result in the (markdown) code block.
26002
+ * when the model wraps the result in the (markdown) code block.
26057
26003
  *
26058
26004
  * @public exported from `@promptbook/markdown-utils`
26059
26005
  */
@@ -26072,7 +26018,7 @@
26072
26018
  * Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
26073
26019
  *
26074
26020
  * Note: This is useful for post-processing of the result of the completion LLM model
26075
- * if you want to start code block in the prompt but you don't want to end it in the result.
26021
+ * if you want to start code block in the prompt but you don't want to end it in the result.
26076
26022
  *
26077
26023
  * @public exported from `@promptbook/markdown-utils`
26078
26024
  */
@@ -26084,6 +26030,8 @@
26084
26030
  }
26085
26031
 
26086
26032
  /**
26033
+ * Collection of preserved.
26034
+ *
26087
26035
  * @private internal for `preserve`
26088
26036
  */
26089
26037
  const _preserved = [];
@@ -26093,21 +26041,20 @@
26093
26041
  *
26094
26042
  * @param value any function to preserve
26095
26043
  * @returns nothing
26044
+ *
26096
26045
  * @private within the repository
26097
26046
  */
26098
26047
  function $preserve(...value) {
26099
26048
  _preserved.push(...value);
26100
26049
  }
26101
- /**
26102
- * Note: [💞] Ignore a discrepancy between file name and entity name
26103
- */
26050
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26104
26051
 
26105
26052
  // Note: [💎]
26106
26053
  /**
26107
26054
  * ScriptExecutionTools for JavaScript implemented via eval
26108
26055
  *
26109
26056
  * Warning: It is used for testing and mocking
26110
- * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
26057
+ * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
26111
26058
  *
26112
26059
  * @public exported from `@promptbook/javascript`
26113
26060
  */
@@ -26302,23 +26249,22 @@
26302
26249
  return result;
26303
26250
  }
26304
26251
  }
26305
- /**
26306
- * TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
26307
- * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
26308
- */
26252
+ // TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
26253
+ // TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
26309
26254
 
26310
26255
  /**
26311
26256
  * Placeholder for better implementation of JavascriptExecutionTools - some proper sandboxing
26312
26257
  *
26313
26258
  * @alias JavascriptExecutionTools
26259
+ *
26314
26260
  * @public exported from `@promptbook/javascript`
26315
26261
  */
26316
26262
  const JavascriptExecutionTools = JavascriptEvalExecutionTools;
26317
26263
 
26318
26264
  /**
26319
26265
  * Note: There is unfortunately no equivalent for this function in the browser environment
26320
- * because it is not possible automatically detect configured LLM providers
26321
- * you need to provide them manually BUT you can help by utilities like `$provideScrapersForBrowser`
26266
+ * because it is not possible automatically detect configured LLM providers
26267
+ * you need to provide them manually BUT you can help by utilities like `$provideScrapersForBrowser`
26322
26268
  *
26323
26269
  * @public exported from `@promptbook/node`
26324
26270
  */
@@ -26343,10 +26289,8 @@
26343
26289
  };
26344
26290
  return tools;
26345
26291
  }
26346
- /**
26347
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26348
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26349
- */
26292
+ // 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
26293
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26350
26294
 
26351
26295
  /**
26352
26296
  * Checks if the directory exists
@@ -26367,12 +26311,10 @@
26367
26311
  .catch(() => false);
26368
26312
  return isDirectory;
26369
26313
  }
26370
- /**
26371
- * Note: Not [~🟢~] because it is not directly dependent on `fs
26372
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
26373
- * TODO: [🧠][📂] "directory" vs "folder"
26374
- * TODO: [🖇] What about symlinks?
26375
- */
26314
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
26315
+ // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
26316
+ // TODO: [🧠][📂] "directory" vs "folder"
26317
+ // TODO: [🖇] What about symlinks?
26376
26318
 
26377
26319
  /**
26378
26320
  * Reads all files in the directory
@@ -26380,6 +26322,7 @@
26380
26322
  * @param path
26381
26323
  * @param isRecursive
26382
26324
  * @returns List of all files in the directory
26325
+ *
26383
26326
  * @private internal function of `AgentCollectionInDirectory` and `createPipelineCollectionFromDirectory`
26384
26327
  */
26385
26328
  async function listAllFiles(path$1, isRecursive, fs) {
@@ -26401,11 +26344,9 @@
26401
26344
  }
26402
26345
  return fileNames;
26403
26346
  }
26404
- /**
26405
- * TODO: [😶] Unite folder listing
26406
- * Note: Not [~🟢~] because it is not directly dependent on `fs
26407
- * TODO: [🖇] What about symlinks?
26408
- */
26347
+ // TODO: [😶] Unite folder listing
26348
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
26349
+ // TODO: [🖇] What about symlinks?
26409
26350
 
26410
26351
  /**
26411
26352
  * Constructs `PipelineCollection` from async sources
@@ -26415,17 +26356,18 @@
26415
26356
  * - Factory function that returns Promise of array of PipelineJson or PipelineString
26416
26357
  *
26417
26358
  * Note: This is useful as internal tool for other constructor functions like
26418
- * `createPipelineCollectionFromUrl` or `createPipelineCollectionFromDirectory`
26419
- * Consider using those functions instead of this one
26359
+ * `createPipelineCollectionFromUrl` or `createPipelineCollectionFromDirectory`
26360
+ * Consider using those functions instead of this one
26420
26361
  *
26421
26362
  * Note: The function does NOT return promise it returns the collection directly which waits for the sources to be resolved
26422
- * when error occurs in given promise or factory function, it is thrown during `listPipelines` or `getPipelineByUrl` call
26363
+ * when error occurs in given promise or factory function, it is thrown during `listPipelines` or `getPipelineByUrl` call
26423
26364
  *
26424
26365
  * Note: Consider using `createPipelineCollectionFromDirectory` or `createPipelineCollectionFromUrl`
26425
26366
  *
26426
26367
  * @param promptbookSourcesPromiseOrFactory
26427
26368
  * @returns PipelineCollection
26428
26369
  * @deprecated Do not use, it will became internal tool for other constructor functions
26370
+ *
26429
26371
  * @public exported from `@promptbook/core`
26430
26372
  */
26431
26373
  function createPipelineCollectionFromPromise(promptbookSourcesPromiseOrFactory) {
@@ -26469,6 +26411,7 @@
26469
26411
  * @param tools - Execution tools to be used for pipeline preparation if needed - If not provided, `$provideExecutionToolsForNode` will be used
26470
26412
  * @param options - Options for the collection creation
26471
26413
  * @returns PipelineCollection
26414
+ *
26472
26415
  * @public exported from `@promptbook/node`
26473
26416
  */
26474
26417
  async function createPipelineCollectionFromDirectory(rootPath, tools, options) {
@@ -26652,10 +26595,8 @@
26652
26595
  }
26653
26596
  return collection;
26654
26597
  }
26655
- /**
26656
- * TODO: [🖇] What about symlinks? Maybe option `isSymlinksFollowed`
26657
- * TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
26658
- */
26598
+ // TODO: [🖇] What about symlinks? Maybe option `isSymlinksFollowed`
26599
+ // TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
26659
26600
 
26660
26601
  /**
26661
26602
  * Provides script execution tools
@@ -26669,10 +26610,8 @@
26669
26610
  // TODO: [🔱] Do here auto-installation
26670
26611
  return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
26671
26612
  }
26672
- /**
26673
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26674
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26675
- */
26613
+ // 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
26614
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
26676
26615
 
26677
26616
  /**
26678
26617
  * Stringify the PipelineJson with proper formatting
@@ -26700,12 +26639,10 @@
26700
26639
  pipelineJsonStringified += '\n';
26701
26640
  return pipelineJsonStringified;
26702
26641
  }
26703
- /**
26704
- * TODO: [🐝] Not Working properly @see https://promptbook.studio/examples/mixed-knowledge.book
26705
- * TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
26706
- * TODO: [🧠] Maybe more elegant solution than replacing via regex
26707
- * TODO: [🍙] Make some standard order of json properties
26708
- */
26642
+ // TODO: [🐝] Not Working properly @see https://promptbook.studio/examples/mixed-knowledge.book
26643
+ // TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
26644
+ // TODO: [🧠] Maybe more elegant solution than replacing via regex
26645
+ // TODO: [🍙] Make some standard order of json properties
26709
26646
 
26710
26647
  /**
26711
26648
  * A storage implementation that caches data in files organized in a directory structure.
@@ -26795,10 +26732,8 @@
26795
26732
  // [0] When `setItem` and `removeItem` called, the state of the file system should be the same
26796
26733
  }
26797
26734
  }
26798
- /**
26799
- * TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
26800
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26801
- */
26735
+ // 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
26736
+ // TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
26802
26737
 
26803
26738
  /**
26804
26739
  * Run multiple commands in a shell in sequence
@@ -26815,9 +26750,7 @@
26815
26750
  await $execCommand({ command, cwd, crashOnError });
26816
26751
  }
26817
26752
  }
26818
- /**
26819
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
26820
- */
26753
+ // 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
26821
26754
 
26822
26755
  /**
26823
26756
  * Keep-alive helpers used for streaming chat responses.
@@ -26829,9 +26762,7 @@
26829
26762
  * @private internal streaming helper for Promptbook chat connections
26830
26763
  */
26831
26764
  const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
26832
- /**
26833
- * Note: [💞] Ignore a discrepancy between file name and entity name
26834
- */
26765
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26835
26766
 
26836
26767
  /**
26837
26768
  * Type guard to check if a string is a valid agent source
@@ -26861,6 +26792,7 @@
26861
26792
  * Default book
26862
26793
  *
26863
26794
  * @deprecated Use `$generateBookBoilerplate` instead
26795
+ *
26864
26796
  * @public exported from `@promptbook/core`
26865
26797
  */
26866
26798
  padBook(validateBook(_spaceTrim.spaceTrim(`
@@ -26879,6 +26811,7 @@
26879
26811
  *
26880
26812
  * @param {string} pipelineString the candidate for a pipeline string
26881
26813
  * @returns {boolean} if the string is a valid pipeline string
26814
+ *
26882
26815
  * @public exported from `@promptbook/core`
26883
26816
  */
26884
26817
  function isValidPipelineString(pipelineString) {
@@ -26891,9 +26824,7 @@
26891
26824
  return false;
26892
26825
  }
26893
26826
  }
26894
- /**
26895
- * TODO: [🧠][🈴] Where is the best location for this file
26896
- */
26827
+ // TODO: [🧠][🈴] Where is the best location for this file
26897
26828
 
26898
26829
  /**
26899
26830
  * Tag function for notating a pipeline with a book\`...\ notation as template literal
@@ -26906,6 +26837,7 @@
26906
26837
  * @param strings The static string parts of the template literal
26907
26838
  * @param values The dynamic values embedded within the template literal used as data
26908
26839
  * @returns the pipeline string
26840
+ *
26909
26841
  * @public exported from `@promptbook/core`
26910
26842
  */
26911
26843
  function book(strings, ...values) {
@@ -26932,10 +26864,8 @@
26932
26864
  }
26933
26865
  return padBook(bookString);
26934
26866
  }
26935
- /**
26936
- * TODO: [🧠][🈴] Where is the best location for this file
26937
- * Note: [💞] Ignore a discrepancy between file name and entity name
26938
- */
26867
+ // TODO: [🧠][🈴] Where is the best location for this file
26868
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26939
26869
 
26940
26870
  /**
26941
26871
  * Tool call name emitted while preparing a GPT assistant for an agent.
@@ -26980,9 +26910,7 @@
26980
26910
  { token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
26981
26911
  { token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
26982
26912
  ];
26983
- /**
26984
- * Note: [💞] Ignore a discrepancy between file name and entity name
26985
- */
26913
+ // Note: [💞] Ignore a discrepancy between file name and entity name
26986
26914
 
26987
26915
  /**
26988
26916
  * Converts encoded whitespace markers back into real whitespace so the UI can render the message
@@ -27000,6 +26928,9 @@
27000
26928
  }, content);
27001
26929
  }
27002
26930
 
26931
+ /**
26932
+ * Constant for raw tool call ID fields.
26933
+ */
27003
26934
  const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
27004
26935
  /**
27005
26936
  * Builds a deterministic idempotency key for tool calls so the UI can track updates.
@@ -27030,6 +26961,9 @@
27030
26961
  }
27031
26962
  return `fallback:${toolCall.name}`;
27032
26963
  }
26964
+ /**
26965
+ * Gets arguments key.
26966
+ */
27033
26967
  function getArgumentsKey(value) {
27034
26968
  if (typeof value === 'string') {
27035
26969
  return value;
@@ -27103,6 +27037,7 @@
27103
27037
  * @param existingToolCall - Previous snapshot.
27104
27038
  * @param incomingToolCall - New snapshot.
27105
27039
  * @returns One merged snapshot.
27040
+ *
27106
27041
  * @private helper of `mergeToolCalls`
27107
27042
  */
27108
27043
  function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
@@ -27125,6 +27060,7 @@
27125
27060
  * @param existingToolCall - Previous snapshot.
27126
27061
  * @param incomingToolCall - New snapshot.
27127
27062
  * @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
27063
+ *
27128
27064
  * @private helper of `mergeToolCalls`
27129
27065
  */
27130
27066
  function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
@@ -27138,6 +27074,7 @@
27138
27074
  *
27139
27075
  * @param toolCall - Tool call snapshot to inspect.
27140
27076
  * @returns Inferred lifecycle state or `undefined`.
27077
+ *
27141
27078
  * @private helper of `mergeToolCalls`
27142
27079
  */
27143
27080
  function inferToolCallState(toolCall) {
@@ -27161,6 +27098,7 @@
27161
27098
  * @param existingValues - Previous list.
27162
27099
  * @param incomingValues - Incoming list.
27163
27100
  * @returns Deduplicated merged list or `undefined`.
27101
+ *
27164
27102
  * @private helper of `mergeToolCalls`
27165
27103
  */
27166
27104
  function mergeUnknownLists(existingValues, incomingValues) {
@@ -27187,6 +27125,7 @@
27187
27125
  *
27188
27126
  * @param value - Value to serialize.
27189
27127
  * @returns String signature.
27128
+ *
27190
27129
  * @private helper of `mergeToolCalls`
27191
27130
  */
27192
27131
  function serializeValueForMerge(value) {
@@ -27204,6 +27143,7 @@
27204
27143
  *
27205
27144
  * @param toolCalls - Mutable list to deduplicate in-place.
27206
27145
  * @returns The same array after removing redundant preparation entries.
27146
+ *
27207
27147
  * @private helper of `mergeToolCalls`
27208
27148
  */
27209
27149
  function deduplicatePreparationToolCalls(toolCalls) {
@@ -27261,6 +27201,7 @@
27261
27201
  *
27262
27202
  * @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
27263
27203
  * @returns Normalized hostname or `null` when the value cannot be normalized.
27204
+ *
27264
27205
  * @private utility for host/domain matching
27265
27206
  */
27266
27207
  function normalizeDomainForMatching(rawDomain) {
@@ -27283,6 +27224,7 @@
27283
27224
  *
27284
27225
  * @param value - Raw value to inspect.
27285
27226
  * @returns True when the value starts with `http://` or `https://`.
27227
+ *
27286
27228
  * @private utility for host/domain matching
27287
27229
  */
27288
27230
  function hasHttpProtocol(value) {
@@ -27298,6 +27240,7 @@
27298
27240
  *
27299
27241
  * @param agentSource - Raw agent source.
27300
27242
  * @returns Parsed prelude with shared line metadata.
27243
+ *
27301
27244
  * @private internal utility of book agent-source parsing
27302
27245
  */
27303
27246
  function parseAgentSourcePrelude(agentSource) {
@@ -27473,6 +27416,7 @@
27473
27416
  *
27474
27417
  * @param text - Text to extract parameters from
27475
27418
  * @returns Array of parsed parameters with unified representation
27419
+ *
27476
27420
  * @public exported from `@promptbook/core`
27477
27421
  */
27478
27422
  function parseParameters(text) {
@@ -27901,9 +27845,7 @@
27901
27845
  const trimmed = _spaceTrim.spaceTrim(content);
27902
27846
  return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
27903
27847
  }
27904
- /**
27905
- * TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
27906
- */
27848
+ // TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
27907
27849
 
27908
27850
  /**
27909
27851
  * Gets all tool titles provided by all commitments
@@ -27929,6 +27871,7 @@
27929
27871
  * Restricts an Updatable to a (2) BehaviorSubject variant
27930
27872
  *
27931
27873
  * @see Updatable
27874
+ *
27932
27875
  * @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
27933
27876
  */
27934
27877
  function asUpdatableSubject(value) {
@@ -27953,9 +27896,7 @@
27953
27896
  return new rxjs.BehaviorSubject(value);
27954
27897
  }
27955
27898
  }
27956
- /**
27957
- * TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
27958
- */
27899
+ // TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
27959
27900
 
27960
27901
  /**
27961
27902
  * Creates an empty/basic agent model requirements object
@@ -27990,12 +27931,11 @@
27990
27931
  systemMessage: `You are ${agentName || 'AI Agent'}`,
27991
27932
  };
27992
27933
  }
27993
- /**
27994
- * TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
27995
- */
27934
+ // TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
27996
27935
 
27997
27936
  /**
27998
27937
  * Gets a commitment definition by its type
27938
+ *
27999
27939
  * @param type The commitment type to look up
28000
27940
  * @returns The commitment definition or null if not found
28001
27941
  *
@@ -28374,7 +28314,9 @@
28374
28314
  };
28375
28315
  }
28376
28316
  /**
28377
- * @private Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
28317
+ * Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
28318
+ *
28319
+ * @private
28378
28320
  */
28379
28321
  async function applyPendingInlineKnowledgeSources(requirements, uploader) {
28380
28322
  var _a;
@@ -28395,6 +28337,9 @@
28395
28337
  _metadata: stripInlineKnowledgeMetadata(requirements._metadata),
28396
28338
  };
28397
28339
  }
28340
+ /**
28341
+ * Handles upload inline knowledge source with fallback.
28342
+ */
28398
28343
  async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
28399
28344
  try {
28400
28345
  return await uploader(inlineSource);
@@ -28407,6 +28352,9 @@
28407
28352
  return inlineKnowledgeSourceToDataUrl(inlineSource);
28408
28353
  }
28409
28354
  }
28355
+ /**
28356
+ * Extracts inline knowledge sources.
28357
+ */
28410
28358
  function extractInlineKnowledgeSources(metadata) {
28411
28359
  if (!metadata) {
28412
28360
  return [];
@@ -28414,6 +28362,9 @@
28414
28362
  const value = metadata.inlineKnowledgeSources;
28415
28363
  return Array.isArray(value) ? value : [];
28416
28364
  }
28365
+ /**
28366
+ * Strips inline knowledge metadata.
28367
+ */
28417
28368
  function stripInlineKnowledgeMetadata(metadata) {
28418
28369
  if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
28419
28370
  return metadata;
@@ -28464,6 +28415,7 @@
28464
28415
  * @param availableModels - Models that could fulfill the agent.
28465
28416
  * @param llmTools - Execution tools used when selecting a best model.
28466
28417
  * @param options - Optional hooks such as the agent reference resolver.
28418
+ *
28467
28419
  * @public exported from `@promptbook/core`
28468
28420
  */
28469
28421
  async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
@@ -28483,6 +28435,7 @@
28483
28435
  * @param agentSource The agent source to derive persona description from
28484
28436
  * @param llmTools LLM tools for preparing persona
28485
28437
  * @returns The name of the best selected model
28438
+ *
28486
28439
  * @private function of `createAgentModelRequirements`
28487
28440
  */
28488
28441
  async function selectBestModelUsingPersona(agentSource, llmTools) {
@@ -28618,6 +28571,7 @@
28618
28571
  *
28619
28572
  * @param {unknown} rawAttachments - The raw attachments to normalize.
28620
28573
  * @returns {Array<ChatAttachment>} The normalized attachments.
28574
+ *
28621
28575
  * @public exported from `@promptbook/core`
28622
28576
  */
28623
28577
  function normalizeChatAttachments(rawAttachments) {
@@ -28662,6 +28616,7 @@
28662
28616
  *
28663
28617
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
28664
28618
  * @returns {string} The formatted context.
28619
+ *
28665
28620
  * @public exported from `@promptbook/core`
28666
28621
  */
28667
28622
  function formatChatAttachmentContext(attachments) {
@@ -28682,6 +28637,7 @@
28682
28637
  * @param {number} maxBytes - Maximum number of bytes to capture.
28683
28638
  * @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
28684
28639
  * @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
28640
+ *
28685
28641
  * @private internal utility for bounded response reads
28686
28642
  */
28687
28643
  async function readResponseBytes(response, maxBytes, options = {}) {
@@ -28778,6 +28734,7 @@
28778
28734
  * @param {number} maxInlineCharacters - Maximum number of characters to inline.
28779
28735
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
28780
28736
  * @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
28737
+ *
28781
28738
  * @private function of resolveChatAttachmentContents
28782
28739
  */
28783
28740
  async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
@@ -28869,6 +28826,7 @@
28869
28826
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
28870
28827
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
28871
28828
  * @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
28829
+ *
28872
28830
  * @public exported from `@promptbook/core`
28873
28831
  */
28874
28832
  async function resolveChatAttachmentContents(attachments, options = {}) {
@@ -28934,6 +28892,7 @@
28934
28892
  *
28935
28893
  * @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
28936
28894
  * @returns {string} The formatted context.
28895
+ *
28937
28896
  * @public exported from `@promptbook/core`
28938
28897
  */
28939
28898
  function formatChatAttachmentContentContext(resolvedContents) {
@@ -28974,6 +28933,7 @@
28974
28933
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
28975
28934
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
28976
28935
  * @returns {Promise<string>} The updated message content.
28936
+ *
28977
28937
  * @public exported from `@promptbook/core`
28978
28938
  */
28979
28939
  async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
@@ -29002,9 +28962,7 @@
29002
28962
  function humanizeAiTextEllipsis(aiText) {
29003
28963
  return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
29004
28964
  }
29005
- /**
29006
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29007
- */
28965
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29008
28966
 
29009
28967
  /**
29010
28968
  * Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
@@ -29017,9 +28975,7 @@
29017
28975
  function humanizeAiTextEmdashed(aiText) {
29018
28976
  return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
29019
28977
  }
29020
- /**
29021
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29022
- */
28978
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29023
28979
 
29024
28980
  /**
29025
28981
  * Change smart quotes to regular quotes
@@ -29032,9 +28988,7 @@
29032
28988
  function humanizeAiTextQuotes(aiText) {
29033
28989
  return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
29034
28990
  }
29035
- /**
29036
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29037
- */
28991
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29038
28992
 
29039
28993
  /**
29040
28994
  * Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
@@ -29047,9 +29001,7 @@
29047
29001
  function humanizeAiTextSources(aiText) {
29048
29002
  return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
29049
29003
  }
29050
- /**
29051
- * Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29052
- */
29004
+ // Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29053
29005
 
29054
29006
  /**
29055
29007
  * Change unprintable hard spaces to regular spaces and drop zero-width spaces
@@ -29062,9 +29014,7 @@
29062
29014
  function humanizeAiTextWhitespace(aiText) {
29063
29015
  return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
29064
29016
  }
29065
- /**
29066
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29067
- */
29017
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
29068
29018
 
29069
29019
  /**
29070
29020
  * Function `humanizeAiText` will remove traces of AI text generation artifacts
@@ -29083,11 +29033,11 @@
29083
29033
  cleanedText = humanizeAiTextWhitespace(cleanedText);
29084
29034
  return cleanedText;
29085
29035
  }
29086
- /**
29087
- * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
29088
- */
29036
+ // TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
29089
29037
 
29090
29038
  /**
29039
+ * Map of promptbook pseudotoken substitution.
29040
+ *
29091
29041
  * @private
29092
29042
  */
29093
29043
  const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
@@ -29135,9 +29085,7 @@
29135
29085
  }
29136
29086
  return promptbookifiedTextTokens.join('');
29137
29087
  }
29138
- /**
29139
- * TODO: [🧠][✌️] Make some Promptbook-native token system
29140
- */
29088
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
29141
29089
 
29142
29090
  /**
29143
29091
  * Make UncertainNumber
@@ -29193,6 +29141,7 @@
29193
29141
  *
29194
29142
  * @see https://platform.openai.com/docs/models/
29195
29143
  * @see https://openai.com/api/pricing/
29144
+ *
29196
29145
  * @public exported from `@promptbook/openai`
29197
29146
  */
29198
29147
  const OPENAI_MODELS = exportJson({
@@ -29869,6 +29818,7 @@
29869
29818
  * @param rawResponse The raw response from OpenAI API
29870
29819
  * @param duration The duration of the execution
29871
29820
  * @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
29821
+ *
29872
29822
  * @private internal utility of `OpenAiExecutionTools`
29873
29823
  */
29874
29824
  function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
@@ -29911,15 +29861,14 @@
29911
29861
  },
29912
29862
  };
29913
29863
  }
29914
- /**
29915
- * TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
29916
- */
29864
+ // TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
29917
29865
 
29918
29866
  /**
29919
29867
  * Parses an OpenAI error message to identify which parameter is unsupported
29920
29868
  *
29921
29869
  * @param errorMessage The error message from OpenAI API
29922
29870
  * @returns The parameter name that is unsupported, or null if not an unsupported parameter error
29871
+ *
29923
29872
  * @private utility of LLM Tools
29924
29873
  */
29925
29874
  function parseUnsupportedParameterError(errorMessage) {
@@ -29941,6 +29890,7 @@
29941
29890
  * @param modelRequirements Original model requirements
29942
29891
  * @param unsupportedParameter The parameter to remove
29943
29892
  * @returns New model requirements without the unsupported parameter
29893
+ *
29944
29894
  * @private utility of LLM Tools
29945
29895
  */
29946
29896
  function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
@@ -29960,8 +29910,10 @@
29960
29910
  }
29961
29911
  /**
29962
29912
  * Checks if an error is an "Unsupported value" error from OpenAI
29913
+ *
29963
29914
  * @param error The error to check
29964
29915
  * @returns true if this is an unsupported parameter error
29916
+ *
29965
29917
  * @private utility of LLM Tools
29966
29918
  */
29967
29919
  function isUnsupportedParameterError(error) {
@@ -31067,13 +31019,11 @@
31067
31019
  return false;
31068
31020
  }
31069
31021
  }
31070
- /**
31071
- * TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
31072
- * TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
31073
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
31074
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
31075
- * TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
31076
- */
31022
+ // TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
31023
+ // TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
31024
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
31025
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
31026
+ // TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
31077
31027
 
31078
31028
  /**
31079
31029
  * Profile for OpenAI provider
@@ -31141,9 +31091,21 @@
31141
31091
  }
31142
31092
  }
31143
31093
 
31094
+ /**
31095
+ * Constant for default knowledge source download timeout ms.
31096
+ */
31144
31097
  const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
31098
+ /**
31099
+ * Constant for default knowledge source upload timeout ms.
31100
+ */
31145
31101
  const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
31102
+ /**
31103
+ * Constant for vector store progress log interval min ms.
31104
+ */
31146
31105
  const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
31106
+ /**
31107
+ * Constant for vector store stall log threshold ms.
31108
+ */
31147
31109
  const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
31148
31110
  /**
31149
31111
  * Base class for OpenAI execution tools that need hosted vector stores.
@@ -31910,6 +31872,9 @@
31910
31872
  }
31911
31873
  }
31912
31874
 
31875
+ /**
31876
+ * Constant for default agent kit model name.
31877
+ */
31913
31878
  const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
31914
31879
  /**
31915
31880
  * Creates one structured log entry for streamed tool-call updates.
@@ -31953,6 +31918,9 @@
31953
31918
  }
31954
31919
  return 'COMPLETE';
31955
31920
  }
31921
+ /**
31922
+ * Constant for default JSON schema name.
31923
+ */
31956
31924
  const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
31957
31925
  /**
31958
31926
  * File extensions considered image inputs when MIME type is missing or generic.
@@ -32108,6 +32076,7 @@
32108
32076
  *
32109
32077
  * @param responseFormat - The OpenAI `response_format` payload from the user request.
32110
32078
  * @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
32079
+ *
32111
32080
  * @private utility of Open AI
32112
32081
  */
32113
32082
  function mapResponseFormatToAgentOutputType(responseFormat) {
@@ -32866,6 +32835,7 @@
32866
32835
  * - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
32867
32836
  *
32868
32837
  * @deprecated Use `OpenAiAgentKitExecutionTools` instead.
32838
+ *
32869
32839
  * @public exported from `@promptbook/openai`
32870
32840
  */
32871
32841
  class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
@@ -33557,14 +33527,12 @@
33557
33527
  * @private const of `OpenAiAssistantExecutionTools`
33558
33528
  */
33559
33529
  const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
33560
- /**
33561
- * TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
33562
- * TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
33563
- * TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
33564
- * TODO: Maybe make custom OpenAiError
33565
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
33566
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
33567
- */
33530
+ // TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
33531
+ // TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
33532
+ // TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
33533
+ // TODO: Maybe make custom OpenAiError
33534
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
33535
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
33568
33536
 
33569
33537
  /**
33570
33538
  * Emits a progress update to signal assistant preparation before long setup work.
@@ -34041,10 +34009,8 @@
34041
34009
  * Cache of OpenAI vector stores to avoid creating duplicates
34042
34010
  */
34043
34011
  AgentLlmExecutionTools.vectorStoreCache = new Map();
34044
- /**
34045
- * TODO: [🍚] Implement Destroyable pattern to free resources
34046
- * TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
34047
- */
34012
+ // TODO: [🍚] Implement Destroyable pattern to free resources
34013
+ // TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
34048
34014
 
34049
34015
  /**
34050
34016
  * Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
@@ -34054,6 +34020,7 @@
34054
34020
  *
34055
34021
  * @param agentSource - The raw agent book source
34056
34022
  * @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
34023
+ *
34057
34024
  * @private Internal helper shared between self-learning and related features.
34058
34025
  */
34059
34026
  function extractOpenTeacherInstructions(agentSource) {
@@ -34261,6 +34228,7 @@
34261
34228
  *
34262
34229
  * @param section Raw fragment from self-learning workflow.
34263
34230
  * @returns Trimmed fragment, or empty string when nothing remains.
34231
+ *
34264
34232
  * @private function of Agent
34265
34233
  */
34266
34234
  function normalizeBookSection(section) {
@@ -34272,6 +34240,7 @@
34272
34240
  * @param agentSource Current source.
34273
34241
  * @param normalizedSection Candidate fragment expected to be normalized first.
34274
34242
  * @returns True when appending would duplicate an existing fragment.
34243
+ *
34275
34244
  * @private function of Agent
34276
34245
  */
34277
34246
  function containsNormalizedBookSection(agentSource, normalizedSection) {
@@ -34286,6 +34255,7 @@
34286
34255
  *
34287
34256
  * @param responseFormat Prompt response format requirements
34288
34257
  * @returns True when JSON schema mode is active
34258
+ *
34289
34259
  * @private function of Agent
34290
34260
  */
34291
34261
  function isJsonSchemaResponseFormat(responseFormat) {
@@ -34297,6 +34267,7 @@
34297
34267
  * @param content Original agent answer content
34298
34268
  * @param isJsonMode Whether the interaction requested JSON schema output
34299
34269
  * @returns Agent answer, wrapped in a formatted JSON code block when possible
34270
+ *
34300
34271
  * @private function of Agent
34301
34272
  */
34302
34273
  function formatAgentMessageForJsonMode(content, isJsonMode) {
@@ -34322,6 +34293,7 @@
34322
34293
  *
34323
34294
  * @param content Text to parse as JSON
34324
34295
  * @returns Parsed JSON value or null when parsing fails
34296
+ *
34325
34297
  * @private function of Agent
34326
34298
  */
34327
34299
  function tryParseJson(content) {
@@ -34337,6 +34309,7 @@
34337
34309
  *
34338
34310
  * @param options - Normalized sample parts.
34339
34311
  * @returns Book-language sample section ready to append into agent source.
34312
+ *
34340
34313
  * @private function of Agent
34341
34314
  */
34342
34315
  function formatSelfLearningSample(options) {
@@ -34358,6 +34331,7 @@
34358
34331
  *
34359
34332
  * @param internalMessage Internal trace payload.
34360
34333
  * @returns Book-language INTERNAL MESSAGE block.
34334
+ *
34361
34335
  * @private function of Agent
34362
34336
  */
34363
34337
  function formatInternalLearningMessage(internalMessage) {
@@ -34371,6 +34345,7 @@
34371
34345
  *
34372
34346
  * @param result Final chat result used in self-learning.
34373
34347
  * @returns Internal payloads that capture request/response/tool-call context.
34348
+ *
34374
34349
  * @private function of Agent
34375
34350
  */
34376
34351
  function buildInternalLearningMessages(result) {
@@ -34400,6 +34375,7 @@
34400
34375
  *
34401
34376
  * @param toolCall Tool call produced during execution.
34402
34377
  * @returns Sanitized and serializable tool-call payload.
34378
+ *
34403
34379
  * @private function of Agent
34404
34380
  */
34405
34381
  function sanitizeToolCallForLearning(toolCall) {
@@ -34419,6 +34395,7 @@
34419
34395
  *
34420
34396
  * @param payload Internal payload to serialize.
34421
34397
  * @returns Pretty JSON string that can be embedded in BOOK.
34398
+ *
34422
34399
  * @private function of Agent
34423
34400
  */
34424
34401
  function stringifyInternalLearningPayload(payload) {
@@ -34468,6 +34445,7 @@
34468
34445
  * Normalizes teacher commitments into trimmed, display-ready lines.
34469
34446
  *
34470
34447
  * @param commitments Raw teacher output
34448
+ *
34471
34449
  * @private function of Agent
34472
34450
  */
34473
34451
  function getTeacherCommitmentLines(commitments) {
@@ -34480,6 +34458,7 @@
34480
34458
  * Summarizes teacher commitment lines into user-friendly counts for self-learning.
34481
34459
  *
34482
34460
  * @param lines Parsed teacher commitment lines
34461
+ *
34483
34462
  * @private function of Agent
34484
34463
  */
34485
34464
  function summarizeTeacherCommitmentLines(lines) {
@@ -34512,6 +34491,7 @@
34512
34491
  * @param commitments Raw teacher commitments
34513
34492
  * @param used Whether the teacher was invoked
34514
34493
  * @returns Summary of learned commitments
34494
+ *
34515
34495
  * @private function of Agent
34516
34496
  */
34517
34497
  function buildTeacherSummary(commitments, used) {
@@ -34748,9 +34728,7 @@
34748
34728
  return finalResult;
34749
34729
  }
34750
34730
  }
34751
- /**
34752
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
34753
- */
34731
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
34754
34732
 
34755
34733
  /**
34756
34734
  * Parses one failed remote agent response into a structured error.
@@ -35216,10 +35194,8 @@
35216
35194
  return agentResult;
35217
35195
  }
35218
35196
  }
35219
- /**
35220
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
35221
- * TODO: !!! Agent on remote server
35222
- */
35197
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
35198
+ // TODO: !!! Agent on remote server
35223
35199
 
35224
35200
  var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
35225
35201
  __proto__: null,