@promptbook/remote-server 0.112.0-34 → 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 (1476) hide show
  1. package/README.md +18 -0
  2. package/esm/index.es.js +710 -668
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/_packages/types.index.d.ts +45 -45
  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 +4 -8
  34. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +2 -3
  35. package/esm/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
  36. package/esm/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
  37. package/esm/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +1 -0
  38. package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
  39. package/esm/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
  40. package/esm/src/book-components/Chat/Chat/constants.d.ts +4 -3
  41. package/esm/src/book-components/Chat/Chat/insertDictationChunk.d.ts +16 -0
  42. package/esm/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
  43. package/esm/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
  44. package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
  45. package/esm/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +1 -0
  46. package/esm/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +1 -0
  47. package/esm/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +1 -0
  48. package/esm/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +1 -0
  49. package/esm/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +1 -0
  50. package/esm/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +1 -0
  51. package/esm/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +1 -0
  52. package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +1 -0
  53. package/esm/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +1 -0
  54. package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +1 -0
  55. package/esm/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +1 -0
  56. package/esm/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +1 -0
  57. package/esm/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
  58. package/esm/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +1 -0
  59. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +7 -30
  60. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
  61. package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -0
  62. package/esm/src/book-components/Chat/LlmChat/defaults.d.ts +0 -3
  63. package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
  64. package/esm/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
  65. package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
  66. package/esm/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
  67. package/esm/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
  68. package/esm/src/book-components/Chat/effects/index.d.ts +0 -4
  69. package/esm/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
  70. package/esm/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
  71. package/esm/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
  72. package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
  73. package/esm/src/book-components/Chat/save/index.d.ts +0 -3
  74. package/esm/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
  75. package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
  76. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
  77. package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
  78. package/esm/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
  79. package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
  80. package/esm/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
  81. package/esm/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
  82. package/esm/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
  83. package/esm/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
  84. package/esm/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
  85. package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
  86. package/esm/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
  87. package/esm/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
  88. package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
  89. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
  90. package/esm/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
  91. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
  92. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
  93. package/esm/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
  94. package/esm/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
  95. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
  96. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
  97. package/esm/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
  98. package/esm/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
  99. package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
  100. package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
  101. package/esm/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
  102. package/esm/src/book-components/Qr/GenericQrCode.d.ts +5 -0
  103. package/esm/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
  104. package/esm/src/book-components/Qr/useQrCode.d.ts +4 -1
  105. package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
  106. package/esm/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
  107. package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
  108. package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -3
  109. package/esm/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
  110. package/esm/src/book-components/icons/AboutIcon.d.ts +1 -0
  111. package/esm/src/book-components/icons/AttachmentIcon.d.ts +4 -0
  112. package/esm/src/book-components/icons/CameraIcon.d.ts +4 -0
  113. package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -0
  114. package/esm/src/book-components/icons/EmailIcon.d.ts +1 -0
  115. package/esm/src/book-components/icons/MenuIcon.d.ts +1 -3
  116. package/esm/src/book-components/icons/SaveIcon.d.ts +1 -0
  117. package/esm/src/book-components/icons/SendIcon.d.ts +0 -3
  118. package/esm/src/book-components/icons/TeacherIcon.d.ts +1 -0
  119. package/esm/src/cli/$runPromptbookCli.d.ts +0 -1
  120. package/esm/src/cli/cli-commands/_boilerplate.d.ts +0 -2
  121. package/esm/src/cli/cli-commands/about.d.ts +0 -6
  122. package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
  123. package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -2
  124. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -2
  125. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -2
  126. package/esm/src/cli/cli-commands/coder/init.d.ts +0 -2
  127. package/esm/src/cli/cli-commands/coder/run.d.ts +1 -3
  128. package/esm/src/cli/cli-commands/coder/run.test.d.ts +1 -0
  129. package/esm/src/cli/cli-commands/coder/verify.d.ts +0 -2
  130. package/esm/src/cli/cli-commands/coder.d.ts +0 -2
  131. package/esm/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
  132. package/esm/src/cli/cli-commands/hello.d.ts +0 -5
  133. package/esm/src/cli/cli-commands/list-models.d.ts +0 -2
  134. package/esm/src/cli/cli-commands/list-scrapers.d.ts +0 -2
  135. package/esm/src/cli/cli-commands/login.d.ts +0 -5
  136. package/esm/src/cli/cli-commands/prettify.d.ts +0 -6
  137. package/esm/src/cli/cli-commands/run.d.ts +0 -8
  138. package/esm/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
  139. package/esm/src/cli/cli-commands/start-agents-server.d.ts +0 -2
  140. package/esm/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
  141. package/esm/src/cli/cli-commands/test-command.d.ts +0 -7
  142. package/esm/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
  143. package/esm/src/cli/main.d.ts +0 -2
  144. package/esm/src/cli/promptbookCli.d.ts +0 -7
  145. package/esm/src/collection/agent-collection/AgentCollection.d.ts +0 -3
  146. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
  147. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
  148. package/esm/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
  149. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
  150. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
  151. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
  152. package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
  153. package/esm/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
  154. package/esm/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
  155. package/esm/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
  156. package/esm/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
  157. package/esm/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
  158. package/esm/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
  159. package/esm/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
  160. package/esm/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
  161. package/esm/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
  162. package/esm/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
  163. package/esm/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
  164. package/esm/src/commands/JOKER/JokerCommand.d.ts +1 -0
  165. package/esm/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
  166. package/esm/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
  167. package/esm/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
  168. package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
  169. package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
  170. package/esm/src/commands/MODEL/ModelCommand.d.ts +1 -0
  171. package/esm/src/commands/MODEL/modelCommandParser.d.ts +1 -0
  172. package/esm/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
  173. package/esm/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
  174. package/esm/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
  175. package/esm/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
  176. package/esm/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
  177. package/esm/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
  178. package/esm/src/commands/SECTION/SectionCommand.d.ts +1 -0
  179. package/esm/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
  180. package/esm/src/commands/URL/UrlCommand.d.ts +1 -0
  181. package/esm/src/commands/URL/urlCommandParser.d.ts +1 -0
  182. package/esm/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
  183. package/esm/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
  184. package/esm/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
  185. package/esm/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
  186. package/esm/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
  187. package/esm/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  188. package/esm/src/commands/_common/stringifyCommand.d.ts +1 -1
  189. package/esm/src/commands/_common/types/CommandParser.d.ts +0 -4
  190. package/esm/src/commands/index.d.ts +0 -3
  191. package/esm/src/commitments/ACTION/ACTION.d.ts +0 -3
  192. package/esm/src/commitments/CLOSED/CLOSED.d.ts +0 -3
  193. package/esm/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
  194. package/esm/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
  195. package/esm/src/commitments/DELETE/DELETE.d.ts +0 -3
  196. package/esm/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
  197. package/esm/src/commitments/FORMAT/FORMAT.d.ts +0 -3
  198. package/esm/src/commitments/FROM/FROM.d.ts +0 -3
  199. package/esm/src/commitments/GOAL/GOAL.d.ts +0 -3
  200. package/esm/src/commitments/IMPORT/IMPORT.d.ts +0 -3
  201. package/esm/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
  202. package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -3
  203. package/esm/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
  204. package/esm/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
  205. package/esm/src/commitments/META/META.d.ts +0 -3
  206. package/esm/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
  207. package/esm/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
  208. package/esm/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
  209. package/esm/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
  210. package/esm/src/commitments/META_FONT/META_FONT.d.ts +0 -3
  211. package/esm/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
  212. package/esm/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
  213. package/esm/src/commitments/META_LINK/META_LINK.d.ts +0 -3
  214. package/esm/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
  215. package/esm/src/commitments/MODEL/MODEL.d.ts +0 -3
  216. package/esm/src/commitments/OPEN/OPEN.d.ts +0 -3
  217. package/esm/src/commitments/PERSONA/PERSONA.d.ts +0 -3
  218. package/esm/src/commitments/RULE/RULE.d.ts +0 -3
  219. package/esm/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
  220. package/esm/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
  221. package/esm/src/commitments/TEAM/TEAM.d.ts +0 -3
  222. package/esm/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
  223. package/esm/src/commitments/USE/USE.d.ts +0 -3
  224. package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
  225. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
  226. package/esm/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -5
  227. package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
  228. package/esm/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
  229. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
  230. package/esm/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
  231. package/esm/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
  232. package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
  233. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
  234. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
  235. package/esm/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
  236. package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
  237. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
  238. package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
  239. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
  240. package/esm/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
  241. package/esm/src/commitments/WALLET/WALLET.d.ts +0 -3
  242. package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
  243. package/esm/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
  244. package/esm/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
  245. package/esm/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
  246. package/esm/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
  247. package/esm/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
  248. package/esm/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
  249. package/esm/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
  250. package/esm/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
  251. package/esm/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
  252. package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
  253. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
  254. package/esm/src/commitments/index.d.ts +0 -4
  255. package/esm/src/config.test.d.ts +0 -3
  256. package/esm/src/constants/streaming.d.ts +0 -3
  257. package/esm/src/constants.d.ts +0 -3
  258. package/esm/src/conversion/archive/loadArchive.d.ts +0 -1
  259. package/esm/src/conversion/archive/saveArchive.d.ts +0 -5
  260. package/esm/src/conversion/compilePipeline.d.ts +2 -7
  261. package/esm/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
  262. package/esm/src/conversion/parsePipeline.d.ts +1 -11
  263. package/esm/src/conversion/pipelineJsonToString.d.ts +1 -7
  264. package/esm/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
  265. package/esm/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
  266. package/esm/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
  267. package/esm/src/conversion/validation/_importPipeline.d.ts +6 -2
  268. package/esm/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
  269. package/esm/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
  270. package/esm/src/conversion/validation/validatePipeline.d.ts +3 -9
  271. package/esm/src/conversion/validation/validatePipeline.test.d.ts +0 -3
  272. package/esm/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -2
  273. package/esm/src/errors/0-BoilerplateError.d.ts +0 -3
  274. package/esm/src/errors/0-index.d.ts +0 -3
  275. package/esm/src/errors/DatabaseError.d.ts +0 -3
  276. package/esm/src/errors/ExpectError.d.ts +2 -1
  277. package/esm/src/errors/ParseError.d.ts +0 -3
  278. package/esm/src/errors/PipelineExecutionError.d.ts +0 -3
  279. package/esm/src/executables/$provideExecutablesForNode.d.ts +0 -5
  280. package/esm/src/executables/apps/locateLibreoffice.d.ts +0 -2
  281. package/esm/src/executables/apps/locatePandoc.d.ts +0 -2
  282. package/esm/src/executables/browsers/locateBrowser.d.ts +0 -1
  283. package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
  284. package/esm/src/executables/locateApp.d.ts +0 -2
  285. package/esm/src/executables/platforms/locateAppOnLinux.d.ts +0 -2
  286. package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +0 -2
  287. package/esm/src/executables/platforms/locateAppOnWindows.d.ts +0 -2
  288. package/esm/src/execution/AbstractTaskResult.d.ts +0 -4
  289. package/esm/src/execution/AvailableModel.d.ts +0 -4
  290. package/esm/src/execution/CommonToolsOptions.d.ts +0 -5
  291. package/esm/src/execution/ExecutionTask.d.ts +4 -4
  292. package/esm/src/execution/FilesystemTools.d.ts +0 -3
  293. package/esm/src/execution/LlmExecutionTools.d.ts +3 -9
  294. package/esm/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
  295. package/esm/src/execution/PipelineExecutor.d.ts +0 -3
  296. package/esm/src/execution/PipelineExecutorResult.d.ts +0 -3
  297. package/esm/src/execution/PromptResult.d.ts +1 -9
  298. package/esm/src/execution/PromptbookFetch.test-type.d.ts +0 -4
  299. package/esm/src/execution/ScriptExecutionTools.d.ts +0 -4
  300. package/esm/src/execution/Usage.d.ts +0 -3
  301. package/esm/src/execution/UserInterfaceTools.d.ts +3 -0
  302. package/esm/src/execution/assertsTaskSuccessful.d.ts +1 -3
  303. package/esm/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
  304. package/esm/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
  305. package/esm/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
  306. package/esm/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
  307. package/esm/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
  308. package/esm/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
  309. package/esm/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
  310. package/esm/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
  311. package/esm/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
  312. package/esm/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
  313. package/esm/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
  314. package/esm/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
  315. package/esm/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
  316. package/esm/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -3
  317. package/esm/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
  318. package/esm/src/execution/utils/checkExpectations.d.ts +2 -5
  319. package/esm/src/execution/utils/forEachAsync.d.ts +5 -1
  320. package/esm/src/execution/utils/usage-constants.d.ts +0 -3
  321. package/esm/src/execution/utils/usageToHuman.d.ts +0 -8
  322. package/esm/src/execution/utils/validatePromptResult.d.ts +1 -0
  323. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
  324. package/esm/src/formats/_common/FormatParser.d.ts +2 -9
  325. package/esm/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
  326. package/esm/src/formats/csv/CsvFormatParser.d.ts +2 -8
  327. package/esm/src/formats/index.d.ts +0 -3
  328. package/esm/src/formats/json/JsonFormatParser.d.ts +0 -11
  329. package/esm/src/formats/text/TextFormatParser.d.ts +0 -9
  330. package/esm/src/formats/xml/XmlFormatParser.d.ts +0 -11
  331. package/esm/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
  332. package/esm/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
  333. package/esm/src/formfactors/index.d.ts +0 -3
  334. package/esm/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
  335. package/esm/src/high-level-abstractions/index.d.ts +0 -4
  336. package/esm/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
  337. package/esm/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
  338. package/esm/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
  339. package/esm/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -1
  340. package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  341. package/esm/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
  342. package/esm/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
  343. package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -16
  344. package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
  345. package/esm/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
  346. package/esm/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
  347. package/esm/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
  348. package/esm/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
  349. package/esm/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
  350. package/esm/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
  351. package/esm/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
  352. package/esm/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
  353. package/esm/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
  354. package/esm/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
  355. package/esm/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
  356. package/esm/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
  357. package/esm/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
  358. package/esm/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
  359. package/esm/src/llm-providers/_multiple/playground/playground.d.ts +0 -1
  360. package/esm/src/llm-providers/agent/Agent.d.ts +0 -3
  361. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
  362. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
  363. package/esm/src/llm-providers/agent/playground/playground.d.ts +0 -6
  364. package/esm/src/llm-providers/agent/register-configuration.d.ts +0 -5
  365. package/esm/src/llm-providers/agent/register-constructor.d.ts +0 -4
  366. package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
  367. package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
  368. package/esm/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
  369. package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
  370. package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
  371. package/esm/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
  372. package/esm/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
  373. package/esm/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
  374. package/esm/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
  375. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
  376. package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
  377. package/esm/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
  378. package/esm/src/llm-providers/azure-openai/playground/playground.d.ts +0 -2
  379. package/esm/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
  380. package/esm/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
  381. package/esm/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
  382. package/esm/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
  383. package/esm/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
  384. package/esm/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
  385. package/esm/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
  386. package/esm/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
  387. package/esm/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
  388. package/esm/src/llm-providers/google/google-models.d.ts +1 -6
  389. package/esm/src/llm-providers/google/register-configuration.d.ts +0 -3
  390. package/esm/src/llm-providers/google/register-constructor.d.ts +0 -4
  391. package/esm/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
  392. package/esm/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
  393. package/esm/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
  394. package/esm/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
  395. package/esm/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
  396. package/esm/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
  397. package/esm/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
  398. package/esm/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
  399. package/esm/src/llm-providers/ollama/ollama-models.d.ts +1 -4
  400. package/esm/src/llm-providers/ollama/playground/playground.d.ts +0 -2
  401. package/esm/src/llm-providers/ollama/register-configuration.d.ts +0 -3
  402. package/esm/src/llm-providers/ollama/register-constructor.d.ts +0 -4
  403. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
  404. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
  405. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
  406. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
  407. package/esm/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
  408. package/esm/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
  409. package/esm/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
  410. package/esm/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
  411. package/esm/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
  412. package/esm/src/llm-providers/openai/openai-models.d.ts +1 -0
  413. package/esm/src/llm-providers/openai/openai-models.test.d.ts +0 -3
  414. package/esm/src/llm-providers/openai/playground/playground.d.ts +0 -2
  415. package/esm/src/llm-providers/openai/register-configuration.d.ts +0 -3
  416. package/esm/src/llm-providers/openai/register-constructor.d.ts +0 -4
  417. package/esm/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
  418. package/esm/src/llm-providers/remote/playground/playground.d.ts +0 -1
  419. package/esm/src/llm-providers/vercel/playground/playground.d.ts +0 -2
  420. package/esm/src/other/templates/getBookTemplates.d.ts +2 -5
  421. package/esm/src/personas/preparePersona.d.ts +1 -7
  422. package/esm/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
  423. package/esm/src/pipeline/PipelineInterface/constants.d.ts +0 -3
  424. package/esm/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
  425. package/esm/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
  426. package/esm/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
  427. package/esm/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
  428. package/esm/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
  429. package/esm/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
  430. package/esm/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
  431. package/esm/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
  432. package/esm/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
  433. package/esm/src/pipeline/book-notation.d.ts +1 -4
  434. package/esm/src/pipeline/isValidPipelineString.d.ts +1 -3
  435. package/esm/src/pipeline/isValidPipelineString.test.d.ts +0 -3
  436. package/esm/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
  437. package/esm/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
  438. package/esm/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
  439. package/esm/src/pipeline/prompt-notation.d.ts +2 -5
  440. package/esm/src/pipeline/prompt-notation.test.d.ts +0 -3
  441. package/esm/src/pipeline/validatePipelineString.d.ts +1 -3
  442. package/esm/src/playground/permanent/_boilerplate.d.ts +0 -1
  443. package/esm/src/playground/permanent/agent-with-browser-playground.d.ts +0 -1
  444. package/esm/src/playground/permanent/error-handling-playground.d.ts +0 -1
  445. package/esm/src/playground/playground.d.ts +0 -2
  446. package/esm/src/postprocessing/utils/extractBlock.d.ts +2 -1
  447. package/esm/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
  448. package/esm/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
  449. package/esm/src/prepare/preparePipeline.d.ts +3 -2
  450. package/esm/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
  451. package/esm/src/prepare/prepareTasks.d.ts +6 -10
  452. package/esm/src/prepare/unpreparePipeline.d.ts +1 -5
  453. package/esm/src/remote-server/RemoteServer.d.ts +3 -0
  454. package/esm/src/remote-server/openapi.d.ts +3 -4
  455. package/esm/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
  456. package/esm/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
  457. package/esm/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
  458. package/esm/src/remote-server/startAgentServer.d.ts +6 -2
  459. package/esm/src/remote-server/startRemoteServer.d.ts +1 -15
  460. package/esm/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
  461. package/esm/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
  462. package/esm/src/remote-server/ui/ServerApp.d.ts +1 -0
  463. package/esm/src/remote-server/ui/types.d.ts +3 -0
  464. package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -4
  465. package/esm/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
  466. package/esm/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -1
  467. package/esm/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
  468. package/esm/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
  469. package/esm/src/scrapers/_common/Scraper.d.ts +0 -5
  470. package/esm/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
  471. package/esm/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
  472. package/esm/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -2
  473. package/esm/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -2
  474. package/esm/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -2
  475. package/esm/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
  476. package/esm/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
  477. package/esm/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
  478. package/esm/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
  479. package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
  480. package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
  481. package/esm/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
  482. package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -6
  483. package/esm/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
  484. package/esm/src/scrapers/document/createDocumentScraper.d.ts +0 -3
  485. package/esm/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -1
  486. package/esm/src/scrapers/document/register-constructor.d.ts +0 -4
  487. package/esm/src/scrapers/document/register-metadata.d.ts +0 -3
  488. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
  489. package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
  490. package/esm/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
  491. package/esm/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -1
  492. package/esm/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
  493. package/esm/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
  494. package/esm/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
  495. package/esm/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
  496. package/esm/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
  497. package/esm/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -1
  498. package/esm/src/scrapers/markdown/register-constructor.d.ts +0 -4
  499. package/esm/src/scrapers/markdown/register-metadata.d.ts +0 -3
  500. package/esm/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
  501. package/esm/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
  502. package/esm/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -1
  503. package/esm/src/scrapers/markitdown/register-constructor.d.ts +0 -5
  504. package/esm/src/scrapers/markitdown/register-metadata.d.ts +0 -3
  505. package/esm/src/scrapers/pdf/PdfScraper.d.ts +1 -6
  506. package/esm/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
  507. package/esm/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -1
  508. package/esm/src/scrapers/pdf/register-constructor.d.ts +0 -4
  509. package/esm/src/scrapers/pdf/register-metadata.d.ts +0 -3
  510. package/esm/src/scrapers/website/WebsiteScraper.d.ts +1 -6
  511. package/esm/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
  512. package/esm/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -1
  513. package/esm/src/scrapers/website/register-constructor.d.ts +0 -4
  514. package/esm/src/scrapers/website/register-metadata.d.ts +0 -3
  515. package/esm/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
  516. package/esm/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
  517. package/esm/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
  518. package/esm/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
  519. package/esm/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
  520. package/esm/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
  521. package/esm/src/search-engines/SearchEngine.d.ts +3 -0
  522. package/esm/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -2
  523. package/esm/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
  524. package/esm/src/storage/_common/PromptbookStorage.d.ts +0 -4
  525. package/esm/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
  526. package/esm/src/storage/env-storage/$EnvStorage.d.ts +0 -3
  527. package/esm/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -2
  528. package/esm/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -1
  529. package/esm/src/storage/local-storage/getLocalStorage.d.ts +0 -1
  530. package/esm/src/storage/local-storage/getSessionStorage.d.ts +0 -1
  531. package/esm/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
  532. package/esm/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
  533. package/esm/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
  534. package/esm/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
  535. package/esm/src/transpilers/openai-sdk/playground/playground.d.ts +0 -1
  536. package/esm/src/transpilers/openai-sdk/register.d.ts +2 -5
  537. package/esm/src/types/Arrayable.d.ts +1 -0
  538. package/esm/src/types/InputParameters_private.d.ts +4 -2
  539. package/esm/src/types/IntermediateFilesStrategy.d.ts +0 -3
  540. package/esm/src/types/LlmCall.d.ts +0 -3
  541. package/esm/src/types/ModelRequirements.d.ts +1 -0
  542. package/esm/src/types/ModelVariant.d.ts +3 -0
  543. package/esm/src/types/Parameters.d.ts +31 -0
  544. package/esm/src/types/Parameters_private.d.ts +4 -2
  545. package/esm/src/types/Prompt.d.ts +1 -6
  546. package/esm/src/types/ReservedParameters_private.d.ts +2 -1
  547. package/esm/src/types/ToolCall.d.ts +0 -2
  548. package/esm/src/types/Updatable.d.ts +1 -3
  549. package/esm/src/types/string_agent_hash_private.d.ts +1 -1
  550. package/esm/src/types/string_agent_name.d.ts +32 -0
  551. package/esm/src/types/string_agent_name_in_book_private.d.ts +1 -1
  552. package/esm/src/types/string_agent_name_private.d.ts +2 -1
  553. package/esm/src/types/string_agent_permanent_id_private.d.ts +2 -1
  554. package/esm/src/types/string_business_category_name.d.ts +5 -0
  555. package/esm/src/types/string_business_category_name_private.d.ts +1 -1
  556. package/esm/src/types/string_char_private.d.ts +1 -1
  557. package/esm/src/types/string_chat_prompt_private.d.ts +1 -1
  558. package/esm/src/types/string_completion_prompt_private.d.ts +1 -1
  559. package/esm/src/types/string_markdown.d.ts +0 -1
  560. package/esm/src/types/string_mime_type_private.d.ts +1 -0
  561. package/esm/src/types/string_model_description_private.d.ts +1 -1
  562. package/esm/src/types/string_model_name.d.ts +7 -0
  563. package/esm/src/types/string_model_name_private.d.ts +1 -1
  564. package/esm/src/types/string_name.d.ts +31 -0
  565. package/esm/src/types/string_name_private.d.ts +1 -1
  566. package/esm/src/types/string_page.d.ts +15 -0
  567. package/esm/src/types/string_page_private.d.ts +1 -1
  568. package/esm/src/types/string_parameter_name.d.ts +11 -210
  569. package/esm/src/types/string_parameter_value_private.d.ts +1 -1
  570. package/esm/src/types/string_persona_description.d.ts +14 -0
  571. package/esm/src/types/string_persona_description_private.d.ts +1 -1
  572. package/esm/src/types/string_prompt.d.ts +49 -0
  573. package/esm/src/types/string_prompt_image_private.d.ts +1 -1
  574. package/esm/src/types/string_prompt_private.d.ts +1 -1
  575. package/esm/src/types/string_reserved_parameter_name_private.d.ts +1 -1
  576. package/esm/src/types/string_sha256.d.ts +2 -2
  577. package/esm/src/types/string_system_message_private.d.ts +1 -1
  578. package/esm/src/types/string_template_private.d.ts +1 -1
  579. package/esm/src/types/string_text_prompt_private.d.ts +1 -1
  580. package/esm/src/types/string_title.d.ts +8 -0
  581. package/esm/src/types/string_title_private.d.ts +1 -1
  582. package/esm/src/types/typeAliasEmoji.d.ts +0 -3
  583. package/esm/src/types/typeAliases.d.ts +0 -6
  584. package/esm/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
  585. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
  586. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
  587. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
  588. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
  589. package/esm/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
  590. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
  591. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
  592. package/esm/src/utils/chat/chatAttachments.d.ts +0 -3
  593. package/esm/src/utils/chat/constants.d.ts +0 -3
  594. package/esm/src/utils/clientVersion.d.ts +0 -3
  595. package/esm/src/utils/color/$randomColor.d.ts +0 -5
  596. package/esm/src/utils/color/css-colors.d.ts +0 -3
  597. package/esm/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
  598. package/esm/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
  599. package/esm/src/utils/color/operators/ColorTransformer.d.ts +2 -0
  600. package/esm/src/utils/color/operators/lighten.d.ts +0 -3
  601. package/esm/src/utils/color/operators/saturate.d.ts +0 -3
  602. package/esm/src/utils/color/utils/areColorsEqual.d.ts +0 -3
  603. package/esm/src/utils/color/utils/colorDistance.d.ts +2 -2
  604. package/esm/src/utils/color/utils/colorHue.d.ts +0 -1
  605. package/esm/src/utils/color/utils/colorHueDistance.d.ts +0 -1
  606. package/esm/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
  607. package/esm/src/utils/database/uniqueConstraint.d.ts +1 -3
  608. package/esm/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
  609. package/esm/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
  610. package/esm/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
  611. package/esm/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
  612. package/esm/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
  613. package/esm/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
  614. package/esm/src/utils/environment/$getGlobalScope.d.ts +1 -1
  615. package/esm/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
  616. package/esm/src/utils/environment/$isRunningInJest.d.ts +0 -3
  617. package/esm/src/utils/environment/$isRunningInNode.d.ts +0 -3
  618. package/esm/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
  619. package/esm/src/utils/execCommand/$execCommand.d.ts +0 -2
  620. package/esm/src/utils/execCommand/$execCommands.d.ts +0 -1
  621. package/esm/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
  622. package/esm/src/utils/expectation-counters/constants.d.ts +0 -4
  623. package/esm/src/utils/expectation-counters/countCharacters.d.ts +0 -4
  624. package/esm/src/utils/expectation-counters/countLines.d.ts +0 -4
  625. package/esm/src/utils/expectation-counters/countPages.d.ts +0 -4
  626. package/esm/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
  627. package/esm/src/utils/expectation-counters/countSentences.d.ts +0 -4
  628. package/esm/src/utils/expectation-counters/countWords.d.ts +0 -5
  629. package/esm/src/utils/expectation-counters/index.d.ts +0 -4
  630. package/esm/src/utils/files/$induceBookDownload.d.ts +0 -1
  631. package/esm/src/utils/files/$induceFileDownload.d.ts +0 -1
  632. package/esm/src/utils/files/ObjectUrl.d.ts +0 -1
  633. package/esm/src/utils/files/isDirectoryExisting.d.ts +0 -6
  634. package/esm/src/utils/files/isExecutable.d.ts +0 -4
  635. package/esm/src/utils/files/isFileExisting.d.ts +0 -5
  636. package/esm/src/utils/files/listAllFiles.d.ts +1 -5
  637. package/esm/src/utils/files/readResponseBytes.d.ts +1 -0
  638. package/esm/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
  639. package/esm/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
  640. package/esm/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
  641. package/esm/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
  642. package/esm/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
  643. package/esm/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
  644. package/esm/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
  645. package/esm/src/utils/markdown/createMarkdownTable.d.ts +0 -3
  646. package/esm/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
  647. package/esm/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
  648. package/esm/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
  649. package/esm/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
  650. package/esm/src/utils/markdown/humanizeAiText.d.ts +0 -3
  651. package/esm/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
  652. package/esm/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
  653. package/esm/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
  654. package/esm/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
  655. package/esm/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
  656. package/esm/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
  657. package/esm/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
  658. package/esm/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
  659. package/esm/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
  660. package/esm/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
  661. package/esm/src/utils/markdown/trimCodeBlock.d.ts +1 -1
  662. package/esm/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
  663. package/esm/src/utils/misc/$getCurrentDate.d.ts +1 -0
  664. package/esm/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
  665. package/esm/src/utils/misc/computeHash.d.ts +0 -3
  666. package/esm/src/utils/misc/debounce.d.ts +2 -0
  667. package/esm/src/utils/misc/emojis.d.ts +3 -8
  668. package/esm/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
  669. package/esm/src/utils/misc/parseNumber.d.ts +0 -4
  670. package/esm/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
  671. package/esm/src/utils/normalization/IKeywords.d.ts +0 -3
  672. package/esm/src/utils/normalization/nameToUriPart.d.ts +1 -0
  673. package/esm/src/utils/normalization/nameToUriParts.d.ts +1 -0
  674. package/esm/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
  675. package/esm/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
  676. package/esm/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
  677. package/esm/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
  678. package/esm/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  679. package/esm/src/utils/normalization/orderJson.d.ts +1 -0
  680. package/esm/src/utils/normalization/orderJson.test.d.ts +0 -3
  681. package/esm/src/utils/normalization/parseKeywords.d.ts +1 -4
  682. package/esm/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
  683. package/esm/src/utils/normalization/removeDiacritics.d.ts +1 -3
  684. package/esm/src/utils/normalization/removeEmojis.d.ts +1 -0
  685. package/esm/src/utils/normalization/removeQuotes.d.ts +1 -0
  686. package/esm/src/utils/normalization/searchKeywords.d.ts +1 -3
  687. package/esm/src/utils/normalization/titleToName.d.ts +1 -0
  688. package/esm/src/utils/normalization/unwrapResult.d.ts +1 -3
  689. package/esm/src/utils/organization/$sideEffect.d.ts +1 -0
  690. package/esm/src/utils/organization/TODO_USE.d.ts +1 -0
  691. package/esm/src/utils/organization/just.d.ts +1 -0
  692. package/esm/src/utils/organization/keepImported.d.ts +1 -0
  693. package/esm/src/utils/organization/keepTypeImported.d.ts +1 -0
  694. package/esm/src/utils/organization/keepUnused.d.ts +1 -0
  695. package/esm/src/utils/organization/preserve.d.ts +1 -3
  696. package/esm/src/utils/organization/really_any.d.ts +1 -0
  697. package/esm/src/utils/organization/spaceTrim.d.ts +3 -2
  698. package/esm/src/utils/parameters/extractParameterNames.d.ts +1 -0
  699. package/esm/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
  700. package/esm/src/utils/parameters/templateParameters.d.ts +2 -1
  701. package/esm/src/utils/parameters/valueToString.d.ts +2 -2
  702. package/esm/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
  703. package/esm/src/utils/random/$randomAgentPersona.d.ts +1 -3
  704. package/esm/src/utils/random/$randomAgentRule.d.ts +1 -3
  705. package/esm/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
  706. package/esm/src/utils/random/$randomItem.d.ts +0 -3
  707. package/esm/src/utils/random/$randomSeed.d.ts +0 -3
  708. package/esm/src/utils/random/$randomToken.d.ts +2 -5
  709. package/esm/src/utils/random/EnglishNamePool.d.ts +1 -0
  710. package/esm/src/utils/serialization/$deepFreeze.d.ts +1 -3
  711. package/esm/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
  712. package/esm/src/utils/serialization/clonePipeline.d.ts +1 -3
  713. package/esm/src/utils/serialization/deepClone.d.ts +1 -3
  714. package/esm/src/utils/serialization/exportJson.d.ts +1 -3
  715. package/esm/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
  716. package/esm/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
  717. package/esm/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
  718. package/esm/src/utils/sets/difference.d.ts +1 -3
  719. package/esm/src/utils/sets/intersection.d.ts +1 -0
  720. package/esm/src/utils/sets/union.d.ts +1 -0
  721. package/esm/src/utils/take/classes/TakeChain.d.ts +4 -1
  722. package/esm/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
  723. package/esm/src/utils/take/interfaces/Takeable.d.ts +2 -1
  724. package/esm/src/utils/take/take.d.ts +1 -1
  725. package/esm/src/utils/validators/filePath/isRootPath.d.ts +1 -3
  726. package/esm/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
  727. package/esm/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
  728. package/esm/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
  729. package/esm/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
  730. package/esm/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  731. package/esm/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
  732. package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
  733. package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
  734. package/esm/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
  735. package/esm/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
  736. package/esm/src/version.d.ts +1 -1
  737. package/esm/src/wizard/$getCompiledBook.d.ts +0 -2
  738. package/esm/src/wizard/wizard.d.ts +1 -2
  739. package/package.json +2 -2
  740. package/umd/index.umd.js +710 -668
  741. package/umd/index.umd.js.map +1 -1
  742. package/umd/src/_packages/types.index.d.ts +45 -45
  743. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -4
  744. package/umd/src/book-2.0/agent-source/AgentModelRequirements.d.ts +0 -4
  745. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +7 -0
  746. package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +1 -0
  747. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +1 -0
  748. package/umd/src/book-2.0/agent-source/padBook.d.ts +1 -4
  749. package/umd/src/book-2.0/agent-source/parseAgentSource.d.ts +0 -3
  750. package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -0
  751. package/umd/src/book-2.0/agent-source/parseParameters.d.ts +1 -0
  752. package/umd/src/book-2.0/agent-source/parseTeamCommitment.d.ts +0 -3
  753. package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +8 -3
  754. package/umd/src/book-2.0/agent-source/string_book.d.ts +1 -0
  755. package/umd/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +0 -3
  756. package/umd/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +0 -3
  757. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +0 -3
  758. package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +4 -0
  759. package/umd/src/book-components/BookEditor/BookEditor.d.ts +0 -3
  760. package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +4 -0
  761. package/umd/src/book-components/BookEditor/BookEditorMonaco.d.ts +2 -0
  762. package/umd/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +3 -0
  763. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +1 -0
  764. package/umd/src/book-components/BookEditor/useBookEditorMonacoDecorations.d.ts +6 -0
  765. package/umd/src/book-components/BookEditor/useBookEditorMonacoDiagnostics.d.ts +9 -0
  766. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +7 -0
  767. package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +3 -0
  768. package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +24 -0
  769. package/umd/src/book-components/Chat/AgentChat/AgentChat.d.ts +0 -3
  770. package/umd/src/book-components/Chat/AgentChip/AgentChip.d.ts +6 -5
  771. package/umd/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +4 -8
  772. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +2 -3
  773. package/umd/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
  774. package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
  775. package/umd/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +1 -0
  776. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
  777. package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
  778. package/umd/src/book-components/Chat/Chat/constants.d.ts +4 -3
  779. package/umd/src/book-components/Chat/Chat/insertDictationChunk.d.ts +16 -0
  780. package/umd/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
  781. package/umd/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
  782. package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
  783. package/umd/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +1 -0
  784. package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +1 -0
  785. package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +1 -0
  786. package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +1 -0
  787. package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +1 -0
  788. package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +1 -0
  789. package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +1 -0
  790. package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +1 -0
  791. package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +1 -0
  792. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +1 -0
  793. package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +1 -0
  794. package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +1 -0
  795. package/umd/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
  796. package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +1 -0
  797. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +7 -30
  798. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
  799. package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -0
  800. package/umd/src/book-components/Chat/LlmChat/defaults.d.ts +0 -3
  801. package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
  802. package/umd/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
  803. package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
  804. package/umd/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
  805. package/umd/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
  806. package/umd/src/book-components/Chat/effects/index.d.ts +0 -4
  807. package/umd/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
  808. package/umd/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
  809. package/umd/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
  810. package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
  811. package/umd/src/book-components/Chat/save/index.d.ts +0 -3
  812. package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
  813. package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
  814. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
  815. package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
  816. package/umd/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
  817. package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
  818. package/umd/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
  819. package/umd/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
  820. package/umd/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
  821. package/umd/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
  822. package/umd/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
  823. package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
  824. package/umd/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
  825. package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
  826. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
  827. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
  828. package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
  829. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
  830. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
  831. package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
  832. package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
  833. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
  834. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
  835. package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
  836. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
  837. package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
  838. package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
  839. package/umd/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
  840. package/umd/src/book-components/Qr/GenericQrCode.d.ts +5 -0
  841. package/umd/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
  842. package/umd/src/book-components/Qr/useQrCode.d.ts +4 -1
  843. package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
  844. package/umd/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
  845. package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
  846. package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -3
  847. package/umd/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
  848. package/umd/src/book-components/icons/AboutIcon.d.ts +1 -0
  849. package/umd/src/book-components/icons/AttachmentIcon.d.ts +4 -0
  850. package/umd/src/book-components/icons/CameraIcon.d.ts +4 -0
  851. package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -0
  852. package/umd/src/book-components/icons/EmailIcon.d.ts +1 -0
  853. package/umd/src/book-components/icons/MenuIcon.d.ts +1 -3
  854. package/umd/src/book-components/icons/SaveIcon.d.ts +1 -0
  855. package/umd/src/book-components/icons/SendIcon.d.ts +0 -3
  856. package/umd/src/book-components/icons/TeacherIcon.d.ts +1 -0
  857. package/umd/src/cli/$runPromptbookCli.d.ts +0 -1
  858. package/umd/src/cli/cli-commands/_boilerplate.d.ts +0 -2
  859. package/umd/src/cli/cli-commands/about.d.ts +0 -6
  860. package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
  861. package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -2
  862. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -2
  863. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -2
  864. package/umd/src/cli/cli-commands/coder/init.d.ts +0 -2
  865. package/umd/src/cli/cli-commands/coder/run.d.ts +1 -3
  866. package/umd/src/cli/cli-commands/coder/run.test.d.ts +1 -0
  867. package/umd/src/cli/cli-commands/coder/verify.d.ts +0 -2
  868. package/umd/src/cli/cli-commands/coder.d.ts +0 -2
  869. package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
  870. package/umd/src/cli/cli-commands/hello.d.ts +0 -5
  871. package/umd/src/cli/cli-commands/list-models.d.ts +0 -2
  872. package/umd/src/cli/cli-commands/list-scrapers.d.ts +0 -2
  873. package/umd/src/cli/cli-commands/login.d.ts +0 -5
  874. package/umd/src/cli/cli-commands/prettify.d.ts +0 -6
  875. package/umd/src/cli/cli-commands/run.d.ts +0 -8
  876. package/umd/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
  877. package/umd/src/cli/cli-commands/start-agents-server.d.ts +0 -2
  878. package/umd/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
  879. package/umd/src/cli/cli-commands/test-command.d.ts +0 -7
  880. package/umd/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
  881. package/umd/src/cli/main.d.ts +0 -2
  882. package/umd/src/cli/promptbookCli.d.ts +0 -7
  883. package/umd/src/collection/agent-collection/AgentCollection.d.ts +0 -3
  884. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
  885. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
  886. package/umd/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
  887. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
  888. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
  889. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
  890. package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
  891. package/umd/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
  892. package/umd/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
  893. package/umd/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
  894. package/umd/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
  895. package/umd/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
  896. package/umd/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
  897. package/umd/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
  898. package/umd/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
  899. package/umd/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
  900. package/umd/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
  901. package/umd/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
  902. package/umd/src/commands/JOKER/JokerCommand.d.ts +1 -0
  903. package/umd/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
  904. package/umd/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
  905. package/umd/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
  906. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
  907. package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
  908. package/umd/src/commands/MODEL/ModelCommand.d.ts +1 -0
  909. package/umd/src/commands/MODEL/modelCommandParser.d.ts +1 -0
  910. package/umd/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
  911. package/umd/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
  912. package/umd/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
  913. package/umd/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
  914. package/umd/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
  915. package/umd/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
  916. package/umd/src/commands/SECTION/SectionCommand.d.ts +1 -0
  917. package/umd/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
  918. package/umd/src/commands/URL/UrlCommand.d.ts +1 -0
  919. package/umd/src/commands/URL/urlCommandParser.d.ts +1 -0
  920. package/umd/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
  921. package/umd/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
  922. package/umd/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
  923. package/umd/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
  924. package/umd/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
  925. package/umd/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
  926. package/umd/src/commands/_common/stringifyCommand.d.ts +1 -1
  927. package/umd/src/commands/_common/types/CommandParser.d.ts +0 -4
  928. package/umd/src/commands/index.d.ts +0 -3
  929. package/umd/src/commitments/ACTION/ACTION.d.ts +0 -3
  930. package/umd/src/commitments/CLOSED/CLOSED.d.ts +0 -3
  931. package/umd/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
  932. package/umd/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
  933. package/umd/src/commitments/DELETE/DELETE.d.ts +0 -3
  934. package/umd/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
  935. package/umd/src/commitments/FORMAT/FORMAT.d.ts +0 -3
  936. package/umd/src/commitments/FROM/FROM.d.ts +0 -3
  937. package/umd/src/commitments/GOAL/GOAL.d.ts +0 -3
  938. package/umd/src/commitments/IMPORT/IMPORT.d.ts +0 -3
  939. package/umd/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
  940. package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -3
  941. package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
  942. package/umd/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
  943. package/umd/src/commitments/META/META.d.ts +0 -3
  944. package/umd/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
  945. package/umd/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
  946. package/umd/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
  947. package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
  948. package/umd/src/commitments/META_FONT/META_FONT.d.ts +0 -3
  949. package/umd/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
  950. package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
  951. package/umd/src/commitments/META_LINK/META_LINK.d.ts +0 -3
  952. package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
  953. package/umd/src/commitments/MODEL/MODEL.d.ts +0 -3
  954. package/umd/src/commitments/OPEN/OPEN.d.ts +0 -3
  955. package/umd/src/commitments/PERSONA/PERSONA.d.ts +0 -3
  956. package/umd/src/commitments/RULE/RULE.d.ts +0 -3
  957. package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
  958. package/umd/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
  959. package/umd/src/commitments/TEAM/TEAM.d.ts +0 -3
  960. package/umd/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
  961. package/umd/src/commitments/USE/USE.d.ts +0 -3
  962. package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
  963. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
  964. package/umd/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -5
  965. package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
  966. package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
  967. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
  968. package/umd/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
  969. package/umd/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
  970. package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
  971. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
  972. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
  973. package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
  974. package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
  975. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
  976. package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
  977. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
  978. package/umd/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
  979. package/umd/src/commitments/WALLET/WALLET.d.ts +0 -3
  980. package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
  981. package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
  982. package/umd/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
  983. package/umd/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
  984. package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
  985. package/umd/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
  986. package/umd/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
  987. package/umd/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
  988. package/umd/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
  989. package/umd/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
  990. package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
  991. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
  992. package/umd/src/commitments/index.d.ts +0 -4
  993. package/umd/src/config.test.d.ts +0 -3
  994. package/umd/src/constants/streaming.d.ts +0 -3
  995. package/umd/src/constants.d.ts +0 -3
  996. package/umd/src/conversion/archive/loadArchive.d.ts +0 -1
  997. package/umd/src/conversion/archive/saveArchive.d.ts +0 -5
  998. package/umd/src/conversion/compilePipeline.d.ts +2 -7
  999. package/umd/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
  1000. package/umd/src/conversion/parsePipeline.d.ts +1 -11
  1001. package/umd/src/conversion/pipelineJsonToString.d.ts +1 -7
  1002. package/umd/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
  1003. package/umd/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
  1004. package/umd/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
  1005. package/umd/src/conversion/validation/_importPipeline.d.ts +6 -2
  1006. package/umd/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
  1007. package/umd/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
  1008. package/umd/src/conversion/validation/validatePipeline.d.ts +3 -9
  1009. package/umd/src/conversion/validation/validatePipeline.test.d.ts +0 -3
  1010. package/umd/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -2
  1011. package/umd/src/errors/0-BoilerplateError.d.ts +0 -3
  1012. package/umd/src/errors/0-index.d.ts +0 -3
  1013. package/umd/src/errors/DatabaseError.d.ts +0 -3
  1014. package/umd/src/errors/ExpectError.d.ts +2 -1
  1015. package/umd/src/errors/ParseError.d.ts +0 -3
  1016. package/umd/src/errors/PipelineExecutionError.d.ts +0 -3
  1017. package/umd/src/executables/$provideExecutablesForNode.d.ts +0 -5
  1018. package/umd/src/executables/apps/locateLibreoffice.d.ts +0 -2
  1019. package/umd/src/executables/apps/locatePandoc.d.ts +0 -2
  1020. package/umd/src/executables/browsers/locateBrowser.d.ts +0 -1
  1021. package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
  1022. package/umd/src/executables/locateApp.d.ts +0 -2
  1023. package/umd/src/executables/platforms/locateAppOnLinux.d.ts +0 -2
  1024. package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +0 -2
  1025. package/umd/src/executables/platforms/locateAppOnWindows.d.ts +0 -2
  1026. package/umd/src/execution/AbstractTaskResult.d.ts +0 -4
  1027. package/umd/src/execution/AvailableModel.d.ts +0 -4
  1028. package/umd/src/execution/CommonToolsOptions.d.ts +0 -5
  1029. package/umd/src/execution/ExecutionTask.d.ts +4 -4
  1030. package/umd/src/execution/FilesystemTools.d.ts +0 -3
  1031. package/umd/src/execution/LlmExecutionTools.d.ts +3 -9
  1032. package/umd/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
  1033. package/umd/src/execution/PipelineExecutor.d.ts +0 -3
  1034. package/umd/src/execution/PipelineExecutorResult.d.ts +0 -3
  1035. package/umd/src/execution/PromptResult.d.ts +1 -9
  1036. package/umd/src/execution/PromptbookFetch.test-type.d.ts +0 -4
  1037. package/umd/src/execution/ScriptExecutionTools.d.ts +0 -4
  1038. package/umd/src/execution/Usage.d.ts +0 -3
  1039. package/umd/src/execution/UserInterfaceTools.d.ts +3 -0
  1040. package/umd/src/execution/assertsTaskSuccessful.d.ts +1 -3
  1041. package/umd/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
  1042. package/umd/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
  1043. package/umd/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
  1044. package/umd/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
  1045. package/umd/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
  1046. package/umd/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
  1047. package/umd/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
  1048. package/umd/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
  1049. package/umd/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
  1050. package/umd/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
  1051. package/umd/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
  1052. package/umd/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
  1053. package/umd/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
  1054. package/umd/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -3
  1055. package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
  1056. package/umd/src/execution/utils/checkExpectations.d.ts +2 -5
  1057. package/umd/src/execution/utils/forEachAsync.d.ts +5 -1
  1058. package/umd/src/execution/utils/usage-constants.d.ts +0 -3
  1059. package/umd/src/execution/utils/usageToHuman.d.ts +0 -8
  1060. package/umd/src/execution/utils/validatePromptResult.d.ts +1 -0
  1061. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
  1062. package/umd/src/formats/_common/FormatParser.d.ts +2 -9
  1063. package/umd/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
  1064. package/umd/src/formats/csv/CsvFormatParser.d.ts +2 -8
  1065. package/umd/src/formats/index.d.ts +0 -3
  1066. package/umd/src/formats/json/JsonFormatParser.d.ts +0 -11
  1067. package/umd/src/formats/text/TextFormatParser.d.ts +0 -9
  1068. package/umd/src/formats/xml/XmlFormatParser.d.ts +0 -11
  1069. package/umd/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
  1070. package/umd/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
  1071. package/umd/src/formfactors/index.d.ts +0 -3
  1072. package/umd/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
  1073. package/umd/src/high-level-abstractions/index.d.ts +0 -4
  1074. package/umd/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
  1075. package/umd/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
  1076. package/umd/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
  1077. package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -1
  1078. package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  1079. package/umd/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
  1080. package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
  1081. package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -16
  1082. package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
  1083. package/umd/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
  1084. package/umd/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
  1085. package/umd/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
  1086. package/umd/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
  1087. package/umd/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
  1088. package/umd/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
  1089. package/umd/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
  1090. package/umd/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
  1091. package/umd/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
  1092. package/umd/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
  1093. package/umd/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
  1094. package/umd/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
  1095. package/umd/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
  1096. package/umd/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
  1097. package/umd/src/llm-providers/_multiple/playground/playground.d.ts +0 -1
  1098. package/umd/src/llm-providers/agent/Agent.d.ts +0 -3
  1099. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
  1100. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
  1101. package/umd/src/llm-providers/agent/playground/playground.d.ts +0 -6
  1102. package/umd/src/llm-providers/agent/register-configuration.d.ts +0 -5
  1103. package/umd/src/llm-providers/agent/register-constructor.d.ts +0 -4
  1104. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
  1105. package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
  1106. package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
  1107. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
  1108. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
  1109. package/umd/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
  1110. package/umd/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
  1111. package/umd/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
  1112. package/umd/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
  1113. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
  1114. package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
  1115. package/umd/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
  1116. package/umd/src/llm-providers/azure-openai/playground/playground.d.ts +0 -2
  1117. package/umd/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
  1118. package/umd/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
  1119. package/umd/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
  1120. package/umd/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
  1121. package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
  1122. package/umd/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
  1123. package/umd/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
  1124. package/umd/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
  1125. package/umd/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
  1126. package/umd/src/llm-providers/google/google-models.d.ts +1 -6
  1127. package/umd/src/llm-providers/google/register-configuration.d.ts +0 -3
  1128. package/umd/src/llm-providers/google/register-constructor.d.ts +0 -4
  1129. package/umd/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
  1130. package/umd/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
  1131. package/umd/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
  1132. package/umd/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
  1133. package/umd/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
  1134. package/umd/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
  1135. package/umd/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
  1136. package/umd/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
  1137. package/umd/src/llm-providers/ollama/ollama-models.d.ts +1 -4
  1138. package/umd/src/llm-providers/ollama/playground/playground.d.ts +0 -2
  1139. package/umd/src/llm-providers/ollama/register-configuration.d.ts +0 -3
  1140. package/umd/src/llm-providers/ollama/register-constructor.d.ts +0 -4
  1141. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
  1142. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
  1143. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
  1144. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
  1145. package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
  1146. package/umd/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
  1147. package/umd/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
  1148. package/umd/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
  1149. package/umd/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
  1150. package/umd/src/llm-providers/openai/openai-models.d.ts +1 -0
  1151. package/umd/src/llm-providers/openai/openai-models.test.d.ts +0 -3
  1152. package/umd/src/llm-providers/openai/playground/playground.d.ts +0 -2
  1153. package/umd/src/llm-providers/openai/register-configuration.d.ts +0 -3
  1154. package/umd/src/llm-providers/openai/register-constructor.d.ts +0 -4
  1155. package/umd/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
  1156. package/umd/src/llm-providers/remote/playground/playground.d.ts +0 -1
  1157. package/umd/src/llm-providers/vercel/playground/playground.d.ts +0 -2
  1158. package/umd/src/other/templates/getBookTemplates.d.ts +2 -5
  1159. package/umd/src/personas/preparePersona.d.ts +1 -7
  1160. package/umd/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
  1161. package/umd/src/pipeline/PipelineInterface/constants.d.ts +0 -3
  1162. package/umd/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
  1163. package/umd/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
  1164. package/umd/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
  1165. package/umd/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
  1166. package/umd/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
  1167. package/umd/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
  1168. package/umd/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
  1169. package/umd/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
  1170. package/umd/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
  1171. package/umd/src/pipeline/book-notation.d.ts +1 -4
  1172. package/umd/src/pipeline/isValidPipelineString.d.ts +1 -3
  1173. package/umd/src/pipeline/isValidPipelineString.test.d.ts +0 -3
  1174. package/umd/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
  1175. package/umd/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
  1176. package/umd/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
  1177. package/umd/src/pipeline/prompt-notation.d.ts +2 -5
  1178. package/umd/src/pipeline/prompt-notation.test.d.ts +0 -3
  1179. package/umd/src/pipeline/validatePipelineString.d.ts +1 -3
  1180. package/umd/src/playground/permanent/_boilerplate.d.ts +0 -1
  1181. package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +0 -1
  1182. package/umd/src/playground/permanent/error-handling-playground.d.ts +0 -1
  1183. package/umd/src/playground/playground.d.ts +0 -2
  1184. package/umd/src/postprocessing/utils/extractBlock.d.ts +2 -1
  1185. package/umd/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
  1186. package/umd/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
  1187. package/umd/src/prepare/preparePipeline.d.ts +3 -2
  1188. package/umd/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
  1189. package/umd/src/prepare/prepareTasks.d.ts +6 -10
  1190. package/umd/src/prepare/unpreparePipeline.d.ts +1 -5
  1191. package/umd/src/remote-server/RemoteServer.d.ts +3 -0
  1192. package/umd/src/remote-server/openapi.d.ts +3 -4
  1193. package/umd/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
  1194. package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
  1195. package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
  1196. package/umd/src/remote-server/startAgentServer.d.ts +6 -2
  1197. package/umd/src/remote-server/startRemoteServer.d.ts +1 -15
  1198. package/umd/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
  1199. package/umd/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
  1200. package/umd/src/remote-server/ui/ServerApp.d.ts +1 -0
  1201. package/umd/src/remote-server/ui/types.d.ts +3 -0
  1202. package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -4
  1203. package/umd/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
  1204. package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -1
  1205. package/umd/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
  1206. package/umd/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
  1207. package/umd/src/scrapers/_common/Scraper.d.ts +0 -5
  1208. package/umd/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
  1209. package/umd/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
  1210. package/umd/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -2
  1211. package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -2
  1212. package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -2
  1213. package/umd/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
  1214. package/umd/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
  1215. package/umd/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
  1216. package/umd/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
  1217. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
  1218. package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
  1219. package/umd/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
  1220. package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -6
  1221. package/umd/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
  1222. package/umd/src/scrapers/document/createDocumentScraper.d.ts +0 -3
  1223. package/umd/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -1
  1224. package/umd/src/scrapers/document/register-constructor.d.ts +0 -4
  1225. package/umd/src/scrapers/document/register-metadata.d.ts +0 -3
  1226. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
  1227. package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
  1228. package/umd/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
  1229. package/umd/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -1
  1230. package/umd/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
  1231. package/umd/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
  1232. package/umd/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
  1233. package/umd/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
  1234. package/umd/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
  1235. package/umd/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -1
  1236. package/umd/src/scrapers/markdown/register-constructor.d.ts +0 -4
  1237. package/umd/src/scrapers/markdown/register-metadata.d.ts +0 -3
  1238. package/umd/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
  1239. package/umd/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
  1240. package/umd/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -1
  1241. package/umd/src/scrapers/markitdown/register-constructor.d.ts +0 -5
  1242. package/umd/src/scrapers/markitdown/register-metadata.d.ts +0 -3
  1243. package/umd/src/scrapers/pdf/PdfScraper.d.ts +1 -6
  1244. package/umd/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
  1245. package/umd/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -1
  1246. package/umd/src/scrapers/pdf/register-constructor.d.ts +0 -4
  1247. package/umd/src/scrapers/pdf/register-metadata.d.ts +0 -3
  1248. package/umd/src/scrapers/website/WebsiteScraper.d.ts +1 -6
  1249. package/umd/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
  1250. package/umd/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -1
  1251. package/umd/src/scrapers/website/register-constructor.d.ts +0 -4
  1252. package/umd/src/scrapers/website/register-metadata.d.ts +0 -3
  1253. package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
  1254. package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
  1255. package/umd/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
  1256. package/umd/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
  1257. package/umd/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
  1258. package/umd/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
  1259. package/umd/src/search-engines/SearchEngine.d.ts +3 -0
  1260. package/umd/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -2
  1261. package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
  1262. package/umd/src/storage/_common/PromptbookStorage.d.ts +0 -4
  1263. package/umd/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
  1264. package/umd/src/storage/env-storage/$EnvStorage.d.ts +0 -3
  1265. package/umd/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -2
  1266. package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -1
  1267. package/umd/src/storage/local-storage/getLocalStorage.d.ts +0 -1
  1268. package/umd/src/storage/local-storage/getSessionStorage.d.ts +0 -1
  1269. package/umd/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
  1270. package/umd/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
  1271. package/umd/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
  1272. package/umd/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
  1273. package/umd/src/transpilers/openai-sdk/playground/playground.d.ts +0 -1
  1274. package/umd/src/transpilers/openai-sdk/register.d.ts +2 -5
  1275. package/umd/src/types/Arrayable.d.ts +1 -0
  1276. package/umd/src/types/InputParameters_private.d.ts +4 -2
  1277. package/umd/src/types/IntermediateFilesStrategy.d.ts +0 -3
  1278. package/umd/src/types/LlmCall.d.ts +0 -3
  1279. package/umd/src/types/ModelRequirements.d.ts +1 -0
  1280. package/umd/src/types/ModelVariant.d.ts +3 -0
  1281. package/umd/src/types/Parameters.d.ts +31 -0
  1282. package/umd/src/types/Parameters_private.d.ts +4 -2
  1283. package/umd/src/types/Prompt.d.ts +1 -6
  1284. package/umd/src/types/ReservedParameters_private.d.ts +2 -1
  1285. package/umd/src/types/ToolCall.d.ts +0 -2
  1286. package/umd/src/types/Updatable.d.ts +1 -3
  1287. package/umd/src/types/string_agent_hash_private.d.ts +1 -1
  1288. package/umd/src/types/string_agent_name.d.ts +32 -0
  1289. package/umd/src/types/string_agent_name_in_book_private.d.ts +1 -1
  1290. package/umd/src/types/string_agent_name_private.d.ts +2 -1
  1291. package/umd/src/types/string_agent_permanent_id_private.d.ts +2 -1
  1292. package/umd/src/types/string_business_category_name.d.ts +5 -0
  1293. package/umd/src/types/string_business_category_name_private.d.ts +1 -1
  1294. package/umd/src/types/string_char_private.d.ts +1 -1
  1295. package/umd/src/types/string_chat_prompt_private.d.ts +1 -1
  1296. package/umd/src/types/string_completion_prompt_private.d.ts +1 -1
  1297. package/umd/src/types/string_markdown.d.ts +0 -1
  1298. package/umd/src/types/string_mime_type_private.d.ts +1 -0
  1299. package/umd/src/types/string_model_description_private.d.ts +1 -1
  1300. package/umd/src/types/string_model_name.d.ts +7 -0
  1301. package/umd/src/types/string_model_name_private.d.ts +1 -1
  1302. package/umd/src/types/string_name.d.ts +31 -0
  1303. package/umd/src/types/string_name_private.d.ts +1 -1
  1304. package/umd/src/types/string_page.d.ts +15 -0
  1305. package/umd/src/types/string_page_private.d.ts +1 -1
  1306. package/umd/src/types/string_parameter_name.d.ts +11 -210
  1307. package/umd/src/types/string_parameter_value_private.d.ts +1 -1
  1308. package/umd/src/types/string_persona_description.d.ts +14 -0
  1309. package/umd/src/types/string_persona_description_private.d.ts +1 -1
  1310. package/umd/src/types/string_prompt.d.ts +49 -0
  1311. package/umd/src/types/string_prompt_image_private.d.ts +1 -1
  1312. package/umd/src/types/string_prompt_private.d.ts +1 -1
  1313. package/umd/src/types/string_reserved_parameter_name_private.d.ts +1 -1
  1314. package/umd/src/types/string_sha256.d.ts +2 -2
  1315. package/umd/src/types/string_system_message_private.d.ts +1 -1
  1316. package/umd/src/types/string_template_private.d.ts +1 -1
  1317. package/umd/src/types/string_text_prompt_private.d.ts +1 -1
  1318. package/umd/src/types/string_title.d.ts +8 -0
  1319. package/umd/src/types/string_title_private.d.ts +1 -1
  1320. package/umd/src/types/typeAliasEmoji.d.ts +0 -3
  1321. package/umd/src/types/typeAliases.d.ts +0 -6
  1322. package/umd/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
  1323. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
  1324. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
  1325. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
  1326. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
  1327. package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
  1328. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
  1329. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
  1330. package/umd/src/utils/chat/chatAttachments.d.ts +0 -3
  1331. package/umd/src/utils/chat/constants.d.ts +0 -3
  1332. package/umd/src/utils/clientVersion.d.ts +0 -3
  1333. package/umd/src/utils/color/$randomColor.d.ts +0 -5
  1334. package/umd/src/utils/color/css-colors.d.ts +0 -3
  1335. package/umd/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
  1336. package/umd/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
  1337. package/umd/src/utils/color/operators/ColorTransformer.d.ts +2 -0
  1338. package/umd/src/utils/color/operators/lighten.d.ts +0 -3
  1339. package/umd/src/utils/color/operators/saturate.d.ts +0 -3
  1340. package/umd/src/utils/color/utils/areColorsEqual.d.ts +0 -3
  1341. package/umd/src/utils/color/utils/colorDistance.d.ts +2 -2
  1342. package/umd/src/utils/color/utils/colorHue.d.ts +0 -1
  1343. package/umd/src/utils/color/utils/colorHueDistance.d.ts +0 -1
  1344. package/umd/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
  1345. package/umd/src/utils/database/uniqueConstraint.d.ts +1 -3
  1346. package/umd/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
  1347. package/umd/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
  1348. package/umd/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
  1349. package/umd/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
  1350. package/umd/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
  1351. package/umd/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
  1352. package/umd/src/utils/environment/$getGlobalScope.d.ts +1 -1
  1353. package/umd/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
  1354. package/umd/src/utils/environment/$isRunningInJest.d.ts +0 -3
  1355. package/umd/src/utils/environment/$isRunningInNode.d.ts +0 -3
  1356. package/umd/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
  1357. package/umd/src/utils/execCommand/$execCommand.d.ts +0 -2
  1358. package/umd/src/utils/execCommand/$execCommands.d.ts +0 -1
  1359. package/umd/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
  1360. package/umd/src/utils/expectation-counters/constants.d.ts +0 -4
  1361. package/umd/src/utils/expectation-counters/countCharacters.d.ts +0 -4
  1362. package/umd/src/utils/expectation-counters/countLines.d.ts +0 -4
  1363. package/umd/src/utils/expectation-counters/countPages.d.ts +0 -4
  1364. package/umd/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
  1365. package/umd/src/utils/expectation-counters/countSentences.d.ts +0 -4
  1366. package/umd/src/utils/expectation-counters/countWords.d.ts +0 -5
  1367. package/umd/src/utils/expectation-counters/index.d.ts +0 -4
  1368. package/umd/src/utils/files/$induceBookDownload.d.ts +0 -1
  1369. package/umd/src/utils/files/$induceFileDownload.d.ts +0 -1
  1370. package/umd/src/utils/files/ObjectUrl.d.ts +0 -1
  1371. package/umd/src/utils/files/isDirectoryExisting.d.ts +0 -6
  1372. package/umd/src/utils/files/isExecutable.d.ts +0 -4
  1373. package/umd/src/utils/files/isFileExisting.d.ts +0 -5
  1374. package/umd/src/utils/files/listAllFiles.d.ts +1 -5
  1375. package/umd/src/utils/files/readResponseBytes.d.ts +1 -0
  1376. package/umd/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
  1377. package/umd/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
  1378. package/umd/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
  1379. package/umd/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
  1380. package/umd/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
  1381. package/umd/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
  1382. package/umd/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
  1383. package/umd/src/utils/markdown/createMarkdownTable.d.ts +0 -3
  1384. package/umd/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
  1385. package/umd/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
  1386. package/umd/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
  1387. package/umd/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
  1388. package/umd/src/utils/markdown/humanizeAiText.d.ts +0 -3
  1389. package/umd/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
  1390. package/umd/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
  1391. package/umd/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
  1392. package/umd/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
  1393. package/umd/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
  1394. package/umd/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
  1395. package/umd/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
  1396. package/umd/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
  1397. package/umd/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
  1398. package/umd/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
  1399. package/umd/src/utils/markdown/trimCodeBlock.d.ts +1 -1
  1400. package/umd/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
  1401. package/umd/src/utils/misc/$getCurrentDate.d.ts +1 -0
  1402. package/umd/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
  1403. package/umd/src/utils/misc/computeHash.d.ts +0 -3
  1404. package/umd/src/utils/misc/debounce.d.ts +2 -0
  1405. package/umd/src/utils/misc/emojis.d.ts +3 -8
  1406. package/umd/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
  1407. package/umd/src/utils/misc/parseNumber.d.ts +0 -4
  1408. package/umd/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
  1409. package/umd/src/utils/normalization/IKeywords.d.ts +0 -3
  1410. package/umd/src/utils/normalization/nameToUriPart.d.ts +1 -0
  1411. package/umd/src/utils/normalization/nameToUriParts.d.ts +1 -0
  1412. package/umd/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
  1413. package/umd/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
  1414. package/umd/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
  1415. package/umd/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
  1416. package/umd/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
  1417. package/umd/src/utils/normalization/orderJson.d.ts +1 -0
  1418. package/umd/src/utils/normalization/orderJson.test.d.ts +0 -3
  1419. package/umd/src/utils/normalization/parseKeywords.d.ts +1 -4
  1420. package/umd/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
  1421. package/umd/src/utils/normalization/removeDiacritics.d.ts +1 -3
  1422. package/umd/src/utils/normalization/removeEmojis.d.ts +1 -0
  1423. package/umd/src/utils/normalization/removeQuotes.d.ts +1 -0
  1424. package/umd/src/utils/normalization/searchKeywords.d.ts +1 -3
  1425. package/umd/src/utils/normalization/titleToName.d.ts +1 -0
  1426. package/umd/src/utils/normalization/unwrapResult.d.ts +1 -3
  1427. package/umd/src/utils/organization/$sideEffect.d.ts +1 -0
  1428. package/umd/src/utils/organization/TODO_USE.d.ts +1 -0
  1429. package/umd/src/utils/organization/just.d.ts +1 -0
  1430. package/umd/src/utils/organization/keepImported.d.ts +1 -0
  1431. package/umd/src/utils/organization/keepTypeImported.d.ts +1 -0
  1432. package/umd/src/utils/organization/keepUnused.d.ts +1 -0
  1433. package/umd/src/utils/organization/preserve.d.ts +1 -3
  1434. package/umd/src/utils/organization/really_any.d.ts +1 -0
  1435. package/umd/src/utils/organization/spaceTrim.d.ts +3 -2
  1436. package/umd/src/utils/parameters/extractParameterNames.d.ts +1 -0
  1437. package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
  1438. package/umd/src/utils/parameters/templateParameters.d.ts +2 -1
  1439. package/umd/src/utils/parameters/valueToString.d.ts +2 -2
  1440. package/umd/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
  1441. package/umd/src/utils/random/$randomAgentPersona.d.ts +1 -3
  1442. package/umd/src/utils/random/$randomAgentRule.d.ts +1 -3
  1443. package/umd/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
  1444. package/umd/src/utils/random/$randomItem.d.ts +0 -3
  1445. package/umd/src/utils/random/$randomSeed.d.ts +0 -3
  1446. package/umd/src/utils/random/$randomToken.d.ts +2 -5
  1447. package/umd/src/utils/random/EnglishNamePool.d.ts +1 -0
  1448. package/umd/src/utils/serialization/$deepFreeze.d.ts +1 -3
  1449. package/umd/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
  1450. package/umd/src/utils/serialization/clonePipeline.d.ts +1 -3
  1451. package/umd/src/utils/serialization/deepClone.d.ts +1 -3
  1452. package/umd/src/utils/serialization/exportJson.d.ts +1 -3
  1453. package/umd/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
  1454. package/umd/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
  1455. package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
  1456. package/umd/src/utils/sets/difference.d.ts +1 -3
  1457. package/umd/src/utils/sets/intersection.d.ts +1 -0
  1458. package/umd/src/utils/sets/union.d.ts +1 -0
  1459. package/umd/src/utils/take/classes/TakeChain.d.ts +4 -1
  1460. package/umd/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
  1461. package/umd/src/utils/take/interfaces/Takeable.d.ts +2 -1
  1462. package/umd/src/utils/take/take.d.ts +1 -1
  1463. package/umd/src/utils/validators/filePath/isRootPath.d.ts +1 -3
  1464. package/umd/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
  1465. package/umd/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
  1466. package/umd/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
  1467. package/umd/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
  1468. package/umd/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
  1469. package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
  1470. package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
  1471. package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
  1472. package/umd/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
  1473. package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
  1474. package/umd/src/version.d.ts +1 -1
  1475. package/umd/src/wizard/$getCompiledBook.d.ts +0 -2
  1476. package/umd/src/wizard/wizard.d.ts +1 -2
