@promptbook/remote-server 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 +711 -694
  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 +711 -694
  762. package/umd/index.umd.js.map +1 -1
  763. package/umd/src/_packages/types.index.d.ts +94 -94
  764. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -4
  765. package/umd/src/book-2.0/agent-source/AgentModelRequirements.d.ts +0 -4
  766. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +7 -0
  767. package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +1 -0
  768. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +1 -0
  769. package/umd/src/book-2.0/agent-source/padBook.d.ts +1 -4
  770. package/umd/src/book-2.0/agent-source/parseAgentSource.d.ts +0 -3
  771. package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -0
  772. package/umd/src/book-2.0/agent-source/parseParameters.d.ts +1 -0
  773. package/umd/src/book-2.0/agent-source/parseTeamCommitment.d.ts +0 -3
  774. package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +8 -3
  775. package/umd/src/book-2.0/agent-source/string_book.d.ts +1 -0
  776. package/umd/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +0 -3
  777. package/umd/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +0 -3
  778. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +0 -3
  779. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +4 -0
  780. package/umd/src/book-components/BookEditor/BookEditor.d.ts +0 -3
  781. package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +4 -0
  782. package/umd/src/book-components/BookEditor/BookEditorMonaco.d.ts +2 -0
  783. package/umd/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +3 -0
  784. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +1 -0
  785. package/umd/src/book-components/BookEditor/useBookEditorMonacoDecorations.d.ts +6 -0
  786. package/umd/src/book-components/BookEditor/useBookEditorMonacoDiagnostics.d.ts +9 -0
  787. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +7 -0
  788. package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +3 -0
  789. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +24 -0
  790. package/umd/src/book-components/Chat/AgentChat/AgentChat.d.ts +0 -3
  791. package/umd/src/book-components/Chat/AgentChip/AgentChip.d.ts +6 -5
  792. package/umd/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +38 -0
  793. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -14
  794. package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
  795. package/umd/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
  796. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +2 -3
  797. package/umd/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
  798. package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
  799. package/umd/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +34 -0
  800. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
  801. package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
  802. package/umd/src/book-components/Chat/Chat/constants.d.ts +4 -3
  803. package/umd/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
  804. package/umd/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
  805. package/umd/src/book-components/Chat/Chat/insertDictationChunk.d.ts +16 -0
  806. package/umd/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
  807. package/umd/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
  808. package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
  809. package/umd/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +27 -0
  810. package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +32 -0
  811. package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +33 -0
  812. package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +32 -0
  813. package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +32 -0
  814. package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +39 -0
  815. package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +39 -0
  816. package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +47 -0
  817. package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +34 -0
  818. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +3 -2
  819. package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +30 -0
  820. package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +27 -0
  821. package/umd/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
  822. package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +10 -0
  823. package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
  824. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +53 -0
  825. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
  826. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -0
  827. package/umd/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
  828. package/umd/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
  829. package/umd/src/book-components/Chat/LlmChat/defaults.d.ts +0 -3
  830. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
  831. package/umd/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
  832. package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
  833. package/umd/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
  834. package/umd/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
  835. package/umd/src/book-components/Chat/effects/index.d.ts +0 -4
  836. package/umd/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
  837. package/umd/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
  838. package/umd/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
  839. package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
  840. package/umd/src/book-components/Chat/save/index.d.ts +0 -3
  841. package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
  842. package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
  843. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
  844. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
  845. package/umd/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
  846. package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
  847. package/umd/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
  848. package/umd/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
  849. package/umd/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
  850. package/umd/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
  851. package/umd/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
  852. package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
  853. package/umd/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
  854. package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
  855. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
  856. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
  857. package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
  858. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
  859. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
  860. package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
  861. package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
  862. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
  863. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
  864. package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
  865. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
  866. package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
  867. package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
  868. package/umd/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
  869. package/umd/src/book-components/Qr/GenericQrCode.d.ts +5 -0
  870. package/umd/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
  871. package/umd/src/book-components/Qr/useQrCode.d.ts +4 -1
  872. package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
  873. package/umd/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
  874. package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
  875. package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -3
  876. package/umd/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
  877. package/umd/src/book-components/icons/AboutIcon.d.ts +1 -0
  878. package/umd/src/book-components/icons/AttachmentIcon.d.ts +4 -0
  879. package/umd/src/book-components/icons/CameraIcon.d.ts +4 -0
  880. package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -0
  881. package/umd/src/book-components/icons/EmailIcon.d.ts +1 -0
  882. package/umd/src/book-components/icons/MenuIcon.d.ts +1 -3
  883. package/umd/src/book-components/icons/SaveIcon.d.ts +1 -0
  884. package/umd/src/book-components/icons/SendIcon.d.ts +0 -3
  885. package/umd/src/book-components/icons/TeacherIcon.d.ts +1 -0
  886. package/umd/src/cli/$runPromptbookCli.d.ts +0 -3
  887. package/umd/src/cli/cli-commands/_boilerplate.d.ts +0 -4
  888. package/umd/src/cli/cli-commands/about.d.ts +0 -6
  889. package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
  890. package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -4
  891. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -4
  892. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -4
  893. package/umd/src/cli/cli-commands/coder/init.d.ts +0 -4
  894. package/umd/src/cli/cli-commands/coder/run.d.ts +1 -5
  895. package/umd/src/cli/cli-commands/coder/run.test.d.ts +1 -0
  896. package/umd/src/cli/cli-commands/coder/verify.d.ts +0 -4
  897. package/umd/src/cli/cli-commands/coder.d.ts +0 -4
  898. package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
  899. package/umd/src/cli/cli-commands/hello.d.ts +0 -5
  900. package/umd/src/cli/cli-commands/list-models.d.ts +0 -4
  901. package/umd/src/cli/cli-commands/list-scrapers.d.ts +0 -4
  902. package/umd/src/cli/cli-commands/login.d.ts +0 -5
  903. package/umd/src/cli/cli-commands/make.d.ts +1 -1
  904. package/umd/src/cli/cli-commands/prettify.d.ts +0 -6
  905. package/umd/src/cli/cli-commands/run.d.ts +0 -8
  906. package/umd/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
  907. package/umd/src/cli/cli-commands/start-agents-server.d.ts +0 -4
  908. package/umd/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
  909. package/umd/src/cli/cli-commands/test-command.d.ts +0 -7
  910. package/umd/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
  911. package/umd/src/cli/main.d.ts +0 -4
  912. package/umd/src/cli/promptbookCli.d.ts +0 -7
  913. package/umd/src/collection/agent-collection/AgentCollection.d.ts +0 -3
  914. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
  915. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
  916. package/umd/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
  917. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
  918. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
  919. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
  920. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
  921. package/umd/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
  922. package/umd/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
  923. package/umd/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
  924. package/umd/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
  925. package/umd/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
  926. package/umd/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
  927. package/umd/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
  928. package/umd/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
  929. package/umd/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
  930. package/umd/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
  931. package/umd/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
  932. package/umd/src/commands/JOKER/JokerCommand.d.ts +1 -0
  933. package/umd/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
  934. package/umd/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
  935. package/umd/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
  936. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
  937. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
  938. package/umd/src/commands/MODEL/ModelCommand.d.ts +1 -0
  939. package/umd/src/commands/MODEL/modelCommandParser.d.ts +1 -0
  940. package/umd/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
  941. package/umd/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
  942. package/umd/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
  943. package/umd/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
  944. package/umd/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
  945. package/umd/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
  946. package/umd/src/commands/SECTION/SectionCommand.d.ts +1 -0
  947. package/umd/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
  948. package/umd/src/commands/URL/UrlCommand.d.ts +1 -0
  949. package/umd/src/commands/URL/urlCommandParser.d.ts +1 -0
  950. package/umd/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
  951. package/umd/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
  952. package/umd/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
  953. package/umd/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
  954. package/umd/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
  955. package/umd/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  956. package/umd/src/commands/_common/stringifyCommand.d.ts +1 -1
  957. package/umd/src/commands/_common/types/CommandParser.d.ts +0 -4
  958. package/umd/src/commands/index.d.ts +0 -3
  959. package/umd/src/commitments/ACTION/ACTION.d.ts +0 -3
  960. package/umd/src/commitments/CLOSED/CLOSED.d.ts +0 -3
  961. package/umd/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
  962. package/umd/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
  963. package/umd/src/commitments/DELETE/DELETE.d.ts +0 -3
  964. package/umd/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
  965. package/umd/src/commitments/FORMAT/FORMAT.d.ts +0 -3
  966. package/umd/src/commitments/FROM/FROM.d.ts +0 -3
  967. package/umd/src/commitments/GOAL/GOAL.d.ts +0 -3
  968. package/umd/src/commitments/IMPORT/IMPORT.d.ts +0 -3
  969. package/umd/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
  970. package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -3
  971. package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
  972. package/umd/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
  973. package/umd/src/commitments/META/META.d.ts +0 -3
  974. package/umd/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
  975. package/umd/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
  976. package/umd/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
  977. package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
  978. package/umd/src/commitments/META_FONT/META_FONT.d.ts +0 -3
  979. package/umd/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
  980. package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
  981. package/umd/src/commitments/META_LINK/META_LINK.d.ts +0 -3
  982. package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
  983. package/umd/src/commitments/MODEL/MODEL.d.ts +0 -3
  984. package/umd/src/commitments/OPEN/OPEN.d.ts +0 -3
  985. package/umd/src/commitments/PERSONA/PERSONA.d.ts +0 -3
  986. package/umd/src/commitments/RULE/RULE.d.ts +0 -3
  987. package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
  988. package/umd/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
  989. package/umd/src/commitments/TEAM/TEAM.d.ts +0 -3
  990. package/umd/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
  991. package/umd/src/commitments/USE/USE.d.ts +0 -3
  992. package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
  993. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
  994. package/umd/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -7
  995. package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
  996. package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
  997. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
  998. package/umd/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
  999. package/umd/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
  1000. package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
  1001. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
  1002. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
  1003. package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
  1004. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
  1005. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
  1006. package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
  1007. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
  1008. package/umd/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
  1009. package/umd/src/commitments/WALLET/WALLET.d.ts +0 -3
  1010. package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
  1011. package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
  1012. package/umd/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
  1013. package/umd/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
  1014. package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
  1015. package/umd/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
  1016. package/umd/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
  1017. package/umd/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
  1018. package/umd/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
  1019. package/umd/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
  1020. package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
  1021. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
  1022. package/umd/src/commitments/index.d.ts +0 -4
  1023. package/umd/src/config.test.d.ts +0 -3
  1024. package/umd/src/constants/streaming.d.ts +0 -3
  1025. package/umd/src/constants.d.ts +0 -3
  1026. package/umd/src/conversion/archive/loadArchive.d.ts +0 -3
  1027. package/umd/src/conversion/archive/saveArchive.d.ts +0 -5
  1028. package/umd/src/conversion/compilePipeline.d.ts +2 -7
  1029. package/umd/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
  1030. package/umd/src/conversion/parsePipeline.d.ts +1 -11
  1031. package/umd/src/conversion/pipelineJsonToString.d.ts +1 -7
  1032. package/umd/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
  1033. package/umd/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
  1034. package/umd/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
  1035. package/umd/src/conversion/validation/_importPipeline.d.ts +6 -4
  1036. package/umd/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
  1037. package/umd/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
  1038. package/umd/src/conversion/validation/validatePipeline.d.ts +3 -9
  1039. package/umd/src/conversion/validation/validatePipeline.test.d.ts +0 -3
  1040. package/umd/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -4
  1041. package/umd/src/errors/0-BoilerplateError.d.ts +0 -3
  1042. package/umd/src/errors/0-index.d.ts +0 -3
  1043. package/umd/src/errors/DatabaseError.d.ts +0 -3
  1044. package/umd/src/errors/ExpectError.d.ts +2 -1
  1045. package/umd/src/errors/ParseError.d.ts +0 -3
  1046. package/umd/src/errors/PipelineExecutionError.d.ts +0 -3
  1047. package/umd/src/executables/$provideExecutablesForNode.d.ts +0 -5
  1048. package/umd/src/executables/apps/locateLibreoffice.d.ts +0 -4
  1049. package/umd/src/executables/apps/locatePandoc.d.ts +0 -4
  1050. package/umd/src/executables/browsers/locateBrowser.d.ts +0 -1
  1051. package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
  1052. package/umd/src/executables/locateApp.d.ts +0 -4
  1053. package/umd/src/executables/platforms/locateAppOnLinux.d.ts +0 -4
  1054. package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +0 -4
  1055. package/umd/src/executables/platforms/locateAppOnWindows.d.ts +0 -4
  1056. package/umd/src/execution/AbstractTaskResult.d.ts +0 -4
  1057. package/umd/src/execution/AvailableModel.d.ts +0 -4
  1058. package/umd/src/execution/CommonToolsOptions.d.ts +0 -5
  1059. package/umd/src/execution/ExecutionTask.d.ts +4 -4
  1060. package/umd/src/execution/FilesystemTools.d.ts +0 -3
  1061. package/umd/src/execution/LlmExecutionTools.d.ts +3 -9
  1062. package/umd/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
  1063. package/umd/src/execution/PipelineExecutor.d.ts +0 -3
  1064. package/umd/src/execution/PipelineExecutorResult.d.ts +0 -3
  1065. package/umd/src/execution/PromptResult.d.ts +1 -9
  1066. package/umd/src/execution/PromptbookFetch.test-type.d.ts +0 -4
  1067. package/umd/src/execution/ScriptExecutionTools.d.ts +0 -4
  1068. package/umd/src/execution/Usage.d.ts +0 -3
  1069. package/umd/src/execution/UserInterfaceTools.d.ts +3 -0
  1070. package/umd/src/execution/assertsTaskSuccessful.d.ts +1 -3
  1071. package/umd/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
  1072. package/umd/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
  1073. package/umd/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
  1074. package/umd/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
  1075. package/umd/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
  1076. package/umd/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
  1077. package/umd/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
  1078. package/umd/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
  1079. package/umd/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
  1080. package/umd/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
  1081. package/umd/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
  1082. package/umd/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
  1083. package/umd/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
  1084. package/umd/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -5
  1085. package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -6
  1086. package/umd/src/execution/utils/checkExpectations.d.ts +2 -5
  1087. package/umd/src/execution/utils/forEachAsync.d.ts +5 -1
  1088. package/umd/src/execution/utils/usage-constants.d.ts +0 -3
  1089. package/umd/src/execution/utils/usageToHuman.d.ts +0 -8
  1090. package/umd/src/execution/utils/validatePromptResult.d.ts +1 -0
  1091. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
  1092. package/umd/src/formats/_common/FormatParser.d.ts +2 -9
  1093. package/umd/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
  1094. package/umd/src/formats/csv/CsvFormatParser.d.ts +2 -8
  1095. package/umd/src/formats/index.d.ts +0 -3
  1096. package/umd/src/formats/json/JsonFormatParser.d.ts +0 -11
  1097. package/umd/src/formats/text/TextFormatParser.d.ts +0 -9
  1098. package/umd/src/formats/xml/XmlFormatParser.d.ts +0 -11
  1099. package/umd/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
  1100. package/umd/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
  1101. package/umd/src/formfactors/index.d.ts +0 -3
  1102. package/umd/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
  1103. package/umd/src/high-level-abstractions/index.d.ts +0 -4
  1104. package/umd/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
  1105. package/umd/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
  1106. package/umd/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
  1107. package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -3
  1108. package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
  1109. package/umd/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
  1110. package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
  1111. package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -18
  1112. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
  1113. package/umd/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
  1114. package/umd/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
  1115. package/umd/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
  1116. package/umd/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
  1117. package/umd/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
  1118. package/umd/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
  1119. package/umd/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
  1120. package/umd/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
  1121. package/umd/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
  1122. package/umd/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
  1123. package/umd/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
  1124. package/umd/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
  1125. package/umd/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
  1126. package/umd/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
  1127. package/umd/src/llm-providers/_multiple/playground/playground.d.ts +0 -3
  1128. package/umd/src/llm-providers/agent/Agent.d.ts +0 -3
  1129. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
  1130. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
  1131. package/umd/src/llm-providers/agent/playground/playground.d.ts +0 -6
  1132. package/umd/src/llm-providers/agent/register-configuration.d.ts +0 -5
  1133. package/umd/src/llm-providers/agent/register-constructor.d.ts +0 -4
  1134. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
  1135. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
  1136. package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
  1137. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
  1138. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
  1139. package/umd/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
  1140. package/umd/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
  1141. package/umd/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
  1142. package/umd/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
  1143. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
  1144. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
  1145. package/umd/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
  1146. package/umd/src/llm-providers/azure-openai/playground/playground.d.ts +0 -4
  1147. package/umd/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
  1148. package/umd/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
  1149. package/umd/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
  1150. package/umd/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
  1151. package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
  1152. package/umd/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
  1153. package/umd/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
  1154. package/umd/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
  1155. package/umd/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
  1156. package/umd/src/llm-providers/google/google-models.d.ts +1 -6
  1157. package/umd/src/llm-providers/google/register-configuration.d.ts +0 -3
  1158. package/umd/src/llm-providers/google/register-constructor.d.ts +0 -4
  1159. package/umd/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
  1160. package/umd/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
  1161. package/umd/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
  1162. package/umd/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
  1163. package/umd/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
  1164. package/umd/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
  1165. package/umd/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
  1166. package/umd/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
  1167. package/umd/src/llm-providers/ollama/ollama-models.d.ts +1 -4
  1168. package/umd/src/llm-providers/ollama/playground/playground.d.ts +0 -4
  1169. package/umd/src/llm-providers/ollama/register-configuration.d.ts +0 -3
  1170. package/umd/src/llm-providers/ollama/register-constructor.d.ts +0 -4
  1171. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
  1172. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
  1173. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
  1174. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
  1175. package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
  1176. package/umd/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
  1177. package/umd/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
  1178. package/umd/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
  1179. package/umd/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
  1180. package/umd/src/llm-providers/openai/openai-models.d.ts +1 -0
  1181. package/umd/src/llm-providers/openai/openai-models.test.d.ts +0 -3
  1182. package/umd/src/llm-providers/openai/playground/playground.d.ts +0 -4
  1183. package/umd/src/llm-providers/openai/register-configuration.d.ts +0 -3
  1184. package/umd/src/llm-providers/openai/register-constructor.d.ts +0 -4
  1185. package/umd/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
  1186. package/umd/src/llm-providers/remote/playground/playground.d.ts +0 -3
  1187. package/umd/src/llm-providers/vercel/playground/playground.d.ts +0 -4
  1188. package/umd/src/other/templates/getBookTemplates.d.ts +2 -5
  1189. package/umd/src/personas/preparePersona.d.ts +1 -7
  1190. package/umd/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
  1191. package/umd/src/pipeline/PipelineInterface/constants.d.ts +0 -3
  1192. package/umd/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
  1193. package/umd/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
  1194. package/umd/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
  1195. package/umd/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
  1196. package/umd/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
  1197. package/umd/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
  1198. package/umd/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
  1199. package/umd/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
  1200. package/umd/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
  1201. package/umd/src/pipeline/book-notation.d.ts +1 -4
  1202. package/umd/src/pipeline/isValidPipelineString.d.ts +1 -3
  1203. package/umd/src/pipeline/isValidPipelineString.test.d.ts +0 -3
  1204. package/umd/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
  1205. package/umd/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
  1206. package/umd/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
  1207. package/umd/src/pipeline/prompt-notation.d.ts +2 -5
  1208. package/umd/src/pipeline/prompt-notation.test.d.ts +0 -3
  1209. package/umd/src/pipeline/validatePipelineString.d.ts +1 -3
  1210. package/umd/src/playground/permanent/_boilerplate.d.ts +0 -3
  1211. package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +0 -3
  1212. package/umd/src/playground/permanent/error-handling-playground.d.ts +0 -3
  1213. package/umd/src/playground/playground.d.ts +0 -4
  1214. package/umd/src/postprocessing/utils/extractBlock.d.ts +2 -1
  1215. package/umd/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
  1216. package/umd/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
  1217. package/umd/src/prepare/preparePipeline.d.ts +3 -2
  1218. package/umd/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
  1219. package/umd/src/prepare/prepareTasks.d.ts +6 -10
  1220. package/umd/src/prepare/unpreparePipeline.d.ts +1 -5
  1221. package/umd/src/remote-server/RemoteServer.d.ts +3 -0
  1222. package/umd/src/remote-server/openapi.d.ts +3 -4
  1223. package/umd/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
  1224. package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
  1225. package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
  1226. package/umd/src/remote-server/startAgentServer.d.ts +6 -4
  1227. package/umd/src/remote-server/startRemoteServer.d.ts +1 -16
  1228. package/umd/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
  1229. package/umd/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
  1230. package/umd/src/remote-server/ui/ServerApp.d.ts +1 -0
  1231. package/umd/src/remote-server/ui/types.d.ts +3 -0
  1232. package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -6
  1233. package/umd/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
  1234. package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -3
  1235. package/umd/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
  1236. package/umd/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
  1237. package/umd/src/scrapers/_common/Scraper.d.ts +0 -5
  1238. package/umd/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
  1239. package/umd/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
  1240. package/umd/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -4
  1241. package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -4
  1242. package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -4
  1243. package/umd/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
  1244. package/umd/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
  1245. package/umd/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
  1246. package/umd/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
  1247. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
  1248. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
  1249. package/umd/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
  1250. package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -6
  1251. package/umd/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
  1252. package/umd/src/scrapers/document/createDocumentScraper.d.ts +0 -3
  1253. package/umd/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -3
  1254. package/umd/src/scrapers/document/register-constructor.d.ts +0 -4
  1255. package/umd/src/scrapers/document/register-metadata.d.ts +0 -3
  1256. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
  1257. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
  1258. package/umd/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
  1259. package/umd/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -3
  1260. package/umd/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
  1261. package/umd/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
  1262. package/umd/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
  1263. package/umd/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
  1264. package/umd/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
  1265. package/umd/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -3
  1266. package/umd/src/scrapers/markdown/register-constructor.d.ts +0 -4
  1267. package/umd/src/scrapers/markdown/register-metadata.d.ts +0 -3
  1268. package/umd/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
  1269. package/umd/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
  1270. package/umd/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -3
  1271. package/umd/src/scrapers/markitdown/register-constructor.d.ts +0 -5
  1272. package/umd/src/scrapers/markitdown/register-metadata.d.ts +0 -3
  1273. package/umd/src/scrapers/pdf/PdfScraper.d.ts +1 -6
  1274. package/umd/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
  1275. package/umd/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -3
  1276. package/umd/src/scrapers/pdf/register-constructor.d.ts +0 -4
  1277. package/umd/src/scrapers/pdf/register-metadata.d.ts +0 -3
  1278. package/umd/src/scrapers/website/WebsiteScraper.d.ts +1 -6
  1279. package/umd/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
  1280. package/umd/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -3
  1281. package/umd/src/scrapers/website/register-constructor.d.ts +0 -4
  1282. package/umd/src/scrapers/website/register-metadata.d.ts +0 -3
  1283. package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
  1284. package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
  1285. package/umd/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
  1286. package/umd/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
  1287. package/umd/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
  1288. package/umd/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
  1289. package/umd/src/search-engines/SearchEngine.d.ts +3 -0
  1290. package/umd/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -4
  1291. package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
  1292. package/umd/src/storage/_common/PromptbookStorage.d.ts +0 -4
  1293. package/umd/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
  1294. package/umd/src/storage/env-storage/$EnvStorage.d.ts +0 -3
  1295. package/umd/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -4
  1296. package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -3
  1297. package/umd/src/storage/local-storage/getLocalStorage.d.ts +0 -3
  1298. package/umd/src/storage/local-storage/getSessionStorage.d.ts +0 -3
  1299. package/umd/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
  1300. package/umd/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
  1301. package/umd/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
  1302. package/umd/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
  1303. package/umd/src/transpilers/openai-sdk/playground/playground.d.ts +0 -3
  1304. package/umd/src/transpilers/openai-sdk/register.d.ts +2 -5
  1305. package/umd/src/types/Arrayable.d.ts +1 -0
  1306. package/umd/src/types/InputParameters_private.d.ts +13 -0
  1307. package/umd/src/types/IntermediateFilesStrategy.d.ts +0 -3
  1308. package/umd/src/types/LlmCall.d.ts +0 -3
  1309. package/umd/src/types/ModelRequirements.d.ts +1 -0
  1310. package/umd/src/types/ModelVariant.d.ts +3 -0
  1311. package/umd/src/types/Parameters.d.ts +31 -0
  1312. package/umd/src/types/Parameters_private.d.ts +18 -0
  1313. package/umd/src/types/Prompt.d.ts +1 -6
  1314. package/umd/src/types/ReservedParameters_private.d.ts +11 -0
  1315. package/umd/src/types/ToolCall.d.ts +0 -2
  1316. package/umd/src/types/Updatable.d.ts +1 -3
  1317. package/umd/src/types/number_bytes.d.ts +21 -0
  1318. package/umd/src/types/number_id.d.ts +13 -0
  1319. package/umd/src/types/number_likeness.d.ts +8 -0
  1320. package/umd/src/types/number_milliseconds.d.ts +33 -0
  1321. package/umd/src/types/number_percent.d.ts +18 -0
  1322. package/umd/src/types/number_positive.d.ts +16 -0
  1323. package/umd/src/types/number_usd.d.ts +6 -106
  1324. package/umd/src/types/string_agent_hash_private.d.ts +9 -0
  1325. package/umd/src/types/string_agent_name.d.ts +32 -0
  1326. package/umd/src/types/string_agent_name_in_book_private.d.ts +8 -0
  1327. package/umd/src/types/string_agent_name_private.d.ts +10 -0
  1328. package/umd/src/types/string_agent_permanent_id_private.d.ts +11 -0
  1329. package/umd/src/types/string_base64_private.d.ts +17 -0
  1330. package/umd/src/types/string_business_category_name.d.ts +5 -0
  1331. package/umd/src/types/string_business_category_name_private.d.ts +6 -0
  1332. package/umd/src/types/string_char_private.d.ts +8 -0
  1333. package/umd/src/types/string_chat_prompt_private.d.ts +9 -0
  1334. package/umd/src/types/string_completion_prompt_private.d.ts +9 -0
  1335. package/umd/src/types/string_email_private.d.ts +16 -0
  1336. package/umd/src/types/string_host_private.d.ts +55 -0
  1337. package/umd/src/types/string_markdown.d.ts +0 -1
  1338. package/umd/src/types/string_mime_type_private.d.ts +18 -0
  1339. package/umd/src/types/string_model_description_private.d.ts +8 -0
  1340. package/umd/src/types/string_model_name.d.ts +7 -0
  1341. package/umd/src/types/string_model_name_private.d.ts +8 -0
  1342. package/umd/src/types/string_name.d.ts +31 -0
  1343. package/umd/src/types/string_name_private.d.ts +9 -0
  1344. package/umd/src/types/string_page.d.ts +15 -0
  1345. package/umd/src/types/string_page_private.d.ts +9 -0
  1346. package/umd/src/types/string_parameter_name.d.ts +11 -167
  1347. package/umd/src/types/string_parameter_value_private.d.ts +9 -0
  1348. package/umd/src/types/string_persona_description.d.ts +14 -0
  1349. package/umd/src/types/string_persona_description_private.d.ts +8 -0
  1350. package/umd/src/types/string_prompt.d.ts +49 -0
  1351. package/umd/src/types/string_prompt_image_private.d.ts +8 -0
  1352. package/umd/src/types/string_prompt_private.d.ts +8 -0
  1353. package/umd/src/types/string_reserved_parameter_name_private.d.ts +11 -0
  1354. package/umd/src/types/string_sha256.d.ts +2 -2
  1355. package/umd/src/types/string_system_message_private.d.ts +9 -0
  1356. package/umd/src/types/string_template_private.d.ts +8 -0
  1357. package/umd/src/types/string_text_prompt_private.d.ts +9 -0
  1358. package/umd/src/types/string_title.d.ts +8 -0
  1359. package/umd/src/types/string_title_private.d.ts +9 -0
  1360. package/umd/src/types/string_url.d.ts +50 -46
  1361. package/umd/src/types/string_url_private.d.ts +88 -0
  1362. package/umd/src/types/typeAliasEmoji.d.ts +0 -3
  1363. package/umd/src/types/typeAliases.d.ts +7 -7
  1364. package/umd/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
  1365. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
  1366. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
  1367. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
  1368. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
  1369. package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
  1370. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
  1371. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
  1372. package/umd/src/utils/chat/chatAttachments.d.ts +0 -3
  1373. package/umd/src/utils/chat/constants.d.ts +0 -3
  1374. package/umd/src/utils/clientVersion.d.ts +0 -3
  1375. package/umd/src/utils/color/$randomColor.d.ts +0 -5
  1376. package/umd/src/utils/color/css-colors.d.ts +0 -3
  1377. package/umd/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
  1378. package/umd/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
  1379. package/umd/src/utils/color/operators/ColorTransformer.d.ts +2 -0
  1380. package/umd/src/utils/color/operators/lighten.d.ts +0 -3
  1381. package/umd/src/utils/color/operators/saturate.d.ts +0 -3
  1382. package/umd/src/utils/color/utils/areColorsEqual.d.ts +0 -3
  1383. package/umd/src/utils/color/utils/colorDistance.d.ts +2 -2
  1384. package/umd/src/utils/color/utils/colorHue.d.ts +0 -1
  1385. package/umd/src/utils/color/utils/colorHueDistance.d.ts +0 -1
  1386. package/umd/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
  1387. package/umd/src/utils/database/uniqueConstraint.d.ts +1 -3
  1388. package/umd/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
  1389. package/umd/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
  1390. package/umd/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
  1391. package/umd/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
  1392. package/umd/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
  1393. package/umd/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
  1394. package/umd/src/utils/environment/$getGlobalScope.d.ts +1 -1
  1395. package/umd/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
  1396. package/umd/src/utils/environment/$isRunningInJest.d.ts +0 -3
  1397. package/umd/src/utils/environment/$isRunningInNode.d.ts +0 -3
  1398. package/umd/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
  1399. package/umd/src/utils/execCommand/$execCommand.d.ts +0 -4
  1400. package/umd/src/utils/execCommand/$execCommands.d.ts +0 -3
  1401. package/umd/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
  1402. package/umd/src/utils/expectation-counters/constants.d.ts +0 -4
  1403. package/umd/src/utils/expectation-counters/countCharacters.d.ts +0 -4
  1404. package/umd/src/utils/expectation-counters/countLines.d.ts +0 -4
  1405. package/umd/src/utils/expectation-counters/countPages.d.ts +0 -4
  1406. package/umd/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
  1407. package/umd/src/utils/expectation-counters/countSentences.d.ts +0 -4
  1408. package/umd/src/utils/expectation-counters/countWords.d.ts +0 -5
  1409. package/umd/src/utils/expectation-counters/index.d.ts +0 -4
  1410. package/umd/src/utils/files/$induceBookDownload.d.ts +0 -3
  1411. package/umd/src/utils/files/$induceFileDownload.d.ts +0 -3
  1412. package/umd/src/utils/files/ObjectUrl.d.ts +0 -3
  1413. package/umd/src/utils/files/isDirectoryExisting.d.ts +0 -6
  1414. package/umd/src/utils/files/isExecutable.d.ts +0 -4
  1415. package/umd/src/utils/files/isFileExisting.d.ts +0 -5
  1416. package/umd/src/utils/files/listAllFiles.d.ts +1 -5
  1417. package/umd/src/utils/files/readResponseBytes.d.ts +1 -0
  1418. package/umd/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
  1419. package/umd/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
  1420. package/umd/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
  1421. package/umd/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
  1422. package/umd/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
  1423. package/umd/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
  1424. package/umd/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
  1425. package/umd/src/utils/markdown/createMarkdownTable.d.ts +0 -3
  1426. package/umd/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
  1427. package/umd/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
  1428. package/umd/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
  1429. package/umd/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
  1430. package/umd/src/utils/markdown/humanizeAiText.d.ts +0 -3
  1431. package/umd/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
  1432. package/umd/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
  1433. package/umd/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
  1434. package/umd/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
  1435. package/umd/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
  1436. package/umd/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
  1437. package/umd/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
  1438. package/umd/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
  1439. package/umd/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
  1440. package/umd/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
  1441. package/umd/src/utils/markdown/trimCodeBlock.d.ts +1 -1
  1442. package/umd/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
  1443. package/umd/src/utils/misc/$getCurrentDate.d.ts +1 -0
  1444. package/umd/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
  1445. package/umd/src/utils/misc/computeHash.d.ts +0 -3
  1446. package/umd/src/utils/misc/debounce.d.ts +2 -0
  1447. package/umd/src/utils/misc/emojis.d.ts +3 -8
  1448. package/umd/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
  1449. package/umd/src/utils/misc/parseNumber.d.ts +0 -4
  1450. package/umd/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
  1451. package/umd/src/utils/normalization/IKeywords.d.ts +0 -3
  1452. package/umd/src/utils/normalization/nameToUriPart.d.ts +1 -0
  1453. package/umd/src/utils/normalization/nameToUriParts.d.ts +1 -0
  1454. package/umd/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
  1455. package/umd/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
  1456. package/umd/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
  1457. package/umd/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
  1458. package/umd/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  1459. package/umd/src/utils/normalization/orderJson.d.ts +1 -0
  1460. package/umd/src/utils/normalization/orderJson.test.d.ts +0 -3
  1461. package/umd/src/utils/normalization/parseKeywords.d.ts +1 -4
  1462. package/umd/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
  1463. package/umd/src/utils/normalization/removeDiacritics.d.ts +1 -3
  1464. package/umd/src/utils/normalization/removeEmojis.d.ts +1 -0
  1465. package/umd/src/utils/normalization/removeQuotes.d.ts +1 -0
  1466. package/umd/src/utils/normalization/searchKeywords.d.ts +1 -3
  1467. package/umd/src/utils/normalization/titleToName.d.ts +1 -0
  1468. package/umd/src/utils/normalization/unwrapResult.d.ts +1 -3
  1469. package/umd/src/utils/organization/$sideEffect.d.ts +1 -0
  1470. package/umd/src/utils/organization/TODO_USE.d.ts +1 -0
  1471. package/umd/src/utils/organization/just.d.ts +1 -0
  1472. package/umd/src/utils/organization/keepImported.d.ts +1 -0
  1473. package/umd/src/utils/organization/keepTypeImported.d.ts +1 -0
  1474. package/umd/src/utils/organization/keepUnused.d.ts +1 -0
  1475. package/umd/src/utils/organization/preserve.d.ts +1 -3
  1476. package/umd/src/utils/organization/really_any.d.ts +1 -0
  1477. package/umd/src/utils/organization/spaceTrim.d.ts +3 -2
  1478. package/umd/src/utils/parameters/extractParameterNames.d.ts +1 -0
  1479. package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
  1480. package/umd/src/utils/parameters/templateParameters.d.ts +2 -1
  1481. package/umd/src/utils/parameters/valueToString.d.ts +2 -2
  1482. package/umd/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
  1483. package/umd/src/utils/random/$randomAgentPersona.d.ts +1 -3
  1484. package/umd/src/utils/random/$randomAgentRule.d.ts +1 -3
  1485. package/umd/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
  1486. package/umd/src/utils/random/$randomItem.d.ts +0 -3
  1487. package/umd/src/utils/random/$randomSeed.d.ts +0 -3
  1488. package/umd/src/utils/random/$randomToken.d.ts +2 -5
  1489. package/umd/src/utils/random/EnglishNamePool.d.ts +1 -0
  1490. package/umd/src/utils/serialization/$deepFreeze.d.ts +1 -3
  1491. package/umd/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
  1492. package/umd/src/utils/serialization/clonePipeline.d.ts +1 -3
  1493. package/umd/src/utils/serialization/deepClone.d.ts +1 -3
  1494. package/umd/src/utils/serialization/exportJson.d.ts +1 -3
  1495. package/umd/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
  1496. package/umd/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
  1497. package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
  1498. package/umd/src/utils/sets/difference.d.ts +1 -3
  1499. package/umd/src/utils/sets/intersection.d.ts +1 -0
  1500. package/umd/src/utils/sets/union.d.ts +1 -0
  1501. package/umd/src/utils/take/classes/TakeChain.d.ts +4 -1
  1502. package/umd/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
  1503. package/umd/src/utils/take/interfaces/Takeable.d.ts +2 -1
  1504. package/umd/src/utils/take/take.d.ts +1 -1
  1505. package/umd/src/utils/validators/filePath/isRootPath.d.ts +1 -3
  1506. package/umd/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
  1507. package/umd/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
  1508. package/umd/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
  1509. package/umd/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
  1510. package/umd/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  1511. package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
  1512. package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
  1513. package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
  1514. package/umd/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
  1515. package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
  1516. package/umd/src/version.d.ts +1 -1
  1517. package/umd/src/wizard/$getCompiledBook.d.ts +0 -4
  1518. package/umd/src/wizard/wizard.d.ts +1 -4