package/umd/index.umd.js CHANGED
@@ -50,7 +50,7 @@
50
50
  * @generated
51
51
  * @see https://github.com/webgptorg/promptbook
52
52
  */
53
- const PROMPTBOOK_ENGINE_VERSION = '0.112.0-34';
53
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
54
54
  /**
55
55
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
56
56
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -60,16 +60,20 @@
60
60
  * Trims string from all 4 sides
61
61
  *
62
62
  * Note: This is a re-exported function from the `spacetrim` package which is
63
- * Developed by same author @hejny as this package
63
+ * Developed by same author @hejny as this package
64
64
  *
65
- * @public exported from `@promptbook/utils`
66
65
  * @see https://github.com/hejny/spacetrim#usage
66
+ *
67
+ * @public exported from `@promptbook/utils`
67
68
  */
68
69
  const spaceTrim = _spaceTrim.spaceTrim;
69
70
 
70
71
  /**
71
- * @private util of `@promptbook/color`
72
+ * Class implementing take chain.
73
+ *
72
74
  * @de
75
+ *
76
+ * @private util of `@promptbook/color`
73
77
  */
74
78
  class TakeChain {
75
79
  constructor(value) {
@@ -86,9 +90,9 @@
86
90
  *
87
91
  * @param {*} initialValue - The initial value.
88
92
  * @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
93
+ * @deprecated [🤡] Use some better functional library instead of `TakeChain`
89
94
  *
90
95
  * @private util of `@promptbook/color`
91
- * @deprecated [🤡] Use some better functional library instead of `TakeChain`
92
96
  */
93
97
  function take(initialValue) {
94
98
  if (initialValue instanceof TakeChain) {
@@ -266,9 +270,7 @@
266
270
  yellow: '#ffff00',
267
271
  yellowgreen: '#9acd32',
268
272
  };
269
- /**
270
- * Note: [💞] Ignore a discrepancy between file name and entity name
271
- */
273
+ // Note: [💞] Ignore a discrepancy between file name and entity name
272
274
 
273
275
  /**
274
276
  * Validates that a channel value is a valid number within the range of 0 to 255.
@@ -298,7 +300,13 @@
298
300
  }
299
301
  }
300
302
 
303
+ /**
304
+ * Constant for short hex lengths.
305
+ */
301
306
  const SHORT_HEX_LENGTHS = new Set([3, 4]);
307
+ /**
308
+ * Constant for long hex lengths.
309
+ */
302
310
  const LONG_HEX_LENGTHS = new Set([6, 8]);
303
311
  /**
304
312
  * Parses a hex string into RGBA channel values.
@@ -331,6 +339,9 @@
331
339
  }
332
340
  return throwInvalidHex();
333
341
  }
342
+ /**
343
+ * Parses short hex channel.
344
+ */
334
345
  function parseShortHexChannel(char, onError) {
335
346
  if (!char) {
336
347
  return onError();
@@ -341,6 +352,9 @@
341
352
  }
342
353
  return parsed * 16;
343
354
  }
355
+ /**
356
+ * Parses long hex channel.
357
+ */
344
358
  function parseLongHexChannel(hex, start, onError) {
345
359
  const segment = hex.substr(start, 2);
346
360
  if (segment.length < 2) {
@@ -353,6 +367,9 @@
353
367
  return parsed;
354
368
  }
355
369
 
370
+ /**
371
+ * Pattern matching hsl.
372
+ */
356
373
  const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
357
374
  /**
358
375
  * Parses an HSL string into RGBA channel values.
@@ -378,6 +395,9 @@
378
395
  alpha: 255,
379
396
  };
380
397
  }
398
+ /**
399
+ * Handles convert hsl to Rgb.
400
+ */
381
401
  function convertHslToRgb(h, s, l) {
382
402
  const c = (1 - Math.abs(2 * l - 1)) * s;
383
403
  const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
@@ -416,7 +436,13 @@
416
436
  };
417
437
  }
418
438
 
439
+ /**
440
+ * Pattern matching RGB.
441
+ */
419
442
  const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
443
+ /**
444
+ * Pattern matching rgba.
445
+ */
420
446
  const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
421
447
  /**
422
448
  * Parses an RGB string into RGBA channel values.
@@ -458,6 +484,9 @@
458
484
  alpha: parseAlphaValue(match[4]),
459
485
  };
460
486
  }
487
+ /**
488
+ * Parses channel value.
489
+ */
461
490
  function parseChannelValue(value) {
462
491
  if (value.endsWith('%')) {
463
492
  const percent = parseFloat(value);
@@ -465,6 +494,9 @@
465
494
  }
466
495
  return Math.round(parseFloat(value));
467
496
  }
497
+ /**
498
+ * Parses alpha value.
499
+ */
468
500
  function parseAlphaValue(value) {
469
501
  if (value.endsWith('%')) {
470
502
  const percent = parseFloat(value);
@@ -477,8 +509,17 @@
477
509
  return Math.round(parsed);
478
510
  }
479
511
 
512
+ /**
513
+ * Pattern matching hsl regex.
514
+ */
480
515
  const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
516
+ /**
517
+ * Pattern matching RGB regex.
518
+ */
481
519
  const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
520
+ /**
521
+ * Pattern matching rgba regex.
522
+ */
482
523
  const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
483
524
  /**
484
525
  * Color object represents an RGB color with alpha channel
@@ -844,9 +885,7 @@
844
885
  }
845
886
  return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
846
887
  }
847
- /**
848
- * TODO: Properly name all used internal variables
849
- */
888
+ // TODO: Properly name all used internal variables
850
889
 
851
890
  /**
852
891
  * Converts RGB values to HSL values
@@ -892,9 +931,7 @@
892
931
  }
893
932
  return [hue, saturation, lightness];
894
933
  }
895
- /**
896
- * TODO: Properly name all used internal variables
897
- */
934
+ // TODO: Properly name all used internal variables
898
935
 
899
936
  /**
900
937
  * Makes color transformer which lighten the given color
@@ -912,9 +949,7 @@
912
949
  return Color.fromValues(r, g, b, alpha);
913
950
  };
914
951
  }
915
- /**
916
- * TODO: Maybe implement by mix+hsl
917
- */
952
+ // TODO: Maybe implement by mix+hsl
918
953
 
919
954
  /**
920
955
  * Makes color transformer which saturate the given color
@@ -932,9 +967,7 @@
932
967
  return Color.fromValues(r, g, b, alpha);
933
968
  };
934
969
  }
935
- /**
936
- * TODO: Maybe implement by mix+hsl
937
- */
970
+ // TODO: Maybe implement by mix+hsl
938
971
 
939
972
  /**
940
973
  * Returns the same value that is passed as argument.
@@ -947,6 +980,7 @@
947
980
  *
948
981
  * @param value any values
949
982
  * @returns the same values
983
+ *
950
984
  * @private within the repository
951
985
  */
952
986
  function just(value) {
@@ -1229,9 +1263,7 @@
1229
1263
  return false;
1230
1264
  }
1231
1265
  }
1232
- /**
1233
- * TODO: [🎺]
1234
- */
1266
+ // TODO: [🎺]
1235
1267
 
1236
1268
  /**
1237
1269
  * Normalize options for `execCommand` and `execCommands`
@@ -1299,7 +1331,6 @@
1299
1331
  /**
1300
1332
  * Run one command in a shell
1301
1333
  *
1302
- *
1303
1334
  * Note: There are 2 similar functions in the codebase:
1304
1335
  * - `$execCommand` which runs a single command
1305
1336
  * - `$execCommands` which runs multiple commands
@@ -1398,7 +1429,7 @@
1398
1429
  }
1399
1430
  });
1400
1431
  }
1401
- /** 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 */
1432
+ // 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
1402
1433
 
1403
1434
  /**
1404
1435
  * [🐱‍🚀]
@@ -1407,9 +1438,11 @@
1407
1438
  * You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
1408
1439
  * This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
1409
1440
  *
1441
+ * TODO: [🐱‍🚀] Change to `@promptbook/agent-server`
1442
+ *
1410
1443
  * @see https://github.com/webgptorg/promptbook#remote-server
1444
+ *
1411
1445
  * @public exported from `@promptbook/remote-server`
1412
- * <- TODO: [🐱‍🚀] Change to `@promptbook/agent-server`
1413
1446
  */
1414
1447
  async function startAgentServer(options) {
1415
1448
  const { port = 4440 } = options;
@@ -1425,7 +1458,7 @@
1425
1458
  isVerbose: true,
1426
1459
  });
1427
1460
  }
1428
- /** 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 */
1461
+ // 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
1429
1462
 
1430
1463
  /**
1431
1464
  * Make error report URL for the given error
@@ -1562,16 +1595,15 @@
1562
1595
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
1563
1596
  * Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
1564
1597
  *
1565
- * @private internal helper function
1566
1598
  * @returns secure random token
1599
+ *
1600
+ * @private internal helper function
1567
1601
  */
1568
1602
  function $randomToken(randomness) {
1569
1603
  return crypto.randomBytes(randomness).toString('hex');
1570
1604
  }
1571
- /**
1572
- * TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
1573
- * TODO: Maybe use nanoid instead https://github.com/ai/nanoid
1574
- */
1605
+ // TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
1606
+ // TODO: Maybe use nanoid instead https://github.com/ai/nanoid
1575
1607
 
1576
1608
  /**
1577
1609
  * This error indicates errors during the execution of the pipeline
@@ -1588,9 +1620,7 @@
1588
1620
  Object.setPrototypeOf(this, PipelineExecutionError.prototype);
1589
1621
  }
1590
1622
  }
1591
- /**
1592
- * TODO: [🧠][🌂] Add id to all errors
1593
- */
1623
+ // TODO: [🧠][🌂] Add id to all errors
1594
1624
 
1595
1625
  /**
1596
1626
  * This error indicates problems parsing the format value
@@ -1660,17 +1690,16 @@
1660
1690
  Object.setPrototypeOf(this, DatabaseError.prototype);
1661
1691
  }
1662
1692
  }
1663
- /**
1664
- * TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
1665
- */
1693
+ // TODO: [🐱‍🚀] Explain that NotFoundError ([🐱‍🚀] and other specific errors) has priority over DatabaseError in some contexts
1666
1694
 
1667
1695
  /**
1668
1696
  * This error occurs when some expectation is not met in the execution of the pipeline
1669
1697
  *
1670
- * @public exported from `@promptbook/core`
1671
1698
  * Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
1672
1699
  * Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
1673
1700
  * Note: This is a kindof subtype of PipelineExecutionError
1701
+ *
1702
+ * @public exported from `@promptbook/core`
1674
1703
  */
1675
1704
  class ExpectError extends Error {
1676
1705
  constructor(message) {
@@ -1785,9 +1814,7 @@
1785
1814
  Object.setPrototypeOf(this, ParseError.prototype);
1786
1815
  }
1787
1816
  }
1788
- /**
1789
- * TODO: Maybe split `ParseError` and `ApplyError`
1790
- */
1817
+ // TODO: Maybe split `ParseError` and `ApplyError`
1791
1818
 
1792
1819
  /**
1793
1820
  * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
@@ -1889,9 +1916,7 @@
1889
1916
  ...PROMPTBOOK_ERRORS,
1890
1917
  ...COMMON_JAVASCRIPT_ERRORS,
1891
1918
  };
1892
- /**
1893
- * Note: [💞] Ignore a discrepancy between file name and entity name
1894
- */
1919
+ // Note: [💞] Ignore a discrepancy between file name and entity name
1895
1920
 
1896
1921
  /**
1897
1922
  * Serializes an error into a [🚉] JSON-serializable object
@@ -1938,8 +1963,8 @@
1938
1963
  return null;
1939
1964
  }
1940
1965
  }
1941
- /** 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 */
1942
- /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
1966
+ // 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
1967
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
1943
1968
 
1944
1969
  /**
1945
1970
  * Provides filesystem access (for example for Node.js-based scrapers)
@@ -1962,8 +1987,8 @@
1962
1987
  watch: promises.watch,
1963
1988
  };
1964
1989
  }
1965
- /** 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 */
1966
- /** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
1990
+ // 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
1991
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
1967
1992
 
1968
1993
  /**
1969
1994
  * Checks if the file is executable
@@ -1979,15 +2004,15 @@
1979
2004
  return false;
1980
2005
  }
1981
2006
  }
1982
- /**
1983
- * Note: Not [~🟢~] because it is not directly dependent on `fs
1984
- * TODO: [🖇] What about symlinks?
1985
- */
2007
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
2008
+ // TODO: [🖇] What about symlinks?
1986
2009
 
1987
2010
  // Note: Module `userhome` has no types available, so it is imported using `require`
1988
2011
  // @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
1989
- // eslint-disable-next-line @typescript-eslint/no-var-requires
1990
- const userhome = require('userhome');
2012
+ /**
2013
+ * Constant for userhome.
2014
+ */
2015
+ const userhome = require('userhome'); // eslint-disable-line @typescript-eslint/no-var-requires
1991
2016
  /**
1992
2017
  * Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
1993
2018
  * Returns the path to the executable if found, or null otherwise.
@@ -2016,8 +2041,8 @@
2016
2041
  return null;
2017
2042
  }
2018
2043
  }
2019
- /** 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 */
2020
- /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
2044
+ // 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
2045
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
2021
2046
 
2022
2047
  /**
2023
2048
  * Attempts to locate the specified application on a Windows system by searching common installation directories.
@@ -2046,8 +2071,8 @@
2046
2071
  return null;
2047
2072
  }
2048
2073
  }
2049
- /** 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 */
2050
- /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
2074
+ // 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
2075
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
2051
2076
 
2052
2077
  /**
2053
2078
  * Locates an application on the system
@@ -2084,8 +2109,8 @@
2084
2109
  }
2085
2110
  }
2086
2111
  }
2087
- /** Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment */
2088
- /** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
2112
+ // Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment
2113
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node`
2089
2114
 
2090
2115
  /**
2091
2116
  * Locates the LibreOffice executable on the current system by searching platform-specific paths.
@@ -2101,8 +2126,8 @@
2101
2126
  macOsName: 'LibreOffice',
2102
2127
  });
2103
2128
  }
2104
- /** 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 */
2105
- /** TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents` */
2129
+ // 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
2130
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
2106
2131
 
2107
2132
  /**
2108
2133
  * Locates the Pandoc executable on the current system by searching platform-specific paths.
@@ -2118,8 +2143,8 @@
2118
2143
  macOsName: 'Pandoc',
2119
2144
  });
2120
2145
  }
2121
- /** 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 */
2122
- /** TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents` */
2146
+ // 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
2147
+ // TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
2123
2148
 
2124
2149
  /**
2125
2150
  * Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
@@ -2136,16 +2161,15 @@
2136
2161
  // <- TODO: [🧠] `null` vs `undefined`
2137
2162
  };
2138
2163
  }
2139
- /** Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment */
2140
- /**
2141
- * TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
2142
- * TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
2143
- */
2164
+ // Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment
2165
+ // TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
2166
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
2144
2167
 
2145
2168
  /**
2146
2169
  * Orders JSON object by keys
2147
2170
  *
2148
2171
  * @returns The same type of object as the input re-ordered
2172
+ *
2149
2173
  * @public exported from `@promptbook/utils`
2150
2174
  */
2151
2175
  function orderJson(options) {
@@ -2164,6 +2188,7 @@
2164
2188
  * Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
2165
2189
  *
2166
2190
  * @returns The same object as the input, but deeply frozen
2191
+ *
2167
2192
  * @public exported from `@promptbook/utils`
2168
2193
  */
2169
2194
  function $deepFreeze(objectValue) {
@@ -2180,9 +2205,7 @@
2180
2205
  Object.freeze(objectValue);
2181
2206
  return objectValue;
2182
2207
  }
2183
- /**
2184
- * TODO: [🧠] Is there a way how to meaningfully test this utility
2185
- */
2208
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
2186
2209
 
2187
2210
  /**
2188
2211
  * Checks if the value is [🚉] serializable as JSON
@@ -2202,6 +2225,7 @@
2202
2225
  * - And much more...
2203
2226
  *
2204
2227
  * @throws UnexpectedError if the value is not serializable as JSON
2228
+ *
2205
2229
  * @public exported from `@promptbook/utils`
2206
2230
  */
2207
2231
  function checkSerializableAsJson(options) {
@@ -2316,11 +2340,9 @@
2316
2340
  `));
2317
2341
  }
2318
2342
  }
2319
- /**
2320
- * TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
2321
- * TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
2322
- * Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
2323
- */
2343
+ // TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
2344
+ // TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
2345
+ // Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
2324
2346
 
2325
2347
  /**
2326
2348
  * Creates a deep clone of the given object
@@ -2330,6 +2352,7 @@
2330
2352
  *
2331
2353
  * @param objectValue The object to clone.
2332
2354
  * @returns A deep, writable clone of the input object.
2355
+ *
2333
2356
  * @public exported from `@promptbook/utils`
2334
2357
  */
2335
2358
  function deepClone(objectValue) {
@@ -2346,9 +2369,7 @@
2346
2369
  > return Object.assign({}, objectValue);
2347
2370
  */
2348
2371
  }
2349
- /**
2350
- * TODO: [🧠] Is there a way how to meaningfully test this utility
2351
- */
2372
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
2352
2373
 
2353
2374
  /**
2354
2375
  * Utility to export a JSON object from a function
@@ -2361,6 +2382,7 @@
2361
2382
  * Note: This function does not mutates the given object
2362
2383
  *
2363
2384
  * @returns The same type of object as the input but read-only and re-ordered
2385
+ *
2364
2386
  * @public exported from `@promptbook/utils`
2365
2387
  */
2366
2388
  function exportJson(options) {
@@ -2380,9 +2402,7 @@
2380
2402
  $deepFreeze(orderedValue);
2381
2403
  return orderedValue;
2382
2404
  }
2383
- /**
2384
- * TODO: [🧠] Is there a way how to meaningfully test this utility
2385
- */
2405
+ // TODO: [🧠] Is there a way how to meaningfully test this utility
2386
2406
 
2387
2407
  /**
2388
2408
  * Order of keys in the pipeline JSON
@@ -2493,9 +2513,7 @@
2493
2513
  */
2494
2514
  SHORT_NAME_LENGTH: 6,
2495
2515
  };
2496
- /**
2497
- * Note: [💞] Ignore a discrepancy between file name and entity name
2498
- */
2516
+ // Note: [💞] Ignore a discrepancy between file name and entity name
2499
2517
 
2500
2518
  /**
2501
2519
  * Tests if given string is valid semantic version
@@ -2520,12 +2538,13 @@
2520
2538
  * Tests if given string is valid promptbook version
2521
2539
  * It looks into list of known promptbook versions.
2522
2540
  *
2523
- * @see https://www.npmjs.com/package/promptbook?activeTab=versions
2524
2541
  * 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.
2525
2542
  * Note: There are two similar functions:
2526
2543
  * - `isValidSemanticVersion` which tests any semantic version
2527
2544
  * - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
2528
2545
  *
2546
+ * @see https://www.npmjs.com/package/promptbook?activeTab=versions
2547
+ *
2529
2548
  * @public exported from `@promptbook/utils`
2530
2549
  */
2531
2550
  function isValidPromptbookVersion(version) {
@@ -2599,9 +2618,7 @@
2599
2618
  */
2600
2619
  return true;
2601
2620
  }
2602
- /**
2603
- * TODO: [🐠] Maybe more info why the URL is invalid
2604
- */
2621
+ // TODO: [🐠] Maybe more info why the URL is invalid
2605
2622
 
2606
2623
  /**
2607
2624
  * Validates PipelineJson if it is logically valid
@@ -2618,6 +2635,7 @@
2618
2635
  * @param pipeline valid or invalid PipelineJson
2619
2636
  * @returns the same pipeline if it is logically valid
2620
2637
  * @throws {PipelineLogicError} on logical error in the pipeline
2638
+ *
2621
2639
  * @public exported from `@promptbook/core`
2622
2640
  */
2623
2641
  function validatePipeline(pipeline) {
@@ -2642,6 +2660,8 @@
2642
2660
  return pipeline;
2643
2661
  }
2644
2662
  /**
2663
+ * Validates pipeline inner function.
2664
+ *
2645
2665
  * @private internal function for `validatePipeline`
2646
2666
  */
2647
2667
  function validatePipeline_InnerFunction(pipeline) {
@@ -2886,15 +2906,13 @@
2886
2906
  * > * - ...
2887
2907
  * > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
2888
2908
  */
2889
- /**
2890
- * TODO: [🧳][main] !!4 Validate that all examples match expectations
2891
- * TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2892
- * TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2893
- * TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2894
- * TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2895
- * TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2896
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2897
- */
2909
+ // TODO: [🧳][main] !!4 Validate that all examples match expectations
2910
+ // TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
2911
+ // TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
2912
+ // TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
2913
+ // TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
2914
+ // TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
2915
+ // TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
2898
2916
 
2899
2917
  /**
2900
2918
  * Determine if the pipeline is fully prepared
@@ -2996,7 +3014,7 @@
2996
3014
 
2997
3015
  /**
2998
3016
  * Recursively converts JSON strings to JSON objects
2999
-
3017
+ *
3000
3018
  * @public exported from `@promptbook/utils`
3001
3019
  */
3002
3020
  function jsonStringsToJsons(object) {
@@ -3020,9 +3038,7 @@
3020
3038
  }
3021
3039
  return newObject;
3022
3040
  }
3023
- /**
3024
- * TODO: Type the return type correctly
3025
- */
3041
+ // TODO: Type the return type correctly
3026
3042
 
3027
3043
  /**
3028
3044
  * Deserializes the error object
@@ -3057,6 +3073,7 @@
3057
3073
  *
3058
3074
  * @param executionResult - The partial result of the Promptbook execution
3059
3075
  * @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
3076
+ *
3060
3077
  * @private internal helper function of `asPromise` method of `ExecutionTask`
3061
3078
  */
3062
3079
  function assertsTaskSuccessful(executionResult) {
@@ -3087,9 +3104,7 @@
3087
3104
  `));
3088
3105
  }
3089
3106
  }
3090
- /**
3091
- * TODO: [🧠] Can this return type be better typed than void
3092
- */
3107
+ // TODO: [🧠] Can this return type be better typed than void
3093
3108
 
3094
3109
  /**
3095
3110
  * Helper to create a new task
@@ -3280,10 +3295,8 @@
3280
3295
  },
3281
3296
  };
3282
3297
  }
3283
- /**
3284
- * TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3285
- * TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3286
- */
3298
+ // TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
3299
+ // TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
3287
3300
 
3288
3301
  /**
3289
3302
  * Represents the uncertain value
@@ -3351,9 +3364,7 @@
3351
3364
  pagesCount: UNCERTAIN_ZERO_VALUE,
3352
3365
  },
3353
3366
  });
3354
- /**
3355
- * Note: [💞] Ignore a discrepancy between file name and entity name
3356
- */
3367
+ // Note: [💞] Ignore a discrepancy between file name and entity name
3357
3368
 
3358
3369
  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"}];
3359
3370
 
@@ -3376,6 +3387,7 @@
3376
3387
  * Tests if given string is valid file path.
3377
3388
  *
3378
3389
  * Note: This does not check if the file exists only if the path is valid
3390
+ *
3379
3391
  * @public exported from `@promptbook/utils`