package/esm/index.es.js CHANGED
@@ -40,7 +40,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
40
40
  * @generated
41
41
  * @see https://github.com/webgptorg/promptbook
42
42
  */
43
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-32';
43
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
44
44
  /**
45
45
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
46
46
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -50,16 +50,20 @@ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-32';
50
50
  * Trims string from all 4 sides
51
51
  *
52
52
  * Note: This is a re-exported function from the `spacetrim` package which is
53
- * Developed by same author @hejny as this package
53
+ * Developed by same author @hejny as this package
54
54
  *
55
- * @public exported from `@promptbook/utils`
56
55
  * @see https://github.com/hejny/spacetrim#usage
56
+ *
57
+ * @public exported from `@promptbook/utils`
57
58
  */
58
59
  const spaceTrim = spaceTrim$1;
59
60
 
60
61
  /**
61
- * @private util of `@promptbook/color`
62
+ * Class implementing take chain.
63
+ *
62
64
  * @de
65
+ *
66
+ * @private util of `@promptbook/color`
63
67
  */
64
68
  class TakeChain {
65
69
  constructor(value) {
@@ -76,9 +80,9 @@ class TakeChain {
76
80
  *
77
81
  * @param {*} initialValue - The initial value.
78
82
  * @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
83
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
79
84
  *
80
85
  * @private util of `@promptbook/color`
81
- * @deprecated [🤡] Use some better functional library instead of `TakeChain`
82
86
  */
83
87
  function take(initialValue) {
84
88
  if (initialValue instanceof TakeChain) {
@@ -256,9 +260,7 @@ const CSS_COLORS = {
256
260
  yellow: '#ffff00',
257
261
  yellowgreen: '#9acd32',
258
262
  };
259
- /**
260
- * Note: [💞] Ignore a discrepancy between file name and entity name
261
- */
263
+ // Note: [💞] Ignore a discrepancy between file name and entity name
262
264
 
263
265
  /**
264
266
  * Validates that a channel value is a valid number within the range of 0 to 255.
@@ -288,7 +290,13 @@ function checkChannelValue(channelName, value) {
288
290
  }
289
291
  }
290
292
 
293
+ /**
294
+ * Constant for short hex lengths.
295
+ */
291
296
  const SHORT_HEX_LENGTHS = new Set([3, 4]);
297
+ /**
298
+ * Constant for long hex lengths.
299
+ */
292
300
  const LONG_HEX_LENGTHS = new Set([6, 8]);
293
301
  /**
294
302
  * Parses a hex string into RGBA channel values.
@@ -321,6 +329,9 @@ function parseHexColor(hex) {
321
329
  }
322
330
  return throwInvalidHex();
323
331
  }
332
+ /**
333
+ * Parses short hex channel.
334
+ */
324
335
  function parseShortHexChannel(char, onError) {
325
336
  if (!char) {
326
337
  return onError();
@@ -331,6 +342,9 @@ function parseShortHexChannel(char, onError) {
331
342
  }
332
343
  return parsed * 16;
333
344
  }
345
+ /**
346
+ * Parses long hex channel.
347
+ */
334
348
  function parseLongHexChannel(hex, start, onError) {
335
349
  const segment = hex.substr(start, 2);
336
350
  if (segment.length < 2) {
@@ -343,6 +357,9 @@ function parseLongHexChannel(hex, start, onError) {
343
357
  return parsed;
344
358
  }
345
359
 
360
+ /**
361
+ * Pattern matching hsl.
362
+ */
346
363
  const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
347
364
  /**
348
365
  * Parses an HSL string into RGBA channel values.
@@ -368,6 +385,9 @@ function parseHslColor(hsl) {
368
385
  alpha: 255,
369
386
  };
370
387
  }
388
+ /**
389
+ * Handles convert hsl to Rgb.
390
+ */
371
391
  function convertHslToRgb(h, s, l) {
372
392
  const c = (1 - Math.abs(2 * l - 1)) * s;
373
393
  const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
@@ -406,7 +426,13 @@ function convertHslToRgb(h, s, l) {
406
426
  };
407
427
  }
408
428
 
429
+ /**
430
+ * Pattern matching RGB.
431
+ */
409
432
  const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
433
+ /**
434
+ * Pattern matching rgba.
435
+ */
410
436
  const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
411
437
  /**
412
438
  * Parses an RGB string into RGBA channel values.
@@ -448,6 +474,9 @@ function parseRgbaColor(rgba) {
448
474
  alpha: parseAlphaValue(match[4]),
449
475
  };
450
476
  }
477
+ /**
478
+ * Parses channel value.
479
+ */
451
480
  function parseChannelValue(value) {
452
481
  if (value.endsWith('%')) {
453
482
  const percent = parseFloat(value);
@@ -455,6 +484,9 @@ function parseChannelValue(value) {
455
484
  }
456
485
  return Math.round(parseFloat(value));
457
486
  }
487
+ /**
488
+ * Parses alpha value.
489
+ */
458
490
  function parseAlphaValue(value) {
459
491
  if (value.endsWith('%')) {
460
492
  const percent = parseFloat(value);
@@ -467,8 +499,17 @@ function parseAlphaValue(value) {
467
499
  return Math.round(parsed);
468
500
  }
469
501
 
502
+ /**
503
+ * Pattern matching hsl regex.
504
+ */
470
505
  const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
506
+ /**
507
+ * Pattern matching RGB regex.
508
+ */
471
509
  const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
510
+ /**
511
+ * Pattern matching rgba regex.
512
+ */
472
513
  const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
473
514
  /**
474
515
  * Color object represents an RGB color with alpha channel
@@ -834,9 +875,7 @@ function hslToRgb(hue, saturation, lightness) {
834
875
  }
835
876
  return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
836
877
  }
837
- /**
838
- * TODO: Properly name all used internal variables
839
- */
878
+ // TODO: Properly name all used internal variables
840
879
 
841
880
  /**
842
881
  * Converts RGB values to HSL values
@@ -882,9 +921,7 @@ function rgbToHsl(red, green, blue) {
882
921
  }
883
922
  return [hue, saturation, lightness];
884
923
  }
885
- /**
886
- * TODO: Properly name all used internal variables
887
- */
924
+ // TODO: Properly name all used internal variables
888
925
 
889
926
  /**
890
927
  * Makes color transformer which lighten the given color
@@ -902,9 +939,7 @@ function lighten(amount) {
902
939
  return Color.fromValues(r, g, b, alpha);
903
940
  };
904
941
  }
905
- /**
906
- * TODO: Maybe implement by mix+hsl
907
- */
942
+ // TODO: Maybe implement by mix+hsl
908
943
 
909
944
  /**
910
945
  * Makes color transformer which saturate the given color
@@ -922,9 +957,7 @@ function saturate(amount) {
922
957
  return Color.fromValues(r, g, b, alpha);
923
958
  };
924
959
  }
925
- /**
926
- * TODO: Maybe implement by mix+hsl
927
- */
960
+ // TODO: Maybe implement by mix+hsl
928
961
 
929
962
  /**
930
963
  * Returns the same value that is passed as argument.
@@ -937,6 +970,7 @@ function saturate(amount) {
937
970
  *
938
971
  * @param value any values
939
972
  * @returns the same values
973
+ *
940
974
  * @private within the repository
941
975
  */
942
976
  function just(value) {
@@ -1219,9 +1253,7 @@ function $isRunningInNode() {
1219
1253
  return false;
1220
1254
  }
1221
1255
  }
1222
- /**
1223
- * TODO: [🎺]
1224
- */
1256
+ // TODO: [🎺]
1225
1257
 
1226
1258
  /**
1227
1259
  * Normalize options for `execCommand` and `execCommands`
@@ -1289,7 +1321,6 @@ function $execCommandNormalizeOptions(options) {
1289
1321
  /**
1290
1322
  * Run one command in a shell
1291
1323
  *
1292
- *
1293
1324
  * Note: There are 2 similar functions in the codebase:
1294
1325
  * - `$execCommand` which runs a single command
1295
1326
  * - `$execCommands` which runs multiple commands
@@ -1388,9 +1419,7 @@ function $execCommand(options) {
1388
1419
  }
1389
1420
  });
1390
1421
  }
1391
- /**
1392
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1393
- */
1422
+ // 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
1394
1423
 
1395
1424
  /**
1396
1425
  * [🐱‍🚀]
@@ -1399,9 +1428,11 @@ function $execCommand(options) {
1399
1428
  * You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
1400
1429
  * This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
1401
1430
  *
1431
+ * TODO: [🐱‍🚀] Change to `@promptbook/agent-server`
1432
+ *
1402
1433
  * @see https://github.com/webgptorg/promptbook#remote-server
1434
+ *
1403
1435
  * @public exported from `@promptbook/remote-server`
1404
- * <- TODO: [🐱‍🚀] Change to `@promptbook/agent-server`
1405
1436
  */
1406
1437
  async function startAgentServer(options) {
1407
1438
  const { port = 4440 } = options;
@@ -1417,9 +1448,7 @@ async function startAgentServer(options) {
1417
1448
  isVerbose: true,
1418
1449
  });
1419
1450
  }
1420
- /**
1421
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1422
- */
1451
+ // Note: [🟢] Code for Node server bootstrap [startAgentServer](src/remote-server/startAgentServer.ts) should never be published into packages that could be imported into browser environment
1423
1452
 
1424
1453
  /**
1425
1454
  * Make error report URL for the given error
@@ -1556,16 +1585,15 @@ class AuthenticationError extends Error {
1556
1585
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
1557
1586
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
1558
1587
  *
1559
- * @private internal helper function
1560
1588
  * @returns secure random token
1589
+ *
1590
+ * @private internal helper function
1561
1591
  */
1562
1592
  function $randomToken(randomness) {
1563
1593
  return randomBytes(randomness).toString('hex');
1564
1594
  }
1565
- /**
1566
- * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
1567
- * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
1568
- */
1595
+ // TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
1596
+ // TODO: Maybe use nanoid instead https://github.com/ai/nanoid
1569
1597
 
1570
1598
  /**
1571
1599
  * This error indicates errors during the execution of the pipeline
@@ -1582,9 +1610,7 @@ class PipelineExecutionError extends Error {
1582
1610
  Object.setPrototypeOf(this, PipelineExecutionError.prototype);
1583
1611
  }
1584
1612
  }
1585
- /**
1586
- * TODO: [🧠][🌂] Add id to all errors
1587
- */
1613
+ // TODO: [🧠][🌂] Add id to all errors
1588
1614
 
1589
1615
  /**
1590
1616
  * This error indicates problems parsing the format value
@@ -1654,17 +1680,16 @@ class DatabaseError extends Error {
1654
1680
  Object.setPrototypeOf(this, DatabaseError.prototype);
1655
1681
  }
1656
1682
  }
1657
- /**
1658
- * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
1659
- */
1683
+ // TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
1660
1684
 
1661
1685
  /**
1662
1686
  * This error occurs when some expectation is not met in the execution of the pipeline
1663
1687
  *
1664
- * @public exported from `@promptbook/core`
1665
1688
  * Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
1666
1689
  * Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
1667
1690
  * Note: This is a kindof subtype of PipelineExecutionError
1691
+ *
1692
+ * @public exported from `@promptbook/core`
1668
1693
  */
1669
1694
  class ExpectError extends Error {
1670
1695
  constructor(message) {
@@ -1779,9 +1804,7 @@ class ParseError extends Error {
1779
1804
  Object.setPrototypeOf(this, ParseError.prototype);
1780
1805
  }
1781
1806
  }
1782
- /**
1783
- * TODO: Maybe split `ParseError` and `ApplyError`
1784
- */
1807
+ // TODO: Maybe split `ParseError` and `ApplyError`
1785
1808
 
1786
1809
  /**
1787
1810
  * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
@@ -1883,9 +1906,7 @@ const ALL_ERRORS = {
1883
1906
  ...PROMPTBOOK_ERRORS,
1884
1907
  ...COMMON_JAVASCRIPT_ERRORS,
1885
1908
  };
1886
- /**
1887
- * Note: [💞] Ignore a discrepancy between file name and entity name
1888
- */
1909
+ // Note: [💞] Ignore a discrepancy between file name and entity name
1889
1910
 
1890
1911
  /**
1891
1912
  * Serializes an error into a [🚉] JSON-serializable object
@@ -1932,10 +1953,8 @@ async function locateAppOnLinux({ linuxWhich, }) {
1932
1953
  return null;
1933
1954
  }
1934
1955
  }
1935
- /**
1936
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
1937
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1938
- */
1956
+ // 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
1957
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
1939
1958
 
1940
1959
  /**
1941
1960
  * Provides filesystem access (for example for Node.js-based scrapers)
@@ -1958,10 +1977,8 @@ function $provideFilesystemForNode(options) {
1958
1977
  watch,
1959
1978
  };
1960
1979
  }
1961
- /**
1962
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
1963
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
1964
- */
1980
+ // 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
1981
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
1965
1982
 
1966
1983
  /**
1967
1984
  * Checks if the file is executable
@@ -1977,15 +1994,15 @@ async function isExecutable(path, fs) {
1977
1994
  return false;
1978
1995
  }
1979
1996
  }
1980
- /**
1981
- * Note: Not [~🟢~] because it is not directly dependent on `fs
1982
- * TODO: [🖇] What about symlinks?
1983
- */
1997
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
1998
+ // TODO: [🖇] What about symlinks?
1984
1999
 
1985
2000
  // Note: Module `userhome` has no types available, so it is imported using `require`
1986
2001
  // @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
1987
- // eslint-disable-next-line @typescript-eslint/no-var-requires
1988
- const userhome = require('userhome');
2002
+ /**
2003
+ * Constant for userhome.
2004
+ */
2005
+ const userhome = require('userhome'); // eslint-disable-line @typescript-eslint/no-var-requires
1989
2006
  /**
1990
2007
  * Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
1991
2008
  * Returns the path to the executable if found, or null otherwise.
@@ -2014,10 +2031,8 @@ async function locateAppOnMacOs({ macOsName, }) {
2014
2031
  return null;
2015
2032
  }
2016
2033
  }
2017
- /**
2018
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
2019
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2020
- */
2034
+ // 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
2035
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
2021
2036
 
2022
2037
  /**
2023
2038
  * Attempts to locate the specified application on a Windows system by searching common installation directories.
@@ -2046,10 +2061,8 @@ async function locateAppOnWindows({ appName, windowsSuffix, }) {
2046
2061
  return null;
2047
2062
  }
2048
2063
  }
2049
- /**
2050
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
2051
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2052
- */
2064
+ // 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
2065
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
2053
2066
 
2054
2067
  /**
2055
2068
  * Locates an application on the system
@@ -2086,10 +2099,8 @@ function locateApp(options) {
2086
2099
  }
2087
2100
  }
2088
2101
  }
2089
- /**
2090
- * TODO: [🧠][♿] Maybe export through `@promptbook/node`
2091
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2092
- */
2102
+ // Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment
2103
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
2093
2104
 
2094
2105
  /**
2095
2106
  * Locates the LibreOffice executable on the current system by searching platform-specific paths.
@@ -2105,10 +2116,8 @@ function locateLibreoffice() {
2105
2116
  macOsName: 'LibreOffice',
2106
2117
  });
2107
2118
  }
2108
- /**
2109
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
2110
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2111
- */
2119
+ // 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
2120
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
2112
2121
 
2113
2122
  /**
2114
2123
  * Locates the Pandoc executable on the current system by searching platform-specific paths.
@@ -2124,10 +2133,8 @@ function locatePandoc() {
2124
2133
  macOsName: 'Pandoc',
2125
2134
  });
2126
2135
  }
2127
- /**
2128
- * TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
2129
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2130
- */
2136
+ // 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
2137
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
2131
2138
 
2132
2139
  /**
2133
2140
  * Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
@@ -2144,16 +2151,15 @@ async function $provideExecutablesForNode(options) {
2144
2151
  // <- TODO: [🧠] `null` vs `undefined`
2145
2152
  };
2146
2153
  }
2147
- /**
2148
- * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
2149
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
2150
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
2151
- */
2154
+ // Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment
2155
+ // TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
2156
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
2152
2157
 
2153
2158
  /**
2154
2159
  * Orders JSON object by keys
2155
2160
  *
2156
2161
  * @returns The same type of object as the input re-ordered
2162
+ *
2157
2163
  * @public exported from `@promptbook/utils`
2158
2164
  */
2159
2165
  function orderJson(options) {
@@ -2172,6 +2178,7 @@ function orderJson(options) {
2172
2178
  * Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
2173
2179
  *
2174
2180
  * @returns The same object as the input, but deeply frozen
2181
+ *
2175
2182
  * @public exported from `@promptbook/utils`
2176
2183
  */
2177
2184
  function $deepFreeze(objectValue) {
@@ -2188,9 +2195,7 @@ function $deepFreeze(objectValue) {
2188
2195
  Object.freeze(objectValue);
2189
2196
  return objectValue;
2190
2197
  }
2191
- /**
2192
- * TODO: [🧠] Is there a way how to meaningfully test this utility
2193
- */
2198
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
2194
2199
 
2195
2200
  /**
2196
2201
  * Checks if the value is [🚉] serializable as JSON
@@ -2210,6 +2215,7 @@ function $deepFreeze(objectValue) {
2210
2215
  * - And much more...
2211
2216
  *
2212
2217
  * @throws UnexpectedError if the value is not serializable as JSON
2218
+ *
2213
2219
  * @public exported from `@promptbook/utils`
2214
2220
  */
2215
2221
  function checkSerializableAsJson(options) {
@@ -2324,11 +2330,9 @@ function checkSerializableAsJson(options) {
2324
2330
  `));
2325
2331
  }
2326
2332
  }
2327
- /**
2328
- * TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
2329
- * TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
2330
- * Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
2331
- */
2333
+ // TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
2334
+ // TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
2335
+ // Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
2332
2336
 
2333
2337
  /**
2334
2338
  * Creates a deep clone of the given object
@@ -2338,6 +2342,7 @@ function checkSerializableAsJson(options) {
2338
2342
  *
2339
2343
  * @param objectValue The object to clone.
2340
2344
  * @returns A deep, writable clone of the input object.
2345
+ *
2341
2346
  * @public exported from `@promptbook/utils`
2342
2347
  */
2343
2348
  function deepClone(objectValue) {
@@ -2354,9 +2359,7 @@ function deepClone(objectValue) {
2354
2359
  > return Object.assign({}, objectValue);
2355
2360
  */
2356
2361
  }
2357
- /**
2358
- * TODO: [🧠] Is there a way how to meaningfully test this utility
2359
- */
2362
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
2360
2363
 
2361
2364
  /**
2362
2365
  * Utility to export a JSON object from a function
@@ -2369,6 +2372,7 @@ function deepClone(objectValue) {
2369
2372
  * Note: This function does not mutates the given object
2370
2373
  *
2371
2374
  * @returns The same type of object as the input but read-only and re-ordered
2375
+ *
2372
2376
  * @public exported from `@promptbook/utils`
2373
2377
  */
2374
2378
  function exportJson(options) {
@@ -2388,9 +2392,7 @@ function exportJson(options) {
2388
2392
  $deepFreeze(orderedValue);
2389
2393
  return orderedValue;
2390
2394
  }
2391
- /**
2392
- * TODO: [🧠] Is there a way how to meaningfully test this utility
2393
- */
2395
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
2394
2396
 
2395
2397
  /**
2396
2398
  * Order of keys in the pipeline JSON
@@ -2501,9 +2503,7 @@ const LIMITS = {
2501
2503
  */
2502
2504
  SHORT_NAME_LENGTH: 6,
2503
2505
  };
2504
- /**
2505
- * Note: [💞] Ignore a discrepancy between file name and entity name
2506
- */
2506
+ // Note: [💞] Ignore a discrepancy between file name and entity name
2507
2507
 
2508
2508
  /**
2509
2509
  * Tests if given string is valid semantic version
@@ -2528,12 +2528,13 @@ function isValidSemanticVersion(version) {
2528
2528
  * Tests if given string is valid promptbook version
2529
2529
  * It looks into list of known promptbook versions.
2530
2530
  *
2531
- * @see https://www.npmjs.com/package/promptbook?activeTab=versions
2532
2531
  * 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.
2533
2532
  * Note: There are two similar functions:
2534
2533
  * - `isValidSemanticVersion` which tests any semantic version
2535
2534
  * - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
2536
2535
  *
2536
+ * @see https://www.npmjs.com/package/promptbook?activeTab=versions
2537
+ *
2537
2538
  * @public exported from `@promptbook/utils`
2538
2539
  */
2539
2540
  function isValidPromptbookVersion(version) {
@@ -2607,9 +2608,7 @@ function isValidPipelineUrl(url) {
2607
2608
  */
2608
2609
  return true;
2609
2610
  }
2610
- /**
2611
- * TODO: [🐠] Maybe more info why the URL is invalid
2612
- */
2611
+ // TODO: [🐠] Maybe more info why the URL is invalid
2613
2612
 
2614
2613
  /**
2615
2614
  * Validates PipelineJson if it is logically valid
@@ -2626,6 +2625,7 @@ function isValidPipelineUrl(url) {
2626
2625
  * @param pipeline valid or invalid PipelineJson
2627
2626
  * @returns the same pipeline if it is logically valid
2628
2627
  * @throws {PipelineLogicError} on logical error in the pipeline
2628
+ *
2629
2629
  * @public exported from `@promptbook/core`
2630
2630
  */
2631
2631
  function validatePipeline(pipeline) {
@@ -2650,6 +2650,8 @@ function validatePipeline(pipeline) {
2650
2650
  return pipeline;
2651
2651
  }
2652
2652
  /**
2653
+ * Validates pipeline inner function.
2654
+ *
2653
2655
  * @private internal function for `validatePipeline`
2654
2656
  */
2655
2657
  function validatePipeline_InnerFunction(pipeline) {
@@ -2894,15 +2896,13 @@ function validatePipeline_InnerFunction(pipeline) {
2894
2896
  * > * - ...
2895
2897
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
2896
2898
  */
2897
- /**
2898
- * TODO: [🧳][main] !!4 Validate that all examples match expectations
2899
- * TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2900
- * TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2901
- * TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2902
- * TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2903
- * TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2904
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2905
- */
2899
+ // TODO: [🧳][main] !!4 Validate that all examples match expectations
2900
+ // TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2901
+ // TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2902
+ // TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2903
+ // TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2904
+ // TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2905
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2906
2906
 
2907
2907
  /**
2908
2908
  * Determine if the pipeline is fully prepared
@@ -3004,7 +3004,7 @@ function jsonParse(value) {
3004
3004
 
3005
3005
  /**
3006
3006
  * Recursively converts JSON strings to JSON objects
3007
-
3007
+ *
3008
3008
  * @public exported from `@promptbook/utils`
3009
3009
  */
3010
3010
  function jsonStringsToJsons(object) {
@@ -3028,9 +3028,7 @@ function jsonStringsToJsons(object) {
3028
3028
  }
3029
3029
  return newObject;
3030
3030
  }
3031
- /**
3032
- * TODO: Type the return type correctly
3033
- */
3031
+ // TODO: Type the return type correctly
3034
3032
 
3035
3033
  /**
3036
3034
  * Deserializes the error object
@@ -3065,6 +3063,7 @@ function deserializeError(error, isStackAddedToMessage = true) {
3065
3063
  *
3066
3064
  * @param executionResult - The partial result of the Promptbook execution
3067
3065
  * @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
3066
+ *
3068
3067
  * @private internal helper function of `asPromise` method of `ExecutionTask`
3069
3068
  */
3070
3069
  function assertsTaskSuccessful(executionResult) {
@@ -3095,9 +3094,7 @@ function assertsTaskSuccessful(executionResult) {
3095
3094
  `));
3096
3095
  }
3097
3096
  }
3098
- /**
3099
- * TODO: [🧠] Can this return type be better typed than void
3100
- */
3097
+ // TODO: [🧠] Can this return type be better typed than void
3101
3098
 
3102
3099
  /**
3103
3100
  * Helper to create a new task
@@ -3288,10 +3285,8 @@ function createTask(options) {
3288
3285
  },
3289
3286
  };
3290
3287
  }
3291
- /**
3292
- * TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3293
- * TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3294
- */
3288
+ // TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3289
+ // TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3295
3290
 
3296
3291
  /**
3297
3292
  * Represents the uncertain value
@@ -3359,9 +3354,7 @@ const UNCERTAIN_USAGE = $deepFreeze({
3359
3354
  pagesCount: UNCERTAIN_ZERO_VALUE,
3360
3355
  },
3361
3356
  });
3362
- /**
3363
- * Note: [💞] Ignore a discrepancy between file name and entity name
3364
- */
3357
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3365
3358
 
3366
3359
  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"}];
3367
3360
 
@@ -3384,6 +3377,7 @@ function isValidEmail(email) {
3384
3377
  * Tests if given string is valid file path.
3385
3378
  *
3386
3379
  * Note: This does not check if the file exists only if the path is valid
3380
+ *
3387
3381
  * @public exported from `@promptbook/utils`
3388
3382
  */
3389
3383
  function isValidFilePath(filename) {
@@ -3432,9 +3426,7 @@ function isValidFilePath(filename) {
3432
3426
  }
3433
3427
  return false;
3434
3428
  }
3435
- /**
3436
- * TODO: [🍏] Implement for MacOs
3437
- */
3429
+ // TODO: [🍏] Implement for MacOs
3438
3430
 
3439
3431
  /**
3440
3432
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
@@ -3445,6 +3437,7 @@ function isValidFilePath(filename) {
3445
3437
  * @param {string} pipelineString the candidate for a pipeline string
3446
3438
  * @returns {PipelineString} the same string as input, but validated as valid
3447
3439
  * @throws {ParseError} if the string is not a valid pipeline string
3440
+ *
3448
3441
  * @public exported from `@promptbook/core`
3449
3442
  */
3450
3443
  function validatePipelineString(pipelineString) {
@@ -3463,17 +3456,16 @@ function validatePipelineString(pipelineString) {
3463
3456
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
3464
3457
  return pipelineString;
3465
3458
  }
3466
- /**
3467
- * TODO: [🧠][🈴] Where is the best location for this file
3468
- */
3459
+ // TODO: [🧠][🈴] Where is the best location for this file
3469
3460
 
3470
3461
  /**
3471
3462
  * Prettify the html code
3472
3463
  *
3473
3464
  * @param content raw html code
3474
3465
  * @returns formatted html code
3475
- * @private withing the package because of HUGE size of prettier dependency
3476
3466
  * @deprecated Prettier removed from Promptbook due to package size
3467
+ *
3468
+ * @private withing the package because of HUGE size of prettier dependency
3477
3469
  */
3478
3470
  function prettifyMarkdown(content) {
3479
3471
  return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
@@ -3496,6 +3488,7 @@ function capitalize(word) {
3496
3488
  * @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
3497
3489
  * @param pipelineJson Promptbook in JSON format (.bookc)
3498
3490
  * @returns Promptbook in string format (.book.md)
3491
+ *
3499
3492
  * @public exported from `@promptbook/core`
3500
3493
  */
3501
3494
  function pipelineJsonToString(pipelineJson) {
@@ -3612,6 +3605,8 @@ function pipelineJsonToString(pipelineJson) {
3612
3605
  return validatePipelineString(pipelineString);
3613
3606
  }
3614
3607
  /**
3608
+ * Handles task parameter Json to string.
3609
+ *
3615
3610
  * @private internal utility of `pipelineJsonToString`
3616
3611
  */
3617
3612
  function taskParameterJsonToString(taskParameterJson) {
@@ -3622,19 +3617,18 @@ function taskParameterJsonToString(taskParameterJson) {
3622
3617
  }
3623
3618
  return parameterString;
3624
3619
  }
3625
- /**
3626
- * TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
3627
- * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
3628
- * TODO: [🏛] Maybe make some markdown builder
3629
- * TODO: [🏛] Escape all
3630
- * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
3631
- */
3620
+ // TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
3621
+ // TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
3622
+ // TODO: [🏛] Maybe make some markdown builder
3623
+ // TODO: [🏛] Escape all
3624
+ // TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
3632
3625
 
3633
3626
  /**
3634
3627
  * Parses the task and returns the list of all parameter names
3635
3628
  *
3636
3629
  * @param template the string template with parameters in {curly} braces
3637
3630
  * @returns the list of parameter names
3631
+ *
3638
3632
  * @public exported from `@promptbook/utils`
3639
3633
  */
3640
3634
  function extractParameterNames(template) {
@@ -3651,6 +3645,7 @@ function extractParameterNames(template) {
3651
3645
  * Unprepare just strips the preparation data of the pipeline
3652
3646
  *
3653
3647
  * @deprecated In future version this function will be removed or deprecated
3648
+ *
3654
3649
  * @public exported from `@promptbook/core`
3655
3650
  */
3656
3651
  function unpreparePipeline(pipeline) {
@@ -3679,18 +3674,17 @@ function unpreparePipeline(pipeline) {
3679
3674
  },
3680
3675
  });
3681
3676
  }
3682
- /**
3683
- * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
3684
- * TODO: Write tests for `preparePipeline`
3685
- * TODO: [🍙] Make some standard order of json properties
3686
- */
3677
+ // TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
3678
+ // TODO: Write tests for `preparePipeline`
3679
+ // TODO: [🍙] Make some standard order of json properties
3687
3680
 
3688
3681
  /**
3689
3682
  * Library of pipelines that groups together pipelines for an application.
3690
3683
  * This implementation is a very thin wrapper around the Array / Map of pipelines.
3691
3684
  *
3692
- * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
3693
3685
  * @see https://github.com/webgptorg/pipeline#pipeline-collection
3686
+ *
3687
+ * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
3694
3688
  */
3695
3689
  class SimplePipelineCollection {
3696
3690
  /**
@@ -3794,6 +3788,7 @@ class SimplePipelineCollection {
3794
3788
  *
3795
3789
  * @param promptbookSources
3796
3790
  * @returns PipelineCollection
3791
+ *
3797
3792
  * @public exported from `@promptbook/core`
3798
3793
  */
3799
3794
  function createPipelineCollectionFromJson(...promptbooks) {
@@ -3806,8 +3801,9 @@ function createPipelineCollectionFromJson(...promptbooks) {
3806
3801
  * @param array - Array to iterate over
3807
3802
  * @param options - Options for the function
3808
3803
  * @param callbackfunction - Function to call for each item
3809
- * @public exported from `@promptbook/utils`
3810
3804
  * @deprecated [🪂] Use queues instead
3805
+ *
3806
+ * @public exported from `@promptbook/utils`
3811
3807
  */
3812
3808
  async function forEachAsync(array, options, callbackfunction) {
3813
3809
  const { maxParallelCount = Infinity } = options;
@@ -3892,6 +3888,7 @@ function addUsage(...usageItems) {
3892
3888
  *
3893
3889
  * @param llmTools - The LLM tools to be intercepted and tracked
3894
3890
  * @returns Full proxy of the tools with added usage tracking capabilities
3891
+ *
3895
3892
  * @public exported from `@promptbook/core`
3896
3893
  */
3897
3894
  function countUsage(llmTools) {
@@ -4016,6 +4013,7 @@ const MULTIPLE_PROVIDER_PROFILE = {
4016
4013
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
4017
4014
  *
4018
4015
  * Note: Internal utility of `joinLlmExecutionTools` but exposed type
4016
+ *
4019
4017
  * @public exported from `@promptbook/core`
4020
4018
  */
4021
4019
  class MultipleLlmExecutionTools {
@@ -4178,16 +4176,16 @@ class MultipleLlmExecutionTools {
4178
4176
  * `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
4179
4177
  *
4180
4178
  * 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
4181
- * If the first provider doesn't support the requested model or fails, it tries the next one.
4179
+ * If the first provider doesn't support the requested model or fails, it tries the next one.
4182
4180
  * 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
4183
4181
  * 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
4184
4182
  *
4183
+ * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4184
+ *
4185
4185
  * @param title - A descriptive title for this collection of joined tools
4186
4186
  * @param llmExecutionTools - An array of execution tools to be joined
4187
4187
  * @returns A single unified execution tool wrapper
4188
4188
  *
4189
- * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4190
- *
4191
4189
  * @public exported from `@promptbook/core`
4192
4190
  */
4193
4191
  function joinLlmExecutionTools(title, ...llmExecutionTools) {
@@ -4224,10 +4222,8 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
4224
4222
  }
4225
4223
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4226
4224
  }
4227
- /**
4228
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4229
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4230
- */
4225
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4226
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4231
4227
 
4232
4228
  /**
4233
4229
  * Just returns the given `LlmExecutionTools` or joins multiple into one
@@ -4241,15 +4237,14 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
4241
4237
  : joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
4242
4238
  return llmTools;
4243
4239
  }
4244
- /**
4245
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4246
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4247
- */
4240
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4241
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4248
4242
 
4249
4243
  /**
4250
4244
  * Prepares the persona for the pipeline
4251
4245
  *
4252
4246
  * @see https://github.com/webgptorg/promptbook/discussions/22
4247
+ *
4253
4248
  * @public exported from `@promptbook/core`
4254
4249
  */
4255
4250
  async function preparePersona(personaDescription, tools, options) {
@@ -4306,13 +4301,11 @@ async function preparePersona(personaDescription, tools, options) {
4306
4301
  modelsRequirements,
4307
4302
  };
4308
4303
  }
4309
- /**
4310
- * TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
4311
- * TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
4312
- * TODO: [🏢] Check validity of `modelName` in pipeline
4313
- * TODO: [🏢] Check validity of `systemMessage` in pipeline
4314
- * TODO: [🏢] Check validity of `temperature` in pipeline
4315
- */
4304
+ // TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
4305
+ // TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
4306
+ // TODO: [🏢] Check validity of `modelName` in pipeline
4307
+ // TODO: [🏢] Check validity of `systemMessage` in pipeline
4308
+ // TODO: [🏢] Check validity of `temperature` in pipeline
4316
4309
 
4317
4310
  /**
4318
4311
  * Safely retrieves the global scope object (window in browser, global in Node.js)
@@ -4320,7 +4313,7 @@ async function preparePersona(personaDescription, tools, options) {
4320
4313
  *
4321
4314
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
4322
4315
  *
4323
- * @private internal function of `$Register`
4316
+ * @private internal function of `$Register`
4324
4317
  */
4325
4318
  function $getGlobalScope() {
4326
4319
  return Function('return this')();
@@ -4335,6 +4328,7 @@ function $getGlobalScope() {
4335
4328
  * @returns The normalized text in SCREAMING_CASE format.
4336
4329
  * @example 'HELLO_WORLD'
4337
4330
  * @example 'I_LOVE_PROMPTBOOK'
4331
+ *
4338
4332
  * @public exported from `@promptbook/utils`
4339
4333
  */
4340
4334
  function normalizeTo_SCREAMING_CASE(text) {
@@ -4392,6 +4386,7 @@ function normalizeTo_SCREAMING_CASE(text) {
4392
4386
  * @returns The normalized text in snake_case format.
4393
4387
  * @example 'hello_world'
4394
4388
  * @example 'i_love_promptbook'
4389
+ *
4395
4390
  * @public exported from `@promptbook/utils`
4396
4391
  */
4397
4392
  function normalizeTo_snake_case(text) {
@@ -4450,26 +4445,26 @@ class $Register {
4450
4445
  * Global registry for storing metadata about all available scrapers and converters.
4451
4446
  *
4452
4447
  * Note: `$` is used to indicate that this interacts with the global scope.
4448
+ *
4453
4449
  * @singleton Only one instance of each register is created per build, but there can be more in different contexts (e.g., tests).
4450
+ *
4454
4451
  * @public exported from `@promptbook/core`
4455
4452
  */
4456
4453
  const $scrapersMetadataRegister = new $Register('scrapers_metadata');
4457
- /**
4458
- * TODO: [®] DRY Register logic
4459
- */
4454
+ // TODO: [®] DRY Register logic
4460
4455
 
4461
4456
  /**
4462
4457
  * Registry for all available scrapers in the system.
4463
4458
  * Central point for registering and accessing different types of content scrapers.
4464
4459
  *
4465
4460
  * Note: `$` is used to indicate that this interacts with the global scope
4461
+ *
4466
4462
  * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
4463
+ *
4467
4464
  * @public exported from `@promptbook/core`
4468
4465
  */
4469
4466
  const $scrapersRegister = new $Register('scraper_constructors');
4470
- /**
4471
- * TODO: [®] DRY Register logic
4472
- */
4467
+ // TODO: [®] DRY Register logic
4473
4468
 
4474
4469
  /**
4475
4470
  * Creates a message with all registered scrapers
@@ -4554,10 +4549,11 @@ function $registeredScrapersMessage(availableScrapers) {
4554
4549
 
4555
4550
  `);
4556
4551
  }
4552
+ // TODO: [®] DRY Register logic
4553
+
4557
4554
  /**
4558
- * TODO: [®] DRY Register logic
4555
+ * Collection of default diacritics removal map.
4559
4556
  */
4560
-
4561
4557
  const defaultDiacriticsRemovalMap = [
4562
4558
  {
4563
4559
  base: 'A',
@@ -4809,6 +4805,7 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
4809
4805
  *
4810
4806
  * @param input The string containing diacritics to be normalized.
4811
4807
  * @returns The string with diacritics removed or normalized.
4808
+ *
4812
4809
  * @public exported from `@promptbook/utils`
4813
4810
  */
4814
4811
  function removeDiacritics(input) {
@@ -4817,9 +4814,7 @@ function removeDiacritics(input) {
4817
4814
  return DIACRITIC_VARIANTS_LETTERS[character] || character;
4818
4815
  });
4819
4816
  }
4820
- /**
4821
- * TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4822
- */
4817
+ // TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4823
4818
 
4824
4819
  /**
4825
4820
  * Converts a given text to kebab-case format.
@@ -4830,6 +4825,7 @@ function removeDiacritics(input) {
4830
4825
  * @returns The kebab-case formatted string.
4831
4826
  * @example 'hello-world'
4832
4827
  * @example 'i-love-promptbook'
4828
+ *
4833
4829
  * @public exported from `@promptbook/utils`
4834
4830
  */
4835
4831
  function normalizeToKebabCase(text) {
@@ -4870,9 +4866,7 @@ function normalizeToKebabCase(text) {
4870
4866
  normalizedName = normalizedName.replace(/-$/, '');
4871
4867
  return normalizedName;
4872
4868
  }
4873
- /**
4874
- * Note: [💞] Ignore a discrepancy between file name and entity name
4875
- */
4869
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4876
4870
 
4877
4871
  /**
4878
4872
  * Creates unique name for the source
@@ -4891,9 +4885,7 @@ function knowledgeSourceContentToName(knowledgeSourceContent) {
4891
4885
  // <- TODO: Use MAX_FILENAME_LENGTH
4892
4886
  return name;
4893
4887
  }
4894
- /**
4895
- * TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
4896
- */
4888
+ // TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
4897
4889
 
4898
4890
  /**
4899
4891
  * Converts a name to a properly formatted subfolder path for cache storage.
@@ -4943,11 +4935,9 @@ async function isFileExisting(filename, fs) {
4943
4935
  .catch(() => false);
4944
4936
  return isFile;
4945
4937
  }
4946
- /**
4947
- * Note: Not [~🟢~] because it is not directly dependent on `fs
4948
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
4949
- * TODO: [🖇] What about symlinks?
4950
- */
4938
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
4939
+ // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
4940
+ // TODO: [🖇] What about symlinks?
4951
4941
 
4952
4942
  /**
4953
4943
  * Convert mime type to file extension
@@ -4967,6 +4957,7 @@ function mimeTypeToExtension(value) {
4967
4957
  *
4968
4958
  * @param text with emojis
4969
4959
  * @returns text without emojis
4960
+ *
4970
4961
  * @public exported from `@promptbook/utils`
4971
4962
  */
4972
4963
  function removeEmojis(text) {
@@ -4986,6 +4977,7 @@ function removeEmojis(text) {
4986
4977
  * @param value The title string to be converted to a name.
4987
4978
  * @returns A normalized name derived from the input title.
4988
4979
  * @example 'Hello World!' -> 'hello-world'
4980
+ *
4989
4981
  * @public exported from `@promptbook/utils`
4990
4982
  */
4991
4983
  function titleToName(value) {
@@ -5031,9 +5023,7 @@ const promptbookFetch = async (urlOrRequest, init) => {
5031
5023
  `));
5032
5024
  }
5033
5025
  };
5034
- /**
5035
- * TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
5036
- */
5026
+ // TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
5037
5027
 
5038
5028
  /**
5039
5029
  * Factory function that creates a handler for processing knowledge sources.
@@ -5253,6 +5243,7 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
5253
5243
  * Prepares the knowledge pieces
5254
5244
  *
5255
5245
  * @see https://github.com/webgptorg/promptbook/discussions/41
5246
+ *
5256
5247
  * @public exported from `@promptbook/core`
5257
5248
  */
5258
5249
  async function prepareKnowledgePieces(knowledgeSources, tools, options) {
@@ -5394,25 +5385,24 @@ async function prepareTasks(pipeline, tools, options) {
5394
5385
  });
5395
5386
  return { tasksPrepared };
5396
5387
  }
5397
- /**
5398
- * TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
5399
- * TODO: [🧠] Add context to each task (if missing)
5400
- * TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
5401
- * TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
5402
- * TODO: Write tests for `preparePipeline`
5403
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
5404
- * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
5405
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
5406
- */
5388
+ // TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
5389
+ // TODO: [🧠] Add context to each task (if missing)
5390
+ // TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
5391
+ // TODO: [][main] !!3 Prepare index the examples and maybe tasks
5392
+ // TODO: Write tests for `preparePipeline`
5393
+ // TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
5394
+ // TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
5395
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
5407
5396
 
5408
5397
  /**
5409
5398
  * Prepare pipeline locally
5410
5399
  *
5411
- * @see https://github.com/webgptorg/promptbook/discussions/196
5412
- *
5413
5400
  * Note: This function does not validate logic of the pipeline
5414
5401
  * Note: This function acts as part of compilation process
5415
5402
  * Note: When the pipeline is already prepared, it returns the same pipeline
5403
+ *
5404
+ * @see https://github.com/webgptorg/promptbook/discussions/196
5405
+ *
5416
5406
  * @public exported from `@promptbook/core`
5417
5407
  */
5418
5408
  async function preparePipeline(pipeline, tools, options) {
@@ -5583,8 +5573,8 @@ function numberToString(value) {
5583
5573
  * This is useful and used in the `templateParameters` function
5584
5574
  *
5585
5575
  * Note: This function is not just calling `toString` method
5586
- * It's more complex and can handle this conversion specifically for LLM models
5587
- * See `VALUE_STRINGS`
5576
+ * It's more complex and can handle this conversion specifically for LLM models
5577
+ * See `VALUE_STRINGS`
5588
5578
  *
5589
5579
  * Note: There are 2 similar functions
5590
5580
  * - `valueToString` converts value to string for LLM models as human-readable string
@@ -5637,6 +5627,7 @@ function valueToString(value) {
5637
5627
  * @param script from which to extract the variables
5638
5628
  * @returns the list of variable names
5639
5629
  * @throws {ParseError} if the script is invalid
5630
+ *
5640
5631
  * @public exported from `@promptbook/javascript`
5641
5632
  */
5642
5633
  function extractVariablesFromJavascript(script) {
@@ -5702,9 +5693,7 @@ function extractVariablesFromJavascript(script) {
5702
5693
  }
5703
5694
  return variables;
5704
5695
  }
5705
- /**
5706
- * TODO: [🔣] Support for multiple languages - python, java,...
5707
- */
5696
+ // TODO: [🔣] Support for multiple languages - python, java,...
5708
5697
 
5709
5698
  /**
5710
5699
  * Parses the task and returns the set of all used parameters
@@ -5712,6 +5701,7 @@ function extractVariablesFromJavascript(script) {
5712
5701
  * @param task the task with used parameters
5713
5702
  * @returns the set of parameter names
5714
5703
  * @throws {ParseError} if the script is invalid
5704
+ *
5715
5705
  * @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
5716
5706
  */
5717
5707
  function extractParameterNamesFromTask(task) {
@@ -5752,14 +5742,13 @@ function extractParameterNamesFromTask(task) {
5752
5742
  }
5753
5743
  return parameterNames;
5754
5744
  }
5755
- /**
5756
- * TODO: [🔣] If script require contentLanguage
5757
- */
5745
+ // TODO: [🔣] If script require contentLanguage
5758
5746
 
5759
5747
  /**
5760
5748
  * Create difference set of two sets.
5761
5749
  *
5762
5750
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
5751
+ *
5763
5752
  * @public exported from `@promptbook/utils`
5764
5753
  */
5765
5754
  function difference(a, b, isEqual = (a, b) => a === b) {
@@ -5771,14 +5760,13 @@ function difference(a, b, isEqual = (a, b) => a === b) {
5771
5760
  }
5772
5761
  return diff;
5773
5762
  }
5774
- /**
5775
- * TODO: [🧠][💯] Maybe also implement symmetricDifference
5776
- */
5763
+ // TODO: [🧠][💯] Maybe also implement symmetricDifference
5777
5764
 
5778
5765
  /**
5779
5766
  * Creates a new set with all elements that are present in either set
5780
5767
  *
5781
5768
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
5769
+ *
5782
5770
  * @public exported from `@promptbook/utils`
5783
5771
  */
5784
5772
  function union(...sets) {
@@ -5844,8 +5832,9 @@ function isValidCsvString(value) {
5844
5832
  /**
5845
5833
  * Definition for CSV spreadsheet
5846
5834
  *
5835
+ * TODO: [🏢] Export from package `@promptbook/csv`
5836
+ *
5847
5837
  * @public exported from `@promptbook/core`
5848
- * <- TODO: [🏢] Export from package `@promptbook/csv`
5849
5838
  */
5850
5839
  const CsvFormatParser = {
5851
5840
  formatName: 'CSV',
@@ -5935,13 +5924,11 @@ const CsvFormatParser = {
5935
5924
  },
5936
5925
  ],
5937
5926
  };
5938
- /**
5939
- * TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
5940
- * TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
5941
- * TODO: [🍓] In `CsvFormatParser` implement `heal
5942
- * TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
5943
- * TODO: [🏢] Allow to expect something inside CSV objects and other formats
5944
- */
5927
+ // TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
5928
+ // TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
5929
+ // TODO: [🍓] In `CsvFormatParser` implement `heal
5930
+ // TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
5931
+ // TODO: [🏢] Allow to expect something inside CSV objects and other formats
5945
5932
 
5946
5933
  /**
5947
5934
  * Definition for JSON format
@@ -5962,17 +5949,15 @@ const JsonFormatParser = {
5962
5949
  },
5963
5950
  subvalueParsers: [],
5964
5951
  };
5965
- /**
5966
- * TODO: [🧠] Maybe proper instance of object
5967
- * TODO: [0] Make string_serialized_json
5968
- * TODO: [1] Make type for JSON Settings and Schema
5969
- * TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
5970
- * TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
5971
- * TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
5972
- * TODO: [🍓] In `JsonFormatParser` implement `heal
5973
- * TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
5974
- * TODO: [🏢] Allow to expect something inside JSON objects and other formats
5975
- */
5952
+ // TODO: [🧠] Maybe proper instance of object
5953
+ // TODO: [0] Make string_serialized_json
5954
+ // TODO: [1] Make type for JSON Settings and Schema
5955
+ // TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
5956
+ // TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
5957
+ // TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
5958
+ // TODO: [🍓] In `JsonFormatParser` implement `heal
5959
+ // TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
5960
+ // TODO: [🏢] Allow to expect something inside JSON objects and other formats
5976
5961
 
5977
5962
  /**
5978
5963
  * Definition for any text - this will be always valid
@@ -6010,15 +5995,13 @@ const TextFormatParser = {
6010
5995
  // <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
6011
5996
  ],
6012
5997
  };
6013
- /**
6014
- * TODO: [1] Make type for XML Text and Schema
6015
- * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
6016
- * TODO: [🍓] In `TextFormatParser` implement simple `isValid`
6017
- * TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
6018
- * TODO: [🍓] In `TextFormatParser` implement `heal
6019
- * TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
6020
- * TODO: [🏢] Allow to expect something inside each item of list and other formats
6021
- */
5998
+ // TODO: [1] Make type for XML Text and Schema
5999
+ // TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
6000
+ // TODO: [🍓] In `TextFormatParser` implement simple `isValid`
6001
+ // TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
6002
+ // TODO: [🍓] In `TextFormatParser` implement `heal
6003
+ // TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
6004
+ // TODO: [🏢] Allow to expect something inside each item of list and other formats
6022
6005
 
6023
6006
  /**
6024
6007
  * Function to check if a string is valid XML
@@ -6063,17 +6046,15 @@ const XmlFormatParser = {
6063
6046
  },
6064
6047
  subvalueParsers: [],
6065
6048
  };
6066
- /**
6067
- * TODO: [🧠] Maybe proper instance of object
6068
- * TODO: [0] Make string_serialized_xml
6069
- * TODO: [1] Make type for XML Settings and Schema
6070
- * TODO: [🧠] What to use for validating XMLs - XSD,...
6071
- * TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
6072
- * TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
6073
- * TODO: [🍓] In `XmlFormatParser` implement `heal
6074
- * TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
6075
- * TODO: [🏢] Allow to expect something inside XML and other formats
6076
- */
6049
+ // TODO: [🧠] Maybe proper instance of object
6050
+ // TODO: [0] Make string_serialized_xml
6051
+ // TODO: [1] Make type for XML Settings and Schema
6052
+ // TODO: [🧠] What to use for validating XMLs - XSD,...
6053
+ // TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
6054
+ // TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
6055
+ // TODO: [🍓] In `XmlFormatParser` implement `heal
6056
+ // TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
6057
+ // TODO: [🏢] Allow to expect something inside XML and other formats
6077
6058
 
6078
6059
  /**
6079
6060
  * Definitions for all formats supported by Promptbook
@@ -6081,9 +6062,7 @@ const XmlFormatParser = {
6081
6062
  * @private internal index of `...` <- TODO [🏢]
6082
6063
  */
6083
6064
  const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
6084
- /**
6085
- * Note: [💞] Ignore a discrepancy between file name and entity name
6086
- */
6065
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6087
6066
 
6088
6067
  /**
6089
6068
  * Maps available parameters to expected parameters for a pipeline task.
@@ -6093,6 +6072,7 @@ const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser,
6093
6072
  * 2) Then, if there are unmatched expected and available parameters, map them by order.
6094
6073
  *
6095
6074
  * @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
6075
+ *
6096
6076
  * @private within the repository used in `createPipelineExecutor`
6097
6077
  */
6098
6078
  function mapAvailableToExpectedParameters(options) {
@@ -6163,6 +6143,7 @@ function mapAvailableToExpectedParameters(options) {
6163
6143
  *
6164
6144
  * @param value any values
6165
6145
  * @returns void
6146
+ *
6166
6147
  * @private within the repository
6167
6148
  */
6168
6149
  function keepUnused(...valuesToKeep) {
@@ -6172,12 +6153,13 @@ function keepUnused(...valuesToKeep) {
6172
6153
  * Replaces parameters in template with values from parameters object
6173
6154
  *
6174
6155
  * Note: This function is not places strings into string,
6175
- * It's more complex and can handle this operation specifically for LLM models
6156
+ * It's more complex and can handle this operation specifically for LLM models
6176
6157
  *
6177
6158
  * @param template the template with parameters in {curly} braces
6178
6159
  * @param parameters the object with parameters
6179
6160
  * @returns the template with replaced parameters
6180
6161
  * @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
6162
+ *
6181
6163
  * @public exported from `@promptbook/utils`
6182
6164
  */
6183
6165
  function templateParameters(template, parameters) {
@@ -6251,6 +6233,7 @@ function templateParameters(template, parameters) {
6251
6233
  * @param markdown any valid markdown
6252
6234
  * @returns code blocks with language and content
6253
6235
  * @throws {ParseError} if block is not closed properly
6236
+ *
6254
6237
  * @public exported from `@promptbook/markdown-utils`
6255
6238
  */
6256
6239
  function extractAllBlocksFromMarkdown(markdown) {
@@ -6301,9 +6284,7 @@ function extractAllBlocksFromMarkdown(markdown) {
6301
6284
  }
6302
6285
  return codeBlocks;
6303
6286
  }
6304
- /**
6305
- * TODO: Maybe name for `blockNotation` instead of '```' and '>'
6306
- */
6287
+ // TODO: Maybe name for `blockNotation` instead of '```' and '>'
6307
6288
 
6308
6289
  /**
6309
6290
  * Extracts extracts exactly one valid JSON code block
@@ -6319,8 +6300,9 @@ function extractAllBlocksFromMarkdown(markdown) {
6319
6300
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
6320
6301
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
6321
6302
  *
6322
- * @public exported from `@promptbook/markdown-utils`
6323
6303
  * @throws {ParseError} if there is no valid JSON block in the markdown
6304
+ *
6305
+ * @public exported from `@promptbook/markdown-utils`
6324
6306
  */
6325
6307
  function extractJsonBlock(markdown) {
6326
6308
  if (isValidJsonString(markdown)) {
@@ -6336,10 +6318,8 @@ function extractJsonBlock(markdown) {
6336
6318
  }
6337
6319
  return jsonBlocks[0].content;
6338
6320
  }
6339
- /**
6340
- * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
6341
- * TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
6342
- */
6321
+ // TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
6322
+ // TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
6343
6323
 
6344
6324
  /**
6345
6325
  * Counts number of characters in the text
@@ -6355,10 +6335,8 @@ function countCharacters(text) {
6355
6335
  text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
6356
6336
  return text.length;
6357
6337
  }
6358
- /**
6359
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6360
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6361
- */
6338
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6339
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6362
6340
 
6363
6341
  /**
6364
6342
  * Number of characters per standard line with 11pt Arial font size.
@@ -6372,10 +6350,8 @@ const CHARACTERS_PER_STANDARD_LINE = 63;
6372
6350
  * @public exported from `@promptbook/utils`
6373
6351
  */
6374
6352
  const LINES_PER_STANDARD_PAGE = 44;
6375
- /**
6376
- * TODO: [🧠] Should be this `constants.ts` or `config.ts`?
6377
- * Note: [💞] Ignore a discrepancy between file name and entity name
6378
- */
6353
+ // TODO: [🧠] Should be this `constants.ts` or `config.ts`?
6354
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6379
6355
 
6380
6356
  /**
6381
6357
  * Counts number of lines in the text
@@ -6393,10 +6369,8 @@ function countLines(text) {
6393
6369
  const lines = text.split(/\r?\n/);
6394
6370
  return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
6395
6371
  }
6396
- /**
6397
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6398
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6399
- */
6372
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6373
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6400
6374
 
6401
6375
  /**
6402
6376
  * Counts number of pages in the text
@@ -6408,10 +6382,8 @@ function countLines(text) {
6408
6382
  function countPages(text) {
6409
6383
  return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
6410
6384
  }
6411
- /**
6412
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6413
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6414
- */
6385
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6386
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6415
6387
 
6416
6388
  /**
6417
6389
  * Counts number of paragraphs in the text
@@ -6421,10 +6393,8 @@ function countPages(text) {
6421
6393
  function countParagraphs(text) {
6422
6394
  return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
6423
6395
  }
6424
- /**
6425
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6426
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6427
- */
6396
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6397
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6428
6398
 
6429
6399
  /**
6430
6400
  * Split text into sentences
@@ -6442,10 +6412,8 @@ function splitIntoSentences(text) {
6442
6412
  function countSentences(text) {
6443
6413
  return splitIntoSentences(text).length;
6444
6414
  }
6445
- /**
6446
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6447
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6448
- */
6415
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6416
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6449
6417
 
6450
6418
  /**
6451
6419
  * Counts number of words in the text
@@ -6459,11 +6427,9 @@ function countWords(text) {
6459
6427
  text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
6460
6428
  return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
6461
6429
  }
6462
- /**
6463
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6464
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6465
- * TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
6466
- */
6430
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6431
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6432
+ // TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
6467
6433
 
6468
6434
  /**
6469
6435
  * Index of all counter functions
@@ -6478,10 +6444,8 @@ const CountUtils = {
6478
6444
  LINES: countLines,
6479
6445
  PAGES: countPages,
6480
6446
  };
6481
- /**
6482
- * TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
6483
- * Note: [💞] Ignore a discrepancy between file name and entity name
6484
- */
6447
+ // TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
6448
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6485
6449
 
6486
6450
  /**
6487
6451
  * Function checkExpectations will check if the expectations on given value are met
@@ -6492,6 +6456,7 @@ const CountUtils = {
6492
6456
  *
6493
6457
  * @throws {ExpectError} if the expectations are not met
6494
6458
  * @returns {void} Nothing
6459
+ *
6495
6460
  * @private internal function of `createPipelineExecutor`
6496
6461
  */
6497
6462
  function checkExpectations(expectations, value) {
@@ -6505,11 +6470,9 @@ function checkExpectations(expectations, value) {
6505
6470
  }
6506
6471
  }
6507
6472
  }
6508
- /**
6509
- * TODO: [💝] Unite object for expecting amount and format
6510
- * TODO: [🧠][🤠] This should be part of `TextFormatParser`
6511
- * Note: [💝] and [🤠] are interconnected together
6512
- */
6473
+ // TODO: [💝] Unite object for expecting amount and format
6474
+ // TODO: [🧠][🤠] This should be part of `TextFormatParser`
6475
+ // Note: [💝] and [🤠] are interconnected together
6513
6476
 
6514
6477
  /**
6515
6478
  * Validates a prompt result against expectations and format requirements.
@@ -6520,6 +6483,7 @@ function checkExpectations(expectations, value) {
6520
6483
  *
6521
6484
  * @param options - The validation options including result string, expectations, and format
6522
6485
  * @returns Validation result with processed string and validity status
6486
+ *
6523
6487
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
6524
6488
  */
6525
6489
  function validatePromptResult(options) {
@@ -6582,6 +6546,7 @@ function validatePromptResult(options) {
6582
6546
  *
6583
6547
  * @param options - The options for execution, including task, parameters, pipeline, and configuration.
6584
6548
  * @returns The result string of the executed task.
6549
+ *
6585
6550
  * @private internal utility of `createPipelineExecutor`
6586
6551
  */
6587
6552
  async function executeAttempts(options) {
@@ -6905,9 +6870,7 @@ async function executeAttempts(options) {
6905
6870
  }
6906
6871
  return $ongoingTaskResult.$resultString;
6907
6872
  }
6908
- /**
6909
- * TODO: Break into smaller functions
6910
- */
6873
+ // TODO: Break into smaller functions
6911
6874
 
6912
6875
  /**
6913
6876
  * Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
@@ -7050,6 +7013,7 @@ async function executeFormatSubvalues(options) {
7050
7013
  *
7051
7014
  * @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
7052
7015
  * @returns The context as a string, formatted as markdown and parameter value.
7016
+ *
7053
7017
  * @private internal utility of `createPipelineExecutor`
7054
7018
  */
7055
7019
  async function getContextForTask(task) {
@@ -7087,7 +7051,6 @@ function computeCosineSimilarity(embeddingVector1, embeddingVector2) {
7087
7051
  }
7088
7052
 
7089
7053
  /**
7090
- *
7091
7054
  * @param knowledgePieces
7092
7055
  * @returns
7093
7056
  *
@@ -7167,11 +7130,9 @@ async function getKnowledgeForTask(options) {
7167
7130
  // Note: If the LLM fails, just return all knowledge pieces
7168
7131
  return knowledgePiecesToString(preparedPipeline.knowledgePieces);
7169
7132
  }
7170
- }
7171
- /**
7172
- * TODO: [♨] Implement Better - use keyword search
7173
- * TODO: [♨] Examples of values
7174
- */
7133
+ }
7134
+ // TODO: [♨] Implement Better - use keyword search
7135
+ // TODO: [♨] Examples of values
7175
7136
 
7176
7137
  /**
7177
7138
  * Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
@@ -7324,9 +7285,7 @@ async function executeTask(options) {
7324
7285
  resultString,
7325
7286
  });
7326
7287
  }
7327
- /**
7328
- * TODO: [🤹‍♂️]
7329
- */
7288
+ // TODO: [🤹‍♂️]
7330
7289
 
7331
7290
  /**
7332
7291
  * Filters and returns only the output parameters from the provided pipeline execution options.
@@ -7656,6 +7615,7 @@ async function executePipeline(options) {
7656
7615
  *
7657
7616
  * @returns The executor function
7658
7617
  * @throws {PipelineLogicError} on logical error in the pipeline
7618
+ *
7659
7619
  * @public exported from `@promptbook/core`
7660
7620
  */
7661
7621
  function createPipelineExecutor(options) {
@@ -7820,9 +7780,7 @@ function $isRunningInBrowser() {
7820
7780
  return false;
7821
7781
  }
7822
7782
  }
7823
- /**
7824
- * TODO: [🎺]
7825
- */
7783
+ // TODO: [🎺]
7826
7784
 
7827
7785
  /**
7828
7786
  * Detects if the code is running in a web worker
@@ -7842,33 +7800,31 @@ function $isRunningInWebWorker() {
7842
7800
  return false;
7843
7801
  }
7844
7802
  }
7845
- /**
7846
- * TODO: [🎺]
7847
- */
7803
+ // TODO: [🎺]
7848
7804
 
7849
7805
  /**
7850
7806
  * Register for LLM tools.
7851
7807
  *
7852
7808
  * Note: `$` is used to indicate that this interacts with the global scope
7809
+ *
7853
7810
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
7811
+ *
7854
7812
  * @public exported from `@promptbook/core`
7855
7813
  */
7856
7814
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
7857
- /**
7858
- * TODO: [®] DRY Register logic
7859
- */
7815
+ // TODO: [®] DRY Register logic
7860
7816
 
7861
7817
  /**
7862
7818
  * Register for LLM tools metadata.
7863
7819
  *
7864
7820
  * Note: `$` is used to indicate that this interacts with the global scope
7821
+ *
7865
7822
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
7823
+ *
7866
7824
  * @public exported from `@promptbook/core`
7867
7825
  */
7868
7826
  const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
7869
- /**
7870
- * TODO: [®] DRY Register logic
7871
- */
7827
+ // TODO: [®] DRY Register logic
7872
7828
 
7873
7829
  /**
7874
7830
  * Creates a message with all registered LLM tools
@@ -7989,10 +7945,8 @@ function $registeredLlmToolsMessage() {
7989
7945
  .join('\n'))}
7990
7946
  `);
7991
7947
  }
7992
- /**
7993
- * TODO: [®] DRY Register logic
7994
- * TODO: [🧠][⚛] Maybe pass env as argument
7995
- */
7948
+ // TODO: [®] DRY Register logic
7949
+ // TODO: [🧠][⚛] Maybe pass env as argument
7996
7950
 
7997
7951
  /**
7998
7952
  * Creates LLM execution tools from provided configuration objects
@@ -8005,6 +7959,7 @@ function $registeredLlmToolsMessage() {
8005
7959
  * @param configuration Array of LLM tool configurations to instantiate
8006
7960
  * @param options Additional options for configuring the LLM tools
8007
7961
  * @returns A unified interface combining all successfully instantiated LLM tools
7962
+ *
8008
7963
  * @public exported from `@promptbook/core`
8009
7964
  */
8010
7965
  function createLlmToolsFromConfiguration(configuration, options = {}) {
@@ -8060,6 +8015,7 @@ function createLlmToolsFromConfiguration(configuration, options = {}) {
8060
8015
  * Provides a collection of scrapers optimized for Node.js environment.
8061
8016
  * 1) `provideScrapersForNode` use as default
8062
8017
  * 2) `provideScrapersForBrowser` use in limited browser environment *
8018
+ *
8063
8019
  * @public exported from `@promptbook/node`
8064
8020
  */
8065
8021
  async function $provideScrapersForNode(tools, options) {
@@ -8079,10 +8035,8 @@ async function $provideScrapersForNode(tools, options) {
8079
8035
  }
8080
8036
  return scrapers;
8081
8037
  }
8082
- /**
8083
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
8084
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
8085
- */
8038
+ // 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
8039
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
8086
8040
 
8087
8041
  /**
8088
8042
  * Normalizes a given text to camelCase format.
@@ -8094,6 +8048,7 @@ async function $provideScrapersForNode(tools, options) {
8094
8048
  * @returns The camelCase formatted string.
8095
8049
  * @example 'helloWorld'
8096
8050
  * @example 'iLovePromptbook'
8051
+ *
8097
8052
  * @public exported from `@promptbook/utils`
8098
8053
  */
8099
8054
  function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
@@ -8134,9 +8089,7 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
8134
8089
  }
8135
8090
  return normalizedName;
8136
8091
  }
8137
- /**
8138
- * TODO: [🌺] Use some intermediate util splitWords
8139
- */
8092
+ // TODO: [🌺] Use some intermediate util splitWords
8140
8093
 
8141
8094
  /**
8142
8095
  * Unsafe characters that prevent an inline parameter.
@@ -8160,6 +8113,7 @@ const PROMPT_PARAMETER_ESCAPE_WITH_BRACES_PATTERN = /[{}$`]/g;
8160
8113
  * Normalizes a JSON string so it can be safely rendered without double escaping.
8161
8114
  *
8162
8115
  * @param value Candidate JSON string.
8116
+ *
8163
8117
  * @private function of ParameterEscaping
8164
8118
  */
8165
8119
  function normalizeJsonString(value) {
@@ -8174,6 +8128,7 @@ function normalizeJsonString(value) {
8174
8128
  * Hides brackets in a string to avoid confusion with template parameters.
8175
8129
  *
8176
8130
  * @param value Input string with literal brackets.
8131
+ *
8177
8132
  * @private function of ParameterEscaping
8178
8133
  */
8179
8134
  function hideBrackets(value) {
@@ -8183,6 +8138,7 @@ function hideBrackets(value) {
8183
8138
  * Restores hidden brackets.
8184
8139
  *
8185
8140
  * @param value String with hidden brackets.
8141
+ *
8186
8142
  * @private function of ParameterEscaping
8187
8143
  */
8188
8144
  function restoreBrackets(value) {
@@ -8192,6 +8148,7 @@ function restoreBrackets(value) {
8192
8148
  * Decides whether a parameter can be inlined safely.
8193
8149
  *
8194
8150
  * @param value Parameter rendered as string.
8151
+ *
8195
8152
  * @private function of ParameterEscaping
8196
8153
  */
8197
8154
  function shouldInlineParameterValue(value) {
@@ -8205,6 +8162,7 @@ function shouldInlineParameterValue(value) {
8205
8162
  *
8206
8163
  * @param value Parameter value to escape.
8207
8164
  * @param options Escape options for additional characters.
8165
+ *
8208
8166
  * @private function of ParameterEscaping
8209
8167
  */
8210
8168
  function escapePromptParameterValue(value, options) {
@@ -8230,6 +8188,7 @@ const ParameterEscaping = {
8230
8188
  * Builds numeric parameter names (1, 2, ...).
8231
8189
  *
8232
8190
  * @param index Zero-based parameter index.
8191
+ *
8233
8192
  * @private function of ParameterNaming
8234
8193
  */
8235
8194
  function buildNumericParameterName(index) {
@@ -8239,6 +8198,7 @@ function buildNumericParameterName(index) {
8239
8198
  * Builds alphabetic parameter names (a, b, ..., aa).
8240
8199
  *
8241
8200
  * @param index Zero-based parameter index.
8201
+ *
8242
8202
  * @private function of ParameterNaming
8243
8203
  */
8244
8204
  function buildAlphabeticParameterName(index) {
@@ -8255,6 +8215,7 @@ function buildAlphabeticParameterName(index) {
8255
8215
  * Converts a positive integer into a Roman numeral string.
8256
8216
  *
8257
8217
  * @param value Positive integer value.
8218
+ *
8258
8219
  * @private function of ParameterNaming
8259
8220
  */
8260
8221
  function toRomanNumeral(value) {
@@ -8287,6 +8248,7 @@ function toRomanNumeral(value) {
8287
8248
  * Builds Roman numeral parameter names (I, II, ...).
8288
8249
  *
8289
8250
  * @param index Zero-based parameter index.
8251
+ *
8290
8252
  * @private function of ParameterNaming
8291
8253
  */
8292
8254
  function buildRomanParameterName(index) {
@@ -8297,6 +8259,7 @@ function buildRomanParameterName(index) {
8297
8259
  *
8298
8260
  * @param prefix Prefix string.
8299
8261
  * @param builder Base builder function.
8262
+ *
8300
8263
  * @private function of ParameterNaming
8301
8264
  */
8302
8265
  function buildPrefixedParameterName(prefix, builder) {
@@ -8318,6 +8281,7 @@ const PARAMETER_NAME_STRATEGIES = [
8318
8281
  * Collects bracketed tokens from parameter values to avoid placeholder collisions.
8319
8282
  *
8320
8283
  * @param values Parameter values to scan.
8284
+ *
8321
8285
  * @private function of ParameterNaming
8322
8286
  */
8323
8287
  function collectBracketedParameterTokens(values) {
@@ -8338,6 +8302,7 @@ function collectBracketedParameterTokens(values) {
8338
8302
  * Builds placeholder names while avoiding collisions with parameter content.
8339
8303
  *
8340
8304
  * @param values Parameter values to scan for conflicting tokens.
8305
+ *
8341
8306
  * @private function of ParameterNaming
8342
8307
  */
8343
8308
  function buildParameterNames(values) {
@@ -8368,6 +8333,7 @@ const ParameterNaming = {
8368
8333
  * Formats the placeholder used in the prompt body for a parameter.
8369
8334
  *
8370
8335
  * @param name Parameter placeholder name.
8336
+ *
8371
8337
  * @private function of ParameterSection
8372
8338
  */
8373
8339
  function formatParameterPlaceholder(name) {
@@ -8377,6 +8343,7 @@ function formatParameterPlaceholder(name) {
8377
8343
  * Formats a single line entry for structured parameters.
8378
8344
  *
8379
8345
  * @param item Parameter entry data.
8346
+ *
8380
8347
  * @private function of ParameterSection
8381
8348
  */
8382
8349
  function formatParameterListItem(item) {
@@ -8388,6 +8355,7 @@ function formatParameterListItem(item) {
8388
8355
  * Builds the structured parameters section appended to the prompt.
8389
8356
  *
8390
8357
  * @param items Parameter entries to include.
8358
+ *
8391
8359
  * @private function of ParameterSection
8392
8360
  */
8393
8361
  function buildParametersSection(items) {
@@ -8463,6 +8431,7 @@ function isPromptString(value) {
8463
8431
  * @param strings
8464
8432
  * @param values
8465
8433
  * @returns prompt content wrapped as a PromptString
8434
+ *
8466
8435
  * @public exported from `@promptbook/utils`
8467
8436
  */
8468
8437
  function prompt(strings, ...values) {
@@ -8547,11 +8516,9 @@ function prompt(strings, ...values) {
8547
8516
  }
8548
8517
  return new PromptString(pipelineString);
8549
8518
  }
8550
- /**
8551
- * TODO: Maybe split into multiple files
8552
- * TODO: [🧠][🈴] Where is the best location for this file
8553
- * Note: [💞] Ignore a discrepancy between file name and entity name
8554
- */
8519
+ // TODO: Maybe split into multiple files
8520
+ // TODO: [🧠][🈴] Where is the best location for this file
8521
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8555
8522
 
8556
8523
  /**
8557
8524
  * @@@
@@ -8588,9 +8555,7 @@ function attachClientVersionHeader(headers) {
8588
8555
  [CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
8589
8556
  };
8590
8557
  }
8591
- /**
8592
- * Note: [💞] Ignore a discrepancy between file name and entity name
8593
- */
8558
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8594
8559
 
8595
8560
  /**
8596
8561
  * Computes SHA-256 hash of the given object
@@ -8600,9 +8565,7 @@ function attachClientVersionHeader(headers) {
8600
8565
  function computeHash(value) {
8601
8566
  return SHA256(hexEncoder.parse(spaceTrim$1(valueToString(value)))).toString( /* hex */);
8602
8567
  }
8603
- /**
8604
- * TODO: [🥬][🥬] Use this ACRY
8605
- */
8568
+ // TODO: [🥬][🥬] Use this ACRY
8606
8569
 
8607
8570
  // spell-checker: disable
8608
8571
  /**
@@ -8768,6 +8731,9 @@ const ADJECTIVES$1 = [
8768
8731
  'prvotní',
8769
8732
  'hbitý',
8770
8733
  ];
8734
+ /**
8735
+ * Collection of nouns.
8736
+ */
8771
8737
  const NOUNS$1 = [
8772
8738
  'jablko',
8773
8739
  'nebe',
@@ -8981,6 +8947,9 @@ const NOUNS$1 = [
8981
8947
  'okno',
8982
8948
  'chodba',
8983
8949
  ];
8950
+ /**
8951
+ * Collection of verbs.
8952
+ */
8984
8953
  const VERBS$1 = [
8985
8954
  'skáče',
8986
8955
  'tančí',
@@ -9153,9 +9122,7 @@ const LINGUISTIC_HASH_WORD_LISTS_CS = {
9153
9122
  noun: NOUNS$1,
9154
9123
  verb: VERBS$1,
9155
9124
  };
9156
- /**
9157
- * Note: [💞] Ignore a discrepancy between file name and entity name
9158
- */
9125
+ // Note: [💞] Ignore a discrepancy between file name and entity name
9159
9126
 
9160
9127
  /**
9161
9128
  * @@@
@@ -9411,6 +9378,9 @@ const ADJECTIVES = [
9411
9378
  'macro',
9412
9379
  'mini',
9413
9380
  ];
9381
+ /**
9382
+ * Collection of nouns.
9383
+ */
9414
9384
  const NOUNS = [
9415
9385
  'apple',
9416
9386
  'sky',
@@ -9650,6 +9620,9 @@ const NOUNS = [
9650
9620
  'roof',
9651
9621
  'floor',
9652
9622
  ];
9623
+ /**
9624
+ * Collection of verbs.
9625
+ */
9653
9626
  const VERBS = [
9654
9627
  'jumping',
9655
9628
  'dancing',
@@ -9845,9 +9818,7 @@ const LINGUISTIC_HASH_WORD_LISTS_EN = {
9845
9818
  noun: NOUNS,
9846
9819
  verb: VERBS,
9847
9820
  };
9848
- /**
9849
- * Note: [💞] Ignore a discrepancy between file name and entity name
9850
- */
9821
+ // Note: [💞] Ignore a discrepancy between file name and entity name
9851
9822
 
9852
9823
  /**
9853
9824
  * Default language used for linguistic hashes.
@@ -10022,8 +9993,9 @@ function normalizeLinguisticHashWordCount(wordCount) {
10022
9993
  /**
10023
9994
  * Creates a human-readable hash as a short, story-like phrase.
10024
9995
  *
10025
- * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
10026
9996
  * {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
9997
+ *
9998
+ * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
10027
9999
  * @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
10028
10000
  *
10029
10001
  * @public exported from `@promptbook/utils`
@@ -10042,6 +10014,7 @@ async function linguisticHash(input, wordCount, language) {
10042
10014
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
10043
10015
  *
10044
10016
  * @returns string_date branded type
10017
+ *
10045
10018
  * @public exported from `@promptbook/utils`
10046
10019
  */
10047
10020
  function $getCurrentDate() {
@@ -10064,6 +10037,7 @@ function decapitalize(word) {
10064
10037
  *
10065
10038
  * @param {string} input
10066
10039
  * @returns {Set} of keywords without diacritics in lowercase
10040
+ *
10067
10041
  * @public exported from `@promptbook/utils`
10068
10042
  */
10069
10043
  function parseKeywordsFromString(input) {
@@ -10080,6 +10054,7 @@ function parseKeywordsFromString(input) {
10080
10054
  * @param name The string to be converted to a URI-compatible format.
10081
10055
  * @returns A URI-compatible string derived from the input name.
10082
10056
  * @example 'Hello World' -> 'hello-world'
10057
+ *
10083
10058
  * @public exported from `@promptbook/utils`
10084
10059
  */
10085
10060
  function nameToUriPart(name) {
@@ -10098,6 +10073,7 @@ function nameToUriPart(name) {
10098
10073
  * @param name The name to be converted into URI parts.
10099
10074
  * @returns An array of URI-compatible parts derived from the name.
10100
10075
  * @example 'Example Name' -> ['example', 'name']
10076
+ *
10101
10077
  * @public exported from `@promptbook/utils`
10102
10078
  */
10103
10079
  function nameToUriParts(name) {
@@ -10127,6 +10103,7 @@ function normalizeMessageText(text) {
10127
10103
  * @returns
10128
10104
  * @example 'HelloWorld'
10129
10105
  * @example 'ILovePromptbook'
10106
+ *
10130
10107
  * @public exported from `@promptbook/utils`
10131
10108
  */
10132
10109
  function normalizeTo_PascalCase(text) {
@@ -10156,6 +10133,7 @@ function normalizeWhitespaces(sentence) {
10156
10133
  *
10157
10134
  * @param text optionally quoted text
10158
10135
  * @returns text without quotes
10136
+ *
10159
10137
  * @public exported from `@promptbook/utils`
10160
10138
  */
10161
10139
  function removeQuotes(text) {
@@ -10179,6 +10157,7 @@ function removeQuotes(text) {
10179
10157
  *
10180
10158
  * @param text optionally quoted text
10181
10159
  * @returns text without quotes
10160
+ *
10182
10161
  * @public exported from `@promptbook/utils`
10183
10162
  */
10184
10163
  function unwrapResult(text, options) {
@@ -10253,9 +10232,7 @@ function unwrapResult(text, options) {
10253
10232
  return processedText;
10254
10233
  }
10255
10234
  }
10256
- /**
10257
- * TODO: [🧠] Should this also unwrap the (parenthesis)
10258
- */
10235
+ // TODO: [🧠] Should this also unwrap the (parenthesis)
10259
10236
 
10260
10237
  /**
10261
10238
  * Checks if an URL is reserved for private networks or localhost.
@@ -10301,6 +10278,7 @@ function isHostnameOnPrivateNetwork(hostname, options = {}) {
10301
10278
  * @param {string} url - The URL to check.
10302
10279
  * @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
10303
10280
  * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
10281
+ *
10304
10282
  * @public exported from `@promptbook/utils`
10305
10283
  */
10306
10284
  function isUrlOnPrivateNetwork(url, options = {}) {
@@ -10339,9 +10317,7 @@ function isValidAgentUrl(url) {
10339
10317
  */
10340
10318
  return true;
10341
10319
  }
10342
- /**
10343
- * TODO: [🐠] Maybe more info why the URL is invalid
10344
- */
10320
+ // TODO: [🐠] Maybe more info why the URL is invalid
10345
10321
 
10346
10322
  /**
10347
10323
  * Retrieves an intermediate source for a scraper based on the knowledge source.
@@ -10405,13 +10381,11 @@ async function getScraperIntermediateSource(source, options) {
10405
10381
  };
10406
10382
  return fileHandler;
10407
10383
  }
10408
- /**
10409
- * Note: Not using `FileCacheStorage` for two reasons:
10410
- * 1) Need to store more than serialized JSONs
10411
- * 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
10412
- * TODO: [🐱‍🐉][🧠] Make some smart crop
10413
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
10414
- */
10384
+ // 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
10385
+ // Note: Not using `FileCacheStorage` for two reasons:
10386
+ // 1. Need to store more than serialized JSONs.
10387
+ // 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
10388
+ // TODO: [🐱‍🐉][🧠] Make some smart crop
10415
10389
 
10416
10390
  /**
10417
10391
  * Metadata of the scraper
@@ -10438,14 +10412,13 @@ const markdownScraperMetadata = $deepFreeze({
10438
10412
  * @public exported from `@promptbook/cli`
10439
10413
  */
10440
10414
  $scrapersMetadataRegister.register(markdownScraperMetadata);
10441
- /**
10442
- * Note: [💞] Ignore a discrepancy between file name and entity name
10443
- */
10415
+ // Note: [💞] Ignore a discrepancy between file name and entity name
10444
10416
 
10445
10417
  /**
10446
10418
  * Scraper for markdown files
10447
10419
  *
10448
10420
  * @see `documentationUrl` for more details
10421
+ *
10449
10422
  * @public exported from `@promptbook/markdown-utils`
10450
10423
  */
10451
10424
  class MarkdownScraper {
@@ -10578,10 +10551,8 @@ class MarkdownScraper {
10578
10551
  return knowledge;
10579
10552
  }
10580
10553
  }
10581
- /**
10582
- * TODO: [🪂] Do it in parallel 11:11
10583
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
10584
- */
10554
+ // TODO: [🪂] Do it in parallel 11:11
10555
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
10585
10556
 
10586
10557
  /**
10587
10558
  * Metadata of the scraper
@@ -10608,9 +10579,7 @@ const websiteScraperMetadata = $deepFreeze({
10608
10579
  * @public exported from `@promptbook/cli`
10609
10580
  */
10610
10581
  $scrapersMetadataRegister.register(websiteScraperMetadata);
10611
- /**
10612
- * Note: [💞] Ignore a discrepancy between file name and entity name
10613
- */
10582
+ // Note: [💞] Ignore a discrepancy between file name and entity name
10614
10583
 
10615
10584
  /**
10616
10585
  * Create a new showdown converter instance
@@ -10639,6 +10608,7 @@ function createShowdownConverter() {
10639
10608
  * Scraper for websites
10640
10609
  *
10641
10610
  * @see `documentationUrl` for more details
10611
+ *
10642
10612
  * @public exported from `@promptbook/website-crawler`
10643
10613
  */
10644
10614
  class WebsiteScraper {
@@ -10742,12 +10712,10 @@ class WebsiteScraper {
10742
10712
  return knowledge;
10743
10713
  }
10744
10714
  }
10745
- /**
10746
- * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
10747
- * TODO: [🪂] Do it in parallel 11:11
10748
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
10749
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
10750
- */
10715
+ // 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
10716
+ // TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
10717
+ // TODO: [🪂] Do it in parallel 11:11
10718
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
10751
10719
 
10752
10720
  /**
10753
10721
  * Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
@@ -10758,14 +10726,14 @@ class WebsiteScraper {
10758
10726
  * 3. Uses the appropriate scraper to convert to markdown
10759
10727
  * 4. Returns the scraped markdown content
10760
10728
  *
10729
+ * WARNING: This function should NOT be used directly in browser environments.
10730
+ * For browser environments, use fetchUrlContentViaBrowser which proxies through
10731
+ * the Agents Server API endpoint at /api/scrape
10732
+ *
10761
10733
  * @param url The URL to fetch and scrape
10762
10734
  * @returns Markdown content from the URL
10763
10735
  *
10764
10736
  * @private internal utility for USE BROWSER commitment
10765
- *
10766
- * WARNING: This function should NOT be used directly in browser environments.
10767
- * For browser environments, use fetchUrlContentViaBrowser which proxies through
10768
- * the Agents Server API endpoint at /api/scrape
10769
10737
  */
10770
10738
  async function fetchUrlContent(url) {
10771
10739
  try {
@@ -10869,9 +10837,7 @@ async function fetchUrlContent(url) {
10869
10837
  `);
10870
10838
  }
10871
10839
  }
10872
- /**
10873
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
10874
- */
10840
+ // 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
10875
10841
 
10876
10842
  /**
10877
10843
  * Cached implementation of `run_browser` when it can be resolved.
@@ -10889,6 +10855,7 @@ let cachedRunBrowserToolError = null;
10889
10855
  * Attempts to load the server-side `run_browser` tool lazily.
10890
10856
  *
10891
10857
  * @returns Loaded `run_browser` implementation
10858
+ *
10892
10859
  * @private internal utility for USE BROWSER commitment
10893
10860
  */
10894
10861
  function loadRunBrowserToolForNode() {
@@ -11258,9 +11225,7 @@ class ActionCommitmentDefinition extends BaseCommitmentDefinition {
11258
11225
  return this.appendToSystemMessage(requirements, actionSection, '\n\n');
11259
11226
  }
11260
11227
  }
11261
- /**
11262
- * Note: [💞] Ignore a discrepancy between file name and entity name
11263
- */
11228
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11264
11229
 
11265
11230
  /**
11266
11231
  * CLOSED commitment definition
@@ -11326,9 +11291,7 @@ class ClosedCommitmentDefinition extends BaseCommitmentDefinition {
11326
11291
  };
11327
11292
  }
11328
11293
  }
11329
- /**
11330
- * Note: [💞] Ignore a discrepancy between file name and entity name
11331
- */
11294
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11332
11295
 
11333
11296
  /**
11334
11297
  * COMPONENT commitment definition
@@ -11387,9 +11350,7 @@ class ComponentCommitmentDefinition extends BaseCommitmentDefinition {
11387
11350
  return this.appendToSystemMessage(requirements, componentSection, '\n\n');
11388
11351
  }
11389
11352
  }
11390
- /**
11391
- * Note: [💞] Ignore a discrepancy between file name and entity name
11392
- */
11353
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11393
11354
 
11394
11355
  /**
11395
11356
  * DELETE commitment definition
@@ -11511,9 +11472,7 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
11511
11472
  return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
11512
11473
  }
11513
11474
  }
11514
- /**
11515
- * Note: [💞] Ignore a discrepancy between file name and entity name
11516
- */
11475
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11517
11476
 
11518
11477
  /**
11519
11478
  * DICTIONARY commitment definition
@@ -11617,9 +11576,7 @@ class DictionaryCommitmentDefinition extends BaseCommitmentDefinition {
11617
11576
  };
11618
11577
  }
11619
11578
  }
11620
- /**
11621
- * Note: [💞] Ignore a discrepancy between file name and entity name
11622
- */
11579
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11623
11580
 
11624
11581
  /**
11625
11582
  * FORMAT commitment definition
@@ -11698,10 +11655,11 @@ class FormatCommitmentDefinition extends BaseCommitmentDefinition {
11698
11655
  return this.appendToSystemMessage(requirements, formatSection, '\n\n');
11699
11656
  }
11700
11657
  }
11658
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11659
+
11701
11660
  /**
11702
- * Note: [💞] Ignore a discrepancy between file name and entity name
11661
+ * Collection of firstnames.
11703
11662
  */
11704
-
11705
11663
  const FIRSTNAMES = [
11706
11664
  'Paul',
11707
11665
  'George',
@@ -11738,6 +11696,9 @@ const FIRSTNAMES = [
11738
11696
  'Anthony',
11739
11697
  'Christopher',
11740
11698
  ];
11699
+ /**
11700
+ * Collection of lastnames with colors.
11701
+ */
11741
11702
  const LASTNAMES_WITH_COLORS = [
11742
11703
  { lastname: 'Green', color: '#008000' },
11743
11704
  { lastname: 'Brown', color: '#A52A2A' },
@@ -11765,6 +11726,7 @@ function pickDeterministicItem(hash, startIndex, list) {
11765
11726
  *
11766
11727
  * @param seed - Input seed used to derive a stable pseudonym.
11767
11728
  * @returns Deterministic English full name with color metadata.
11729
+ *
11768
11730
  * @private internal helper for deterministic pseudonym generation
11769
11731
  */
11770
11732
  function generateDeterministicEnglishName(seed) {
@@ -11806,6 +11768,9 @@ const VOID_PSEUDO_AGENT_ALIAS_KEYS = ['void', 'null', 'none', 'nil'];
11806
11768
  * Legacy aliases that historically behaved like `FROM VOID`.
11807
11769
  */
11808
11770
  const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
11771
+ /**
11772
+ * Constant for void alias entries.
11773
+ */
11809
11774
  const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
11810
11775
  alias,
11811
11776
  'VOID',
@@ -11854,6 +11819,7 @@ function normalizePseudoReferenceKey(rawReference) {
11854
11819
  *
11855
11820
  * @param rawReference - Raw reference token or payload.
11856
11821
  * @returns Pseudo-agent kind or `null` when the reference is not pseudo.
11822
+ *
11857
11823
  * @private internal utility of pseudo-agent resolution
11858
11824
  */
11859
11825
  function resolvePseudoAgentKindFromReference(rawReference) {
@@ -11868,6 +11834,7 @@ function resolvePseudoAgentKindFromReference(rawReference) {
11868
11834
  *
11869
11835
  * @param agentUrl - URL to inspect.
11870
11836
  * @returns Pseudo-agent kind or `null` when the URL is not pseudo.
11837
+ *
11871
11838
  * @private internal utility of pseudo-agent resolution
11872
11839
  */
11873
11840
  function resolvePseudoAgentKindFromUrl(agentUrl) {
@@ -11888,6 +11855,7 @@ function resolvePseudoAgentKindFromUrl(agentUrl) {
11888
11855
  *
11889
11856
  * @param teamCommitmentContent - TEAM commitment content after reference resolution.
11890
11857
  * @returns Deterministic English full name representing pseudo-user in that TEAM context.
11858
+ *
11891
11859
  * @private internal utility of TEAM commitment rendering
11892
11860
  */
11893
11861
  function createPseudoUserTeammateLabel(teamCommitmentContent) {
@@ -11903,6 +11871,7 @@ function createPseudoUserTeammateLabel(teamCommitmentContent) {
11903
11871
  *
11904
11872
  * @param rawReference - Raw reference content.
11905
11873
  * @returns True when the reference maps to void.
11874
+ *
11906
11875
  * @private internal utility of pseudo-agent resolution
11907
11876
  */
11908
11877
  function isVoidPseudoAgentReference(rawReference) {
@@ -11916,9 +11885,7 @@ function isVoidPseudoAgentReference(rawReference) {
11916
11885
  const normalizedReference = normalizePseudoReferenceKey(rawReference);
11917
11886
  return LEGACY_VOID_ALIASES.has(normalizedReference);
11918
11887
  }
11919
- /**
11920
- * Note: [💞] Ignore a discrepancy between file name and entity name
11921
- */
11888
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11922
11889
 
11923
11890
  /**
11924
11891
  * FROM commitment definition
@@ -11997,9 +11964,7 @@ class FromCommitmentDefinition extends BaseCommitmentDefinition {
11997
11964
  };
11998
11965
  }
11999
11966
  }
12000
- /**
12001
- * Note: [💞] Ignore a discrepancy between file name and entity name
12002
- */
11967
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12003
11968
 
12004
11969
  /**
12005
11970
  * GOAL commitment definition
@@ -12097,9 +12062,7 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
12097
12062
  return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
12098
12063
  }
12099
12064
  }
12100
- /**
12101
- * Note: [💞] Ignore a discrepancy between file name and entity name
12102
- */
12065
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12103
12066
 
12104
12067
  /**
12105
12068
  * IMPORT commitment definition
@@ -12178,19 +12141,26 @@ class ImportCommitmentDefinition extends BaseCommitmentDefinition {
12178
12141
  `));
12179
12142
  }
12180
12143
  }
12144
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12145
+
12181
12146
  /**
12182
- * Note: [💞] Ignore a discrepancy between file name and entity name
12147
+ * Matches URL-like candidates inside arbitrary text.
12148
+ *
12149
+ * @private
12183
12150
  */
12184
-
12185
- /** @private Matches URL-like candidates inside arbitrary text. */
12186
12151
  const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
12187
- /** @private Trims punctuation that commonly trails URLs in prose. */
12152
+ /**
12153
+ * Trims punctuation that commonly trails URLs in prose.
12154
+ *
12155
+ * @private
12156
+ */
12188
12157
  const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
12189
12158
  /**
12190
12159
  * Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
12191
12160
  *
12192
12161
  * @param text - Input text that may contain one or more URLs.
12193
12162
  * @returns Unique URLs in their first-seen order.
12163
+ *
12194
12164
  * @private utility of KNOWLEDGE parsing
12195
12165
  */
12196
12166
  function extractUrlsFromText(text) {
@@ -12220,7 +12190,9 @@ function extractUrlsFromText(text) {
12220
12190
  return urls;
12221
12191
  }
12222
12192
  /**
12223
- * @private Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
12193
+ * Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
12194
+ *
12195
+ * @private
12224
12196
  */
12225
12197
  function normalizeUrlCandidate(candidate) {
12226
12198
  let normalized = candidate.trim();
@@ -12240,7 +12212,9 @@ function normalizeUrlCandidate(candidate) {
12240
12212
  return normalized;
12241
12213
  }
12242
12214
  /**
12243
- * @private Removes trailing closing wrappers when they are unmatched in the candidate.
12215
+ * Removes trailing closing wrappers when they are unmatched in the candidate.
12216
+ *
12217
+ * @private
12244
12218
  */
12245
12219
  function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
12246
12220
  let normalized = candidate;
@@ -12255,7 +12229,9 @@ function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
12255
12229
  return normalized;
12256
12230
  }
12257
12231
  /**
12258
- * @private Counts character occurrences in a string.
12232
+ * Counts character occurrences in a string.
12233
+ *
12234
+ * @private
12259
12235
  */
12260
12236
  function countOccurrences(value, searchedChar) {
12261
12237
  let count = 0;
@@ -12267,14 +12243,28 @@ function countOccurrences(value, searchedChar) {
12267
12243
  return count;
12268
12244
  }
12269
12245
 
12270
- /** @private The default base name for inline knowledge files when the content lacks identifying text */
12246
+ /**
12247
+ * The default base name for inline knowledge files when the content lacks identifying text.
12248
+ *
12249
+ * @private
12250
+ */
12271
12251
  const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
12272
- /** @private The default file extension used for inline knowledge uploads */
12252
+ /**
12253
+ * The default file extension used for inline knowledge uploads.
12254
+ *
12255
+ * @private
12256
+ */
12273
12257
  const INLINE_KNOWLEDGE_EXTENSION = '.txt';
12274
- /** @private Prefix that identifies base64 data URLs */
12258
+ /**
12259
+ * Prefix that identifies base64 data URLs.
12260
+ *
12261
+ * @private
12262
+ */
12275
12263
  const DATA_URL_PREFIX = 'data:';
12276
12264
  /**
12277
- * @private Retrieves the first meaningful line from the inline content.
12265
+ * Retrieves the first meaningful line from the inline content.
12266
+ *
12267
+ * @private
12278
12268
  */
12279
12269
  function getFirstNonEmptyLine(content) {
12280
12270
  const lines = content.split(/\r?\n/);
@@ -12287,7 +12277,9 @@ function getFirstNonEmptyLine(content) {
12287
12277
  return null;
12288
12278
  }
12289
12279
  /**
12290
- * @private Determines the base file name by normalizing the first non-empty line.
12280
+ * Determines the base file name by normalizing the first non-empty line.
12281
+ *
12282
+ * @private
12291
12283
  */
12292
12284
  function deriveBaseFilename(content) {
12293
12285
  const firstLine = getFirstNonEmptyLine(content);
@@ -12298,7 +12290,9 @@ function deriveBaseFilename(content) {
12298
12290
  return normalized || INLINE_KNOWLEDGE_BASE_NAME;
12299
12291
  }
12300
12292
  /**
12301
- * @private Converts inline knowledge into the internal metadata form used for uploads.
12293
+ * Converts inline knowledge into the internal metadata form used for uploads.
12294
+ *
12295
+ * @private
12302
12296
  */
12303
12297
  function createInlineKnowledgeSourceFile(content) {
12304
12298
  const trimmedContent = content.trim();
@@ -12321,7 +12315,9 @@ function isDataUrlKnowledgeSource(source) {
12321
12315
  return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
12322
12316
  }
12323
12317
  /**
12324
- * @private Converts a stored inline knowledge file into a data URL for backwards compatibility.
12318
+ * Converts a stored inline knowledge file into a data URL for backwards compatibility.
12319
+ *
12320
+ * @private
12325
12321
  */
12326
12322
  function inlineKnowledgeSourceToDataUrl(source) {
12327
12323
  const base64 = source.buffer.toString('base64');
@@ -12381,9 +12377,7 @@ function parseDataUrlKnowledgeSource(source) {
12381
12377
  return null;
12382
12378
  }
12383
12379
  }
12384
- /**
12385
- * Note: [💞] Ignore a discrepancy between file name and entity name
12386
- */
12380
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12387
12381
 
12388
12382
  /**
12389
12383
  * KNOWLEDGE commitment definition
@@ -12587,9 +12581,7 @@ class LanguageCommitmentDefinition extends BaseCommitmentDefinition {
12587
12581
  return this.appendToSystemMessage(requirements, languageSection, '\n\n');
12588
12582
  }
12589
12583
  }
12590
- /**
12591
- * Note: [💞] Ignore a discrepancy between file name and entity name
12592
- */
12584
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12593
12585
 
12594
12586
  /**
12595
12587
  * @@@
@@ -12855,6 +12847,7 @@ function serializeToolRuntimeContext(context) {
12855
12847
  *
12856
12848
  * @param listener - Listener notified about tool progress.
12857
12849
  * @returns Hidden token used to route progress updates.
12850
+ *
12858
12851
  * @private internal runtime wiring for commitment tools
12859
12852
  */
12860
12853
  function registerToolCallProgressListener(listener) {
@@ -12867,14 +12860,13 @@ function registerToolCallProgressListener(listener) {
12867
12860
  * Unregisters one in-memory progress listener.
12868
12861
  *
12869
12862
  * @param token - Token previously created by `registerToolCallProgressListener`.
12863
+ *
12870
12864
  * @private internal runtime wiring for commitment tools
12871
12865
  */
12872
12866
  function unregisterToolCallProgressListener(token) {
12873
12867
  toolCallProgressListeners.delete(token);
12874
12868
  }
12875
- /**
12876
- * Note: [💞] Ignore a discrepancy between file name and entity name
12877
- */
12869
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12878
12870
 
12879
12871
  /**
12880
12872
  * Resolves runtime context from hidden tool arguments.
@@ -13235,9 +13227,7 @@ class MemoryCommitmentDefinition extends BaseCommitmentDefinition {
13235
13227
  return createMemoryToolFunctions();
13236
13228
  }
13237
13229
  }
13238
- /**
13239
- * Note: [💞] Ignore a discrepancy between file name and entity name
13240
- */
13230
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13241
13231
 
13242
13232
  /**
13243
13233
  * AGENT MESSAGE commitment definition
@@ -13567,9 +13557,7 @@ class MessageCommitmentDefinition extends BaseCommitmentDefinition {
13567
13557
  return this.appendToSystemMessage(requirements, messageSection, '\n\n');
13568
13558
  }
13569
13559
  }
13570
- /**
13571
- * Note: [💞] Ignore a discrepancy between file name and entity name
13572
- */
13560
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13573
13561
 
13574
13562
  /**
13575
13563
  * USER MESSAGE commitment definition
@@ -13700,9 +13688,7 @@ class MessageSuffixCommitmentDefinition extends BaseCommitmentDefinition {
13700
13688
  return requirements;
13701
13689
  }
13702
13690
  }
13703
- /**
13704
- * Note: [💞] Ignore a discrepancy between file name and entity name
13705
- */
13691
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13706
13692
 
13707
13693
  /**
13708
13694
  * META commitment definition
@@ -13849,9 +13835,7 @@ class MetaCommitmentDefinition extends BaseCommitmentDefinition {
13849
13835
  return knownTypes.includes(metaType.toUpperCase());
13850
13836
  }
13851
13837
  }
13852
- /**
13853
- * Note: [💞] Ignore a discrepancy between file name and entity name
13854
- */
13838
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13855
13839
 
13856
13840
  /**
13857
13841
  * META COLOR commitment definition
@@ -13947,9 +13931,7 @@ class MetaColorCommitmentDefinition extends BaseCommitmentDefinition {
13947
13931
  return trimmedContent || null;
13948
13932
  }
13949
13933
  }
13950
- /**
13951
- * Note: [💞] Ignore a discrepancy between file name and entity name
13952
- */
13934
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13953
13935
 
13954
13936
  /**
13955
13937
  * META DOMAIN commitment definition
@@ -14014,9 +13996,7 @@ class MetaDomainCommitmentDefinition extends BaseCommitmentDefinition {
14014
13996
  return trimmedContent || null;
14015
13997
  }
14016
13998
  }
14017
- /**
14018
- * Note: [💞] Ignore a discrepancy between file name and entity name
14019
- */
13999
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14020
14000
 
14021
14001
  /**
14022
14002
  * META DISCLAIMER commitment definition
@@ -14084,9 +14064,7 @@ class MetaDisclaimerCommitmentDefinition extends BaseCommitmentDefinition {
14084
14064
  return requirements;
14085
14065
  }
14086
14066
  }
14087
- /**
14088
- * Note: [💞] Ignore a discrepancy between file name and entity name
14089
- */
14067
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14090
14068
 
14091
14069
  /**
14092
14070
  * META FONT commitment definition
@@ -14169,9 +14147,7 @@ class MetaFontCommitmentDefinition extends BaseCommitmentDefinition {
14169
14147
  return trimmedContent || null;
14170
14148
  }
14171
14149
  }
14172
- /**
14173
- * Note: [💞] Ignore a discrepancy between file name and entity name
14174
- */
14150
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14175
14151
 
14176
14152
  /**
14177
14153
  * META IMAGE commitment definition
@@ -14256,9 +14232,7 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
14256
14232
  return trimmedContent || null;
14257
14233
  }
14258
14234
  }
14259
- /**
14260
- * Note: [💞] Ignore a discrepancy between file name and entity name
14261
- */
14235
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14262
14236
 
14263
14237
  /**
14264
14238
  * META INPUT PLACEHOLDER commitment definition.
@@ -14321,9 +14295,7 @@ class MetaInputPlaceholderCommitmentDefinition extends BaseCommitmentDefinition
14321
14295
  return trimmedContent || null;
14322
14296
  }
14323
14297
  }
14324
- /**
14325
- * Note: [💞] Ignore a discrepancy between file name and entity name
14326
- */
14298
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14327
14299
 
14328
14300
  /**
14329
14301
  * META LINK commitment definition
@@ -14430,9 +14402,7 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
14430
14402
  }
14431
14403
  }
14432
14404
  }
14433
- /**
14434
- * Note: [💞] Ignore a discrepancy between file name and entity name
14435
- */
14405
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14436
14406
 
14437
14407
  /**
14438
14408
  * META VOICE commitment definition
@@ -14501,9 +14471,7 @@ class MetaVoiceCommitmentDefinition extends BaseCommitmentDefinition {
14501
14471
  return trimmedContent || null;
14502
14472
  }
14503
14473
  }
14504
- /**
14505
- * Note: [💞] Ignore a discrepancy between file name and entity name
14506
- */
14474
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14507
14475
 
14508
14476
  /**
14509
14477
  * MODEL commitment definition
@@ -14741,9 +14709,7 @@ class ModelCommitmentDefinition extends BaseCommitmentDefinition {
14741
14709
  return result;
14742
14710
  }
14743
14711
  }
14744
- /**
14745
- * Note: [💞] Ignore a discrepancy between file name and entity name
14746
- */
14712
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14747
14713
 
14748
14714
  /**
14749
14715
  * NOTE commitment definition
@@ -14905,9 +14871,7 @@ class OpenCommitmentDefinition extends BaseCommitmentDefinition {
14905
14871
  };
14906
14872
  }
14907
14873
  }
14908
- /**
14909
- * Note: [💞] Ignore a discrepancy between file name and entity name
14910
- */
14874
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14911
14875
 
14912
14876
  /**
14913
14877
  * PERSONA commitment definition
@@ -15046,9 +15010,7 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
15046
15010
  };
15047
15011
  }
15048
15012
  }
15049
- /**
15050
- * Note: [💞] Ignore a discrepancy between file name and entity name
15051
- */
15013
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15052
15014
 
15053
15015
  /**
15054
15016
  * RULE commitment definition
@@ -15129,15 +15091,14 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
15129
15091
  return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
15130
15092
  }
15131
15093
  }
15132
- /**
15133
- * Note: [💞] Ignore a discrepancy between file name and entity name
15134
- */
15094
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15135
15095
 
15136
15096
  /**
15137
15097
  * Creates the canonical system-message body for one writing-sample commitment.
15138
15098
  *
15139
15099
  * @param content - Explicit 1:1 sample text.
15140
15100
  * @returns Writing-sample guidance ready for one system-message section.
15101
+ *
15141
15102
  * @private internal utility of writing commitments
15142
15103
  */
15143
15104
  function createWritingSampleSection(content) {
@@ -15155,6 +15116,7 @@ function createWritingSampleSection(content) {
15155
15116
  *
15156
15117
  * @param content - Writing-only instructions.
15157
15118
  * @returns Writing-rules guidance ready for one system-message section.
15119
+ *
15158
15120
  * @private internal utility of writing commitments
15159
15121
  */
15160
15122
  function createWritingRulesSection(content) {
@@ -15167,9 +15129,7 @@ function createWritingRulesSection(content) {
15167
15129
  ${content}
15168
15130
  `);
15169
15131
  }
15170
- /**
15171
- * Note: [💞] Ignore a discrepancy between file name and entity name
15172
- */
15132
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15173
15133
 
15174
15134
  /**
15175
15135
  * Legacy `SAMPLE` / `EXAMPLE` commitment definition.
@@ -15248,9 +15208,7 @@ class SampleCommitmentDefinition extends BaseCommitmentDefinition {
15248
15208
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
15249
15209
  }
15250
15210
  }
15251
- /**
15252
- * Note: [💞] Ignore a discrepancy between file name and entity name
15253
- */
15211
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15254
15212
 
15255
15213
  /**
15256
15214
  * SCENARIO commitment definition
@@ -15372,9 +15330,7 @@ class ScenarioCommitmentDefinition extends BaseCommitmentDefinition {
15372
15330
  return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
15373
15331
  }
15374
15332
  }
15375
- /**
15376
- * Note: [💞] Ignore a discrepancy between file name and entity name
15377
- */
15333
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15378
15334
 
15379
15335
  /**
15380
15336
  * STYLE commitment definition
@@ -15471,6 +15427,7 @@ const TEAM_TOOL_FALLBACK_NAME = 'teammate';
15471
15427
  *
15472
15428
  * @param teammateLabel - Human-readable teammate label.
15473
15429
  * @returns Normalized teammate identifier for TEAM tool names.
15430
+ *
15474
15431
  * @private internal helper of TEAM tool-name generation
15475
15432
  */
15476
15433
  function normalizeTeammateToolNamePart(teammateLabel) {
@@ -15486,6 +15443,7 @@ function normalizeTeammateToolNamePart(teammateLabel) {
15486
15443
  * @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
15487
15444
  * @param teammateLabel - Human-readable teammate label used as the basis for the name.
15488
15445
  * @returns TEAM tool name derived from the label.
15446
+ *
15489
15447
  * @private internal utility of TEAM commitments and chat UI mapping
15490
15448
  */
15491
15449
  function createTeamToolName(_teammateUrl, teammateLabel) {
@@ -15493,9 +15451,21 @@ function createTeamToolName(_teammateUrl, teammateLabel) {
15493
15451
  return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
15494
15452
  }
15495
15453
 
15454
+ /**
15455
+ * Pattern matching agent URLs inside TEAM commitment content.
15456
+ */
15496
15457
  const urlRegex = /https?:\/\/[^\s]+/gi;
15458
+ /**
15459
+ * Pattern matching punctuation that often trails teammate URLs in prose.
15460
+ */
15497
15461
  const trailingPunctuationRegex = /[),.;!?]+$/;
15462
+ /**
15463
+ * Clause separators used while splitting TEAM instruction context.
15464
+ */
15498
15465
  const clauseSeparators = ['.', '?', '!', ';', ','];
15466
+ /**
15467
+ * Conjunction separators used while splitting TEAM instruction context.
15468
+ */
15499
15469
  const conjunctionSeparators = [' and ', ' or '];
15500
15470
  /**
15501
15471
  * Parses TEAM commitment content into teammates with instructions.
@@ -15543,6 +15513,9 @@ function parseTeamCommitmentContent(content, options = {}) {
15543
15513
  }
15544
15514
  return teammates;
15545
15515
  }
15516
+ /**
15517
+ * Extracts the instruction fragment associated with one teammate URL.
15518
+ */
15546
15519
  function extractInstructionContext(line, matches, matchIndex) {
15547
15520
  var _a;
15548
15521
  const match = matches[matchIndex];
@@ -15568,6 +15541,9 @@ function extractInstructionContext(line, matches, matchIndex) {
15568
15541
  }
15569
15542
  return `${prefix} ${suffix}`.trim();
15570
15543
  }
15544
+ /**
15545
+ * Trims content after the last detected clause delimiter.
15546
+ */
15571
15547
  function trimAfterLastDelimiter(text) {
15572
15548
  const match = findLastDelimiter(text);
15573
15549
  if (!match) {
@@ -15575,6 +15551,9 @@ function trimAfterLastDelimiter(text) {
15575
15551
  }
15576
15552
  return text.slice(match.index + match.length);
15577
15553
  }
15554
+ /**
15555
+ * Trims content before the last detected clause delimiter.
15556
+ */
15578
15557
  function trimBeforeLastDelimiter(text) {
15579
15558
  const cleaned = text.replace(/^[,;:]\s*/g, '');
15580
15559
  const match = findLastDelimiter(cleaned);
@@ -15583,6 +15562,9 @@ function trimBeforeLastDelimiter(text) {
15583
15562
  }
15584
15563
  return cleaned.slice(0, match.index);
15585
15564
  }
15565
+ /**
15566
+ * Finds the last clause or conjunction delimiter in a string.
15567
+ */
15586
15568
  function findLastDelimiter(text) {
15587
15569
  let bestIndex = -1;
15588
15570
  let bestLength = 0;
@@ -15606,6 +15588,9 @@ function findLastDelimiter(text) {
15606
15588
  }
15607
15589
  return { index: bestIndex, length: bestLength };
15608
15590
  }
15591
+ /**
15592
+ * Normalizes teammate instruction text after URL extraction.
15593
+ */
15609
15594
  function normalizeInstructionText(text) {
15610
15595
  if (!text) {
15611
15596
  return '';
@@ -15619,6 +15604,9 @@ function normalizeInstructionText(text) {
15619
15604
  normalized = normalizeWhitespaces(normalized).trim();
15620
15605
  return normalized;
15621
15606
  }
15607
+ /**
15608
+ * Creates a readable teammate label from an agent URL.
15609
+ */
15622
15610
  function createTeammateLabel(url) {
15623
15611
  try {
15624
15612
  const parsed = new URL(url);
@@ -15638,12 +15626,19 @@ function createTeammateLabel(url) {
15638
15626
  return url;
15639
15627
  }
15640
15628
  }
15629
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15630
+
15641
15631
  /**
15642
- * Note: [💞] Ignore a discrepancy between file name and entity name
15632
+ * Map of team tool functions.
15643
15633
  */
15644
-
15645
15634
  const teamToolFunctions = {};
15635
+ /**
15636
+ * Map of team tool titles.
15637
+ */
15646
15638
  const teamToolTitles = {};
15639
+ /**
15640
+ * Constant for remote agents by Url.
15641
+ */
15647
15642
  const remoteAgentsByUrl = new Map();
15648
15643
  /**
15649
15644
  * TEAM commitment definition
@@ -16007,9 +16002,7 @@ function createTeamToolFunction(entry) {
16007
16002
  return JSON.stringify(result);
16008
16003
  };
16009
16004
  }
16010
- /**
16011
- * Note: [💞] Ignore a discrepancy between file name and entity name
16012
- */
16005
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16013
16006
 
16014
16007
  /**
16015
16008
  * TEMPLATE commitment definition
@@ -16130,9 +16123,7 @@ class TemplateCommitmentDefinition extends BaseCommitmentDefinition {
16130
16123
  };
16131
16124
  }
16132
16125
  }
16133
- /**
16134
- * Note: [💞] Ignore a discrepancy between file name and entity name
16135
- */
16126
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16136
16127
 
16137
16128
  /**
16138
16129
  * USE commitment definition
@@ -16244,9 +16235,7 @@ class UseCommitmentDefinition extends BaseCommitmentDefinition {
16244
16235
  return knownTypes.includes(useType.toUpperCase());
16245
16236
  }
16246
16237
  }
16247
- /**
16248
- * Note: [💞] Ignore a discrepancy between file name and entity name
16249
- */
16238
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16250
16239
 
16251
16240
  /**
16252
16241
  * All `USE` commitment types currently participating in final system-message aggregation.
@@ -16269,6 +16258,7 @@ const AGGREGATED_USE_COMMITMENT_PLACEHOLDER_PREFIX = '# AGGREGATED USE COMMITMEN
16269
16258
  *
16270
16259
  * @param type - Commitment type to check.
16271
16260
  * @returns `true` when the commitment participates in `USE` system-message aggregation.
16261
+ *
16272
16262
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
16273
16263
  */
16274
16264
  function isAggregatedUseCommitmentType(type) {
@@ -16279,6 +16269,7 @@ function isAggregatedUseCommitmentType(type) {
16279
16269
  *
16280
16270
  * @param type - Aggregated `USE` commitment type.
16281
16271
  * @returns Single-line placeholder comment stored in the interim system message.
16272
+ *
16282
16273
  * @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
16283
16274
  */
16284
16275
  function getAggregatedUseCommitmentPlaceholder(type) {
@@ -16289,6 +16280,7 @@ function getAggregatedUseCommitmentPlaceholder(type) {
16289
16280
  *
16290
16281
  * @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
16291
16282
  * @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
16283
+ *
16292
16284
  * @private internal utility of `createAggregatedUseCommitmentSystemMessage`
16293
16285
  */
16294
16286
  function combineAdditionalInstructions(additionalInstructions) {
@@ -16300,6 +16292,7 @@ function combineAdditionalInstructions(additionalInstructions) {
16300
16292
  * @param type - Aggregated `USE` commitment type.
16301
16293
  * @param additionalInstructions - Distinct additional instructions in source order.
16302
16294
  * @returns Final system-message block for the commitment type.
16295
+ *
16303
16296
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
16304
16297
  */
16305
16298
  function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
@@ -16338,6 +16331,7 @@ function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions
16338
16331
  * @param requirements - Current model requirements.
16339
16332
  * @param type - Aggregated `USE` commitment type being applied.
16340
16333
  * @returns Requirements with the placeholder inserted when it was not already present.
16334
+ *
16341
16335
  * @private internal utility of `USE` commitments
16342
16336
  */
16343
16337
  function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
@@ -16361,6 +16355,7 @@ function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
16361
16355
  * @param requirements - Model requirements produced by commitment-by-commitment application.
16362
16356
  * @param commitments - Filtered commitments in their original source order.
16363
16357
  * @returns Requirements with aggregated `USE` system-message sections.
16358
+ *
16364
16359
  * @private internal utility of `createAgentModelRequirementsWithCommitments`
16365
16360
  */
16366
16361
  function aggregateUseCommitmentSystemMessages(requirements, commitments) {
@@ -16653,9 +16648,7 @@ class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition {
16653
16648
  };
16654
16649
  }
16655
16650
  }
16656
- /**
16657
- * Note: [💞] Ignore a discrepancy between file name and entity name
16658
- */
16651
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16659
16652
 
16660
16653
  /**
16661
16654
  * Base Google Calendar API URL.
@@ -16926,9 +16919,7 @@ function removeTokenFromLine(line, token) {
16926
16919
  const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
16927
16920
  return filteredTokens.join(' ').trim();
16928
16921
  }
16929
- /**
16930
- * Note: [💞] Ignore a discrepancy between file name and entity name
16931
- */
16922
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16932
16923
 
16933
16924
  /**
16934
16925
  * Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
@@ -17879,9 +17870,7 @@ function addConfiguredCalendarIfMissing(configuredCalendars, calendarReference)
17879
17870
  ...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
17880
17871
  });
17881
17872
  }
17882
- /**
17883
- * Note: [💞] Ignore a discrepancy between file name and entity name
17884
- */
17873
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17885
17874
 
17886
17875
  /**
17887
17876
  * Lightweight email token matcher used for `USE EMAIL` first-line parsing.
@@ -18147,9 +18136,7 @@ function addUseEmailTools(existingTools) {
18147
18136
  },
18148
18137
  ];
18149
18138
  }
18150
- /**
18151
- * Note: [💞] Ignore a discrepancy between file name and entity name
18152
- */
18139
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18153
18140
 
18154
18141
  /**
18155
18142
  * USE IMAGE GENERATOR commitment definition
@@ -18240,9 +18227,7 @@ class UseImageGeneratorCommitmentDefinition extends BaseCommitmentDefinition {
18240
18227
  `));
18241
18228
  }
18242
18229
  }
18243
- /**
18244
- * Note: [💞] Ignore a discrepancy between file name and entity name
18245
- */
18230
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18246
18231
 
18247
18232
  /**
18248
18233
  * USE MCP commitment definition
@@ -18317,9 +18302,7 @@ class UseMcpCommitmentDefinition extends BaseCommitmentDefinition {
18317
18302
  };
18318
18303
  }
18319
18304
  }
18320
- /**
18321
- * Note: [💞] Ignore a discrepancy between file name and entity name
18322
- */
18305
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18323
18306
 
18324
18307
  /**
18325
18308
  * USE POPUP commitment definition
@@ -18455,9 +18438,7 @@ class UsePopupCommitmentDefinition extends BaseCommitmentDefinition {
18455
18438
  };
18456
18439
  }
18457
18440
  }
18458
- /**
18459
- * Note: [💞] Ignore a discrepancy between file name and entity name
18460
- */
18441
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18461
18442
 
18462
18443
  /**
18463
18444
  * Tool name used by the USE PRIVACY commitment.
@@ -18629,9 +18610,7 @@ class UsePrivacyCommitmentDefinition extends BaseCommitmentDefinition {
18629
18610
  };
18630
18611
  }
18631
18612
  }
18632
- /**
18633
- * Note: [💞] Ignore a discrepancy between file name and entity name
18634
- */
18613
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18635
18614
 
18636
18615
  /* eslint-disable no-magic-numbers */
18637
18616
  /**
@@ -19419,9 +19398,7 @@ function createGitHubRepositoryReference(owner, repository, defaultBranch) {
19419
19398
  defaultBranch,
19420
19399
  };
19421
19400
  }
19422
- /**
19423
- * Note: [💞] Ignore a discrepancy between file name and entity name
19424
- */
19401
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19425
19402
 
19426
19403
  /**
19427
19404
  * Wallet metadata used by USE PROJECT when resolving GitHub credentials.
@@ -20280,9 +20257,7 @@ function addConfiguredProjectIfMissing(configuredProjects, repositoryReference)
20280
20257
  defaultBranch: repositoryReference.defaultBranch,
20281
20258
  });
20282
20259
  }
20283
- /**
20284
- * Note: [💞] Ignore a discrepancy between file name and entity name
20285
- */
20260
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20286
20261
 
20287
20262
  /**
20288
20263
  * A search engine implementation that uses the SerpApi to fetch Google search results.
@@ -20493,9 +20468,7 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
20493
20468
  };
20494
20469
  }
20495
20470
  }
20496
- /**
20497
- * Note: [💞] Ignore a discrepancy between file name and entity name
20498
- */
20471
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20499
20472
 
20500
20473
  /**
20501
20474
  * Maximum allowed source length for create-agent payloads.
@@ -20692,9 +20665,7 @@ class UseSpawnCommitmentDefinition extends BaseCommitmentDefinition {
20692
20665
  };
20693
20666
  }
20694
20667
  }
20695
- /**
20696
- * Note: [💞] Ignore a discrepancy between file name and entity name
20697
- */
20668
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20698
20669
 
20699
20670
  /**
20700
20671
  * Creates system-message instructions for `USE TIMEOUT`.
@@ -20759,9 +20730,7 @@ function parseToolExecutionEnvelope(rawValue) {
20759
20730
  return null;
20760
20731
  }
20761
20732
  }
20762
- /**
20763
- * Note: [💞] Ignore a discrepancy between file name and entity name
20764
- */
20733
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20765
20734
 
20766
20735
  /**
20767
20736
  * Builds a disabled timeout-tool payload.
@@ -21495,9 +21464,7 @@ class UseTimeoutCommitmentDefinition extends BaseCommitmentDefinition {
21495
21464
  return createTimeoutToolFunctions();
21496
21465
  }
21497
21466
  }
21498
- /**
21499
- * Note: [💞] Ignore a discrepancy between file name and entity name
21500
- */
21467
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21501
21468
 
21502
21469
  /**
21503
21470
  * USE TIME commitment definition
@@ -21644,9 +21611,7 @@ class UseTimeCommitmentDefinition extends BaseCommitmentDefinition {
21644
21611
  };
21645
21612
  }
21646
21613
  }
21647
- /**
21648
- * Note: [💞] Ignore a discrepancy between file name and entity name
21649
- */
21614
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21650
21615
 
21651
21616
  /**
21652
21617
  * Tool name used by the USE USER LOCATION commitment.
@@ -21859,9 +21824,7 @@ class UseUserLocationCommitmentDefinition extends BaseCommitmentDefinition {
21859
21824
  };
21860
21825
  }
21861
21826
  }
21862
- /**
21863
- * Note: [💞] Ignore a discrepancy between file name and entity name
21864
- */
21827
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21865
21828
 
21866
21829
  /**
21867
21830
  * `WRITING RULES` commitment definition.
@@ -21937,9 +21900,7 @@ class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
21937
21900
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
21938
21901
  }
21939
21902
  }
21940
- /**
21941
- * Note: [💞] Ignore a discrepancy between file name and entity name
21942
- */
21903
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21943
21904
 
21944
21905
  /**
21945
21906
  * `WRITING SAMPLE` commitment definition.
@@ -22009,9 +21970,7 @@ class WritingSampleCommitmentDefinition extends BaseCommitmentDefinition {
22009
21970
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
22010
21971
  }
22011
21972
  }
22012
- /**
22013
- * Note: [💞] Ignore a discrepancy between file name and entity name
22014
- */
21973
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22015
21974
 
22016
21975
  /**
22017
21976
  * Placeholder commitment definition for commitments that are not yet implemented
@@ -22173,13 +22132,12 @@ const COMMITMENT_REGISTRY = [
22173
22132
  new NotYetImplementedCommitmentDefinition('CONTEXT'),
22174
22133
  // <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
22175
22134
  ];
22176
- /**
22177
- * TODO: [🧠] Maybe create through standardized $register
22178
- * Note: [💞] Ignore a discrepancy between file name and entity name
22179
- */
22135
+ // TODO: [🧠] Maybe create through standardized $register
22136
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22180
22137
 
22181
22138
  /**
22182
22139
  * Gets all available commitment definitions
22140
+ *
22183
22141
  * @returns Array of all commitment definitions
22184
22142
  *
22185
22143
  * @public exported from `@promptbook/core`
@@ -22192,6 +22150,7 @@ function getAllCommitmentDefinitions() {
22192
22150
  * Collects tool functions from all commitment definitions.
22193
22151
  *
22194
22152
  * @returns Map of tool function implementations.
22153
+ *
22195
22154
  * @private internal helper for commitment tool registry
22196
22155
  */
22197
22156
  function collectCommitmentToolFunctions() {
@@ -22213,6 +22172,7 @@ function collectCommitmentToolFunctions() {
22213
22172
  *
22214
22173
  * @param getFunctions - Provider of current tool functions.
22215
22174
  * @returns Proxy exposing tool functions as properties.
22175
+ *
22216
22176
  * @private internal helper for commitment tool registry
22217
22177
  */
22218
22178
  function createToolFunctionsProxy(getFunctions) {
@@ -22250,10 +22210,11 @@ function createToolFunctionsProxy(getFunctions) {
22250
22210
  },
22251
22211
  });
22252
22212
  }
22213
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22214
+
22253
22215
  /**
22254
- * Note: [💞] Ignore a discrepancy between file name and entity name
22216
+ * Map of node tool functions.
22255
22217
  */
22256
-
22257
22218
  const nodeToolFunctions = {
22258
22219
  /**
22259
22220
  * @@@
@@ -22285,6 +22246,9 @@ const nodeToolFunctions = {
22285
22246
  spawn_agent: resolveSpawnAgentToolForNode(),
22286
22247
  // TODO: !!!! Unhardcode, make proper server function register from definitions
22287
22248
  };
22249
+ /**
22250
+ * Constant for node tool functions proxy.
22251
+ */
22288
22252
  const nodeToolFunctionsProxy = createToolFunctionsProxy(() => ({
22289
22253
  ...collectCommitmentToolFunctions(),
22290
22254
  ...nodeToolFunctions,
@@ -22308,10 +22272,8 @@ function getAllCommitmentsToolFunctionsForNode() {
22308
22272
  }
22309
22273
  return nodeToolFunctionsProxy;
22310
22274
  }
22311
- /**
22312
- * Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
22313
- * TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
22314
- */
22275
+ // Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
22276
+ // TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
22315
22277
 
22316
22278
  /**
22317
22279
  * Extracts exactly ONE code block from markdown.
@@ -22326,8 +22288,9 @@ function getAllCommitmentsToolFunctionsForNode() {
22326
22288
  *
22327
22289
  * @param markdown any valid markdown
22328
22290
  * @returns code block with language and content
22329
- * @public exported from `@promptbook/markdown-utils`
22330
22291
  * @throws {ParseError} if there is not exactly one code block in the markdown
22292
+ *
22293
+ * @public exported from `@promptbook/markdown-utils`
22331
22294
  */
22332
22295
  function extractOneBlockFromMarkdown(markdown) {
22333
22296
  const codeBlocks = extractAllBlocksFromMarkdown(markdown);
@@ -22340,9 +22303,7 @@ function extractOneBlockFromMarkdown(markdown) {
22340
22303
  }
22341
22304
  return codeBlocks[0];
22342
22305
  }
22343
- /***
22344
- * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
22345
- */
22306
+ // TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
22346
22307
 
22347
22308
  /**
22348
22309
  * Extracts code block from markdown.
@@ -22355,8 +22316,9 @@ function extractOneBlockFromMarkdown(markdown) {
22355
22316
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
22356
22317
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
22357
22318
  *
22358
- * @public exported from `@promptbook/markdown-utils`
22359
22319
  * @throws {ParseError} if there is not exactly one code block in the markdown
22320
+ *
22321
+ * @public exported from `@promptbook/markdown-utils`
22360
22322
  */
22361
22323
  function extractBlock(markdown) {
22362
22324
  const { content } = extractOneBlockFromMarkdown(markdown);
@@ -22368,7 +22330,7 @@ function extractBlock(markdown) {
22368
22330
  *
22369
22331
  * Note: [🔂] This function is idempotent.
22370
22332
  * Note: This is useful for post-processing of the result of the chat LLM model
22371
- * when the model wraps the result in the (markdown) code block.
22333
+ * when the model wraps the result in the (markdown) code block.
22372
22334
  *
22373
22335
  * @public exported from `@promptbook/markdown-utils`
22374
22336
  */
@@ -22387,7 +22349,7 @@ function trimCodeBlock(value) {
22387
22349
  * Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
22388
22350
  *
22389
22351
  * Note: This is useful for post-processing of the result of the completion LLM model
22390
- * if you want to start code block in the prompt but you don't want to end it in the result.
22352
+ * if you want to start code block in the prompt but you don't want to end it in the result.
22391
22353
  *
22392
22354
  * @public exported from `@promptbook/markdown-utils`
22393
22355
  */
@@ -22399,6 +22361,8 @@ function trimEndOfCodeBlock(value) {
22399
22361
  }
22400
22362
 
22401
22363
  /**
22364
+ * Collection of preserved.
22365
+ *
22402
22366
  * @private internal for `preserve`
22403
22367
  */
22404
22368
  const _preserved = [];
@@ -22408,21 +22372,20 @@ const _preserved = [];
22408
22372
  *
22409
22373
  * @param value any function to preserve
22410
22374
  * @returns nothing
22375
+ *
22411
22376
  * @private within the repository
22412
22377
  */
22413
22378
  function $preserve(...value) {
22414
22379
  _preserved.push(...value);
22415
22380
  }
22416
- /**
22417
- * Note: [💞] Ignore a discrepancy between file name and entity name
22418
- */
22381
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22419
22382
 
22420
22383
  // Note: [💎]
22421
22384
  /**
22422
22385
  * ScriptExecutionTools for JavaScript implemented via eval
22423
22386
  *
22424
22387
  * Warning: It is used for testing and mocking
22425
- * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
22388
+ * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
22426
22389
  *
22427
22390
  * @public exported from `@promptbook/javascript`
22428
22391
  */
@@ -22617,15 +22580,14 @@ class JavascriptEvalExecutionTools {
22617
22580
  return result;
22618
22581
  }
22619
22582
  }
22620
- /**
22621
- * TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
22622
- * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
22623
- */
22583
+ // TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
22584
+ // TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
22624
22585
 
22625
22586
  /**
22626
22587
  * Placeholder for better implementation of JavascriptExecutionTools - some proper sandboxing
22627
22588
  *
22628
22589
  * @alias JavascriptExecutionTools
22590
+ *
22629
22591
  * @public exported from `@promptbook/javascript`
22630
22592
  */
22631
22593
  const JavascriptExecutionTools = JavascriptEvalExecutionTools;
@@ -22642,15 +22604,15 @@ async function $provideScriptingForNode(options) {
22642
22604
  // TODO: [🔱] Do here auto-installation
22643
22605
  return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
22644
22606
  }
22645
- /**
22646
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
22647
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
22648
- */
22607
+ // 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
22608
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
22649
22609
 
22650
22610
  // TODO: [🥺] List running services from REMOTE_SERVER_URLS
22651
22611
  // TODO: [🥺] Import directly from YML
22652
22612
  /**
22653
- * @private [🥺] Decide how to expose this
22613
+ * [🥺] Decide how to expose this.
22614
+ *
22615
+ * @private
22654
22616
  */
22655
22617
  const openapiJson = {
22656
22618
  openapi: '3.0.0',
@@ -23241,23 +23203,36 @@ const openapiJson = {
23241
23203
  },
23242
23204
  ],
23243
23205
  };
23206
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23207
+
23244
23208
  /**
23245
- * Note: [💞] Ignore a discrepancy between file name and entity name
23209
+ * Constant for h.
23246
23210
  */
23247
-
23248
23211
  const h = createElement;
23212
+ /**
23213
+ * Handles key val.
23214
+ */
23249
23215
  function KeyVal(props) {
23250
23216
  return h('div', { className: 'flex items-start gap-2' }, h('div', { className: 'font-semibold min-w-[14rem]' }, props.label), h('div', { className: 'text-gray-800' }, props.value));
23251
23217
  }
23218
+ /**
23219
+ * Handles list.
23220
+ */
23252
23221
  function List(props) {
23253
23222
  var _a;
23254
23223
  if (!((_a = props.items) === null || _a === void 0 ? void 0 : _a.length))
23255
23224
  return h('span', { className: 'text-gray-500' }, 'none');
23256
23225
  return h('ul', { className: 'list-disc ml-6' }, ...props.items.map((item, i) => h('li', { key: String(i), className: 'break-all' }, item)));
23257
23226
  }
23227
+ /**
23228
+ * Handles section.
23229
+ */
23258
23230
  function Section(props) {
23259
23231
  return h('section', { className: 'mt-8' }, h('h2', { className: 'text-xl font-semibold mb-2' }, props.title), props.children);
23260
23232
  }
23233
+ /**
23234
+ * Handles server body.
23235
+ */
23261
23236
  function ServerBody({ info }) {
23262
23237
  var _a;
23263
23238
  return h('div', { className: 'max-w-4xl mx-auto p-6' }, h('h1', { className: 'text-3xl font-bold mb-4' }, 'Promptbook Server'), h('div', { className: 'space-y-2' }, h(KeyVal, { label: 'Book language version:', value: info.bookLanguageVersion }), h(KeyVal, { label: 'Promptbook engine version:', value: info.promptbookEngineVersion }), h(KeyVal, { label: 'Node.js version:', value: info.nodeVersion }), h(KeyVal, { label: 'Server port:', value: String((_a = info.port) !== null && _a !== void 0 ? _a : '') }), h(KeyVal, { label: 'Startup date:', value: info.startupDate }), h(KeyVal, {
@@ -23271,6 +23246,9 @@ function ServerBody({ info }) {
23271
23246
  className: 'text-blue-600 underline',
23272
23247
  }, 'https://www.npmjs.com/package/@promptbook/remote-client')), h('li', null, 'OpenAI compatible client ', h('span', { className: 'text-gray-500' }, '(Not working yet)')), h('li', null, 'REST API')), h('p', { className: 'mt-2' }, 'For more information look at: ', h('a', { href: 'https://github.com/webgptorg/promptbook', className: 'text-blue-600 underline' }, 'https://github.com/webgptorg/promptbook'))));
23273
23248
  }
23249
+ /**
23250
+ * Handles Html doc.
23251
+ */
23274
23252
  function HtmlDoc({ info }) {
23275
23253
  return h('html', { lang: 'en' }, h('head', null, h('meta', { charSet: 'UTF-8' }), h('meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0' }), h('title', null, 'Promptbook Server'), h('link', {
23276
23254
  href: 'https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css',
@@ -23294,6 +23272,7 @@ function renderServerIndexHtml(info) {
23294
23272
  * This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
23295
23273
  *
23296
23274
  * @see https://github.com/webgptorg/promptbook#remote-server
23275
+ *
23297
23276
  * @public exported from `@promptbook/remote-server`
23298
23277
  */
23299
23278
  function startRemoteServer(options) {
@@ -23851,22 +23830,19 @@ function startRemoteServer(options) {
23851
23830
  },
23852
23831
  };
23853
23832
  }
23854
- /**
23855
-
23856
- * TODO: [🕋] Use here `aboutPromptbookInformation`
23857
- * TODO: [🌡] Add CORS and security - probably via `helmet`
23858
- * TODO: Split this file into multiple functions - handler for each request
23859
- * TODO: Maybe use `$exportJson`
23860
- * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
23861
- * TODO: [⚖] Expose the collection to be able to connect to same collection via createPipelineCollectionFromUrl
23862
- * TODO: Handle progress - support streaming
23863
- * TODO: [🗯] Do not hang up immediately but wait until client closes OR timeout
23864
- * TODO: [🗯] Timeout on chat to free up resources
23865
- * TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
23866
- * TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
23867
- * TODO: Allow to constrain anonymous mode for specific models / providers
23868
- * Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
23869
- */
23833
+ // Note: [🟢] Code for Node server bootstrap [startRemoteServer](src/remote-server/startRemoteServer.ts) should never be published into packages that could be imported into browser environment
23834
+ // TODO: [🕋] Use here `aboutPromptbookInformation`
23835
+ // TODO: [🌡] Add CORS and security - probably via `helmet`
23836
+ // TODO: Split this file into multiple functions - handler for each request
23837
+ // TODO: Maybe use `$exportJson`
23838
+ // TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
23839
+ // TODO: [] Expose the collection to be able to connect to same collection via createPipelineCollectionFromUrl
23840
+ // TODO: Handle progress - support streaming
23841
+ // TODO: [🗯] Do not hang up immediately but wait until client closes OR timeout
23842
+ // TODO: [🗯] Timeout on chat to free up resources
23843
+ // TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
23844
+ // TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
23845
+ // TODO: Allow to constrain anonymous mode for specific models / providers
23870
23846
 
23871
23847
  /**
23872
23848
  * Keep-alive helpers used for streaming chat responses.
@@ -23878,12 +23854,10 @@ function startRemoteServer(options) {
23878
23854
  * @private internal streaming helper for Promptbook chat connections
23879
23855
  */
23880
23856
  const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
23881
- /**
23882
- * Note: [💞] Ignore a discrepancy between file name and entity name
23883
- */
23857
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23884
23858
 
23885
23859
  /**
23886
- * Number of padding lines to add at the end of the book content
23860
+ * Number of padding lines to add at the end of the book content
23887
23861
  *
23888
23862
  * @public exported from `@promptbook/core`
23889
23863
  */
@@ -23920,9 +23894,7 @@ function padBook(content) {
23920
23894
  const linesToAdd = PADDING_LINES - trailingEmptyLines;
23921
23895
  return (content + '\n'.repeat(linesToAdd));
23922
23896
  }
23923
- /**
23924
- * TODO: [🧠] Maybe export
23925
- */
23897
+ // TODO: [🧠] Maybe export
23926
23898
 
23927
23899
  /**
23928
23900
  * Type guard to check if a string is a valid agent source
@@ -23952,6 +23924,7 @@ function validateBook(source) {
23952
23924
  * Default book
23953
23925
  *
23954
23926
  * @deprecated Use `$generateBookBoilerplate` instead
23927
+ *
23955
23928
  * @public exported from `@promptbook/core`
23956
23929
  */
23957
23930
  padBook(validateBook(spaceTrim$1(`
@@ -23970,6 +23943,7 @@ padBook(validateBook(spaceTrim$1(`
23970
23943
  *
23971
23944
  * @param {string} pipelineString the candidate for a pipeline string
23972
23945
  * @returns {boolean} if the string is a valid pipeline string
23946
+ *
23973
23947
  * @public exported from `@promptbook/core`
23974
23948
  */
23975
23949
  function isValidPipelineString(pipelineString) {
@@ -23982,9 +23956,7 @@ function isValidPipelineString(pipelineString) {
23982
23956
  return false;
23983
23957
  }
23984
23958
  }
23985
- /**
23986
- * TODO: [🧠][🈴] Where is the best location for this file
23987
- */
23959
+ // TODO: [🧠][🈴] Where is the best location for this file
23988
23960
 
23989
23961
  /**
23990
23962
  * Tag function for notating a pipeline with a book\`...\ notation as template literal
@@ -23997,6 +23969,7 @@ function isValidPipelineString(pipelineString) {
23997
23969
  * @param strings The static string parts of the template literal
23998
23970
  * @param values The dynamic values embedded within the template literal used as data
23999
23971
  * @returns the pipeline string
23972
+ *
24000
23973
  * @public exported from `@promptbook/core`
24001
23974
  */
24002
23975
  function book(strings, ...values) {
@@ -24023,10 +23996,8 @@ function book(strings, ...values) {
24023
23996
  }
24024
23997
  return padBook(bookString);
24025
23998
  }
24026
- /**
24027
- * TODO: [🧠][🈴] Where is the best location for this file
24028
- * Note: [💞] Ignore a discrepancy between file name and entity name
24029
- */
23999
+ // TODO: [🧠][🈴] Where is the best location for this file
24000
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24030
24001
 
24031
24002
  /**
24032
24003
  * Tool call name emitted while preparing a GPT assistant for an agent.
@@ -24071,9 +24042,7 @@ const CHAT_STREAM_WHITESPACE_DECODERS = [
24071
24042
  { token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
24072
24043
  { token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
24073
24044
  ];
24074
- /**
24075
- * Note: [💞] Ignore a discrepancy between file name and entity name
24076
- */
24045
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24077
24046
 
24078
24047
  /**
24079
24048
  * Converts encoded whitespace markers back into real whitespace so the UI can render the message
@@ -24091,6 +24060,9 @@ function decodeChatStreamWhitespaceFromTransport(content) {
24091
24060
  }, content);
24092
24061
  }
24093
24062
 
24063
+ /**
24064
+ * Constant for raw tool call ID fields.
24065
+ */
24094
24066
  const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
24095
24067
  /**
24096
24068
  * Builds a deterministic idempotency key for tool calls so the UI can track updates.
@@ -24121,6 +24093,9 @@ function resolveToolCallIdempotencyKey(toolCall) {
24121
24093
  }
24122
24094
  return `fallback:${toolCall.name}`;
24123
24095
  }
24096
+ /**
24097
+ * Gets arguments key.
24098
+ */
24124
24099
  function getArgumentsKey(value) {
24125
24100
  if (typeof value === 'string') {
24126
24101
  return value;
@@ -24194,6 +24169,7 @@ function mergeToolCalls(existingToolCalls, incomingToolCalls) {
24194
24169
  * @param existingToolCall - Previous snapshot.
24195
24170
  * @param incomingToolCall - New snapshot.
24196
24171
  * @returns One merged snapshot.
24172
+ *
24197
24173
  * @private helper of `mergeToolCalls`
24198
24174
  */
24199
24175
  function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
@@ -24216,6 +24192,7 @@ function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
24216
24192
  * @param existingToolCall - Previous snapshot.
24217
24193
  * @param incomingToolCall - New snapshot.
24218
24194
  * @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
24195
+ *
24219
24196
  * @private helper of `mergeToolCalls`
24220
24197
  */
24221
24198
  function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
@@ -24229,6 +24206,7 @@ function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
24229
24206
  *
24230
24207
  * @param toolCall - Tool call snapshot to inspect.
24231
24208
  * @returns Inferred lifecycle state or `undefined`.
24209
+ *
24232
24210
  * @private helper of `mergeToolCalls`
24233
24211
  */
24234
24212
  function inferToolCallState(toolCall) {
@@ -24252,6 +24230,7 @@ function inferToolCallState(toolCall) {
24252
24230
  * @param existingValues - Previous list.
24253
24231
  * @param incomingValues - Incoming list.
24254
24232
  * @returns Deduplicated merged list or `undefined`.
24233
+ *
24255
24234
  * @private helper of `mergeToolCalls`
24256
24235
  */
24257
24236
  function mergeUnknownLists(existingValues, incomingValues) {
@@ -24278,6 +24257,7 @@ function mergeUnknownLists(existingValues, incomingValues) {
24278
24257
  *
24279
24258
  * @param value - Value to serialize.
24280
24259
  * @returns String signature.
24260
+ *
24281
24261
  * @private helper of `mergeToolCalls`
24282
24262
  */
24283
24263
  function serializeValueForMerge(value) {
@@ -24295,6 +24275,7 @@ function serializeValueForMerge(value) {
24295
24275
  *
24296
24276
  * @param toolCalls - Mutable list to deduplicate in-place.
24297
24277
  * @returns The same array after removing redundant preparation entries.
24278
+ *
24298
24279
  * @private helper of `mergeToolCalls`
24299
24280
  */
24300
24281
  function deduplicatePreparationToolCalls(toolCalls) {
@@ -24352,6 +24333,7 @@ function createDefaultAgentName(agentSource) {
24352
24333
  *
24353
24334
  * @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
24354
24335
  * @returns Normalized hostname or `null` when the value cannot be normalized.
24336
+ *
24355
24337
  * @private utility for host/domain matching
24356
24338
  */
24357
24339
  function normalizeDomainForMatching(rawDomain) {
@@ -24374,6 +24356,7 @@ function normalizeDomainForMatching(rawDomain) {
24374
24356
  *
24375
24357
  * @param value - Raw value to inspect.
24376
24358
  * @returns True when the value starts with `http://` or `https://`.
24359
+ *
24377
24360
  * @private utility for host/domain matching
24378
24361
  */
24379
24362
  function hasHttpProtocol(value) {
@@ -24389,6 +24372,7 @@ function hasHttpProtocol(value) {
24389
24372
  *
24390
24373
  * @param agentSource - Raw agent source.
24391
24374
  * @returns Parsed prelude with shared line metadata.
24375
+ *
24392
24376
  * @private internal utility of book agent-source parsing
24393
24377
  */
24394
24378
  function parseAgentSourcePrelude(agentSource) {
@@ -24564,6 +24548,7 @@ function parseAgentSourceWithCommitments(agentSource) {
24564
24548
  *
24565
24549
  * @param text - Text to extract parameters from
24566
24550
  * @returns Array of parsed parameters with unified representation
24551
+ *
24567
24552
  * @public exported from `@promptbook/core`
24568
24553
  */
24569
24554
  function parseParameters(text) {
@@ -24992,9 +24977,7 @@ function normalizeMetaDomain(content) {
24992
24977
  const trimmed = spaceTrim$1(content);
24993
24978
  return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
24994
24979
  }
24995
- /**
24996
- * TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
24997
- */
24980
+ // TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
24998
24981
 
24999
24982
  /**
25000
24983
  * Gets all tool titles provided by all commitments
@@ -25020,6 +25003,7 @@ function getAllCommitmentsToolTitles() {
25020
25003
  * Restricts an Updatable to a (2) BehaviorSubject variant
25021
25004
  *
25022
25005
  * @see Updatable
25006
+ *
25023
25007
  * @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
25024
25008
  */
25025
25009
  function asUpdatableSubject(value) {
@@ -25044,9 +25028,7 @@ function asUpdatableSubject(value) {
25044
25028
  return new BehaviorSubject(value);
25045
25029
  }
25046
25030
  }
25047
- /**
25048
- * TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
25049
- */
25031
+ // TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
25050
25032
 
25051
25033
  /**
25052
25034
  * Creates an empty/basic agent model requirements object
@@ -25081,12 +25063,11 @@ function createBasicAgentModelRequirements(agentName) {
25081
25063
  systemMessage: `You are ${agentName || 'AI Agent'}`,
25082
25064
  };
25083
25065
  }
25084
- /**
25085
- * TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
25086
- */
25066
+ // TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
25087
25067
 
25088
25068
  /**
25089
25069
  * Gets a commitment definition by its type
25070
+ *
25090
25071
  * @param type The commitment type to look up
25091
25072
  * @returns The commitment definition or null if not found
25092
25073
  *
@@ -25465,7 +25446,9 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
25465
25446
  };
25466
25447
  }
25467
25448
  /**
25468
- * @private Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
25449
+ * Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
25450
+ *
25451
+ * @private
25469
25452
  */
25470
25453
  async function applyPendingInlineKnowledgeSources(requirements, uploader) {
25471
25454
  var _a;
@@ -25486,6 +25469,9 @@ async function applyPendingInlineKnowledgeSources(requirements, uploader) {
25486
25469
  _metadata: stripInlineKnowledgeMetadata(requirements._metadata),
25487
25470
  };
25488
25471
  }
25472
+ /**
25473
+ * Handles upload inline knowledge source with fallback.
25474
+ */
25489
25475
  async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
25490
25476
  try {
25491
25477
  return await uploader(inlineSource);
@@ -25498,6 +25484,9 @@ async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
25498
25484
  return inlineKnowledgeSourceToDataUrl(inlineSource);
25499
25485
  }
25500
25486
  }
25487
+ /**
25488
+ * Extracts inline knowledge sources.
25489
+ */
25501
25490
  function extractInlineKnowledgeSources(metadata) {
25502
25491
  if (!metadata) {
25503
25492
  return [];
@@ -25505,6 +25494,9 @@ function extractInlineKnowledgeSources(metadata) {
25505
25494
  const value = metadata.inlineKnowledgeSources;
25506
25495
  return Array.isArray(value) ? value : [];
25507
25496
  }
25497
+ /**
25498
+ * Strips inline knowledge metadata.
25499
+ */
25508
25500
  function stripInlineKnowledgeMetadata(metadata) {
25509
25501
  if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
25510
25502
  return metadata;
@@ -25555,6 +25547,7 @@ function isBinaryMimeType(mimeType) {
25555
25547
  * @param availableModels - Models that could fulfill the agent.
25556
25548
  * @param llmTools - Execution tools used when selecting a best model.
25557
25549
  * @param options - Optional hooks such as the agent reference resolver.
25550
+ *
25558
25551
  * @public exported from `@promptbook/core`
25559
25552
  */
25560
25553
  async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
@@ -25574,6 +25567,7 @@ async function createAgentModelRequirements(agentSource, modelName, availableMod
25574
25567
  * @param agentSource The agent source to derive persona description from
25575
25568
  * @param llmTools LLM tools for preparing persona
25576
25569
  * @returns The name of the best selected model
25570
+ *
25577
25571
  * @private function of `createAgentModelRequirements`
25578
25572
  */
25579
25573
  async function selectBestModelUsingPersona(agentSource, llmTools) {
@@ -25709,6 +25703,7 @@ function normalizeChatAttachment(rawAttachment) {
25709
25703
  *
25710
25704
  * @param {unknown} rawAttachments - The raw attachments to normalize.
25711
25705
  * @returns {Array<ChatAttachment>} The normalized attachments.
25706
+ *
25712
25707
  * @public exported from `@promptbook/core`
25713
25708
  */
25714
25709
  function normalizeChatAttachments(rawAttachments) {
@@ -25753,6 +25748,7 @@ function formatChatAttachmentLine(attachment) {
25753
25748
  *
25754
25749
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
25755
25750
  * @returns {string} The formatted context.
25751
+ *
25756
25752
  * @public exported from `@promptbook/core`
25757
25753
  */
25758
25754
  function formatChatAttachmentContext(attachments) {
@@ -25773,6 +25769,7 @@ function formatChatAttachmentContext(attachments) {
25773
25769
  * @param {number} maxBytes - Maximum number of bytes to capture.
25774
25770
  * @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
25775
25771
  * @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
25772
+ *
25776
25773
  * @private internal utility for bounded response reads
25777
25774
  */
25778
25775
  async function readResponseBytes(response, maxBytes, options = {}) {
@@ -25869,6 +25866,7 @@ function createAttachmentContentFailure(attachment, reason, options = {}) {
25869
25866
  * @param {number} maxInlineCharacters - Maximum number of characters to inline.
25870
25867
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
25871
25868
  * @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
25869
+ *
25872
25870
  * @private function of resolveChatAttachmentContents
25873
25871
  */
25874
25872
  async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
@@ -25960,6 +25958,7 @@ const CHAT_ATTACHMENT_MAX_INLINE_CHARACTERS_TOTAL = 24000;
25960
25958
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
25961
25959
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
25962
25960
  * @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
25961
+ *
25963
25962
  * @public exported from `@promptbook/core`
25964
25963
  */
25965
25964
  async function resolveChatAttachmentContents(attachments, options = {}) {
@@ -26025,6 +26024,7 @@ function formatResolvedChatAttachmentContent(contentResolution) {
26025
26024
  *
26026
26025
  * @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
26027
26026
  * @returns {string} The formatted context.
26027
+ *
26028
26028
  * @public exported from `@promptbook/core`
26029
26029
  */
26030
26030
  function formatChatAttachmentContentContext(resolvedContents) {
@@ -26065,6 +26065,7 @@ function appendChatContextSections(messageContent, contextSections) {
26065
26065
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
26066
26066
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
26067
26067
  * @returns {Promise<string>} The updated message content.
26068
+ *
26068
26069
  * @public exported from `@promptbook/core`
26069
26070
  */
26070
26071
  async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
@@ -26093,9 +26094,7 @@ async function appendChatAttachmentContextWithContent(messageContent, attachment
26093
26094
  function humanizeAiTextEllipsis(aiText) {
26094
26095
  return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
26095
26096
  }
26096
- /**
26097
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26098
- */
26097
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26099
26098
 
26100
26099
  /**
26101
26100
  * Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
@@ -26108,9 +26107,7 @@ function humanizeAiTextEllipsis(aiText) {
26108
26107
  function humanizeAiTextEmdashed(aiText) {
26109
26108
  return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
26110
26109
  }
26111
- /**
26112
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26113
- */
26110
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26114
26111
 
26115
26112
  /**
26116
26113
  * Change smart quotes to regular quotes
@@ -26123,9 +26120,7 @@ function humanizeAiTextEmdashed(aiText) {
26123
26120
  function humanizeAiTextQuotes(aiText) {
26124
26121
  return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
26125
26122
  }
26126
- /**
26127
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26128
- */
26123
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26129
26124
 
26130
26125
  /**
26131
26126
  * Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
@@ -26138,9 +26133,7 @@ function humanizeAiTextQuotes(aiText) {
26138
26133
  function humanizeAiTextSources(aiText) {
26139
26134
  return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
26140
26135
  }
26141
- /**
26142
- * Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26143
- */
26136
+ // Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26144
26137
 
26145
26138
  /**
26146
26139
  * Change unprintable hard spaces to regular spaces and drop zero-width spaces
@@ -26153,9 +26146,7 @@ function humanizeAiTextSources(aiText) {
26153
26146
  function humanizeAiTextWhitespace(aiText) {
26154
26147
  return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
26155
26148
  }
26156
- /**
26157
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26158
- */
26149
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26159
26150
 
26160
26151
  /**
26161
26152
  * Function `humanizeAiText` will remove traces of AI text generation artifacts
@@ -26174,11 +26165,11 @@ function humanizeAiText(aiText) {
26174
26165
  cleanedText = humanizeAiTextWhitespace(cleanedText);
26175
26166
  return cleanedText;
26176
26167
  }
26177
- /**
26178
- * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
26179
- */
26168
+ // TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
26180
26169
 
26181
26170
  /**
26171
+ * Map of promptbook pseudotoken substitution.
26172
+ *
26182
26173
  * @private
26183
26174
  */
26184
26175
  const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
@@ -26226,9 +26217,7 @@ function promptbookifyAiText(text) {
26226
26217
  }
26227
26218
  return promptbookifiedTextTokens.join('');
26228
26219
  }
26229
- /**
26230
- * TODO: [🧠][✌️] Make some Promptbook-native token system
26231
- */
26220
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
26232
26221
 
26233
26222
  /**
26234
26223
  * Make UncertainNumber
@@ -26284,6 +26273,7 @@ function pricing(value) {
26284
26273
  *
26285
26274
  * @see https://platform.openai.com/docs/models/
26286
26275
  * @see https://openai.com/api/pricing/
26276
+ *
26287
26277
  * @public exported from `@promptbook/openai`
26288
26278
  */
26289
26279
  const OPENAI_MODELS = exportJson({
@@ -26960,6 +26950,7 @@ const OPENAI_MODELS = exportJson({
26960
26950
  * @param rawResponse The raw response from OpenAI API
26961
26951
  * @param duration The duration of the execution
26962
26952
  * @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
26953
+ *
26963
26954
  * @private internal utility of `OpenAiExecutionTools`
26964
26955
  */
26965
26956
  function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
@@ -27002,15 +26993,14 @@ resultContent, rawResponse, duration = ZERO_VALUE) {
27002
26993
  },
27003
26994
  };
27004
26995
  }
27005
- /**
27006
- * TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
27007
- */
26996
+ // TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
27008
26997
 
27009
26998
  /**
27010
26999
  * Parses an OpenAI error message to identify which parameter is unsupported
27011
27000
  *
27012
27001
  * @param errorMessage The error message from OpenAI API
27013
27002
  * @returns The parameter name that is unsupported, or null if not an unsupported parameter error
27003
+ *
27014
27004
  * @private utility of LLM Tools
27015
27005
  */
27016
27006
  function parseUnsupportedParameterError(errorMessage) {
@@ -27032,6 +27022,7 @@ function parseUnsupportedParameterError(errorMessage) {
27032
27022
  * @param modelRequirements Original model requirements
27033
27023
  * @param unsupportedParameter The parameter to remove
27034
27024
  * @returns New model requirements without the unsupported parameter
27025
+ *
27035
27026
  * @private utility of LLM Tools
27036
27027
  */
27037
27028
  function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
@@ -27051,8 +27042,10 @@ function removeUnsupportedModelRequirement(modelRequirements, unsupportedParamet
27051
27042
  }
27052
27043
  /**
27053
27044
  * Checks if an error is an "Unsupported value" error from OpenAI
27045
+ *
27054
27046
  * @param error The error to check
27055
27047
  * @returns true if this is an unsupported parameter error
27048
+ *
27056
27049
  * @private utility of LLM Tools
27057
27050
  */
27058
27051
  function isUnsupportedParameterError(error) {
@@ -28158,13 +28151,11 @@ class OpenAiCompatibleExecutionTools {
28158
28151
  return false;
28159
28152
  }
28160
28153
  }
28161
- /**
28162
- * TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
28163
- * TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
28164
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
28165
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
28166
- * TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
28167
- */
28154
+ // TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
28155
+ // TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
28156
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
28157
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
28158
+ // TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
28168
28159
 
28169
28160
  /**
28170
28161
  * Profile for OpenAI provider
@@ -28232,9 +28223,21 @@ class OpenAiExecutionTools extends OpenAiCompatibleExecutionTools {
28232
28223
  }
28233
28224
  }
28234
28225
 
28226
+ /**
28227
+ * Constant for default knowledge source download timeout ms.
28228
+ */
28235
28229
  const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
28230
+ /**
28231
+ * Constant for default knowledge source upload timeout ms.
28232
+ */
28236
28233
  const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
28234
+ /**
28235
+ * Constant for vector store progress log interval min ms.
28236
+ */
28237
28237
  const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
28238
+ /**
28239
+ * Constant for vector store stall log threshold ms.
28240
+ */
28238
28241
  const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
28239
28242
  /**
28240
28243
  * Base class for OpenAI execution tools that need hosted vector stores.
@@ -29001,6 +29004,9 @@ class OpenAiVectorStoreHandler extends OpenAiExecutionTools {
29001
29004
  }
29002
29005
  }
29003
29006
 
29007
+ /**
29008
+ * Constant for default agent kit model name.
29009
+ */
29004
29010
  const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
29005
29011
  /**
29006
29012
  * Creates one structured log entry for streamed tool-call updates.
@@ -29044,6 +29050,9 @@ function resolveFinalToolCallState$1(options) {
29044
29050
  }
29045
29051
  return 'COMPLETE';
29046
29052
  }
29053
+ /**
29054
+ * Constant for default JSON schema name.
29055
+ */
29047
29056
  const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
29048
29057
  /**
29049
29058
  * File extensions considered image inputs when MIME type is missing or generic.
@@ -29199,6 +29208,7 @@ function buildJsonSchemaDefinition(jsonSchema) {
29199
29208
  *
29200
29209
  * @param responseFormat - The OpenAI `response_format` payload from the user request.
29201
29210
  * @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
29211
+ *
29202
29212
  * @private utility of Open AI
29203
29213
  */
29204
29214
  function mapResponseFormatToAgentOutputType(responseFormat) {
@@ -29957,6 +29967,7 @@ function resolveFinalToolCallState(options) {
29957
29967
  * - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
29958
29968
  *
29959
29969
  * @deprecated Use `OpenAiAgentKitExecutionTools` instead.
29970
+ *
29960
29971
  * @public exported from `@promptbook/openai`
29961
29972
  */
29962
29973
  class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
@@ -30648,14 +30659,12 @@ class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
30648
30659
  * @private const of `OpenAiAssistantExecutionTools`
30649
30660
  */
30650
30661
  const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
30651
- /**
30652
- * TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
30653
- * TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
30654
- * TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
30655
- * TODO: Maybe make custom OpenAiError
30656
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
30657
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
30658
- */
30662
+ // TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
30663
+ // TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
30664
+ // TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
30665
+ // TODO: Maybe make custom OpenAiError
30666
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
30667
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
30659
30668
 
30660
30669
  /**
30661
30670
  * Emits a progress update to signal assistant preparation before long setup work.
@@ -31132,10 +31141,8 @@ AgentLlmExecutionTools.assistantCache = new Map();
31132
31141
  * Cache of OpenAI vector stores to avoid creating duplicates
31133
31142
  */
31134
31143
  AgentLlmExecutionTools.vectorStoreCache = new Map();
31135
- /**
31136
- * TODO: [🍚] Implement Destroyable pattern to free resources
31137
- * TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
31138
- */
31144
+ // TODO: [🍚] Implement Destroyable pattern to free resources
31145
+ // TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
31139
31146
 
31140
31147
  /**
31141
31148
  * Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
@@ -31145,6 +31152,7 @@ AgentLlmExecutionTools.vectorStoreCache = new Map();
31145
31152
  *
31146
31153
  * @param agentSource - The raw agent book source
31147
31154
  * @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
31155
+ *
31148
31156
  * @private Internal helper shared between self-learning and related features.
31149
31157
  */
31150
31158
  function extractOpenTeacherInstructions(agentSource) {
@@ -31352,6 +31360,7 @@ class SelfLearningManager {
31352
31360
  *
31353
31361
  * @param section Raw fragment from self-learning workflow.
31354
31362
  * @returns Trimmed fragment, or empty string when nothing remains.
31363
+ *
31355
31364
  * @private function of Agent
31356
31365
  */
31357
31366
  function normalizeBookSection(section) {
@@ -31363,6 +31372,7 @@ function normalizeBookSection(section) {
31363
31372
  * @param agentSource Current source.
31364
31373
  * @param normalizedSection Candidate fragment expected to be normalized first.
31365
31374
  * @returns True when appending would duplicate an existing fragment.
31375
+ *
31366
31376
  * @private function of Agent
31367
31377
  */
31368
31378
  function containsNormalizedBookSection(agentSource, normalizedSection) {
@@ -31377,6 +31387,7 @@ function containsNormalizedBookSection(agentSource, normalizedSection) {
31377
31387
  *
31378
31388
  * @param responseFormat Prompt response format requirements
31379
31389
  * @returns True when JSON schema mode is active
31390
+ *
31380
31391
  * @private function of Agent
31381
31392
  */
31382
31393
  function isJsonSchemaResponseFormat(responseFormat) {
@@ -31388,6 +31399,7 @@ function isJsonSchemaResponseFormat(responseFormat) {
31388
31399
  * @param content Original agent answer content
31389
31400
  * @param isJsonMode Whether the interaction requested JSON schema output
31390
31401
  * @returns Agent answer, wrapped in a formatted JSON code block when possible
31402
+ *
31391
31403
  * @private function of Agent
31392
31404
  */
31393
31405
  function formatAgentMessageForJsonMode(content, isJsonMode) {
@@ -31413,6 +31425,7 @@ function formatAgentMessageForJsonMode(content, isJsonMode) {
31413
31425
  *
31414
31426
  * @param content Text to parse as JSON
31415
31427
  * @returns Parsed JSON value or null when parsing fails
31428
+ *
31416
31429
  * @private function of Agent
31417
31430
  */
31418
31431
  function tryParseJson(content) {
@@ -31428,6 +31441,7 @@ function tryParseJson(content) {
31428
31441
  *
31429
31442
  * @param options - Normalized sample parts.
31430
31443
  * @returns Book-language sample section ready to append into agent source.
31444
+ *
31431
31445
  * @private function of Agent
31432
31446
  */
31433
31447
  function formatSelfLearningSample(options) {
@@ -31449,6 +31463,7 @@ function formatSelfLearningSample(options) {
31449
31463
  *
31450
31464
  * @param internalMessage Internal trace payload.
31451
31465
  * @returns Book-language INTERNAL MESSAGE block.
31466
+ *
31452
31467
  * @private function of Agent
31453
31468
  */
31454
31469
  function formatInternalLearningMessage(internalMessage) {
@@ -31462,6 +31477,7 @@ function formatInternalLearningMessage(internalMessage) {
31462
31477
  *
31463
31478
  * @param result Final chat result used in self-learning.
31464
31479
  * @returns Internal payloads that capture request/response/tool-call context.
31480
+ *
31465
31481
  * @private function of Agent
31466
31482
  */
31467
31483
  function buildInternalLearningMessages(result) {
@@ -31491,6 +31507,7 @@ function buildInternalLearningMessages(result) {
31491
31507
  *
31492
31508
  * @param toolCall Tool call produced during execution.
31493
31509
  * @returns Sanitized and serializable tool-call payload.
31510
+ *
31494
31511
  * @private function of Agent
31495
31512
  */
31496
31513
  function sanitizeToolCallForLearning(toolCall) {
@@ -31510,6 +31527,7 @@ function sanitizeToolCallForLearning(toolCall) {
31510
31527
  *
31511
31528
  * @param payload Internal payload to serialize.
31512
31529
  * @returns Pretty JSON string that can be embedded in BOOK.
31530
+ *
31513
31531
  * @private function of Agent
31514
31532
  */
31515
31533
  function stringifyInternalLearningPayload(payload) {
@@ -31559,6 +31577,7 @@ function createEmptySelfLearningCommitmentCounts() {
31559
31577
  * Normalizes teacher commitments into trimmed, display-ready lines.
31560
31578
  *
31561
31579
  * @param commitments Raw teacher output
31580
+ *
31562
31581
  * @private function of Agent
31563
31582
  */
31564
31583
  function getTeacherCommitmentLines(commitments) {
@@ -31571,6 +31590,7 @@ function getTeacherCommitmentLines(commitments) {
31571
31590
  * Summarizes teacher commitment lines into user-friendly counts for self-learning.
31572
31591
  *
31573
31592
  * @param lines Parsed teacher commitment lines
31593
+ *
31574
31594
  * @private function of Agent
31575
31595
  */
31576
31596
  function summarizeTeacherCommitmentLines(lines) {
@@ -31603,6 +31623,7 @@ function summarizeTeacherCommitmentLines(lines) {
31603
31623
  * @param commitments Raw teacher commitments
31604
31624
  * @param used Whether the teacher was invoked
31605
31625
  * @returns Summary of learned commitments
31626
+ *
31606
31627
  * @private function of Agent
31607
31628
  */
31608
31629
  function buildTeacherSummary(commitments, used) {
@@ -31839,9 +31860,7 @@ class Agent extends AgentLlmExecutionTools {
31839
31860
  return finalResult;
31840
31861
  }
31841
31862
  }
31842
- /**
31843
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
31844
- */
31863
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
31845
31864
 
31846
31865
  /**
31847
31866
  * Parses one failed remote agent response into a structured error.
@@ -32307,10 +32326,8 @@ class RemoteAgent extends Agent {
32307
32326
  return agentResult;
32308
32327
  }
32309
32328
  }
32310
- /**
32311
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
32312
- * TODO: !!! Agent on remote server
32313
- */
32329
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
32330
+ // TODO: !!! Agent on remote server
32314
32331
 
32315
32332
  var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
32316
32333
  __proto__: null,