3380
3392
  */
3381
3393
  function isValidFilePath(filename) {
@@ -3424,9 +3436,7 @@
3424
3436
  }
3425
3437
  return false;
3426
3438
  }
3427
- /**
3428
- * TODO: [🍏] Implement for MacOs
3429
- */
3439
+ // TODO: [🍏] Implement for MacOs
3430
3440
 
3431
3441
  /**
3432
3442
  * Function `validatePipelineString` will validate the if the string is a valid pipeline string
@@ -3437,6 +3447,7 @@
3437
3447
  * @param {string} pipelineString the candidate for a pipeline string
3438
3448
  * @returns {PipelineString} the same string as input, but validated as valid
3439
3449
  * @throws {ParseError} if the string is not a valid pipeline string
3450
+ *
3440
3451
  * @public exported from `@promptbook/core`
3441
3452
  */
3442
3453
  function validatePipelineString(pipelineString) {
@@ -3455,17 +3466,16 @@
3455
3466
  // <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
3456
3467
  return pipelineString;
3457
3468
  }
3458
- /**
3459
- * TODO: [🧠][🈴] Where is the best location for this file
3460
- */
3469
+ // TODO: [🧠][🈴] Where is the best location for this file
3461
3470
 
3462
3471
  /**
3463
3472
  * Prettify the html code
3464
3473
  *
3465
3474
  * @param content raw html code
3466
3475
  * @returns formatted html code
3467
- * @private withing the package because of HUGE size of prettier dependency
3468
3476
  * @deprecated Prettier removed from Promptbook due to package size
3477
+ *
3478
+ * @private withing the package because of HUGE size of prettier dependency
3469
3479
  */
3470
3480
  function prettifyMarkdown(content) {
3471
3481
  return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
@@ -3488,6 +3498,7 @@
3488
3498
  * @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
3489
3499
  * @param pipelineJson Promptbook in JSON format (.bookc)
3490
3500
  * @returns Promptbook in string format (.book.md)
3501
+ *
3491
3502
  * @public exported from `@promptbook/core`
3492
3503
  */
3493
3504
  function pipelineJsonToString(pipelineJson) {
@@ -3604,6 +3615,8 @@
3604
3615
  return validatePipelineString(pipelineString);
3605
3616
  }
3606
3617
  /**
3618
+ * Handles task parameter Json to string.
3619
+ *
3607
3620
  * @private internal utility of `pipelineJsonToString`
3608
3621
  */
3609
3622
  function taskParameterJsonToString(taskParameterJson) {
@@ -3614,19 +3627,18 @@
3614
3627
  }
3615
3628
  return parameterString;
3616
3629
  }
3617
- /**
3618
- * TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
3619
- * TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
3620
- * TODO: [🏛] Maybe make some markdown builder
3621
- * TODO: [🏛] Escape all
3622
- * TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
3623
- */
3630
+ // TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
3631
+ // TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
3632
+ // TODO: [🏛] Maybe make some markdown builder
3633
+ // TODO: [🏛] Escape all
3634
+ // TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
3624
3635
 
3625
3636
  /**
3626
3637
  * Parses the task and returns the list of all parameter names
3627
3638
  *
3628
3639
  * @param template the string template with parameters in {curly} braces
3629
3640
  * @returns the list of parameter names
3641
+ *
3630
3642
  * @public exported from `@promptbook/utils`
3631
3643
  */
3632
3644
  function extractParameterNames(template) {
@@ -3643,6 +3655,7 @@
3643
3655
  * Unprepare just strips the preparation data of the pipeline
3644
3656
  *
3645
3657
  * @deprecated In future version this function will be removed or deprecated
3658
+ *
3646
3659
  * @public exported from `@promptbook/core`
3647
3660
  */
3648
3661
  function unpreparePipeline(pipeline) {
@@ -3671,18 +3684,17 @@
3671
3684
  },
3672
3685
  });
3673
3686
  }
3674
- /**
3675
- * TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
3676
- * TODO: Write tests for `preparePipeline`
3677
- * TODO: [🍙] Make some standard order of json properties
3678
- */
3687
+ // TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
3688
+ // TODO: Write tests for `preparePipeline`
3689
+ // TODO: [🍙] Make some standard order of json properties
3679
3690
 
3680
3691
  /**
3681
3692
  * Library of pipelines that groups together pipelines for an application.
3682
3693
  * This implementation is a very thin wrapper around the Array / Map of pipelines.
3683
3694
  *
3684
- * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
3685
3695
  * @see https://github.com/webgptorg/pipeline#pipeline-collection
3696
+ *
3697
+ * @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
3686
3698
  */
3687
3699
  class SimplePipelineCollection {
3688
3700
  /**
@@ -3786,6 +3798,7 @@
3786
3798
  *
3787
3799
  * @param promptbookSources
3788
3800
  * @returns PipelineCollection
3801
+ *
3789
3802
  * @public exported from `@promptbook/core`
3790
3803
  */
3791
3804
  function createPipelineCollectionFromJson(...promptbooks) {
@@ -3798,8 +3811,9 @@
3798
3811
  * @param array - Array to iterate over
3799
3812
  * @param options - Options for the function
3800
3813
  * @param callbackfunction - Function to call for each item
3801
- * @public exported from `@promptbook/utils`
3802
3814
  * @deprecated [🪂] Use queues instead
3815
+ *
3816
+ * @public exported from `@promptbook/utils`
3803
3817
  */
3804
3818
  async function forEachAsync(array, options, callbackfunction) {
3805
3819
  const { maxParallelCount = Infinity } = options;
@@ -3884,6 +3898,7 @@
3884
3898
  *
3885
3899
  * @param llmTools - The LLM tools to be intercepted and tracked
3886
3900
  * @returns Full proxy of the tools with added usage tracking capabilities
3901
+ *
3887
3902
  * @public exported from `@promptbook/core`
3888
3903
  */
3889
3904
  function countUsage(llmTools) {
@@ -4008,6 +4023,7 @@
4008
4023
  * Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
4009
4024
  *
4010
4025
  * Note: Internal utility of `joinLlmExecutionTools` but exposed type
4026
+ *
4011
4027
  * @public exported from `@promptbook/core`
4012
4028
  */
4013
4029
  class MultipleLlmExecutionTools {
@@ -4170,16 +4186,16 @@
4170
4186
  * `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
4171
4187
  *
4172
4188
  * 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
4173
- * If the first provider doesn't support the requested model or fails, it tries the next one.
4189
+ * If the first provider doesn't support the requested model or fails, it tries the next one.
4174
4190
  * 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
4175
4191
  * 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
4176
4192
  *
4193
+ * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4194
+ *
4177
4195
  * @param title - A descriptive title for this collection of joined tools
4178
4196
  * @param llmExecutionTools - An array of execution tools to be joined
4179
4197
  * @returns A single unified execution tool wrapper
4180
4198
  *
4181
- * Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
4182
- *
4183
4199
  * @public exported from `@promptbook/core`
4184
4200
  */
4185
4201
  function joinLlmExecutionTools(title, ...llmExecutionTools) {
@@ -4216,10 +4232,8 @@
4216
4232
  }
4217
4233
  return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
4218
4234
  }
4219
- /**
4220
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4221
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4222
- */
4235
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4236
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4223
4237
 
4224
4238
  /**
4225
4239
  * Just returns the given `LlmExecutionTools` or joins multiple into one
@@ -4233,15 +4247,14 @@
4233
4247
  : joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
4234
4248
  return llmTools;
4235
4249
  }
4236
- /**
4237
- * TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4238
- * TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4239
- */
4250
+ // TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
4251
+ // TODO: [👷‍♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
4240
4252
 
4241
4253
  /**
4242
4254
  * Prepares the persona for the pipeline
4243
4255
  *
4244
4256
  * @see https://github.com/webgptorg/promptbook/discussions/22
4257
+ *
4245
4258
  * @public exported from `@promptbook/core`
4246
4259
  */
4247
4260
  async function preparePersona(personaDescription, tools, options) {
@@ -4298,13 +4311,11 @@
4298
4311
  modelsRequirements,
4299
4312
  };
4300
4313
  }
4301
- /**
4302
- * TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
4303
- * TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
4304
- * TODO: [🏢] Check validity of `modelName` in pipeline
4305
- * TODO: [🏢] Check validity of `systemMessage` in pipeline
4306
- * TODO: [🏢] Check validity of `temperature` in pipeline
4307
- */
4314
+ // TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
4315
+ // TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
4316
+ // TODO: [🏢] Check validity of `modelName` in pipeline
4317
+ // TODO: [🏢] Check validity of `systemMessage` in pipeline
4318
+ // TODO: [🏢] Check validity of `temperature` in pipeline
4308
4319
 
4309
4320
  /**
4310
4321
  * Safely retrieves the global scope object (window in browser, global in Node.js)
@@ -4312,7 +4323,7 @@
4312
4323
  *
4313
4324
  * Note: `$` is used to indicate that this function is not a pure function - it access global scope
4314
4325
  *
4315
- * @private internal function of `$Register`
4326
+ * @private internal function of `$Register`
4316
4327
  */
4317
4328
  function $getGlobalScope() {
4318
4329
  return Function('return this')();
@@ -4327,6 +4338,7 @@
4327
4338
  * @returns The normalized text in SCREAMING_CASE format.
4328
4339
  * @example 'HELLO_WORLD'
4329
4340
  * @example 'I_LOVE_PROMPTBOOK'
4341
+ *
4330
4342
  * @public exported from `@promptbook/utils`
4331
4343
  */
4332
4344
  function normalizeTo_SCREAMING_CASE(text) {
@@ -4384,6 +4396,7 @@
4384
4396
  * @returns The normalized text in snake_case format.
4385
4397
  * @example 'hello_world'
4386
4398
  * @example 'i_love_promptbook'
4399
+ *
4387
4400
  * @public exported from `@promptbook/utils`
4388
4401
  */
4389
4402
  function normalizeTo_snake_case(text) {
@@ -4442,26 +4455,26 @@
4442
4455
  * Global registry for storing metadata about all available scrapers and converters.
4443
4456
  *
4444
4457
  * Note: `$` is used to indicate that this interacts with the global scope.
4458
+ *
4445
4459
  * @singleton Only one instance of each register is created per build, but there can be more in different contexts (e.g., tests).
4460
+ *
4446
4461
  * @public exported from `@promptbook/core`
4447
4462
  */
4448
4463
  const $scrapersMetadataRegister = new $Register('scrapers_metadata');
4449
- /**
4450
- * TODO: [®] DRY Register logic
4451
- */
4464
+ // TODO: [®] DRY Register logic
4452
4465
 
4453
4466
  /**
4454
4467
  * Registry for all available scrapers in the system.
4455
4468
  * Central point for registering and accessing different types of content scrapers.
4456
4469
  *
4457
4470
  * Note: `$` is used to indicate that this interacts with the global scope
4471
+ *
4458
4472
  * @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
4473
+ *
4459
4474
  * @public exported from `@promptbook/core`
4460
4475
  */
4461
4476
  const $scrapersRegister = new $Register('scraper_constructors');
4462
- /**
4463
- * TODO: [®] DRY Register logic
4464
- */
4477
+ // TODO: [®] DRY Register logic
4465
4478
 
4466
4479
  /**
4467
4480
  * Creates a message with all registered scrapers
@@ -4546,10 +4559,11 @@
4546
4559
 
4547
4560
  `);
4548
4561
  }
4562
+ // TODO: [®] DRY Register logic
4563
+
4549
4564
  /**
4550
- * TODO: [®] DRY Register logic
4565
+ * Collection of default diacritics removal map.
4551
4566
  */
4552
-
4553
4567
  const defaultDiacriticsRemovalMap = [
4554
4568
  {
4555
4569
  base: 'A',
@@ -4801,6 +4815,7 @@
4801
4815
  *
4802
4816
  * @param input The string containing diacritics to be normalized.
4803
4817
  * @returns The string with diacritics removed or normalized.
4818
+ *
4804
4819
  * @public exported from `@promptbook/utils`
4805
4820
  */
4806
4821
  function removeDiacritics(input) {
@@ -4809,9 +4824,7 @@
4809
4824
  return DIACRITIC_VARIANTS_LETTERS[character] || character;
4810
4825
  });
4811
4826
  }
4812
- /**
4813
- * TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4814
- */
4827
+ // TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
4815
4828
 
4816
4829
  /**
4817
4830
  * Converts a given text to kebab-case format.
@@ -4822,6 +4835,7 @@
4822
4835
  * @returns The kebab-case formatted string.
4823
4836
  * @example 'hello-world'
4824
4837
  * @example 'i-love-promptbook'
4838
+ *
4825
4839
  * @public exported from `@promptbook/utils`
4826
4840
  */
4827
4841
  function normalizeToKebabCase(text) {
@@ -4862,9 +4876,7 @@
4862
4876
  normalizedName = normalizedName.replace(/-$/, '');
4863
4877
  return normalizedName;
4864
4878
  }
4865
- /**
4866
- * Note: [💞] Ignore a discrepancy between file name and entity name
4867
- */
4879
+ // Note: [💞] Ignore a discrepancy between file name and entity name
4868
4880
 
4869
4881
  /**
4870
4882
  * Creates unique name for the source
@@ -4883,9 +4895,7 @@
4883
4895
  // <- TODO: Use MAX_FILENAME_LENGTH
4884
4896
  return name;
4885
4897
  }
4886
- /**
4887
- * TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
4888
- */
4898
+ // TODO: [🐱‍🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
4889
4899
 
4890
4900
  /**
4891
4901
  * Converts a name to a properly formatted subfolder path for cache storage.
@@ -4935,11 +4945,9 @@
4935
4945
  .catch(() => false);
4936
4946
  return isFile;
4937
4947
  }
4938
- /**
4939
- * Note: Not [~🟢~] because it is not directly dependent on `fs
4940
- * TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
4941
- * TODO: [🖇] What about symlinks?
4942
- */
4948
+ // Note: Not [~🟢~] because it is not directly dependent on `fs
4949
+ // TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
4950
+ // TODO: [🖇] What about symlinks?
4943
4951
 
4944
4952
  /**
4945
4953
  * Convert mime type to file extension
@@ -4959,6 +4967,7 @@
4959
4967
  *
4960
4968
  * @param text with emojis
4961
4969
  * @returns text without emojis
4970
+ *
4962
4971
  * @public exported from `@promptbook/utils`
4963
4972
  */
4964
4973
  function removeEmojis(text) {
@@ -4978,6 +4987,7 @@
4978
4987
  * @param value The title string to be converted to a name.
4979
4988
  * @returns A normalized name derived from the input title.
4980
4989
  * @example 'Hello World!' -> 'hello-world'
4990
+ *
4981
4991
  * @public exported from `@promptbook/utils`
4982
4992
  */
4983
4993
  function titleToName(value) {
@@ -5023,9 +5033,7 @@
5023
5033
  `));
5024
5034
  }
5025
5035
  };
5026
- /**
5027
- * TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
5028
- */
5036
+ // TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
5029
5037
 
5030
5038
  /**
5031
5039
  * Factory function that creates a handler for processing knowledge sources.
@@ -5245,6 +5253,7 @@
5245
5253
  * Prepares the knowledge pieces
5246
5254
  *
5247
5255
  * @see https://github.com/webgptorg/promptbook/discussions/41
5256
+ *
5248
5257
  * @public exported from `@promptbook/core`
5249
5258
  */
5250
5259
  async function prepareKnowledgePieces(knowledgeSources, tools, options) {
@@ -5386,25 +5395,24 @@
5386
5395
  });
5387
5396
  return { tasksPrepared };
5388
5397
  }
5389
- /**
5390
- * TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
5391
- * TODO: [🧠] Add context to each task (if missing)
5392
- * TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
5393
- * TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
5394
- * TODO: Write tests for `preparePipeline`
5395
- * TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
5396
- * TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
5397
- * TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
5398
- */
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
5399
5406
 
5400
5407
  /**
5401
5408
  * Prepare pipeline locally
5402
5409
  *
5403
- * @see https://github.com/webgptorg/promptbook/discussions/196
5404
- *
5405
5410
  * Note: This function does not validate logic of the pipeline
5406
5411
  * Note: This function acts as part of compilation process
5407
5412
  * Note: When the pipeline is already prepared, it returns the same pipeline
5413
+ *
5414
+ * @see https://github.com/webgptorg/promptbook/discussions/196
5415
+ *
5408
5416
  * @public exported from `@promptbook/core`
5409
5417
  */
5410
5418
  async function preparePipeline(pipeline, tools, options) {
@@ -5575,8 +5583,8 @@
5575
5583
  * This is useful and used in the `templateParameters` function
5576
5584
  *
5577
5585
  * Note: This function is not just calling `toString` method
5578
- * It's more complex and can handle this conversion specifically for LLM models
5579
- * See `VALUE_STRINGS`
5586
+ * It's more complex and can handle this conversion specifically for LLM models
5587
+ * See `VALUE_STRINGS`
5580
5588
  *
5581
5589
  * Note: There are 2 similar functions
5582
5590
  * - `valueToString` converts value to string for LLM models as human-readable string
@@ -5629,6 +5637,7 @@
5629
5637
  * @param script from which to extract the variables
5630
5638
  * @returns the list of variable names
5631
5639
  * @throws {ParseError} if the script is invalid
5640
+ *
5632
5641
  * @public exported from `@promptbook/javascript`
5633
5642
  */
5634
5643
  function extractVariablesFromJavascript(script) {
@@ -5694,9 +5703,7 @@
5694
5703
  }
5695
5704
  return variables;
5696
5705
  }
5697
- /**
5698
- * TODO: [🔣] Support for multiple languages - python, java,...
5699
- */
5706
+ // TODO: [🔣] Support for multiple languages - python, java,...
5700
5707
 
5701
5708
  /**
5702
5709
  * Parses the task and returns the set of all used parameters
@@ -5704,6 +5711,7 @@
5704
5711
  * @param task the task with used parameters
5705
5712
  * @returns the set of parameter names
5706
5713
  * @throws {ParseError} if the script is invalid
5714
+ *
5707
5715
  * @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
5708
5716
  */
5709
5717
  function extractParameterNamesFromTask(task) {
@@ -5744,14 +5752,13 @@
5744
5752
  }
5745
5753
  return parameterNames;
5746
5754
  }
5747
- /**
5748
- * TODO: [🔣] If script require contentLanguage
5749
- */
5755
+ // TODO: [🔣] If script require contentLanguage
5750
5756
 
5751
5757
  /**
5752
5758
  * Create difference set of two sets.
5753
5759
  *
5754
5760
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
5761
+ *
5755
5762
  * @public exported from `@promptbook/utils`
5756
5763
  */
5757
5764
  function difference(a, b, isEqual = (a, b) => a === b) {
@@ -5763,14 +5770,13 @@
5763
5770
  }
5764
5771
  return diff;
5765
5772
  }
5766
- /**
5767
- * TODO: [🧠][💯] Maybe also implement symmetricDifference
5768
- */
5773
+ // TODO: [🧠][💯] Maybe also implement symmetricDifference
5769
5774
 
5770
5775
  /**
5771
5776
  * Creates a new set with all elements that are present in either set
5772
5777
  *
5773
5778
  * @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
5779
+ *
5774
5780
  * @public exported from `@promptbook/utils`
5775
5781
  */
5776
5782
  function union(...sets) {
@@ -5836,8 +5842,9 @@
5836
5842
  /**
5837
5843
  * Definition for CSV spreadsheet
5838
5844
  *
5845
+ * TODO: [🏢] Export from package `@promptbook/csv`
5846
+ *
5839
5847
  * @public exported from `@promptbook/core`
5840
- * <- TODO: [🏢] Export from package `@promptbook/csv`
5841
5848
  */
5842
5849
  const CsvFormatParser = {
5843
5850
  formatName: 'CSV',
@@ -5927,13 +5934,11 @@
5927
5934
  },
5928
5935
  ],
5929
5936
  };
5930
- /**
5931
- * TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
5932
- * TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
5933
- * TODO: [🍓] In `CsvFormatParser` implement `heal
5934
- * TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
5935
- * TODO: [🏢] Allow to expect something inside CSV objects and other formats
5936
- */
5937
+ // TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
5938
+ // TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
5939
+ // TODO: [🍓] In `CsvFormatParser` implement `heal
5940
+ // TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
5941
+ // TODO: [🏢] Allow to expect something inside CSV objects and other formats
5937
5942
 
5938
5943
  /**
5939
5944
  * Definition for JSON format
@@ -5954,17 +5959,15 @@
5954
5959
  },
5955
5960
  subvalueParsers: [],
5956
5961
  };
5957
- /**
5958
- * TODO: [🧠] Maybe proper instance of object
5959
- * TODO: [0] Make string_serialized_json
5960
- * TODO: [1] Make type for JSON Settings and Schema
5961
- * TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
5962
- * TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
5963
- * TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
5964
- * TODO: [🍓] In `JsonFormatParser` implement `heal
5965
- * TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
5966
- * TODO: [🏢] Allow to expect something inside JSON objects and other formats
5967
- */
5962
+ // TODO: [🧠] Maybe proper instance of object
5963
+ // TODO: [0] Make string_serialized_json
5964
+ // TODO: [1] Make type for JSON Settings and Schema
5965
+ // TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
5966
+ // TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
5967
+ // TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
5968
+ // TODO: [🍓] In `JsonFormatParser` implement `heal
5969
+ // TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
5970
+ // TODO: [🏢] Allow to expect something inside JSON objects and other formats
5968
5971
 
5969
5972
  /**
5970
5973
  * Definition for any text - this will be always valid
@@ -6002,15 +6005,13 @@
6002
6005
  // <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
6003
6006
  ],
6004
6007
  };
6005
- /**
6006
- * TODO: [1] Make type for XML Text and Schema
6007
- * TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
6008
- * TODO: [🍓] In `TextFormatParser` implement simple `isValid`
6009
- * TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
6010
- * TODO: [🍓] In `TextFormatParser` implement `heal
6011
- * TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
6012
- * TODO: [🏢] Allow to expect something inside each item of list and other formats
6013
- */
6008
+ // TODO: [1] Make type for XML Text and Schema
6009
+ // TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
6010
+ // TODO: [🍓] In `TextFormatParser` implement simple `isValid`
6011
+ // TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
6012
+ // TODO: [🍓] In `TextFormatParser` implement `heal
6013
+ // TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
6014
+ // TODO: [🏢] Allow to expect something inside each item of list and other formats
6014
6015
 
6015
6016
  /**
6016
6017
  * Function to check if a string is valid XML
@@ -6055,17 +6056,15 @@
6055
6056
  },
6056
6057
  subvalueParsers: [],
6057
6058
  };
6058
- /**
6059
- * TODO: [🧠] Maybe proper instance of object
6060
- * TODO: [0] Make string_serialized_xml
6061
- * TODO: [1] Make type for XML Settings and Schema
6062
- * TODO: [🧠] What to use for validating XMLs - XSD,...
6063
- * TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
6064
- * TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
6065
- * TODO: [🍓] In `XmlFormatParser` implement `heal
6066
- * TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
6067
- * TODO: [🏢] Allow to expect something inside XML and other formats
6068
- */
6059
+ // TODO: [🧠] Maybe proper instance of object
6060
+ // TODO: [0] Make string_serialized_xml
6061
+ // TODO: [1] Make type for XML Settings and Schema
6062
+ // TODO: [🧠] What to use for validating XMLs - XSD,...
6063
+ // TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
6064
+ // TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
6065
+ // TODO: [🍓] In `XmlFormatParser` implement `heal
6066
+ // TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
6067
+ // TODO: [🏢] Allow to expect something inside XML and other formats
6069
6068
 
6070
6069
  /**
6071
6070
  * Definitions for all formats supported by Promptbook
@@ -6073,9 +6072,7 @@
6073
6072
  * @private internal index of `...` <- TODO [🏢]
6074
6073
  */
6075
6074
  const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
6076
- /**
6077
- * Note: [💞] Ignore a discrepancy between file name and entity name
6078
- */
6075
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6079
6076
 
6080
6077
  /**
6081
6078
  * Maps available parameters to expected parameters for a pipeline task.
@@ -6085,6 +6082,7 @@
6085
6082
  * 2) Then, if there are unmatched expected and available parameters, map them by order.
6086
6083
  *
6087
6084
  * @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
6085
+ *
6088
6086
  * @private within the repository used in `createPipelineExecutor`
6089
6087
  */
6090
6088
  function mapAvailableToExpectedParameters(options) {
@@ -6155,6 +6153,7 @@
6155
6153
  *
6156
6154
  * @param value any values
6157
6155
  * @returns void
6156
+ *
6158
6157
  * @private within the repository
6159
6158
  */
6160
6159
  function keepUnused(...valuesToKeep) {
@@ -6164,12 +6163,13 @@
6164
6163
  * Replaces parameters in template with values from parameters object
6165
6164
  *
6166
6165
  * Note: This function is not places strings into string,
6167
- * It's more complex and can handle this operation specifically for LLM models
6166
+ * It's more complex and can handle this operation specifically for LLM models
6168
6167
  *
6169
6168
  * @param template the template with parameters in {curly} braces
6170
6169
  * @param parameters the object with parameters
6171
6170
  * @returns the template with replaced parameters
6172
6171
  * @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
6172
+ *
6173
6173
  * @public exported from `@promptbook/utils`
6174
6174
  */
6175
6175
  function templateParameters(template, parameters) {
@@ -6243,6 +6243,7 @@
6243
6243
  * @param markdown any valid markdown
6244
6244
  * @returns code blocks with language and content
6245
6245
  * @throws {ParseError} if block is not closed properly
6246
+ *
6246
6247
  * @public exported from `@promptbook/markdown-utils`
6247
6248
  */
6248
6249
  function extractAllBlocksFromMarkdown(markdown) {
@@ -6293,9 +6294,7 @@
6293
6294
  }
6294
6295
  return codeBlocks;
6295
6296
  }
6296
- /**
6297
- * TODO: Maybe name for `blockNotation` instead of '```' and '>'
6298
- */
6297
+ // TODO: Maybe name for `blockNotation` instead of '```' and '>'
6299
6298
 
6300
6299
  /**
6301
6300
  * Extracts extracts exactly one valid JSON code block
@@ -6311,8 +6310,9 @@
6311
6310
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
6312
6311
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
6313
6312
  *
6314
- * @public exported from `@promptbook/markdown-utils`
6315
6313
  * @throws {ParseError} if there is no valid JSON block in the markdown
6314
+ *
6315
+ * @public exported from `@promptbook/markdown-utils`
6316
6316
  */
6317
6317
  function extractJsonBlock(markdown) {
6318
6318
  if (isValidJsonString(markdown)) {
@@ -6328,10 +6328,8 @@
6328
6328
  }
6329
6329
  return jsonBlocks[0].content;
6330
6330
  }
6331
- /**
6332
- * TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
6333
- * TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
6334
- */
6331
+ // TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
6332
+ // TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
6335
6333
 
6336
6334
  /**
6337
6335
  * Counts number of characters in the text
@@ -6347,10 +6345,8 @@
6347
6345
  text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
6348
6346
  return text.length;
6349
6347
  }
6350
- /**
6351
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6352
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6353
- */
6348
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6349
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6354
6350
 
6355
6351
  /**
6356
6352
  * Number of characters per standard line with 11pt Arial font size.
@@ -6364,10 +6360,8 @@
6364
6360
  * @public exported from `@promptbook/utils`
6365
6361
  */
6366
6362
  const LINES_PER_STANDARD_PAGE = 44;
6367
- /**
6368
- * TODO: [🧠] Should be this `constants.ts` or `config.ts`?
6369
- * Note: [💞] Ignore a discrepancy between file name and entity name
6370
- */
6363
+ // TODO: [🧠] Should be this `constants.ts` or `config.ts`?
6364
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6371
6365
 
6372
6366
  /**
6373
6367
  * Counts number of lines in the text
@@ -6385,10 +6379,8 @@
6385
6379
  const lines = text.split(/\r?\n/);
6386
6380
  return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
6387
6381
  }
6388
- /**
6389
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6390
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6391
- */
6382
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6383
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6392
6384
 
6393
6385
  /**
6394
6386
  * Counts number of pages in the text
@@ -6400,10 +6392,8 @@
6400
6392
  function countPages(text) {
6401
6393
  return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
6402
6394
  }
6403
- /**
6404
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6405
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6406
- */
6395
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6396
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6407
6397
 
6408
6398
  /**
6409
6399
  * Counts number of paragraphs in the text
@@ -6413,10 +6403,8 @@
6413
6403
  function countParagraphs(text) {
6414
6404
  return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
6415
6405
  }
6416
- /**
6417
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6418
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6419
- */
6406
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6407
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6420
6408
 
6421
6409
  /**
6422
6410
  * Split text into sentences
@@ -6434,10 +6422,8 @@
6434
6422
  function countSentences(text) {
6435
6423
  return splitIntoSentences(text).length;
6436
6424
  }
6437
- /**
6438
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6439
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6440
- */
6425
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6426
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6441
6427
 
6442
6428
  /**
6443
6429
  * Counts number of words in the text
@@ -6451,11 +6437,9 @@
6451
6437
  text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
6452
6438
  return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
6453
6439
  }
6454
- /**
6455
- * TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6456
- * TODO: [🧠][✌️] Make some Promptbook-native token system
6457
- * TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
6458
- */
6440
+ // TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
6441
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
6442
+ // TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
6459
6443
 
6460
6444
  /**
6461
6445
  * Index of all counter functions
@@ -6470,10 +6454,8 @@
6470
6454
  LINES: countLines,
6471
6455
  PAGES: countPages,
6472
6456
  };
6473
- /**
6474
- * TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
6475
- * Note: [💞] Ignore a discrepancy between file name and entity name
6476
- */
6457
+ // TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
6458
+ // Note: [💞] Ignore a discrepancy between file name and entity name
6477
6459
 
6478
6460
  /**
6479
6461
  * Function checkExpectations will check if the expectations on given value are met
@@ -6484,6 +6466,7 @@
6484
6466
  *
6485
6467
  * @throws {ExpectError} if the expectations are not met
6486
6468
  * @returns {void} Nothing
6469
+ *
6487
6470
  * @private internal function of `createPipelineExecutor`
6488
6471
  */
6489
6472
  function checkExpectations(expectations, value) {
@@ -6497,11 +6480,9 @@
6497
6480
  }
6498
6481
  }
6499
6482
  }
6500
- /**
6501
- * TODO: [💝] Unite object for expecting amount and format
6502
- * TODO: [🧠][🤠] This should be part of `TextFormatParser`
6503
- * Note: [💝] and [🤠] are interconnected together
6504
- */
6483
+ // TODO: [💝] Unite object for expecting amount and format
6484
+ // TODO: [🧠][🤠] This should be part of `TextFormatParser`
6485
+ // Note: [💝] and [🤠] are interconnected together
6505
6486
 
6506
6487
  /**
6507
6488
  * Validates a prompt result against expectations and format requirements.
@@ -6512,6 +6493,7 @@
6512
6493
  *
6513
6494
  * @param options - The validation options including result string, expectations, and format
6514
6495
  * @returns Validation result with processed string and validity status
6496
+ *
6515
6497
  * @private internal function of `createPipelineExecutor` and `cacheLlmTools`
6516
6498
  */
6517
6499
  function validatePromptResult(options) {
@@ -6574,6 +6556,7 @@
6574
6556
  *
6575
6557
  * @param options - The options for execution, including task, parameters, pipeline, and configuration.
6576
6558
  * @returns The result string of the executed task.
6559
+ *
6577
6560
  * @private internal utility of `createPipelineExecutor`
6578
6561
  */
6579
6562
  async function executeAttempts(options) {
@@ -6897,9 +6880,7 @@
6897
6880
  }
6898
6881
  return $ongoingTaskResult.$resultString;
6899
6882
  }
6900
- /**
6901
- * TODO: Break into smaller functions
6902
- */
6883
+ // TODO: Break into smaller functions
6903
6884
 
6904
6885
  /**
6905
6886
  * Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
@@ -7042,6 +7023,7 @@
7042
7023
  *
7043
7024
  * @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
7044
7025
  * @returns The context as a string, formatted as markdown and parameter value.
7026
+ *
7045
7027
  * @private internal utility of `createPipelineExecutor`
7046
7028
  */
7047
7029
  async function getContextForTask(task) {
@@ -7079,7 +7061,6 @@
7079
7061
  }
7080
7062
 
7081
7063
  /**
7082
- *
7083
7064
  * @param knowledgePieces
7084
7065
  * @returns
7085
7066
  *
@@ -7160,10 +7141,8 @@
7160
7141
  return knowledgePiecesToString(preparedPipeline.knowledgePieces);
7161
7142
  }
7162
7143
  }
7163
- /**
7164
- * TODO: [♨] Implement Better - use keyword search
7165
- * TODO: [♨] Examples of values
7166
- */
7144
+ // TODO: [♨] Implement Better - use keyword search
7145
+ // TODO: [♨] Examples of values
7167
7146
 
7168
7147
  /**
7169
7148
  * Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
@@ -7316,9 +7295,7 @@
7316
7295
  resultString,
7317
7296
  });
7318
7297
  }
7319
- /**
7320
- * TODO: [🤹‍♂️]
7321
- */
7298
+ // TODO: [🤹‍♂️]
7322
7299
 
7323
7300
  /**
7324
7301
  * Filters and returns only the output parameters from the provided pipeline execution options.
@@ -7648,6 +7625,7 @@
7648
7625
  *
7649
7626
  * @returns The executor function
7650
7627
  * @throws {PipelineLogicError} on logical error in the pipeline
7628
+ *
7651
7629
  * @public exported from `@promptbook/core`
7652
7630
  */
7653
7631
  function createPipelineExecutor(options) {
@@ -7812,9 +7790,7 @@
7812
7790
  return false;
7813
7791
  }
7814
7792
  }
7815
- /**
7816
- * TODO: [🎺]
7817
- */
7793
+ // TODO: [🎺]
7818
7794
 
7819
7795
  /**
7820
7796
  * Detects if the code is running in a web worker
@@ -7834,33 +7810,31 @@
7834
7810
  return false;
7835
7811
  }
7836
7812
  }
7837
- /**
7838
- * TODO: [🎺]
7839
- */
7813
+ // TODO: [🎺]
7840
7814
 
7841
7815
  /**
7842
7816
  * Register for LLM tools.
7843
7817
  *
7844
7818
  * Note: `$` is used to indicate that this interacts with the global scope
7819
+ *
7845
7820
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
7821
+ *
7846
7822
  * @public exported from `@promptbook/core`
7847
7823
  */
7848
7824
  const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
7849
- /**
7850
- * TODO: [®] DRY Register logic
7851
- */
7825
+ // TODO: [®] DRY Register logic
7852
7826
 
7853
7827
  /**
7854
7828
  * Register for LLM tools metadata.
7855
7829
  *
7856
7830
  * Note: `$` is used to indicate that this interacts with the global scope
7831
+ *
7857
7832
  * @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
7833
+ *
7858
7834
  * @public exported from `@promptbook/core`
7859
7835
  */
7860
7836
  const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
7861
- /**
7862
- * TODO: [®] DRY Register logic
7863
- */
7837
+ // TODO: [®] DRY Register logic
7864
7838
 
7865
7839
  /**
7866
7840
  * Creates a message with all registered LLM tools
@@ -7981,10 +7955,8 @@
7981
7955
  .join('\n'))}
7982
7956
  `);
7983
7957
  }
7984
- /**
7985
- * TODO: [®] DRY Register logic
7986
- * TODO: [🧠][⚛] Maybe pass env as argument
7987
- */
7958
+ // TODO: [®] DRY Register logic
7959
+ // TODO: [🧠][⚛] Maybe pass env as argument
7988
7960
 
7989
7961
  /**
7990
7962
  * Creates LLM execution tools from provided configuration objects
@@ -7997,6 +7969,7 @@
7997
7969
  * @param configuration Array of LLM tool configurations to instantiate
7998
7970
  * @param options Additional options for configuring the LLM tools
7999
7971
  * @returns A unified interface combining all successfully instantiated LLM tools
7972
+ *
8000
7973
  * @public exported from `@promptbook/core`
8001
7974
  */
8002
7975
  function createLlmToolsFromConfiguration(configuration, options = {}) {
@@ -8052,6 +8025,7 @@
8052
8025
  * Provides a collection of scrapers optimized for Node.js environment.
8053
8026
  * 1) `provideScrapersForNode` use as default
8054
8027
  * 2) `provideScrapersForBrowser` use in limited browser environment *
8028
+ *
8055
8029
  * @public exported from `@promptbook/node`
8056
8030
  */
8057
8031
  async function $provideScrapersForNode(tools, options) {
@@ -8071,8 +8045,8 @@
8071
8045
  }
8072
8046
  return scrapers;
8073
8047
  }
8074
- /** 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 */
8075
- /** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
8048
+ // 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
8049
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
8076
8050
 
8077
8051
  /**
8078
8052
  * Normalizes a given text to camelCase format.
@@ -8084,6 +8058,7 @@
8084
8058
  * @returns The camelCase formatted string.
8085
8059
  * @example 'helloWorld'
8086
8060
  * @example 'iLovePromptbook'
8061
+ *
8087
8062
  * @public exported from `@promptbook/utils`
8088
8063
  */
8089
8064
  function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
@@ -8124,9 +8099,7 @@
8124
8099
  }
8125
8100
  return normalizedName;
8126
8101
  }
8127
- /**
8128
- * TODO: [🌺] Use some intermediate util splitWords
8129
- */
8102
+ // TODO: [🌺] Use some intermediate util splitWords
8130
8103
 
8131
8104
  /**
8132
8105
  * Unsafe characters that prevent an inline parameter.
@@ -8150,6 +8123,7 @@
8150
8123
  * Normalizes a JSON string so it can be safely rendered without double escaping.
8151
8124
  *
8152
8125
  * @param value Candidate JSON string.
8126
+ *
8153
8127
  * @private function of ParameterEscaping
8154
8128
  */
8155
8129
  function normalizeJsonString(value) {
@@ -8164,6 +8138,7 @@
8164
8138
  * Hides brackets in a string to avoid confusion with template parameters.
8165
8139
  *
8166
8140
  * @param value Input string with literal brackets.
8141
+ *
8167
8142
  * @private function of ParameterEscaping
8168
8143
  */
8169
8144
  function hideBrackets(value) {
@@ -8173,6 +8148,7 @@
8173
8148
  * Restores hidden brackets.
8174
8149
  *
8175
8150
  * @param value String with hidden brackets.
8151
+ *
8176
8152
  * @private function of ParameterEscaping
8177
8153
  */
8178
8154
  function restoreBrackets(value) {
@@ -8182,6 +8158,7 @@
8182
8158
  * Decides whether a parameter can be inlined safely.
8183
8159
  *
8184
8160
  * @param value Parameter rendered as string.
8161
+ *
8185
8162
  * @private function of ParameterEscaping
8186
8163
  */
8187
8164
  function shouldInlineParameterValue(value) {
@@ -8195,6 +8172,7 @@
8195
8172
  *
8196
8173
  * @param value Parameter value to escape.
8197
8174
  * @param options Escape options for additional characters.
8175
+ *
8198
8176
  * @private function of ParameterEscaping
8199
8177
  */
8200
8178
  function escapePromptParameterValue(value, options) {
@@ -8220,6 +8198,7 @@
8220
8198
  * Builds numeric parameter names (1, 2, ...).
8221
8199
  *
8222
8200
  * @param index Zero-based parameter index.
8201
+ *
8223
8202
  * @private function of ParameterNaming
8224
8203
  */
8225
8204
  function buildNumericParameterName(index) {
@@ -8229,6 +8208,7 @@
8229
8208
  * Builds alphabetic parameter names (a, b, ..., aa).
8230
8209
  *
8231
8210
  * @param index Zero-based parameter index.
8211
+ *
8232
8212
  * @private function of ParameterNaming
8233
8213
  */
8234
8214
  function buildAlphabeticParameterName(index) {
@@ -8245,6 +8225,7 @@
8245
8225
  * Converts a positive integer into a Roman numeral string.
8246
8226
  *
8247
8227
  * @param value Positive integer value.
8228
+ *
8248
8229
  * @private function of ParameterNaming
8249
8230
  */
8250
8231
  function toRomanNumeral(value) {
@@ -8277,6 +8258,7 @@
8277
8258
  * Builds Roman numeral parameter names (I, II, ...).
8278
8259
  *
8279
8260
  * @param index Zero-based parameter index.
8261
+ *
8280
8262
  * @private function of ParameterNaming
8281
8263
  */
8282
8264
  function buildRomanParameterName(index) {
@@ -8287,6 +8269,7 @@
8287
8269
  *
8288
8270
  * @param prefix Prefix string.
8289
8271
  * @param builder Base builder function.
8272
+ *
8290
8273
  * @private function of ParameterNaming
8291
8274
  */
8292
8275
  function buildPrefixedParameterName(prefix, builder) {
@@ -8308,6 +8291,7 @@
8308
8291
  * Collects bracketed tokens from parameter values to avoid placeholder collisions.
8309
8292
  *
8310
8293
  * @param values Parameter values to scan.
8294
+ *
8311
8295
  * @private function of ParameterNaming
8312
8296
  */
8313
8297
  function collectBracketedParameterTokens(values) {
@@ -8328,6 +8312,7 @@
8328
8312
  * Builds placeholder names while avoiding collisions with parameter content.
8329
8313
  *
8330
8314
  * @param values Parameter values to scan for conflicting tokens.
8315
+ *
8331
8316
  * @private function of ParameterNaming
8332
8317
  */
8333
8318
  function buildParameterNames(values) {
@@ -8358,6 +8343,7 @@
8358
8343
  * Formats the placeholder used in the prompt body for a parameter.
8359
8344
  *
8360
8345
  * @param name Parameter placeholder name.
8346
+ *
8361
8347
  * @private function of ParameterSection
8362
8348
  */
8363
8349
  function formatParameterPlaceholder(name) {
@@ -8367,6 +8353,7 @@
8367
8353
  * Formats a single line entry for structured parameters.
8368
8354
  *
8369
8355
  * @param item Parameter entry data.
8356
+ *
8370
8357
  * @private function of ParameterSection
8371
8358
  */
8372
8359
  function formatParameterListItem(item) {
@@ -8378,6 +8365,7 @@
8378
8365
  * Builds the structured parameters section appended to the prompt.
8379
8366
  *
8380
8367
  * @param items Parameter entries to include.
8368
+ *
8381
8369
  * @private function of ParameterSection
8382
8370
  */
8383
8371
  function buildParametersSection(items) {
@@ -8453,6 +8441,7 @@
8453
8441
  * @param strings
8454
8442
  * @param values
8455
8443
  * @returns prompt content wrapped as a PromptString
8444
+ *
8456
8445
  * @public exported from `@promptbook/utils`
8457
8446
  */
8458
8447
  function prompt(strings, ...values) {
@@ -8537,11 +8526,9 @@
8537
8526
  }
8538
8527
  return new PromptString(pipelineString);
8539
8528
  }
8540
- /**
8541
- * TODO: Maybe split into multiple files
8542
- * TODO: [🧠][🈴] Where is the best location for this file
8543
- * Note: [💞] Ignore a discrepancy between file name and entity name
8544
- */
8529
+ // TODO: Maybe split into multiple files
8530
+ // TODO: [🧠][🈴] Where is the best location for this file
8531
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8545
8532
 
8546
8533
  /**
8547
8534
  * @@@
@@ -8578,9 +8565,7 @@
8578
8565
  [CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
8579
8566
  };
8580
8567
  }
8581
- /**
8582
- * Note: [💞] Ignore a discrepancy between file name and entity name
8583
- */
8568
+ // Note: [💞] Ignore a discrepancy between file name and entity name
8584
8569
 
8585
8570
  /**
8586
8571
  * Computes SHA-256 hash of the given object
@@ -8590,9 +8575,7 @@
8590
8575
  function computeHash(value) {
8591
8576
  return cryptoJs.SHA256(hexEncoder__default["default"].parse(_spaceTrim.spaceTrim(valueToString(value)))).toString( /* hex */);
8592
8577
  }
8593
- /**
8594
- * TODO: [🥬][🥬] Use this ACRY
8595
- */
8578
+ // TODO: [🥬][🥬] Use this ACRY
8596
8579
 
8597
8580
  // spell-checker: disable
8598
8581
  /**
@@ -8758,6 +8741,9 @@
8758
8741
  'prvotní',
8759
8742
  'hbitý',
8760
8743
  ];
8744
+ /**
8745
+ * Collection of nouns.
8746
+ */
8761
8747
  const NOUNS$1 = [
8762
8748
  'jablko',
8763
8749
  'nebe',
@@ -8971,6 +8957,9 @@
8971
8957
  'okno',
8972
8958
  'chodba',
8973
8959
  ];
8960
+ /**
8961
+ * Collection of verbs.
8962
+ */
8974
8963
  const VERBS$1 = [
8975
8964
  'skáče',
8976
8965
  'tančí',
@@ -9143,9 +9132,7 @@
9143
9132
  noun: NOUNS$1,
9144
9133
  verb: VERBS$1,
9145
9134
  };
9146
- /**
9147
- * Note: [💞] Ignore a discrepancy between file name and entity name
9148
- */
9135
+ // Note: [💞] Ignore a discrepancy between file name and entity name
9149
9136
 
9150
9137
  /**
9151
9138
  * @@@
@@ -9401,6 +9388,9 @@
9401
9388
  'macro',
9402
9389
  'mini',
9403
9390
  ];
9391
+ /**
9392
+ * Collection of nouns.
9393
+ */
9404
9394
  const NOUNS = [
9405
9395
  'apple',
9406
9396
  'sky',
@@ -9640,6 +9630,9 @@
9640
9630
  'roof',
9641
9631
  'floor',
9642
9632
  ];
9633
+ /**
9634
+ * Collection of verbs.
9635
+ */
9643
9636
  const VERBS = [
9644
9637
  'jumping',
9645
9638
  'dancing',
@@ -9835,9 +9828,7 @@
9835
9828
  noun: NOUNS,
9836
9829
  verb: VERBS,
9837
9830
  };
9838
- /**
9839
- * Note: [💞] Ignore a discrepancy between file name and entity name
9840
- */
9831
+ // Note: [💞] Ignore a discrepancy between file name and entity name
9841
9832
 
9842
9833
  /**
9843
9834
  * Default language used for linguistic hashes.
@@ -10012,8 +10003,9 @@
10012
10003
  /**
10013
10004
  * Creates a human-readable hash as a short, story-like phrase.
10014
10005
  *
10015
- * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
10016
10006
  * {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
10007
+ *
10008
+ * @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
10017
10009
  * @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
10018
10010
  *
10019
10011
  * @public exported from `@promptbook/utils`
@@ -10032,6 +10024,7 @@
10032
10024
  * Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
10033
10025
  *
10034
10026
  * @returns string_date branded type
10027
+ *
10035
10028
  * @public exported from `@promptbook/utils`
10036
10029
  */
10037
10030
  function $getCurrentDate() {
@@ -10054,6 +10047,7 @@
10054
10047
  *
10055
10048
  * @param {string} input
10056
10049
  * @returns {Set} of keywords without diacritics in lowercase
10050
+ *
10057
10051
  * @public exported from `@promptbook/utils`
10058
10052
  */
10059
10053
  function parseKeywordsFromString(input) {
@@ -10070,6 +10064,7 @@
10070
10064
  * @param name The string to be converted to a URI-compatible format.
10071
10065
  * @returns A URI-compatible string derived from the input name.
10072
10066
  * @example 'Hello World' -> 'hello-world'
10067
+ *
10073
10068
  * @public exported from `@promptbook/utils`
10074
10069
  */
10075
10070
  function nameToUriPart(name) {
@@ -10088,6 +10083,7 @@
10088
10083
  * @param name The name to be converted into URI parts.
10089
10084
  * @returns An array of URI-compatible parts derived from the name.
10090
10085
  * @example 'Example Name' -> ['example', 'name']
10086
+ *
10091
10087
  * @public exported from `@promptbook/utils`
10092
10088
  */
10093
10089
  function nameToUriParts(name) {
@@ -10117,6 +10113,7 @@
10117
10113
  * @returns
10118
10114
  * @example 'HelloWorld'
10119
10115
  * @example 'ILovePromptbook'
10116
+ *
10120
10117
  * @public exported from `@promptbook/utils`
10121
10118
  */
10122
10119
  function normalizeTo_PascalCase(text) {
@@ -10146,6 +10143,7 @@
10146
10143
  *
10147
10144
  * @param text optionally quoted text
10148
10145
  * @returns text without quotes
10146
+ *
10149
10147
  * @public exported from `@promptbook/utils`
10150
10148
  */
10151
10149
  function removeQuotes(text) {
@@ -10169,6 +10167,7 @@
10169
10167
  *
10170
10168
  * @param text optionally quoted text
10171
10169
  * @returns text without quotes
10170
+ *
10172
10171
  * @public exported from `@promptbook/utils`
10173
10172
  */
10174
10173
  function unwrapResult(text, options) {
@@ -10243,9 +10242,7 @@
10243
10242
  return processedText;
10244
10243
  }
10245
10244
  }
10246
- /**
10247
- * TODO: [🧠] Should this also unwrap the (parenthesis)
10248
- */
10245
+ // TODO: [🧠] Should this also unwrap the (parenthesis)
10249
10246
 
10250
10247
  /**
10251
10248
  * Checks if an URL is reserved for private networks or localhost.
@@ -10291,6 +10288,7 @@
10291
10288
  * @param {string} url - The URL to check.
10292
10289
  * @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
10293
10290
  * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
10291
+ *
10294
10292
  * @public exported from `@promptbook/utils`
10295
10293
  */
10296
10294
  function isUrlOnPrivateNetwork(url, options = {}) {
@@ -10329,9 +10327,7 @@
10329
10327
  */
10330
10328
  return true;
10331
10329
  }
10332
- /**
10333
- * TODO: [🐠] Maybe more info why the URL is invalid
10334
- */
10330
+ // TODO: [🐠] Maybe more info why the URL is invalid
10335
10331
 
10336
10332
  /**
10337
10333
  * Retrieves an intermediate source for a scraper based on the knowledge source.
@@ -10395,13 +10391,11 @@
10395
10391
  };
10396
10392
  return fileHandler;
10397
10393
  }
10398
- /** 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 */
10399
- /**
10400
- * Note: Not using `FileCacheStorage` for two reasons:
10401
- * 1) Need to store more than serialized JSONs
10402
- * 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
10403
- * TODO: [🐱‍🐉][🧠] Make some smart crop
10404
- */
10394
+ // 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
10395
+ // Note: Not using `FileCacheStorage` for two reasons:
10396
+ // 1. Need to store more than serialized JSONs.
10397
+ // 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
10398
+ // TODO: [🐱‍🐉][🧠] Make some smart crop
10405
10399
 
10406
10400
  /**
10407
10401
  * Metadata of the scraper
@@ -10428,14 +10422,13 @@
10428
10422
  * @public exported from `@promptbook/cli`
10429
10423
  */
10430
10424
  $scrapersMetadataRegister.register(markdownScraperMetadata);
10431
- /**
10432
- * Note: [💞] Ignore a discrepancy between file name and entity name
10433
- */
10425
+ // Note: [💞] Ignore a discrepancy between file name and entity name
10434
10426
 
10435
10427
  /**
10436
10428
  * Scraper for markdown files
10437
10429
  *
10438
10430
  * @see `documentationUrl` for more details
10431
+ *
10439
10432
  * @public exported from `@promptbook/markdown-utils`
10440
10433
  */
10441
10434
  class MarkdownScraper {
@@ -10568,10 +10561,8 @@
10568
10561
  return knowledge;
10569
10562
  }
10570
10563
  }
10571
- /**
10572
- * TODO: [🪂] Do it in parallel 11:11
10573
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
10574
- */
10564
+ // TODO: [🪂] Do it in parallel 11:11
10565
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
10575
10566
 
10576
10567
  /**
10577
10568
  * Metadata of the scraper
@@ -10598,9 +10589,7 @@
10598
10589
  * @public exported from `@promptbook/cli`
10599
10590
  */
10600
10591
  $scrapersMetadataRegister.register(websiteScraperMetadata);
10601
- /**
10602
- * Note: [💞] Ignore a discrepancy between file name and entity name
10603
- */
10592
+ // Note: [💞] Ignore a discrepancy between file name and entity name
10604
10593
 
10605
10594
  /**
10606
10595
  * Create a new showdown converter instance
@@ -10629,6 +10618,7 @@
10629
10618
  * Scraper for websites
10630
10619
  *
10631
10620
  * @see `documentationUrl` for more details
10621
+ *
10632
10622
  * @public exported from `@promptbook/website-crawler`
10633
10623
  */
10634
10624
  class WebsiteScraper {
@@ -10732,12 +10722,10 @@
10732
10722
  return knowledge;
10733
10723
  }
10734
10724
  }
10735
- /** 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 */
10736
- /**
10737
- * TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
10738
- * TODO: [🪂] Do it in parallel 11:11
10739
- * Note: No need to aggregate usage here, it is done by intercepting the llmTools
10740
- */
10725
+ // 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
10726
+ // TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
10727
+ // TODO: [🪂] Do it in parallel 11:11
10728
+ // Note: No need to aggregate usage here, it is done by intercepting the llmTools
10741
10729
 
10742
10730
  /**
10743
10731
  * Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
@@ -10748,14 +10736,14 @@
10748
10736
  * 3. Uses the appropriate scraper to convert to markdown
10749
10737
  * 4. Returns the scraped markdown content
10750
10738
  *
10739
+ * WARNING: This function should NOT be used directly in browser environments.
10740
+ * For browser environments, use fetchUrlContentViaBrowser which proxies through
10741
+ * the Agents Server API endpoint at /api/scrape
10742
+ *
10751
10743
  * @param url The URL to fetch and scrape
10752
10744
  * @returns Markdown content from the URL
10753
10745
  *
10754
10746
  * @private internal utility for USE BROWSER commitment
10755
- *
10756
- * WARNING: This function should NOT be used directly in browser environments.
10757
- * For browser environments, use fetchUrlContentViaBrowser which proxies through
10758
- * the Agents Server API endpoint at /api/scrape
10759
10747
  */
10760
10748
  async function fetchUrlContent(url) {
10761
10749
  try {
@@ -10859,7 +10847,7 @@
10859
10847
  `);
10860
10848
  }
10861
10849
  }
10862
- /** 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 */
10850
+ // 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
10863
10851
 
10864
10852
  /**
10865
10853
  * Cached implementation of `run_browser` when it can be resolved.
@@ -10877,6 +10865,7 @@
10877
10865
  * Attempts to load the server-side `run_browser` tool lazily.
10878
10866
  *
10879
10867
  * @returns Loaded `run_browser` implementation
10868
+ *
10880
10869
  * @private internal utility for USE BROWSER commitment
10881
10870
  */
10882
10871
  function loadRunBrowserToolForNode() {
@@ -11246,9 +11235,7 @@
11246
11235
  return this.appendToSystemMessage(requirements, actionSection, '\n\n');
11247
11236
  }
11248
11237
  }
11249
- /**
11250
- * Note: [💞] Ignore a discrepancy between file name and entity name
11251
- */
11238
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11252
11239
 
11253
11240
  /**
11254
11241
  * CLOSED commitment definition
@@ -11314,9 +11301,7 @@
11314
11301
  };
11315
11302
  }
11316
11303
  }
11317
- /**
11318
- * Note: [💞] Ignore a discrepancy between file name and entity name
11319
- */
11304
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11320
11305
 
11321
11306
  /**
11322
11307
  * COMPONENT commitment definition
@@ -11375,9 +11360,7 @@
11375
11360
  return this.appendToSystemMessage(requirements, componentSection, '\n\n');
11376
11361
  }
11377
11362
  }
11378
- /**
11379
- * Note: [💞] Ignore a discrepancy between file name and entity name
11380
- */
11363
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11381
11364
 
11382
11365
  /**
11383
11366
  * DELETE commitment definition
@@ -11499,9 +11482,7 @@
11499
11482
  return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
11500
11483
  }
11501
11484
  }
11502
- /**
11503
- * Note: [💞] Ignore a discrepancy between file name and entity name
11504
- */
11485
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11505
11486
 
11506
11487
  /**
11507
11488
  * DICTIONARY commitment definition
@@ -11605,9 +11586,7 @@
11605
11586
  };
11606
11587
  }
11607
11588
  }
11608
- /**
11609
- * Note: [💞] Ignore a discrepancy between file name and entity name
11610
- */
11589
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11611
11590
 
11612
11591
  /**
11613
11592
  * FORMAT commitment definition
@@ -11686,10 +11665,11 @@
11686
11665
  return this.appendToSystemMessage(requirements, formatSection, '\n\n');
11687
11666
  }
11688
11667
  }
11668
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11669
+
11689
11670
  /**
11690
- * Note: [💞] Ignore a discrepancy between file name and entity name
11671
+ * Collection of firstnames.
11691
11672
  */
11692
-
11693
11673
  const FIRSTNAMES = [
11694
11674
  'Paul',
11695
11675
  'George',
@@ -11726,6 +11706,9 @@
11726
11706
  'Anthony',
11727
11707
  'Christopher',
11728
11708
  ];
11709
+ /**
11710
+ * Collection of lastnames with colors.
11711
+ */
11729
11712
  const LASTNAMES_WITH_COLORS = [
11730
11713
  { lastname: 'Green', color: '#008000' },
11731
11714
  { lastname: 'Brown', color: '#A52A2A' },
@@ -11753,6 +11736,7 @@
11753
11736
  *
11754
11737
  * @param seed - Input seed used to derive a stable pseudonym.
11755
11738
  * @returns Deterministic English full name with color metadata.
11739
+ *
11756
11740
  * @private internal helper for deterministic pseudonym generation
11757
11741
  */
11758
11742
  function generateDeterministicEnglishName(seed) {
@@ -11794,6 +11778,9 @@
11794
11778
  * Legacy aliases that historically behaved like `FROM VOID`.
11795
11779
  */
11796
11780
  const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
11781
+ /**
11782
+ * Constant for void alias entries.
11783
+ */
11797
11784
  const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
11798
11785
  alias,
11799
11786
  'VOID',
@@ -11842,6 +11829,7 @@
11842
11829
  *
11843
11830
  * @param rawReference - Raw reference token or payload.
11844
11831
  * @returns Pseudo-agent kind or `null` when the reference is not pseudo.
11832
+ *
11845
11833
  * @private internal utility of pseudo-agent resolution
11846
11834
  */
11847
11835
  function resolvePseudoAgentKindFromReference(rawReference) {
@@ -11856,6 +11844,7 @@
11856
11844
  *
11857
11845
  * @param agentUrl - URL to inspect.
11858
11846
  * @returns Pseudo-agent kind or `null` when the URL is not pseudo.
11847
+ *
11859
11848
  * @private internal utility of pseudo-agent resolution
11860
11849
  */
11861
11850
  function resolvePseudoAgentKindFromUrl(agentUrl) {
@@ -11876,6 +11865,7 @@
11876
11865
  *
11877
11866
  * @param teamCommitmentContent - TEAM commitment content after reference resolution.
11878
11867
  * @returns Deterministic English full name representing pseudo-user in that TEAM context.
11868
+ *
11879
11869
  * @private internal utility of TEAM commitment rendering
11880
11870
  */
11881
11871
  function createPseudoUserTeammateLabel(teamCommitmentContent) {
@@ -11891,6 +11881,7 @@
11891
11881
  *
11892
11882
  * @param rawReference - Raw reference content.
11893
11883
  * @returns True when the reference maps to void.
11884
+ *
11894
11885
  * @private internal utility of pseudo-agent resolution
11895
11886
  */
11896
11887
  function isVoidPseudoAgentReference(rawReference) {
@@ -11904,9 +11895,7 @@
11904
11895
  const normalizedReference = normalizePseudoReferenceKey(rawReference);
11905
11896
  return LEGACY_VOID_ALIASES.has(normalizedReference);
11906
11897
  }
11907
- /**
11908
- * Note: [💞] Ignore a discrepancy between file name and entity name
11909
- */
11898
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11910
11899
 
11911
11900
  /**
11912
11901
  * FROM commitment definition
@@ -11985,9 +11974,7 @@
11985
11974
  };
11986
11975
  }
11987
11976
  }
11988
- /**
11989
- * Note: [💞] Ignore a discrepancy between file name and entity name
11990
- */
11977
+ // Note: [💞] Ignore a discrepancy between file name and entity name
11991
11978
 
11992
11979
  /**
11993
11980
  * GOAL commitment definition
@@ -12085,9 +12072,7 @@
12085
12072
  return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
12086
12073
  }
12087
12074
  }
12088
- /**
12089
- * Note: [💞] Ignore a discrepancy between file name and entity name
12090
- */
12075
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12091
12076
 
12092
12077
  /**
12093
12078
  * IMPORT commitment definition
@@ -12166,19 +12151,26 @@
12166
12151
  `));
12167
12152
  }
12168
12153
  }
12154
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12155
+
12169
12156
  /**
12170
- * Note: [💞] Ignore a discrepancy between file name and entity name
12157
+ * Matches URL-like candidates inside arbitrary text.
12158
+ *
12159
+ * @private
12171
12160
  */
12172
-
12173
- /** @private Matches URL-like candidates inside arbitrary text. */
12174
12161
  const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
12175
- /** @private Trims punctuation that commonly trails URLs in prose. */
12162
+ /**
12163
+ * Trims punctuation that commonly trails URLs in prose.
12164
+ *
12165
+ * @private
12166
+ */
12176
12167
  const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
12177
12168
  /**
12178
12169
  * Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
12179
12170
  *
12180
12171
  * @param text - Input text that may contain one or more URLs.
12181
12172
  * @returns Unique URLs in their first-seen order.
12173
+ *
12182
12174
  * @private utility of KNOWLEDGE parsing
12183
12175
  */
12184
12176
  function extractUrlsFromText(text) {
@@ -12208,7 +12200,9 @@
12208
12200
  return urls;
12209
12201
  }
12210
12202
  /**
12211
- * @private Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
12203
+ * Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
12204
+ *
12205
+ * @private
12212
12206
  */
12213
12207
  function normalizeUrlCandidate(candidate) {
12214
12208
  let normalized = candidate.trim();
@@ -12228,7 +12222,9 @@
12228
12222
  return normalized;
12229
12223
  }
12230
12224
  /**
12231
- * @private Removes trailing closing wrappers when they are unmatched in the candidate.
12225
+ * Removes trailing closing wrappers when they are unmatched in the candidate.
12226
+ *
12227
+ * @private
12232
12228
  */
12233
12229
  function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
12234
12230
  let normalized = candidate;
@@ -12243,7 +12239,9 @@
12243
12239
  return normalized;
12244
12240
  }
12245
12241
  /**
12246
- * @private Counts character occurrences in a string.
12242
+ * Counts character occurrences in a string.
12243
+ *
12244
+ * @private
12247
12245
  */
12248
12246
  function countOccurrences(value, searchedChar) {
12249
12247
  let count = 0;
@@ -12255,14 +12253,28 @@
12255
12253
  return count;
12256
12254
  }
12257
12255
 
12258
- /** @private The default base name for inline knowledge files when the content lacks identifying text */
12256
+ /**
12257
+ * The default base name for inline knowledge files when the content lacks identifying text.
12258
+ *
12259
+ * @private
12260
+ */
12259
12261
  const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
12260
- /** @private The default file extension used for inline knowledge uploads */
12262
+ /**
12263
+ * The default file extension used for inline knowledge uploads.
12264
+ *
12265
+ * @private
12266
+ */
12261
12267
  const INLINE_KNOWLEDGE_EXTENSION = '.txt';
12262
- /** @private Prefix that identifies base64 data URLs */
12268
+ /**
12269
+ * Prefix that identifies base64 data URLs.
12270
+ *
12271
+ * @private
12272
+ */
12263
12273
  const DATA_URL_PREFIX = 'data:';
12264
12274
  /**
12265
- * @private Retrieves the first meaningful line from the inline content.
12275
+ * Retrieves the first meaningful line from the inline content.
12276
+ *
12277
+ * @private
12266
12278
  */
12267
12279
  function getFirstNonEmptyLine(content) {
12268
12280
  const lines = content.split(/\r?\n/);
@@ -12275,7 +12287,9 @@
12275
12287
  return null;
12276
12288
  }
12277
12289
  /**
12278
- * @private Determines the base file name by normalizing the first non-empty line.
12290
+ * Determines the base file name by normalizing the first non-empty line.
12291
+ *
12292
+ * @private
12279
12293
  */
12280
12294
  function deriveBaseFilename(content) {
12281
12295
  const firstLine = getFirstNonEmptyLine(content);
@@ -12286,7 +12300,9 @@
12286
12300
  return normalized || INLINE_KNOWLEDGE_BASE_NAME;
12287
12301
  }
12288
12302
  /**
12289
- * @private Converts inline knowledge into the internal metadata form used for uploads.
12303
+ * Converts inline knowledge into the internal metadata form used for uploads.
12304
+ *
12305
+ * @private
12290
12306
  */
12291
12307
  function createInlineKnowledgeSourceFile(content) {
12292
12308
  const trimmedContent = content.trim();
@@ -12309,7 +12325,9 @@
12309
12325
  return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
12310
12326
  }
12311
12327
  /**
12312
- * @private Converts a stored inline knowledge file into a data URL for backwards compatibility.
12328
+ * Converts a stored inline knowledge file into a data URL for backwards compatibility.
12329
+ *
12330
+ * @private
12313
12331
  */
12314
12332
  function inlineKnowledgeSourceToDataUrl(source) {
12315
12333
  const base64 = source.buffer.toString('base64');
@@ -12369,9 +12387,7 @@
12369
12387
  return null;
12370
12388
  }
12371
12389
  }
12372
- /**
12373
- * Note: [💞] Ignore a discrepancy between file name and entity name
12374
- */
12390
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12375
12391
 
12376
12392
  /**
12377
12393
  * KNOWLEDGE commitment definition
@@ -12575,9 +12591,7 @@
12575
12591
  return this.appendToSystemMessage(requirements, languageSection, '\n\n');
12576
12592
  }
12577
12593
  }
12578
- /**
12579
- * Note: [💞] Ignore a discrepancy between file name and entity name
12580
- */
12594
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12581
12595
 
12582
12596
  /**
12583
12597
  * @@@
@@ -12843,6 +12857,7 @@
12843
12857
  *
12844
12858
  * @param listener - Listener notified about tool progress.
12845
12859
  * @returns Hidden token used to route progress updates.
12860
+ *
12846
12861
  * @private internal runtime wiring for commitment tools
12847
12862
  */
12848
12863
  function registerToolCallProgressListener(listener) {
@@ -12855,14 +12870,13 @@
12855
12870
  * Unregisters one in-memory progress listener.
12856
12871
  *
12857
12872
  * @param token - Token previously created by `registerToolCallProgressListener`.
12873
+ *
12858
12874
  * @private internal runtime wiring for commitment tools
12859
12875
  */
12860
12876
  function unregisterToolCallProgressListener(token) {
12861
12877
  toolCallProgressListeners.delete(token);
12862
12878
  }
12863
- /**
12864
- * Note: [💞] Ignore a discrepancy between file name and entity name
12865
- */
12879
+ // Note: [💞] Ignore a discrepancy between file name and entity name
12866
12880
 
12867
12881
  /**
12868
12882
  * Resolves runtime context from hidden tool arguments.
@@ -13223,9 +13237,7 @@
13223
13237
  return createMemoryToolFunctions();
13224
13238
  }
13225
13239
  }
13226
- /**
13227
- * Note: [💞] Ignore a discrepancy between file name and entity name
13228
- */
13240
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13229
13241
 
13230
13242
  /**
13231
13243
  * AGENT MESSAGE commitment definition
@@ -13555,9 +13567,7 @@
13555
13567
  return this.appendToSystemMessage(requirements, messageSection, '\n\n');
13556
13568
  }
13557
13569
  }
13558
- /**
13559
- * Note: [💞] Ignore a discrepancy between file name and entity name
13560
- */
13570
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13561
13571
 
13562
13572
  /**
13563
13573
  * USER MESSAGE commitment definition
@@ -13688,9 +13698,7 @@
13688
13698
  return requirements;
13689
13699
  }
13690
13700
  }
13691
- /**
13692
- * Note: [💞] Ignore a discrepancy between file name and entity name
13693
- */
13701
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13694
13702
 
13695
13703
  /**
13696
13704
  * META commitment definition
@@ -13837,9 +13845,7 @@
13837
13845
  return knownTypes.includes(metaType.toUpperCase());
13838
13846
  }
13839
13847
  }
13840
- /**
13841
- * Note: [💞] Ignore a discrepancy between file name and entity name
13842
- */
13848
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13843
13849
 
13844
13850
  /**
13845
13851
  * META COLOR commitment definition
@@ -13935,9 +13941,7 @@
13935
13941
  return trimmedContent || null;
13936
13942
  }
13937
13943
  }
13938
- /**
13939
- * Note: [💞] Ignore a discrepancy between file name and entity name
13940
- */
13944
+ // Note: [💞] Ignore a discrepancy between file name and entity name
13941
13945
 
13942
13946
  /**
13943
13947
  * META DOMAIN commitment definition
@@ -14002,9 +14006,7 @@
14002
14006
  return trimmedContent || null;
14003
14007
  }
14004
14008
  }
14005
- /**
14006
- * Note: [💞] Ignore a discrepancy between file name and entity name
14007
- */
14009
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14008
14010
 
14009
14011
  /**
14010
14012
  * META DISCLAIMER commitment definition
@@ -14072,9 +14074,7 @@
14072
14074
  return requirements;
14073
14075
  }
14074
14076
  }
14075
- /**
14076
- * Note: [💞] Ignore a discrepancy between file name and entity name
14077
- */
14077
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14078
14078
 
14079
14079
  /**
14080
14080
  * META FONT commitment definition
@@ -14157,9 +14157,7 @@
14157
14157
  return trimmedContent || null;
14158
14158
  }
14159
14159
  }
14160
- /**
14161
- * Note: [💞] Ignore a discrepancy between file name and entity name
14162
- */
14160
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14163
14161
 
14164
14162
  /**
14165
14163
  * META IMAGE commitment definition
@@ -14244,9 +14242,7 @@
14244
14242
  return trimmedContent || null;
14245
14243
  }
14246
14244
  }
14247
- /**
14248
- * Note: [💞] Ignore a discrepancy between file name and entity name
14249
- */
14245
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14250
14246
 
14251
14247
  /**
14252
14248
  * META INPUT PLACEHOLDER commitment definition.
@@ -14309,9 +14305,7 @@
14309
14305
  return trimmedContent || null;
14310
14306
  }
14311
14307
  }
14312
- /**
14313
- * Note: [💞] Ignore a discrepancy between file name and entity name
14314
- */
14308
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14315
14309
 
14316
14310
  /**
14317
14311
  * META LINK commitment definition
@@ -14418,9 +14412,7 @@
14418
14412
  }
14419
14413
  }
14420
14414
  }
14421
- /**
14422
- * Note: [💞] Ignore a discrepancy between file name and entity name
14423
- */
14415
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14424
14416
 
14425
14417
  /**
14426
14418
  * META VOICE commitment definition
@@ -14489,9 +14481,7 @@
14489
14481
  return trimmedContent || null;
14490
14482
  }
14491
14483
  }
14492
- /**
14493
- * Note: [💞] Ignore a discrepancy between file name and entity name
14494
- */
14484
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14495
14485
 
14496
14486
  /**
14497
14487
  * MODEL commitment definition
@@ -14729,9 +14719,7 @@
14729
14719
  return result;
14730
14720
  }
14731
14721
  }
14732
- /**
14733
- * Note: [💞] Ignore a discrepancy between file name and entity name
14734
- */
14722
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14735
14723
 
14736
14724
  /**
14737
14725
  * NOTE commitment definition
@@ -14893,9 +14881,7 @@
14893
14881
  };
14894
14882
  }
14895
14883
  }
14896
- /**
14897
- * Note: [💞] Ignore a discrepancy between file name and entity name
14898
- */
14884
+ // Note: [💞] Ignore a discrepancy between file name and entity name
14899
14885
 
14900
14886
  /**
14901
14887
  * PERSONA commitment definition
@@ -15034,9 +15020,7 @@
15034
15020
  };
15035
15021
  }
15036
15022
  }
15037
- /**
15038
- * Note: [💞] Ignore a discrepancy between file name and entity name
15039
- */
15023
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15040
15024
 
15041
15025
  /**
15042
15026
  * RULE commitment definition
@@ -15117,15 +15101,14 @@
15117
15101
  return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
15118
15102
  }
15119
15103
  }
15120
- /**
15121
- * Note: [💞] Ignore a discrepancy between file name and entity name
15122
- */
15104
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15123
15105
 
15124
15106
  /**
15125
15107
  * Creates the canonical system-message body for one writing-sample commitment.
15126
15108
  *
15127
15109
  * @param content - Explicit 1:1 sample text.
15128
15110
  * @returns Writing-sample guidance ready for one system-message section.
15111
+ *
15129
15112
  * @private internal utility of writing commitments
15130
15113
  */
15131
15114
  function createWritingSampleSection(content) {
@@ -15143,6 +15126,7 @@
15143
15126
  *
15144
15127
  * @param content - Writing-only instructions.
15145
15128
  * @returns Writing-rules guidance ready for one system-message section.
15129
+ *
15146
15130
  * @private internal utility of writing commitments
15147
15131
  */
15148
15132
  function createWritingRulesSection(content) {
@@ -15155,9 +15139,7 @@
15155
15139
  ${content}
15156
15140
  `);
15157
15141
  }
15158
- /**
15159
- * Note: [💞] Ignore a discrepancy between file name and entity name
15160
- */
15142
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15161
15143
 
15162
15144
  /**
15163
15145
  * Legacy `SAMPLE` / `EXAMPLE` commitment definition.
@@ -15236,9 +15218,7 @@
15236
15218
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
15237
15219
  }
15238
15220
  }
15239
- /**
15240
- * Note: [💞] Ignore a discrepancy between file name and entity name
15241
- */
15221
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15242
15222
 
15243
15223
  /**
15244
15224
  * SCENARIO commitment definition
@@ -15360,9 +15340,7 @@
15360
15340
  return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
15361
15341
  }
15362
15342
  }
15363
- /**
15364
- * Note: [💞] Ignore a discrepancy between file name and entity name
15365
- */
15343
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15366
15344
 
15367
15345
  /**
15368
15346
  * STYLE commitment definition
@@ -15459,6 +15437,7 @@
15459
15437
  *
15460
15438
  * @param teammateLabel - Human-readable teammate label.
15461
15439
  * @returns Normalized teammate identifier for TEAM tool names.
15440
+ *
15462
15441
  * @private internal helper of TEAM tool-name generation
15463
15442
  */
15464
15443
  function normalizeTeammateToolNamePart(teammateLabel) {
@@ -15474,6 +15453,7 @@
15474
15453
  * @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
15475
15454
  * @param teammateLabel - Human-readable teammate label used as the basis for the name.
15476
15455
  * @returns TEAM tool name derived from the label.
15456
+ *
15477
15457
  * @private internal utility of TEAM commitments and chat UI mapping
15478
15458
  */
15479
15459
  function createTeamToolName(_teammateUrl, teammateLabel) {
@@ -15481,9 +15461,21 @@
15481
15461
  return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
15482
15462
  }
15483
15463
 
15464
+ /**
15465
+ * Pattern matching agent URLs inside TEAM commitment content.
15466
+ */
15484
15467
  const urlRegex = /https?:\/\/[^\s]+/gi;
15468
+ /**
15469
+ * Pattern matching punctuation that often trails teammate URLs in prose.
15470
+ */
15485
15471
  const trailingPunctuationRegex = /[),.;!?]+$/;
15472
+ /**
15473
+ * Clause separators used while splitting TEAM instruction context.
15474
+ */
15486
15475
  const clauseSeparators = ['.', '?', '!', ';', ','];
15476
+ /**
15477
+ * Conjunction separators used while splitting TEAM instruction context.
15478
+ */
15487
15479
  const conjunctionSeparators = [' and ', ' or '];
15488
15480
  /**
15489
15481
  * Parses TEAM commitment content into teammates with instructions.
@@ -15531,6 +15523,9 @@
15531
15523
  }
15532
15524
  return teammates;
15533
15525
  }
15526
+ /**
15527
+ * Extracts the instruction fragment associated with one teammate URL.
15528
+ */
15534
15529
  function extractInstructionContext(line, matches, matchIndex) {
15535
15530
  var _a;
15536
15531
  const match = matches[matchIndex];
@@ -15556,6 +15551,9 @@
15556
15551
  }
15557
15552
  return `${prefix} ${suffix}`.trim();
15558
15553
  }
15554
+ /**
15555
+ * Trims content after the last detected clause delimiter.
15556
+ */
15559
15557
  function trimAfterLastDelimiter(text) {
15560
15558
  const match = findLastDelimiter(text);
15561
15559
  if (!match) {
@@ -15563,6 +15561,9 @@
15563
15561
  }
15564
15562
  return text.slice(match.index + match.length);
15565
15563
  }
15564
+ /**
15565
+ * Trims content before the last detected clause delimiter.
15566
+ */
15566
15567
  function trimBeforeLastDelimiter(text) {
15567
15568
  const cleaned = text.replace(/^[,;:]\s*/g, '');
15568
15569
  const match = findLastDelimiter(cleaned);
@@ -15571,6 +15572,9 @@
15571
15572
  }
15572
15573
  return cleaned.slice(0, match.index);
15573
15574
  }
15575
+ /**
15576
+ * Finds the last clause or conjunction delimiter in a string.
15577
+ */
15574
15578
  function findLastDelimiter(text) {
15575
15579
  let bestIndex = -1;
15576
15580
  let bestLength = 0;
@@ -15594,6 +15598,9 @@
15594
15598
  }
15595
15599
  return { index: bestIndex, length: bestLength };
15596
15600
  }
15601
+ /**
15602
+ * Normalizes teammate instruction text after URL extraction.
15603
+ */
15597
15604
  function normalizeInstructionText(text) {
15598
15605
  if (!text) {
15599
15606
  return '';
@@ -15607,6 +15614,9 @@
15607
15614
  normalized = normalizeWhitespaces(normalized).trim();
15608
15615
  return normalized;
15609
15616
  }
15617
+ /**
15618
+ * Creates a readable teammate label from an agent URL.
15619
+ */
15610
15620
  function createTeammateLabel(url) {
15611
15621
  try {
15612
15622
  const parsed = new URL(url);
@@ -15626,12 +15636,19 @@
15626
15636
  return url;
15627
15637
  }
15628
15638
  }
15639
+ // Note: [💞] Ignore a discrepancy between file name and entity name
15640
+
15629
15641
  /**
15630
- * Note: [💞] Ignore a discrepancy between file name and entity name
15642
+ * Map of team tool functions.
15631
15643
  */
15632
-
15633
15644
  const teamToolFunctions = {};
15645
+ /**
15646
+ * Map of team tool titles.
15647
+ */
15634
15648
  const teamToolTitles = {};
15649
+ /**
15650
+ * Constant for remote agents by Url.
15651
+ */
15635
15652
  const remoteAgentsByUrl = new Map();
15636
15653
  /**
15637
15654
  * TEAM commitment definition
@@ -15995,9 +16012,7 @@
15995
16012
  return JSON.stringify(result);
15996
16013
  };
15997
16014
  }
15998
- /**
15999
- * Note: [💞] Ignore a discrepancy between file name and entity name
16000
- */
16015
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16001
16016
 
16002
16017
  /**
16003
16018
  * TEMPLATE commitment definition
@@ -16118,9 +16133,7 @@
16118
16133
  };
16119
16134
  }
16120
16135
  }
16121
- /**
16122
- * Note: [💞] Ignore a discrepancy between file name and entity name
16123
- */
16136
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16124
16137
 
16125
16138
  /**
16126
16139
  * USE commitment definition
@@ -16232,9 +16245,7 @@
16232
16245
  return knownTypes.includes(useType.toUpperCase());
16233
16246
  }
16234
16247
  }
16235
- /**
16236
- * Note: [💞] Ignore a discrepancy between file name and entity name
16237
- */
16248
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16238
16249
 
16239
16250
  /**
16240
16251
  * All `USE` commitment types currently participating in final system-message aggregation.
@@ -16257,6 +16268,7 @@
16257
16268
  *
16258
16269
  * @param type - Commitment type to check.
16259
16270
  * @returns `true` when the commitment participates in `USE` system-message aggregation.
16271
+ *
16260
16272
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
16261
16273
  */
16262
16274
  function isAggregatedUseCommitmentType(type) {
@@ -16267,6 +16279,7 @@
16267
16279
  *
16268
16280
  * @param type - Aggregated `USE` commitment type.
16269
16281
  * @returns Single-line placeholder comment stored in the interim system message.
16282
+ *
16270
16283
  * @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
16271
16284
  */
16272
16285
  function getAggregatedUseCommitmentPlaceholder(type) {
@@ -16277,6 +16290,7 @@
16277
16290
  *
16278
16291
  * @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
16279
16292
  * @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
16293
+ *
16280
16294
  * @private internal utility of `createAggregatedUseCommitmentSystemMessage`
16281
16295
  */
16282
16296
  function combineAdditionalInstructions(additionalInstructions) {
@@ -16288,6 +16302,7 @@
16288
16302
  * @param type - Aggregated `USE` commitment type.
16289
16303
  * @param additionalInstructions - Distinct additional instructions in source order.
16290
16304
  * @returns Final system-message block for the commitment type.
16305
+ *
16291
16306
  * @private internal utility of `aggregateUseCommitmentSystemMessages`
16292
16307
  */
16293
16308
  function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
@@ -16326,6 +16341,7 @@
16326
16341
  * @param requirements - Current model requirements.
16327
16342
  * @param type - Aggregated `USE` commitment type being applied.
16328
16343
  * @returns Requirements with the placeholder inserted when it was not already present.
16344
+ *
16329
16345
  * @private internal utility of `USE` commitments
16330
16346
  */
16331
16347
  function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
@@ -16349,6 +16365,7 @@
16349
16365
  * @param requirements - Model requirements produced by commitment-by-commitment application.
16350
16366
  * @param commitments - Filtered commitments in their original source order.
16351
16367
  * @returns Requirements with aggregated `USE` system-message sections.
16368
+ *
16352
16369
  * @private internal utility of `createAgentModelRequirementsWithCommitments`
16353
16370
  */
16354
16371
  function aggregateUseCommitmentSystemMessages(requirements, commitments) {
@@ -16641,9 +16658,7 @@
16641
16658
  };
16642
16659
  }
16643
16660
  }
16644
- /**
16645
- * Note: [💞] Ignore a discrepancy between file name and entity name
16646
- */
16661
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16647
16662
 
16648
16663
  /**
16649
16664
  * Base Google Calendar API URL.
@@ -16914,9 +16929,7 @@
16914
16929
  const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
16915
16930
  return filteredTokens.join(' ').trim();
16916
16931
  }
16917
- /**
16918
- * Note: [💞] Ignore a discrepancy between file name and entity name
16919
- */
16932
+ // Note: [💞] Ignore a discrepancy between file name and entity name
16920
16933
 
16921
16934
  /**
16922
16935
  * Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
@@ -17867,9 +17880,7 @@
17867
17880
  ...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
17868
17881
  });
17869
17882
  }
17870
- /**
17871
- * Note: [💞] Ignore a discrepancy between file name and entity name
17872
- */
17883
+ // Note: [💞] Ignore a discrepancy between file name and entity name
17873
17884
 
17874
17885
  /**
17875
17886
  * Lightweight email token matcher used for `USE EMAIL` first-line parsing.
@@ -18135,9 +18146,7 @@
18135
18146
  },
18136
18147
  ];
18137
18148
  }
18138
- /**
18139
- * Note: [💞] Ignore a discrepancy between file name and entity name
18140
- */
18149
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18141
18150
 
18142
18151
  /**
18143
18152
  * USE IMAGE GENERATOR commitment definition
@@ -18228,9 +18237,7 @@
18228
18237
  `));
18229
18238
  }
18230
18239
  }
18231
- /**
18232
- * Note: [💞] Ignore a discrepancy between file name and entity name
18233
- */
18240
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18234
18241
 
18235
18242
  /**
18236
18243
  * USE MCP commitment definition
@@ -18305,9 +18312,7 @@
18305
18312
  };
18306
18313
  }
18307
18314
  }
18308
- /**
18309
- * Note: [💞] Ignore a discrepancy between file name and entity name
18310
- */
18315
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18311
18316
 
18312
18317
  /**
18313
18318
  * USE POPUP commitment definition
@@ -18443,9 +18448,7 @@
18443
18448
  };
18444
18449
  }
18445
18450
  }
18446
- /**
18447
- * Note: [💞] Ignore a discrepancy between file name and entity name
18448
- */
18451
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18449
18452
 
18450
18453
  /**
18451
18454
  * Tool name used by the USE PRIVACY commitment.
@@ -18617,9 +18620,7 @@
18617
18620
  };
18618
18621
  }
18619
18622
  }
18620
- /**
18621
- * Note: [💞] Ignore a discrepancy between file name and entity name
18622
- */
18623
+ // Note: [💞] Ignore a discrepancy between file name and entity name
18623
18624
 
18624
18625
  /* eslint-disable no-magic-numbers */
18625
18626
  /**
@@ -19407,9 +19408,7 @@
19407
19408
  defaultBranch,
19408
19409
  };
19409
19410
  }
19410
- /**
19411
- * Note: [💞] Ignore a discrepancy between file name and entity name
19412
- */
19411
+ // Note: [💞] Ignore a discrepancy between file name and entity name
19413
19412
 
19414
19413
  /**
19415
19414
  * Wallet metadata used by USE PROJECT when resolving GitHub credentials.
@@ -20268,9 +20267,7 @@
20268
20267
  defaultBranch: repositoryReference.defaultBranch,
20269
20268
  });
20270
20269
  }
20271
- /**
20272
- * Note: [💞] Ignore a discrepancy between file name and entity name
20273
- */
20270
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20274
20271
 
20275
20272
  /**
20276
20273
  * A search engine implementation that uses the SerpApi to fetch Google search results.
@@ -20481,9 +20478,7 @@
20481
20478
  };
20482
20479
  }
20483
20480
  }
20484
- /**
20485
- * Note: [💞] Ignore a discrepancy between file name and entity name
20486
- */
20481
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20487
20482
 
20488
20483
  /**
20489
20484
  * Maximum allowed source length for create-agent payloads.
@@ -20680,9 +20675,7 @@
20680
20675
  };
20681
20676
  }
20682
20677
  }
20683
- /**
20684
- * Note: [💞] Ignore a discrepancy between file name and entity name
20685
- */
20678
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20686
20679
 
20687
20680
  /**
20688
20681
  * Creates system-message instructions for `USE TIMEOUT`.
@@ -20747,9 +20740,7 @@
20747
20740
  return null;
20748
20741
  }
20749
20742
  }
20750
- /**
20751
- * Note: [💞] Ignore a discrepancy between file name and entity name
20752
- */
20743
+ // Note: [💞] Ignore a discrepancy between file name and entity name
20753
20744
 
20754
20745
  /**
20755
20746
  * Builds a disabled timeout-tool payload.
@@ -21483,9 +21474,7 @@
21483
21474
  return createTimeoutToolFunctions();
21484
21475
  }
21485
21476
  }
21486
- /**
21487
- * Note: [💞] Ignore a discrepancy between file name and entity name
21488
- */
21477
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21489
21478
 
21490
21479
  /**
21491
21480
  * USE TIME commitment definition
@@ -21632,9 +21621,7 @@
21632
21621
  };
21633
21622
  }
21634
21623
  }
21635
- /**
21636
- * Note: [💞] Ignore a discrepancy between file name and entity name
21637
- */
21624
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21638
21625
 
21639
21626
  /**
21640
21627
  * Tool name used by the USE USER LOCATION commitment.
@@ -21847,9 +21834,7 @@
21847
21834
  };
21848
21835
  }
21849
21836
  }
21850
- /**
21851
- * Note: [💞] Ignore a discrepancy between file name and entity name
21852
- */
21837
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21853
21838
 
21854
21839
  /**
21855
21840
  * `WRITING RULES` commitment definition.
@@ -21925,9 +21910,7 @@
21925
21910
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
21926
21911
  }
21927
21912
  }
21928
- /**
21929
- * Note: [💞] Ignore a discrepancy between file name and entity name
21930
- */
21913
+ // Note: [💞] Ignore a discrepancy between file name and entity name
21931
21914
 
21932
21915
  /**
21933
21916
  * `WRITING SAMPLE` commitment definition.
@@ -21997,9 +21980,7 @@
21997
21980
  return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
21998
21981
  }
21999
21982
  }
22000
- /**
22001
- * Note: [💞] Ignore a discrepancy between file name and entity name
22002
- */
21983
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22003
21984
 
22004
21985
  /**
22005
21986
  * Placeholder commitment definition for commitments that are not yet implemented
@@ -22161,13 +22142,12 @@
22161
22142
  new NotYetImplementedCommitmentDefinition('CONTEXT'),
22162
22143
  // <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
22163
22144
  ];
22164
- /**
22165
- * TODO: [🧠] Maybe create through standardized $register
22166
- * Note: [💞] Ignore a discrepancy between file name and entity name
22167
- */
22145
+ // TODO: [🧠] Maybe create through standardized $register
22146
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22168
22147
 
22169
22148
  /**
22170
22149
  * Gets all available commitment definitions
22150
+ *
22171
22151
  * @returns Array of all commitment definitions
22172
22152
  *
22173
22153
  * @public exported from `@promptbook/core`
@@ -22180,6 +22160,7 @@
22180
22160
  * Collects tool functions from all commitment definitions.
22181
22161
  *
22182
22162
  * @returns Map of tool function implementations.
22163
+ *
22183
22164
  * @private internal helper for commitment tool registry
22184
22165
  */
22185
22166
  function collectCommitmentToolFunctions() {
@@ -22201,6 +22182,7 @@
22201
22182
  *
22202
22183
  * @param getFunctions - Provider of current tool functions.
22203
22184
  * @returns Proxy exposing tool functions as properties.
22185
+ *
22204
22186
  * @private internal helper for commitment tool registry
22205
22187
  */
22206
22188
  function createToolFunctionsProxy(getFunctions) {
@@ -22238,10 +22220,11 @@
22238
22220
  },
22239
22221
  });
22240
22222
  }
22223
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22224
+
22241
22225
  /**
22242
- * Note: [💞] Ignore a discrepancy between file name and entity name
22226
+ * Map of node tool functions.
22243
22227
  */
22244
-
22245
22228
  const nodeToolFunctions = {
22246
22229
  /**
22247
22230
  * @@@
@@ -22273,6 +22256,9 @@
22273
22256
  spawn_agent: resolveSpawnAgentToolForNode(),
22274
22257
  // TODO: !!!! Unhardcode, make proper server function register from definitions
22275
22258
  };
22259
+ /**
22260
+ * Constant for node tool functions proxy.
22261
+ */
22276
22262
  const nodeToolFunctionsProxy = createToolFunctionsProxy(() => ({
22277
22263
  ...collectCommitmentToolFunctions(),
22278
22264
  ...nodeToolFunctions,
@@ -22296,10 +22282,8 @@
22296
22282
  }
22297
22283
  return nodeToolFunctionsProxy;
22298
22284
  }
22299
- /**
22300
- * Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
22301
- * TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
22302
- */
22285
+ // Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
22286
+ // TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
22303
22287
 
22304
22288
  /**
22305
22289
  * Extracts exactly ONE code block from markdown.
@@ -22314,8 +22298,9 @@
22314
22298
  *
22315
22299
  * @param markdown any valid markdown
22316
22300
  * @returns code block with language and content
22317
- * @public exported from `@promptbook/markdown-utils`
22318
22301
  * @throws {ParseError} if there is not exactly one code block in the markdown
22302
+ *
22303
+ * @public exported from `@promptbook/markdown-utils`
22319
22304
  */
22320
22305
  function extractOneBlockFromMarkdown(markdown) {
22321
22306
  const codeBlocks = extractAllBlocksFromMarkdown(markdown);
@@ -22328,9 +22313,7 @@
22328
22313
  }
22329
22314
  return codeBlocks[0];
22330
22315
  }
22331
- /***
22332
- * TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
22333
- */
22316
+ // TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
22334
22317
 
22335
22318
  /**
22336
22319
  * Extracts code block from markdown.
@@ -22343,8 +22326,9 @@
22343
22326
  * - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
22344
22327
  * - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
22345
22328
  *
22346
- * @public exported from `@promptbook/markdown-utils`
22347
22329
  * @throws {ParseError} if there is not exactly one code block in the markdown
22330
+ *
22331
+ * @public exported from `@promptbook/markdown-utils`
22348
22332
  */
22349
22333
  function extractBlock(markdown) {
22350
22334
  const { content } = extractOneBlockFromMarkdown(markdown);
@@ -22356,7 +22340,7 @@
22356
22340
  *
22357
22341
  * Note: [🔂] This function is idempotent.
22358
22342
  * Note: This is useful for post-processing of the result of the chat LLM model
22359
- * when the model wraps the result in the (markdown) code block.
22343
+ * when the model wraps the result in the (markdown) code block.
22360
22344
  *
22361
22345
  * @public exported from `@promptbook/markdown-utils`
22362
22346
  */
@@ -22375,7 +22359,7 @@
22375
22359
  * Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
22376
22360
  *
22377
22361
  * Note: This is useful for post-processing of the result of the completion LLM model
22378
- * if you want to start code block in the prompt but you don't want to end it in the result.
22362
+ * if you want to start code block in the prompt but you don't want to end it in the result.
22379
22363
  *
22380
22364
  * @public exported from `@promptbook/markdown-utils`
22381
22365
  */
@@ -22387,6 +22371,8 @@
22387
22371
  }
22388
22372
 
22389
22373
  /**
22374
+ * Collection of preserved.
22375
+ *
22390
22376
  * @private internal for `preserve`
22391
22377
  */
22392
22378
  const _preserved = [];
@@ -22396,21 +22382,20 @@
22396
22382
  *
22397
22383
  * @param value any function to preserve
22398
22384
  * @returns nothing
22385
+ *
22399
22386
  * @private within the repository
22400
22387
  */
22401
22388
  function $preserve(...value) {
22402
22389
  _preserved.push(...value);
22403
22390
  }
22404
- /**
22405
- * Note: [💞] Ignore a discrepancy between file name and entity name
22406
- */
22391
+ // Note: [💞] Ignore a discrepancy between file name and entity name
22407
22392
 
22408
22393
  // Note: [💎]
22409
22394
  /**
22410
22395
  * ScriptExecutionTools for JavaScript implemented via eval
22411
22396
  *
22412
22397
  * Warning: It is used for testing and mocking
22413
- * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
22398
+ * **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
22414
22399
  *
22415
22400
  * @public exported from `@promptbook/javascript`
22416
22401
  */
@@ -22605,15 +22590,14 @@
22605
22590
  return result;
22606
22591
  }
22607
22592
  }
22608
- /**
22609
- * TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
22610
- * TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
22611
- */
22593
+ // TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
22594
+ // TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
22612
22595
 
22613
22596
  /**
22614
22597
  * Placeholder for better implementation of JavascriptExecutionTools - some proper sandboxing
22615
22598
  *
22616
22599
  * @alias JavascriptExecutionTools
22600
+ *
22617
22601
  * @public exported from `@promptbook/javascript`
22618
22602
  */
22619
22603
  const JavascriptExecutionTools = JavascriptEvalExecutionTools;
@@ -22630,13 +22614,15 @@
22630
22614
  // TODO: [🔱] Do here auto-installation
22631
22615
  return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
22632
22616
  }
22633
- /** 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 */
22634
- /** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
22617
+ // 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
22618
+ // TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
22635
22619
 
22636
22620
  // TODO: [🥺] List running services from REMOTE_SERVER_URLS
22637
22621
  // TODO: [🥺] Import directly from YML
22638
22622
  /**
22639
- * @private [🥺] Decide how to expose this
22623
+ * [🥺] Decide how to expose this.
22624
+ *
22625
+ * @private
22640
22626
  */
22641
22627
  const openapiJson = {
22642
22628
  openapi: '3.0.0',
@@ -23227,23 +23213,36 @@
23227
23213
  },
23228
23214
  ],
23229
23215
  };
23216
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23217
+
23230
23218
  /**
23231
- * Note: [💞] Ignore a discrepancy between file name and entity name
23219
+ * Constant for h.
23232
23220
  */
23233
-
23234
23221
  const h = react.createElement;
23222
+ /**
23223
+ * Handles key val.
23224
+ */
23235
23225
  function KeyVal(props) {
23236
23226
  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));
23237
23227
  }
23228
+ /**
23229
+ * Handles list.
23230
+ */
23238
23231
  function List(props) {
23239
23232
  var _a;
23240
23233
  if (!((_a = props.items) === null || _a === void 0 ? void 0 : _a.length))
23241
23234
  return h('span', { className: 'text-gray-500' }, 'none');
23242
23235
  return h('ul', { className: 'list-disc ml-6' }, ...props.items.map((item, i) => h('li', { key: String(i), className: 'break-all' }, item)));
23243
23236
  }
23237
+ /**
23238
+ * Handles section.
23239
+ */
23244
23240
  function Section(props) {
23245
23241
  return h('section', { className: 'mt-8' }, h('h2', { className: 'text-xl font-semibold mb-2' }, props.title), props.children);
23246
23242
  }
23243
+ /**
23244
+ * Handles server body.
23245
+ */
23247
23246
  function ServerBody({ info }) {
23248
23247
  var _a;
23249
23248
  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, {
@@ -23257,6 +23256,9 @@
23257
23256
  className: 'text-blue-600 underline',
23258
23257
  }, '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'))));
23259
23258
  }
23259
+ /**
23260
+ * Handles Html doc.
23261
+ */
23260
23262
  function HtmlDoc({ info }) {
23261
23263
  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', {
23262
23264
  href: 'https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css',
@@ -23280,6 +23282,7 @@
23280
23282
  * This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
23281
23283
  *
23282
23284
  * @see https://github.com/webgptorg/promptbook#remote-server
23285
+ *
23283
23286
  * @public exported from `@promptbook/remote-server`
23284
23287
  */
23285
23288
  function startRemoteServer(options) {
@@ -23837,21 +23840,19 @@
23837
23840
  },
23838
23841
  };
23839
23842
  }
23840
- /** 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 */
23841
- /**
23842
- * TODO: [🕋] Use here `aboutPromptbookInformation`
23843
- * TODO: [🌡] Add CORS and security - probably via `helmet`
23844
- * TODO: Split this file into multiple functions - handler for each request
23845
- * TODO: Maybe use `$exportJson`
23846
- * TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
23847
- * TODO: [⚖] Expose the collection to be able to connect to same collection via createPipelineCollectionFromUrl
23848
- * TODO: Handle progress - support streaming
23849
- * TODO: [🗯] Do not hang up immediately but wait until client closes OR timeout
23850
- * TODO: [🗯] Timeout on chat to free up resources
23851
- * TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
23852
- * TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
23853
- * TODO: Allow to constrain anonymous mode for specific models / providers
23854
- */
23843
+ // 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
23844
+ // TODO: [🕋] Use here `aboutPromptbookInformation`
23845
+ // TODO: [🌡] Add CORS and security - probably via `helmet`
23846
+ // TODO: Split this file into multiple functions - handler for each request
23847
+ // TODO: Maybe use `$exportJson`
23848
+ // TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
23849
+ // TODO: [] Expose the collection to be able to connect to same collection via createPipelineCollectionFromUrl
23850
+ // TODO: Handle progress - support streaming
23851
+ // TODO: [🗯] Do not hang up immediately but wait until client closes OR timeout
23852
+ // TODO: [🗯] Timeout on chat to free up resources
23853
+ // TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
23854
+ // TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
23855
+ // TODO: Allow to constrain anonymous mode for specific models / providers
23855
23856
 
23856
23857
  /**
23857
23858
  * Keep-alive helpers used for streaming chat responses.
@@ -23863,12 +23864,10 @@
23863
23864
  * @private internal streaming helper for Promptbook chat connections
23864
23865
  */
23865
23866
  const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
23866
- /**
23867
- * Note: [💞] Ignore a discrepancy between file name and entity name
23868
- */
23867
+ // Note: [💞] Ignore a discrepancy between file name and entity name
23869
23868
 
23870
23869
  /**
23871
- * Number of padding lines to add at the end of the book content
23870
+ * Number of padding lines to add at the end of the book content
23872
23871
  *
23873
23872
  * @public exported from `@promptbook/core`
23874
23873
  */
@@ -23905,9 +23904,7 @@
23905
23904
  const linesToAdd = PADDING_LINES - trailingEmptyLines;
23906
23905
  return (content + '\n'.repeat(linesToAdd));
23907
23906
  }
23908
- /**
23909
- * TODO: [🧠] Maybe export
23910
- */
23907
+ // TODO: [🧠] Maybe export
23911
23908
 
23912
23909
  /**
23913
23910
  * Type guard to check if a string is a valid agent source
@@ -23937,6 +23934,7 @@
23937
23934
  * Default book
23938
23935
  *
23939
23936
  * @deprecated Use `$generateBookBoilerplate` instead
23937
+ *
23940
23938
  * @public exported from `@promptbook/core`
23941
23939
  */
23942
23940
  padBook(validateBook(_spaceTrim.spaceTrim(`
@@ -23955,6 +23953,7 @@
23955
23953
  *
23956
23954
  * @param {string} pipelineString the candidate for a pipeline string
23957
23955
  * @returns {boolean} if the string is a valid pipeline string
23956
+ *
23958
23957
  * @public exported from `@promptbook/core`
23959
23958
  */
23960
23959
  function isValidPipelineString(pipelineString) {
@@ -23967,9 +23966,7 @@
23967
23966
  return false;
23968
23967
  }
23969
23968
  }
23970
- /**
23971
- * TODO: [🧠][🈴] Where is the best location for this file
23972
- */
23969
+ // TODO: [🧠][🈴] Where is the best location for this file
23973
23970
 
23974
23971
  /**
23975
23972
  * Tag function for notating a pipeline with a book\`...\ notation as template literal
@@ -23982,6 +23979,7 @@
23982
23979
  * @param strings The static string parts of the template literal
23983
23980
  * @param values The dynamic values embedded within the template literal used as data
23984
23981
  * @returns the pipeline string
23982
+ *
23985
23983
  * @public exported from `@promptbook/core`
23986
23984
  */
23987
23985
  function book(strings, ...values) {
@@ -24008,10 +24006,8 @@
24008
24006
  }
24009
24007
  return padBook(bookString);
24010
24008
  }
24011
- /**
24012
- * TODO: [🧠][🈴] Where is the best location for this file
24013
- * Note: [💞] Ignore a discrepancy between file name and entity name
24014
- */
24009
+ // TODO: [🧠][🈴] Where is the best location for this file
24010
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24015
24011
 
24016
24012
  /**
24017
24013
  * Tool call name emitted while preparing a GPT assistant for an agent.
@@ -24056,9 +24052,7 @@
24056
24052
  { token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
24057
24053
  { token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
24058
24054
  ];
24059
- /**
24060
- * Note: [💞] Ignore a discrepancy between file name and entity name
24061
- */
24055
+ // Note: [💞] Ignore a discrepancy between file name and entity name
24062
24056
 
24063
24057
  /**
24064
24058
  * Converts encoded whitespace markers back into real whitespace so the UI can render the message
@@ -24076,6 +24070,9 @@
24076
24070
  }, content);
24077
24071
  }
24078
24072
 
24073
+ /**
24074
+ * Constant for raw tool call ID fields.
24075
+ */
24079
24076
  const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
24080
24077
  /**
24081
24078
  * Builds a deterministic idempotency key for tool calls so the UI can track updates.
@@ -24106,6 +24103,9 @@
24106
24103
  }
24107
24104
  return `fallback:${toolCall.name}`;
24108
24105
  }
24106
+ /**
24107
+ * Gets arguments key.
24108
+ */
24109
24109
  function getArgumentsKey(value) {
24110
24110
  if (typeof value === 'string') {
24111
24111
  return value;
@@ -24179,6 +24179,7 @@
24179
24179
  * @param existingToolCall - Previous snapshot.
24180
24180
  * @param incomingToolCall - New snapshot.
24181
24181
  * @returns One merged snapshot.
24182
+ *
24182
24183
  * @private helper of `mergeToolCalls`
24183
24184
  */
24184
24185
  function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
@@ -24201,6 +24202,7 @@
24201
24202
  * @param existingToolCall - Previous snapshot.
24202
24203
  * @param incomingToolCall - New snapshot.
24203
24204
  * @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
24205
+ *
24204
24206
  * @private helper of `mergeToolCalls`
24205
24207
  */
24206
24208
  function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
@@ -24214,6 +24216,7 @@
24214
24216
  *
24215
24217
  * @param toolCall - Tool call snapshot to inspect.
24216
24218
  * @returns Inferred lifecycle state or `undefined`.
24219
+ *
24217
24220
  * @private helper of `mergeToolCalls`
24218
24221
  */
24219
24222
  function inferToolCallState(toolCall) {
@@ -24237,6 +24240,7 @@
24237
24240
  * @param existingValues - Previous list.
24238
24241
  * @param incomingValues - Incoming list.
24239
24242
  * @returns Deduplicated merged list or `undefined`.
24243
+ *
24240
24244
  * @private helper of `mergeToolCalls`
24241
24245
  */
24242
24246
  function mergeUnknownLists(existingValues, incomingValues) {
@@ -24263,6 +24267,7 @@
24263
24267
  *
24264
24268
  * @param value - Value to serialize.
24265
24269
  * @returns String signature.
24270
+ *
24266
24271
  * @private helper of `mergeToolCalls`
24267
24272
  */
24268
24273
  function serializeValueForMerge(value) {
@@ -24280,6 +24285,7 @@
24280
24285
  *
24281
24286
  * @param toolCalls - Mutable list to deduplicate in-place.
24282
24287
  * @returns The same array after removing redundant preparation entries.
24288
+ *
24283
24289
  * @private helper of `mergeToolCalls`
24284
24290
  */
24285
24291
  function deduplicatePreparationToolCalls(toolCalls) {
@@ -24337,6 +24343,7 @@
24337
24343
  *
24338
24344
  * @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
24339
24345
  * @returns Normalized hostname or `null` when the value cannot be normalized.
24346
+ *
24340
24347
  * @private utility for host/domain matching
24341
24348
  */
24342
24349
  function normalizeDomainForMatching(rawDomain) {
@@ -24359,6 +24366,7 @@
24359
24366
  *
24360
24367
  * @param value - Raw value to inspect.
24361
24368
  * @returns True when the value starts with `http://` or `https://`.
24369
+ *
24362
24370
  * @private utility for host/domain matching
24363
24371
  */
24364
24372
  function hasHttpProtocol(value) {
@@ -24374,6 +24382,7 @@
24374
24382
  *
24375
24383
  * @param agentSource - Raw agent source.
24376
24384
  * @returns Parsed prelude with shared line metadata.
24385
+ *
24377
24386
  * @private internal utility of book agent-source parsing
24378
24387
  */
24379
24388
  function parseAgentSourcePrelude(agentSource) {
@@ -24549,6 +24558,7 @@
24549
24558
  *
24550
24559
  * @param text - Text to extract parameters from
24551
24560
  * @returns Array of parsed parameters with unified representation
24561
+ *
24552
24562
  * @public exported from `@promptbook/core`
24553
24563
  */
24554
24564
  function parseParameters(text) {
@@ -24977,9 +24987,7 @@
24977
24987
  const trimmed = _spaceTrim.spaceTrim(content);
24978
24988
  return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
24979
24989
  }
24980
- /**
24981
- * TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
24982
- */
24990
+ // TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
24983
24991
 
24984
24992
  /**
24985
24993
  * Gets all tool titles provided by all commitments
@@ -25005,6 +25013,7 @@
25005
25013
  * Restricts an Updatable to a (2) BehaviorSubject variant
25006
25014
  *
25007
25015
  * @see Updatable
25016
+ *
25008
25017
  * @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
25009
25018
  */
25010
25019
  function asUpdatableSubject(value) {
@@ -25029,9 +25038,7 @@
25029
25038
  return new rxjs.BehaviorSubject(value);
25030
25039
  }
25031
25040
  }
25032
- /**
25033
- * TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
25034
- */
25041
+ // TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
25035
25042
 
25036
25043
  /**
25037
25044
  * Creates an empty/basic agent model requirements object
@@ -25066,12 +25073,11 @@
25066
25073
  systemMessage: `You are ${agentName || 'AI Agent'}`,
25067
25074
  };
25068
25075
  }
25069
- /**
25070
- * TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
25071
- */
25076
+ // TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
25072
25077
 
25073
25078
  /**
25074
25079
  * Gets a commitment definition by its type
25080
+ *
25075
25081
  * @param type The commitment type to look up
25076
25082
  * @returns The commitment definition or null if not found
25077
25083
  *
@@ -25450,7 +25456,9 @@
25450
25456
  };
25451
25457
  }
25452
25458
  /**
25453
- * @private Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
25459
+ * Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
25460
+ *
25461
+ * @private
25454
25462
  */
25455
25463
  async function applyPendingInlineKnowledgeSources(requirements, uploader) {
25456
25464
  var _a;
@@ -25471,6 +25479,9 @@
25471
25479
  _metadata: stripInlineKnowledgeMetadata(requirements._metadata),
25472
25480
  };
25473
25481
  }
25482
+ /**
25483
+ * Handles upload inline knowledge source with fallback.
25484
+ */
25474
25485
  async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
25475
25486
  try {
25476
25487
  return await uploader(inlineSource);
@@ -25483,6 +25494,9 @@
25483
25494
  return inlineKnowledgeSourceToDataUrl(inlineSource);
25484
25495
  }
25485
25496
  }
25497
+ /**
25498
+ * Extracts inline knowledge sources.
25499
+ */
25486
25500
  function extractInlineKnowledgeSources(metadata) {
25487
25501
  if (!metadata) {
25488
25502
  return [];
@@ -25490,6 +25504,9 @@
25490
25504
  const value = metadata.inlineKnowledgeSources;
25491
25505
  return Array.isArray(value) ? value : [];
25492
25506
  }
25507
+ /**
25508
+ * Strips inline knowledge metadata.
25509
+ */
25493
25510
  function stripInlineKnowledgeMetadata(metadata) {
25494
25511
  if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
25495
25512
  return metadata;
@@ -25540,6 +25557,7 @@
25540
25557
  * @param availableModels - Models that could fulfill the agent.
25541
25558
  * @param llmTools - Execution tools used when selecting a best model.
25542
25559
  * @param options - Optional hooks such as the agent reference resolver.
25560
+ *
25543
25561
  * @public exported from `@promptbook/core`
25544
25562
  */
25545
25563
  async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
@@ -25559,6 +25577,7 @@
25559
25577
  * @param agentSource The agent source to derive persona description from
25560
25578
  * @param llmTools LLM tools for preparing persona
25561
25579
  * @returns The name of the best selected model
25580
+ *
25562
25581
  * @private function of `createAgentModelRequirements`
25563
25582
  */
25564
25583
  async function selectBestModelUsingPersona(agentSource, llmTools) {
@@ -25694,6 +25713,7 @@
25694
25713
  *
25695
25714
  * @param {unknown} rawAttachments - The raw attachments to normalize.
25696
25715
  * @returns {Array<ChatAttachment>} The normalized attachments.
25716
+ *
25697
25717
  * @public exported from `@promptbook/core`
25698
25718
  */
25699
25719
  function normalizeChatAttachments(rawAttachments) {
@@ -25738,6 +25758,7 @@
25738
25758
  *
25739
25759
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
25740
25760
  * @returns {string} The formatted context.
25761
+ *
25741
25762
  * @public exported from `@promptbook/core`
25742
25763
  */
25743
25764
  function formatChatAttachmentContext(attachments) {
@@ -25758,6 +25779,7 @@
25758
25779
  * @param {number} maxBytes - Maximum number of bytes to capture.
25759
25780
  * @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
25760
25781
  * @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
25782
+ *
25761
25783
  * @private internal utility for bounded response reads
25762
25784
  */
25763
25785
  async function readResponseBytes(response, maxBytes, options = {}) {
@@ -25854,6 +25876,7 @@
25854
25876
  * @param {number} maxInlineCharacters - Maximum number of characters to inline.
25855
25877
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
25856
25878
  * @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
25879
+ *
25857
25880
  * @private function of resolveChatAttachmentContents
25858
25881
  */
25859
25882
  async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
@@ -25945,6 +25968,7 @@
25945
25968
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
25946
25969
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
25947
25970
  * @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
25971
+ *
25948
25972
  * @public exported from `@promptbook/core`
25949
25973
  */
25950
25974
  async function resolveChatAttachmentContents(attachments, options = {}) {
@@ -26010,6 +26034,7 @@
26010
26034
  *
26011
26035
  * @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
26012
26036
  * @returns {string} The formatted context.
26037
+ *
26013
26038
  * @public exported from `@promptbook/core`
26014
26039
  */
26015
26040
  function formatChatAttachmentContentContext(resolvedContents) {
@@ -26050,6 +26075,7 @@
26050
26075
  * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
26051
26076
  * @param {ResolveChatAttachmentOptions} options - Options for resolution.
26052
26077
  * @returns {Promise<string>} The updated message content.
26078
+ *
26053
26079
  * @public exported from `@promptbook/core`
26054
26080
  */
26055
26081
  async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
@@ -26078,9 +26104,7 @@
26078
26104
  function humanizeAiTextEllipsis(aiText) {
26079
26105
  return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
26080
26106
  }
26081
- /**
26082
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26083
- */
26107
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26084
26108
 
26085
26109
  /**
26086
26110
  * Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
@@ -26093,9 +26117,7 @@
26093
26117
  function humanizeAiTextEmdashed(aiText) {
26094
26118
  return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
26095
26119
  }
26096
- /**
26097
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26098
- */
26120
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26099
26121
 
26100
26122
  /**
26101
26123
  * Change smart quotes to regular quotes
@@ -26108,9 +26130,7 @@
26108
26130
  function humanizeAiTextQuotes(aiText) {
26109
26131
  return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
26110
26132
  }
26111
- /**
26112
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26113
- */
26133
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26114
26134
 
26115
26135
  /**
26116
26136
  * Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
@@ -26123,9 +26143,7 @@
26123
26143
  function humanizeAiTextSources(aiText) {
26124
26144
  return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
26125
26145
  }
26126
- /**
26127
- * Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26128
- */
26146
+ // Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26129
26147
 
26130
26148
  /**
26131
26149
  * Change unprintable hard spaces to regular spaces and drop zero-width spaces
@@ -26138,9 +26156,7 @@
26138
26156
  function humanizeAiTextWhitespace(aiText) {
26139
26157
  return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
26140
26158
  }
26141
- /**
26142
- * Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26143
- */
26159
+ // Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
26144
26160
 
26145
26161
  /**
26146
26162
  * Function `humanizeAiText` will remove traces of AI text generation artifacts
@@ -26159,11 +26175,11 @@
26159
26175
  cleanedText = humanizeAiTextWhitespace(cleanedText);
26160
26176
  return cleanedText;
26161
26177
  }
26162
- /**
26163
- * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
26164
- */
26178
+ // TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
26165
26179
 
26166
26180
  /**
26181
+ * Map of promptbook pseudotoken substitution.
26182
+ *
26167
26183
  * @private
26168
26184
  */
26169
26185
  const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
@@ -26211,9 +26227,7 @@
26211
26227
  }
26212
26228
  return promptbookifiedTextTokens.join('');
26213
26229
  }
26214
- /**
26215
- * TODO: [🧠][✌️] Make some Promptbook-native token system
26216
- */
26230
+ // TODO: [🧠][✌️] Make some Promptbook-native token system
26217
26231
 
26218
26232
  /**
26219
26233
  * Make UncertainNumber
@@ -26269,6 +26283,7 @@
26269
26283
  *
26270
26284
  * @see https://platform.openai.com/docs/models/
26271
26285
  * @see https://openai.com/api/pricing/
26286
+ *
26272
26287
  * @public exported from `@promptbook/openai`
26273
26288
  */
26274
26289
  const OPENAI_MODELS = exportJson({
@@ -26945,6 +26960,7 @@
26945
26960
  * @param rawResponse The raw response from OpenAI API
26946
26961
  * @param duration The duration of the execution
26947
26962
  * @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
26963
+ *
26948
26964
  * @private internal utility of `OpenAiExecutionTools`
26949
26965
  */
26950
26966
  function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
@@ -26987,15 +27003,14 @@
26987
27003
  },
26988
27004
  };
26989
27005
  }
26990
- /**
26991
- * TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
26992
- */
27006
+ // TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
26993
27007
 
26994
27008
  /**
26995
27009
  * Parses an OpenAI error message to identify which parameter is unsupported
26996
27010
  *
26997
27011
  * @param errorMessage The error message from OpenAI API
26998
27012
  * @returns The parameter name that is unsupported, or null if not an unsupported parameter error
27013
+ *
26999
27014
  * @private utility of LLM Tools
27000
27015
  */
27001
27016
  function parseUnsupportedParameterError(errorMessage) {
@@ -27017,6 +27032,7 @@
27017
27032
  * @param modelRequirements Original model requirements
27018
27033
  * @param unsupportedParameter The parameter to remove
27019
27034
  * @returns New model requirements without the unsupported parameter
27035
+ *
27020
27036
  * @private utility of LLM Tools
27021
27037
  */
27022
27038
  function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
@@ -27036,8 +27052,10 @@
27036
27052
  }
27037
27053
  /**
27038
27054
  * Checks if an error is an "Unsupported value" error from OpenAI
27055
+ *
27039
27056
  * @param error The error to check
27040
27057
  * @returns true if this is an unsupported parameter error
27058
+ *
27041
27059
  * @private utility of LLM Tools
27042
27060
  */
27043
27061
  function isUnsupportedParameterError(error) {
@@ -28143,13 +28161,11 @@
28143
28161
  return false;
28144
28162
  }
28145
28163
  }
28146
- /**
28147
- * TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
28148
- * TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
28149
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
28150
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
28151
- * TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
28152
- */
28164
+ // TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
28165
+ // TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
28166
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
28167
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
28168
+ // TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
28153
28169
 
28154
28170
  /**
28155
28171
  * Profile for OpenAI provider
@@ -28217,9 +28233,21 @@
28217
28233
  }
28218
28234
  }
28219
28235
 
28236
+ /**
28237
+ * Constant for default knowledge source download timeout ms.
28238
+ */
28220
28239
  const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
28240
+ /**
28241
+ * Constant for default knowledge source upload timeout ms.
28242
+ */
28221
28243
  const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
28244
+ /**
28245
+ * Constant for vector store progress log interval min ms.
28246
+ */
28222
28247
  const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
28248
+ /**
28249
+ * Constant for vector store stall log threshold ms.
28250
+ */
28223
28251
  const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
28224
28252
  /**
28225
28253
  * Base class for OpenAI execution tools that need hosted vector stores.
@@ -28986,6 +29014,9 @@
28986
29014
  }
28987
29015
  }
28988
29016
 
29017
+ /**
29018
+ * Constant for default agent kit model name.
29019
+ */
28989
29020
  const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
28990
29021
  /**
28991
29022
  * Creates one structured log entry for streamed tool-call updates.
@@ -29029,6 +29060,9 @@
29029
29060
  }
29030
29061
  return 'COMPLETE';
29031
29062
  }
29063
+ /**
29064
+ * Constant for default JSON schema name.
29065
+ */
29032
29066
  const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
29033
29067
  /**
29034
29068
  * File extensions considered image inputs when MIME type is missing or generic.
@@ -29184,6 +29218,7 @@
29184
29218
  *
29185
29219
  * @param responseFormat - The OpenAI `response_format` payload from the user request.
29186
29220
  * @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
29221
+ *
29187
29222
  * @private utility of Open AI
29188
29223
  */
29189
29224
  function mapResponseFormatToAgentOutputType(responseFormat) {
@@ -29942,6 +29977,7 @@
29942
29977
  * - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
29943
29978
  *
29944
29979
  * @deprecated Use `OpenAiAgentKitExecutionTools` instead.
29980
+ *
29945
29981
  * @public exported from `@promptbook/openai`
29946
29982
  */
29947
29983
  class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
@@ -30633,14 +30669,12 @@
30633
30669
  * @private const of `OpenAiAssistantExecutionTools`
30634
30670
  */
30635
30671
  const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
30636
- /**
30637
- * TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
30638
- * TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
30639
- * TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
30640
- * TODO: Maybe make custom OpenAiError
30641
- * TODO: [🧠][🈁] Maybe use `isDeterministic` from options
30642
- * TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
30643
- */
30672
+ // TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
30673
+ // TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
30674
+ // TODO: [🧠][🧙‍♂️] Maybe there can be some wizard for those who want to use just OpenAI
30675
+ // TODO: Maybe make custom OpenAiError
30676
+ // TODO: [🧠][🈁] Maybe use `isDeterministic` from options
30677
+ // TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
30644
30678
 
30645
30679
  /**
30646
30680
  * Emits a progress update to signal assistant preparation before long setup work.
@@ -31117,10 +31151,8 @@
31117
31151
  * Cache of OpenAI vector stores to avoid creating duplicates
31118
31152
  */
31119
31153
  AgentLlmExecutionTools.vectorStoreCache = new Map();
31120
- /**
31121
- * TODO: [🍚] Implement Destroyable pattern to free resources
31122
- * TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
31123
- */
31154
+ // TODO: [🍚] Implement Destroyable pattern to free resources
31155
+ // TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
31124
31156
 
31125
31157
  /**
31126
31158
  * Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
@@ -31130,6 +31162,7 @@
31130
31162
  *
31131
31163
  * @param agentSource - The raw agent book source
31132
31164
  * @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
31165
+ *
31133
31166
  * @private Internal helper shared between self-learning and related features.
31134
31167
  */
31135
31168
  function extractOpenTeacherInstructions(agentSource) {
@@ -31337,6 +31370,7 @@
31337
31370
  *
31338
31371
  * @param section Raw fragment from self-learning workflow.
31339
31372
  * @returns Trimmed fragment, or empty string when nothing remains.
31373
+ *
31340
31374
  * @private function of Agent
31341
31375
  */
31342
31376
  function normalizeBookSection(section) {
@@ -31348,6 +31382,7 @@
31348
31382
  * @param agentSource Current source.
31349
31383
  * @param normalizedSection Candidate fragment expected to be normalized first.
31350
31384
  * @returns True when appending would duplicate an existing fragment.
31385
+ *
31351
31386
  * @private function of Agent
31352
31387
  */
31353
31388
  function containsNormalizedBookSection(agentSource, normalizedSection) {
@@ -31362,6 +31397,7 @@
31362
31397
  *
31363
31398
  * @param responseFormat Prompt response format requirements
31364
31399
  * @returns True when JSON schema mode is active
31400
+ *
31365
31401
  * @private function of Agent
31366
31402
  */
31367
31403
  function isJsonSchemaResponseFormat(responseFormat) {
@@ -31373,6 +31409,7 @@
31373
31409
  * @param content Original agent answer content
31374
31410
  * @param isJsonMode Whether the interaction requested JSON schema output
31375
31411
  * @returns Agent answer, wrapped in a formatted JSON code block when possible
31412
+ *
31376
31413
  * @private function of Agent
31377
31414
  */
31378
31415
  function formatAgentMessageForJsonMode(content, isJsonMode) {
@@ -31398,6 +31435,7 @@
31398
31435
  *
31399
31436
  * @param content Text to parse as JSON
31400
31437
  * @returns Parsed JSON value or null when parsing fails
31438
+ *
31401
31439
  * @private function of Agent
31402
31440
  */
31403
31441
  function tryParseJson(content) {
@@ -31413,6 +31451,7 @@
31413
31451
  *
31414
31452
  * @param options - Normalized sample parts.
31415
31453
  * @returns Book-language sample section ready to append into agent source.
31454
+ *
31416
31455
  * @private function of Agent
31417
31456
  */
31418
31457
  function formatSelfLearningSample(options) {
@@ -31434,6 +31473,7 @@
31434
31473
  *
31435
31474
  * @param internalMessage Internal trace payload.
31436
31475
  * @returns Book-language INTERNAL MESSAGE block.
31476
+ *
31437
31477
  * @private function of Agent
31438
31478
  */
31439
31479
  function formatInternalLearningMessage(internalMessage) {
@@ -31447,6 +31487,7 @@
31447
31487
  *
31448
31488
  * @param result Final chat result used in self-learning.
31449
31489
  * @returns Internal payloads that capture request/response/tool-call context.
31490
+ *
31450
31491
  * @private function of Agent
31451
31492
  */
31452
31493
  function buildInternalLearningMessages(result) {
@@ -31476,6 +31517,7 @@
31476
31517
  *
31477
31518
  * @param toolCall Tool call produced during execution.
31478
31519
  * @returns Sanitized and serializable tool-call payload.
31520
+ *
31479
31521
  * @private function of Agent
31480
31522
  */
31481
31523
  function sanitizeToolCallForLearning(toolCall) {
@@ -31495,6 +31537,7 @@
31495
31537
  *
31496
31538
  * @param payload Internal payload to serialize.
31497
31539
  * @returns Pretty JSON string that can be embedded in BOOK.
31540
+ *
31498
31541
  * @private function of Agent
31499
31542
  */
31500
31543
  function stringifyInternalLearningPayload(payload) {
@@ -31544,6 +31587,7 @@
31544
31587
  * Normalizes teacher commitments into trimmed, display-ready lines.
31545
31588
  *
31546
31589
  * @param commitments Raw teacher output
31590
+ *
31547
31591
  * @private function of Agent
31548
31592
  */
31549
31593
  function getTeacherCommitmentLines(commitments) {
@@ -31556,6 +31600,7 @@
31556
31600
  * Summarizes teacher commitment lines into user-friendly counts for self-learning.
31557
31601
  *
31558
31602
  * @param lines Parsed teacher commitment lines
31603
+ *
31559
31604
  * @private function of Agent
31560
31605
  */
31561
31606
  function summarizeTeacherCommitmentLines(lines) {
@@ -31588,6 +31633,7 @@
31588
31633
  * @param commitments Raw teacher commitments
31589
31634
  * @param used Whether the teacher was invoked
31590
31635
  * @returns Summary of learned commitments
31636
+ *
31591
31637
  * @private function of Agent
31592
31638
  */
31593
31639
  function buildTeacherSummary(commitments, used) {
@@ -31824,9 +31870,7 @@
31824
31870
  return finalResult;
31825
31871
  }
31826
31872
  }
31827
- /**
31828
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
31829
- */
31873
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
31830
31874
 
31831
31875
  /**
31832
31876
  * Parses one failed remote agent response into a structured error.
@@ -32292,10 +32336,8 @@
32292
32336
  return agentResult;
32293
32337
  }
32294
32338
  }
32295
- /**
32296
- * TODO: [🧠][😰]Agent is not working with the parameters, should it be?
32297
- * TODO: !!! Agent on remote server
32298
- */
32339
+ // TODO: [🧠][😰]Agent is not working with the parameters, should it be?
32340
+ // TODO: !!! Agent on remote server
32299
32341
 
32300
32342
  var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
32301
32343
  __proto__: null,