@promptbook/utils 0.111.0-7 → 0.112.0-12

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 (527) hide show
  1. package/esm/index.es.js +41 -23
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/src/_packages/components.index.d.ts +2 -0
  4. package/esm/src/_packages/core.index.d.ts +26 -0
  5. package/esm/src/_packages/markdown-utils.index.d.ts +5 -5
  6. package/esm/src/_packages/types.index.d.ts +250 -228
  7. package/esm/src/_packages/utils.index.d.ts +2 -0
  8. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +4 -1
  9. package/esm/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -1
  10. package/esm/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +2 -2
  11. package/esm/src/book-2.0/agent-source/createAgentModelRequirements.writing.test.d.ts +1 -0
  12. package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.knowledge.test.d.ts +1 -0
  13. package/esm/src/book-2.0/agent-source/createTeamToolName.d.ts +12 -0
  14. package/esm/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +12 -0
  15. package/esm/src/book-2.0/agent-source/extractOpenTeacherInstructions.test.d.ts +1 -0
  16. package/esm/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +38 -0
  17. package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +3 -0
  18. package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.title.test.d.ts +1 -0
  19. package/esm/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +110 -0
  20. package/esm/src/book-2.0/agent-source/removeCommentsFromSystemMessage.d.ts +2 -2
  21. package/esm/src/book-components/BookEditor/BookEditor.d.ts +15 -0
  22. package/esm/src/book-components/BookEditor/BookEditorActionbar.d.ts +2 -0
  23. package/esm/src/book-components/BookEditor/BookEditorMonacoConstants.d.ts +1 -0
  24. package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +14 -7
  25. package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.test.d.ts +1 -0
  26. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +28 -0
  27. package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.test.d.ts +1 -0
  28. package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +27 -0
  29. package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.test.d.ts +1 -0
  30. package/esm/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
  31. package/esm/src/book-components/Chat/Chat/ChatActionsBar.d.ts +1 -0
  32. package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +2 -0
  33. package/esm/src/book-components/Chat/Chat/ChatInputArea.test.d.ts +2 -0
  34. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +6 -1
  35. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +3 -0
  36. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +56 -0
  37. package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +11 -0
  38. package/esm/src/book-components/Chat/Chat/ChatToolCallModal.test.d.ts +2 -0
  39. package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +32 -0
  40. package/esm/src/book-components/Chat/Chat/chatCssClassNames.d.ts +41 -0
  41. package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +44 -0
  42. package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +40 -0
  43. package/esm/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +5 -0
  44. package/esm/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.d.ts +18 -0
  45. package/esm/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.test.d.ts +1 -0
  46. package/esm/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +16 -0
  47. package/esm/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +1 -1
  48. package/esm/src/book-components/Chat/hooks/useChatAutoScroll.test.d.ts +1 -0
  49. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
  50. package/esm/src/book-components/Chat/utils/ChatPersistence.d.ts +16 -0
  51. package/esm/src/book-components/Chat/utils/ChatPersistence.test.d.ts +4 -0
  52. package/esm/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +2 -2
  53. package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.timeout.test.d.ts +1 -0
  54. package/esm/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -5
  55. package/esm/src/book-components/Chat/utils/parseMessageButtons.test.d.ts +1 -0
  56. package/esm/src/book-components/Chat/utils/resolveToolCallFromChatMessages.d.ts +13 -0
  57. package/esm/src/book-components/Chat/utils/resolveToolCallState.d.ts +10 -0
  58. package/esm/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +29 -1
  59. package/esm/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +16 -3
  60. package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +24 -0
  61. package/esm/src/book-components/Chat/utils/thinkingMessageVariants.test.d.ts +1 -0
  62. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +123 -0
  63. package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.test.d.ts +1 -0
  64. package/esm/src/book-components/Chat/utils/toolCallParsing/RunBrowserToolResult.d.ts +50 -0
  65. package/esm/src/book-components/Chat/utils/toolCallParsing/TeamToolResult.d.ts +30 -0
  66. package/esm/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +19 -0
  67. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +9 -0
  68. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +9 -0
  69. package/esm/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +10 -0
  70. package/esm/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +10 -0
  71. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +10 -0
  72. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +10 -0
  73. package/esm/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +8 -0
  74. package/esm/src/book-components/Chat/utils/toolCallParsing.d.ts +10 -68
  75. package/esm/src/book-components/Chat/utils/toolCallParsing.test.d.ts +1 -0
  76. package/esm/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +52 -0
  77. package/esm/src/book-components/Chat/utils/walletCredentialToolCall.test.d.ts +1 -0
  78. package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +14 -0
  79. package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -0
  80. package/esm/src/book-components/_common/MonacoEditorWithShadowDom.d.ts +17 -0
  81. package/esm/src/book-components/icons/ArrowIcon.d.ts +30 -5
  82. package/esm/src/book-components/icons/SolidArrowButton.d.ts +28 -0
  83. package/esm/src/book-components/icons/StopIcon.d.ts +8 -0
  84. package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tag.d.ts +14 -0
  85. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +14 -0
  86. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +14 -0
  87. package/esm/src/cli/cli-commands/coder/run.d.ts +14 -0
  88. package/esm/src/cli/cli-commands/coder/verify.d.ts +14 -0
  89. package/esm/src/cli/cli-commands/coder.d.ts +21 -0
  90. package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +59 -0
  91. package/esm/src/collection/agent-collection/CreateAgentInput.test.d.ts +1 -0
  92. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +52 -8
  93. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
  94. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +36 -0
  95. package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -3
  96. package/esm/src/commitments/MEMORY/MEMORY.d.ts +4 -59
  97. package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +11 -0
  98. package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +149 -0
  99. package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +6 -0
  100. package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +8 -0
  101. package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +14 -0
  102. package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +6 -0
  103. package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  104. package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +7 -0
  105. package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +61 -0
  106. package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +8 -0
  107. package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +13 -0
  108. package/esm/src/commitments/MESSAGE/InternalMessageCommitmentDefinition.d.ts +33 -0
  109. package/esm/src/commitments/MESSAGE/MESSAGE.d.ts +2 -2
  110. package/esm/src/commitments/META/META.d.ts +4 -0
  111. package/esm/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +33 -0
  112. package/esm/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +33 -0
  113. package/esm/src/commitments/META_VOICE/META_VOICE.d.ts +39 -0
  114. package/esm/src/commitments/SAMPLE/SAMPLE.d.ts +13 -13
  115. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +1 -1
  116. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +10 -0
  117. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +1 -0
  118. package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +42 -0
  119. package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.test.d.ts +1 -0
  120. package/esm/src/commitments/USE_CALENDAR/UseCalendarToolNames.d.ts +13 -0
  121. package/esm/src/commitments/USE_CALENDAR/UseCalendarWallet.d.ts +9 -0
  122. package/esm/src/commitments/USE_CALENDAR/calendarReference.d.ts +68 -0
  123. package/esm/src/commitments/USE_CALENDAR/callGoogleCalendarApi.d.ts +19 -0
  124. package/esm/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +8 -0
  125. package/esm/src/commitments/USE_CALENDAR/createUseCalendarTools.d.ts +7 -0
  126. package/esm/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +7 -0
  127. package/esm/src/commitments/USE_CALENDAR/normalizeConfiguredCalendars.d.ts +19 -0
  128. package/esm/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +34 -0
  129. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +4 -11
  130. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +1 -0
  131. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +21 -0
  132. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +1 -0
  133. package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +2 -7
  134. package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +49 -0
  135. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +39 -0
  136. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.test.d.ts +1 -0
  137. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +42 -0
  138. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.test.d.ts +1 -0
  139. package/esm/src/commitments/USE_PROJECT/UseProjectToolNames.d.ts +13 -0
  140. package/esm/src/commitments/USE_PROJECT/UseProjectWallet.d.ts +9 -0
  141. package/esm/src/commitments/USE_PROJECT/callGitHubApi.d.ts +69 -0
  142. package/esm/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +8 -0
  143. package/esm/src/commitments/USE_PROJECT/createUseProjectTools.d.ts +7 -0
  144. package/esm/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +7 -0
  145. package/esm/src/commitments/USE_PROJECT/normalizeConfiguredProjects.d.ts +16 -0
  146. package/esm/src/commitments/USE_PROJECT/normalizeOptionalToolText.d.ts +12 -0
  147. package/esm/src/commitments/USE_PROJECT/projectReference.d.ts +52 -0
  148. package/esm/src/commitments/USE_PROJECT/projectReference.test.d.ts +1 -0
  149. package/esm/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +34 -0
  150. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +41 -0
  151. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +1 -0
  152. package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +9 -0
  153. package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +12 -0
  154. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +9 -0
  155. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +90 -0
  156. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +41 -0
  157. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +1 -0
  158. package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +6 -0
  159. package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +8 -0
  160. package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +7 -0
  161. package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  162. package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +34 -0
  163. package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +8 -0
  164. package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +13 -0
  165. package/esm/src/commitments/WALLET/WALLET.d.ts +24 -0
  166. package/esm/src/commitments/WALLET/WALLET.test.d.ts +1 -0
  167. package/esm/src/commitments/WALLET/WalletToolNames.d.ts +12 -0
  168. package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +163 -0
  169. package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +6 -0
  170. package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +8 -0
  171. package/esm/src/commitments/WALLET/createWalletTools.d.ts +7 -0
  172. package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +6 -0
  173. package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +16 -0
  174. package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +7 -0
  175. package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +51 -0
  176. package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +8 -0
  177. package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +13 -0
  178. package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +29 -0
  179. package/esm/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +29 -0
  180. package/esm/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
  181. package/esm/src/commitments/_base/CommitmentDefinition.d.ts +23 -0
  182. package/esm/src/commitments/_common/createWritingCommitmentSections.d.ts +19 -0
  183. package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.writing.test.d.ts +1 -0
  184. package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +22 -0
  185. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +99 -0
  186. package/esm/src/commitments/index.d.ts +13 -1
  187. package/esm/src/config.d.ts +3 -0
  188. package/esm/src/errors/0-index.d.ts +3 -0
  189. package/esm/src/errors/ConflictError.d.ts +9 -0
  190. package/esm/src/executables/apps/locateVscode.d.ts +7 -0
  191. package/esm/src/executables/apps/locateVscode.test.d.ts +1 -0
  192. package/esm/src/executables/browsers/locateBrowser.d.ts +10 -0
  193. package/esm/src/executables/browsers/locateBrowser.test.d.ts +1 -0
  194. package/esm/src/executables/browsers/locateChrome.d.ts +7 -0
  195. package/esm/src/executables/browsers/locateChrome.test.d.ts +1 -0
  196. package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +10 -0
  197. package/esm/src/executables/browsers/locateDefaultSystemBrowser.test.d.ts +1 -0
  198. package/esm/src/executables/browsers/locateEdge.d.ts +7 -0
  199. package/esm/src/executables/browsers/locateEdge.test.d.ts +1 -0
  200. package/esm/src/executables/browsers/locateFirefox.d.ts +7 -0
  201. package/esm/src/executables/browsers/locateFirefox.test.d.ts +1 -0
  202. package/esm/src/executables/browsers/locateInternetExplorer.d.ts +7 -0
  203. package/esm/src/executables/browsers/locateInternetExplorer.test.d.ts +1 -0
  204. package/esm/src/executables/browsers/locateSafari.d.ts +7 -0
  205. package/esm/src/execution/LlmExecutionTools.d.ts +12 -1
  206. package/esm/src/execution/Usage.d.ts +4 -0
  207. package/esm/src/execution/utils/usageToHuman.d.ts +1 -0
  208. package/esm/src/file-security-checkers/FileSecurityCheckResult.d.ts +32 -0
  209. package/esm/src/file-security-checkers/FileSecurityChecker.d.ts +34 -0
  210. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +36 -0
  211. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.test.d.ts +1 -0
  212. package/esm/src/llm-providers/agent/Agent.d.ts +2 -2
  213. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -2
  214. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +2 -1
  215. package/esm/src/llm-providers/agent/self-learning/SelfLearningManager.test.d.ts +1 -0
  216. package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +3 -1
  217. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +33 -3
  218. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
  219. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +2 -2
  220. package/esm/src/llm-providers/openai/computeOpenAiUsage.d.ts +3 -1
  221. package/esm/src/playground/playground.d.ts +1 -0
  222. package/esm/src/speech-recognition/OpenAiSpeechRecognition.d.ts +49 -1
  223. package/esm/src/types/SpeechRecognition.d.ts +14 -0
  224. package/esm/src/types/ToolCall.d.ts +56 -0
  225. package/esm/src/types/number_usd.d.ts +110 -0
  226. package/esm/src/types/string_filename.d.ts +39 -0
  227. package/esm/src/types/string_knowledge_source_content.d.ts +29 -0
  228. package/esm/src/types/string_markdown.d.ts +138 -0
  229. package/esm/src/types/string_parameter_name.d.ts +170 -0
  230. package/esm/src/types/string_person_fullname.d.ts +85 -0
  231. package/esm/src/types/string_sha256.d.ts +44 -0
  232. package/esm/src/types/string_token.d.ts +58 -0
  233. package/esm/src/types/string_url.d.ts +146 -0
  234. package/esm/src/types/typeAliases.d.ts +9 -741
  235. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +10 -0
  236. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +14 -0
  237. package/esm/src/utils/chat/chatAttachments/appendChatContextSections.d.ts +6 -0
  238. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +9 -0
  239. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +9 -0
  240. package/esm/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +11 -0
  241. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +11 -0
  242. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +10 -0
  243. package/esm/src/utils/chat/chatAttachments.d.ts +54 -0
  244. package/esm/src/utils/chat/chatAttachments.test.d.ts +1 -0
  245. package/esm/src/utils/chat/constants.d.ts +21 -0
  246. package/esm/src/utils/chat/decodeChatStreamWhitespaceFromTransport.d.ts +7 -0
  247. package/esm/src/utils/chat/encodeChatStreamWhitespaceForTransport.d.ts +7 -0
  248. package/esm/src/utils/chat/escapeRegExp.d.ts +6 -0
  249. package/esm/src/utils/database/uniqueConstraint.d.ts +28 -0
  250. package/esm/src/utils/files/decodeAttachmentAsText.d.ts +81 -0
  251. package/esm/src/utils/files/decodeAttachmentAsText.test.d.ts +1 -0
  252. package/esm/src/utils/files/readResponseBytes.d.ts +14 -0
  253. package/esm/src/utils/random/EnglishNamePool.d.ts +9 -1
  254. package/esm/src/utils/toolCalls/getToolCallIdentity.d.ts +1 -1
  255. package/esm/src/utils/toolCalls/mergeToolCalls.d.ts +12 -0
  256. package/esm/src/utils/toolCalls/resolveToolCallIdempotencyKey.d.ts +10 -0
  257. package/esm/src/utils/validators/url/extractUrlsFromText.d.ts +8 -0
  258. package/esm/src/utils/validators/url/extractUrlsFromText.test.d.ts +1 -0
  259. package/esm/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +12 -1
  260. package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +8 -2
  261. package/esm/src/utils/validators/url/normalizeDomainForMatching.d.ts +11 -0
  262. package/esm/src/utils/validators/url/normalizeDomainForMatching.test.d.ts +1 -0
  263. package/esm/src/version.d.ts +1 -1
  264. package/package.json +1 -1
  265. package/umd/index.umd.js +41 -22
  266. package/umd/index.umd.js.map +1 -1
  267. package/umd/src/_packages/components.index.d.ts +2 -0
  268. package/umd/src/_packages/core.index.d.ts +26 -0
  269. package/umd/src/_packages/markdown-utils.index.d.ts +5 -5
  270. package/umd/src/_packages/types.index.d.ts +250 -228
  271. package/umd/src/_packages/utils.index.d.ts +2 -0
  272. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +4 -1
  273. package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -1
  274. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +2 -2
  275. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.writing.test.d.ts +1 -0
  276. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.knowledge.test.d.ts +1 -0
  277. package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +12 -0
  278. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +12 -0
  279. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.test.d.ts +1 -0
  280. package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +38 -0
  281. package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +3 -0
  282. package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.title.test.d.ts +1 -0
  283. package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +110 -0
  284. package/umd/src/book-2.0/agent-source/removeCommentsFromSystemMessage.d.ts +2 -2
  285. package/umd/src/book-components/BookEditor/BookEditor.d.ts +15 -0
  286. package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +2 -0
  287. package/umd/src/book-components/BookEditor/BookEditorMonacoConstants.d.ts +1 -0
  288. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +14 -7
  289. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.test.d.ts +1 -0
  290. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +28 -0
  291. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.test.d.ts +1 -0
  292. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +27 -0
  293. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.test.d.ts +1 -0
  294. package/umd/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
  295. package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +1 -0
  296. package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +2 -0
  297. package/umd/src/book-components/Chat/Chat/ChatInputArea.test.d.ts +2 -0
  298. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +6 -1
  299. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +3 -0
  300. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +56 -0
  301. package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +11 -0
  302. package/umd/src/book-components/Chat/Chat/ChatToolCallModal.test.d.ts +2 -0
  303. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +32 -0
  304. package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +41 -0
  305. package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +44 -0
  306. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +40 -0
  307. package/umd/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +5 -0
  308. package/umd/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.d.ts +18 -0
  309. package/umd/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.test.d.ts +1 -0
  310. package/umd/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +16 -0
  311. package/umd/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +1 -1
  312. package/umd/src/book-components/Chat/hooks/useChatAutoScroll.test.d.ts +1 -0
  313. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
  314. package/umd/src/book-components/Chat/utils/ChatPersistence.d.ts +16 -0
  315. package/umd/src/book-components/Chat/utils/ChatPersistence.test.d.ts +4 -0
  316. package/umd/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +2 -2
  317. package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.timeout.test.d.ts +1 -0
  318. package/umd/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -5
  319. package/umd/src/book-components/Chat/utils/parseMessageButtons.test.d.ts +1 -0
  320. package/umd/src/book-components/Chat/utils/resolveToolCallFromChatMessages.d.ts +13 -0
  321. package/umd/src/book-components/Chat/utils/resolveToolCallState.d.ts +10 -0
  322. package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +29 -1
  323. package/umd/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +16 -3
  324. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +24 -0
  325. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.test.d.ts +1 -0
  326. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +123 -0
  327. package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.test.d.ts +1 -0
  328. package/umd/src/book-components/Chat/utils/toolCallParsing/RunBrowserToolResult.d.ts +50 -0
  329. package/umd/src/book-components/Chat/utils/toolCallParsing/TeamToolResult.d.ts +30 -0
  330. package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +19 -0
  331. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +9 -0
  332. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +9 -0
  333. package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +10 -0
  334. package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +10 -0
  335. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +10 -0
  336. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +10 -0
  337. package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +8 -0
  338. package/umd/src/book-components/Chat/utils/toolCallParsing.d.ts +10 -68
  339. package/umd/src/book-components/Chat/utils/toolCallParsing.test.d.ts +1 -0
  340. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +52 -0
  341. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.test.d.ts +1 -0
  342. package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +14 -0
  343. package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -0
  344. package/umd/src/book-components/_common/MonacoEditorWithShadowDom.d.ts +17 -0
  345. package/umd/src/book-components/icons/ArrowIcon.d.ts +30 -5
  346. package/umd/src/book-components/icons/SolidArrowButton.d.ts +28 -0
  347. package/umd/src/book-components/icons/StopIcon.d.ts +8 -0
  348. package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tag.d.ts +14 -0
  349. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +14 -0
  350. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +14 -0
  351. package/umd/src/cli/cli-commands/coder/run.d.ts +14 -0
  352. package/umd/src/cli/cli-commands/coder/verify.d.ts +14 -0
  353. package/umd/src/cli/cli-commands/coder.d.ts +21 -0
  354. package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +59 -0
  355. package/umd/src/collection/agent-collection/CreateAgentInput.test.d.ts +1 -0
  356. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +52 -8
  357. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
  358. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +36 -0
  359. package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -3
  360. package/umd/src/commitments/MEMORY/MEMORY.d.ts +4 -59
  361. package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +11 -0
  362. package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +149 -0
  363. package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +6 -0
  364. package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +8 -0
  365. package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +14 -0
  366. package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +6 -0
  367. package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  368. package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +7 -0
  369. package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +61 -0
  370. package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +8 -0
  371. package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +13 -0
  372. package/umd/src/commitments/MESSAGE/InternalMessageCommitmentDefinition.d.ts +33 -0
  373. package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +2 -2
  374. package/umd/src/commitments/META/META.d.ts +4 -0
  375. package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +33 -0
  376. package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +33 -0
  377. package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +39 -0
  378. package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +13 -13
  379. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +1 -1
  380. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +10 -0
  381. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +1 -0
  382. package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +42 -0
  383. package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.test.d.ts +1 -0
  384. package/umd/src/commitments/USE_CALENDAR/UseCalendarToolNames.d.ts +13 -0
  385. package/umd/src/commitments/USE_CALENDAR/UseCalendarWallet.d.ts +9 -0
  386. package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +68 -0
  387. package/umd/src/commitments/USE_CALENDAR/callGoogleCalendarApi.d.ts +19 -0
  388. package/umd/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +8 -0
  389. package/umd/src/commitments/USE_CALENDAR/createUseCalendarTools.d.ts +7 -0
  390. package/umd/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +7 -0
  391. package/umd/src/commitments/USE_CALENDAR/normalizeConfiguredCalendars.d.ts +19 -0
  392. package/umd/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +34 -0
  393. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +4 -11
  394. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +1 -0
  395. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +21 -0
  396. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +1 -0
  397. package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +2 -7
  398. package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +49 -0
  399. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +39 -0
  400. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.test.d.ts +1 -0
  401. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +42 -0
  402. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.test.d.ts +1 -0
  403. package/umd/src/commitments/USE_PROJECT/UseProjectToolNames.d.ts +13 -0
  404. package/umd/src/commitments/USE_PROJECT/UseProjectWallet.d.ts +9 -0
  405. package/umd/src/commitments/USE_PROJECT/callGitHubApi.d.ts +69 -0
  406. package/umd/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +8 -0
  407. package/umd/src/commitments/USE_PROJECT/createUseProjectTools.d.ts +7 -0
  408. package/umd/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +7 -0
  409. package/umd/src/commitments/USE_PROJECT/normalizeConfiguredProjects.d.ts +16 -0
  410. package/umd/src/commitments/USE_PROJECT/normalizeOptionalToolText.d.ts +12 -0
  411. package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +52 -0
  412. package/umd/src/commitments/USE_PROJECT/projectReference.test.d.ts +1 -0
  413. package/umd/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +34 -0
  414. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +41 -0
  415. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +1 -0
  416. package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +9 -0
  417. package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +12 -0
  418. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +9 -0
  419. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +90 -0
  420. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +41 -0
  421. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +1 -0
  422. package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +6 -0
  423. package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +8 -0
  424. package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +7 -0
  425. package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  426. package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +34 -0
  427. package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +8 -0
  428. package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +13 -0
  429. package/umd/src/commitments/WALLET/WALLET.d.ts +24 -0
  430. package/umd/src/commitments/WALLET/WALLET.test.d.ts +1 -0
  431. package/umd/src/commitments/WALLET/WalletToolNames.d.ts +12 -0
  432. package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +163 -0
  433. package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +6 -0
  434. package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +8 -0
  435. package/umd/src/commitments/WALLET/createWalletTools.d.ts +7 -0
  436. package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +6 -0
  437. package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +16 -0
  438. package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +7 -0
  439. package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +51 -0
  440. package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +8 -0
  441. package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +13 -0
  442. package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +29 -0
  443. package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +29 -0
  444. package/umd/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
  445. package/umd/src/commitments/_base/CommitmentDefinition.d.ts +23 -0
  446. package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +19 -0
  447. package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.writing.test.d.ts +1 -0
  448. package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +22 -0
  449. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +99 -0
  450. package/umd/src/commitments/index.d.ts +13 -1
  451. package/umd/src/config.d.ts +3 -0
  452. package/umd/src/errors/0-index.d.ts +3 -0
  453. package/umd/src/errors/ConflictError.d.ts +9 -0
  454. package/umd/src/executables/apps/locateVscode.d.ts +7 -0
  455. package/umd/src/executables/apps/locateVscode.test.d.ts +1 -0
  456. package/umd/src/executables/browsers/locateBrowser.d.ts +10 -0
  457. package/umd/src/executables/browsers/locateBrowser.test.d.ts +1 -0
  458. package/umd/src/executables/browsers/locateChrome.d.ts +7 -0
  459. package/umd/src/executables/browsers/locateChrome.test.d.ts +1 -0
  460. package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +10 -0
  461. package/umd/src/executables/browsers/locateDefaultSystemBrowser.test.d.ts +1 -0
  462. package/umd/src/executables/browsers/locateEdge.d.ts +7 -0
  463. package/umd/src/executables/browsers/locateEdge.test.d.ts +1 -0
  464. package/umd/src/executables/browsers/locateFirefox.d.ts +7 -0
  465. package/umd/src/executables/browsers/locateFirefox.test.d.ts +1 -0
  466. package/umd/src/executables/browsers/locateInternetExplorer.d.ts +7 -0
  467. package/umd/src/executables/browsers/locateInternetExplorer.test.d.ts +1 -0
  468. package/umd/src/executables/browsers/locateSafari.d.ts +7 -0
  469. package/umd/src/execution/LlmExecutionTools.d.ts +12 -1
  470. package/umd/src/execution/Usage.d.ts +4 -0
  471. package/umd/src/execution/utils/usageToHuman.d.ts +1 -0
  472. package/umd/src/file-security-checkers/FileSecurityCheckResult.d.ts +32 -0
  473. package/umd/src/file-security-checkers/FileSecurityChecker.d.ts +34 -0
  474. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +36 -0
  475. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.test.d.ts +1 -0
  476. package/umd/src/llm-providers/agent/Agent.d.ts +2 -2
  477. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -2
  478. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +2 -1
  479. package/umd/src/llm-providers/agent/self-learning/SelfLearningManager.test.d.ts +1 -0
  480. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +3 -1
  481. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +33 -3
  482. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
  483. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +2 -2
  484. package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +3 -1
  485. package/umd/src/playground/playground.d.ts +1 -0
  486. package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +49 -1
  487. package/umd/src/types/SpeechRecognition.d.ts +14 -0
  488. package/umd/src/types/ToolCall.d.ts +56 -0
  489. package/umd/src/types/number_usd.d.ts +110 -0
  490. package/umd/src/types/string_filename.d.ts +39 -0
  491. package/umd/src/types/string_knowledge_source_content.d.ts +29 -0
  492. package/umd/src/types/string_markdown.d.ts +138 -0
  493. package/umd/src/types/string_parameter_name.d.ts +170 -0
  494. package/umd/src/types/string_person_fullname.d.ts +85 -0
  495. package/umd/src/types/string_sha256.d.ts +44 -0
  496. package/umd/src/types/string_token.d.ts +58 -0
  497. package/umd/src/types/string_url.d.ts +146 -0
  498. package/umd/src/types/typeAliases.d.ts +9 -741
  499. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +10 -0
  500. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +14 -0
  501. package/umd/src/utils/chat/chatAttachments/appendChatContextSections.d.ts +6 -0
  502. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +9 -0
  503. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +9 -0
  504. package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +11 -0
  505. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +11 -0
  506. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +10 -0
  507. package/umd/src/utils/chat/chatAttachments.d.ts +54 -0
  508. package/umd/src/utils/chat/chatAttachments.test.d.ts +1 -0
  509. package/umd/src/utils/chat/constants.d.ts +21 -0
  510. package/umd/src/utils/chat/decodeChatStreamWhitespaceFromTransport.d.ts +7 -0
  511. package/umd/src/utils/chat/encodeChatStreamWhitespaceForTransport.d.ts +7 -0
  512. package/umd/src/utils/chat/escapeRegExp.d.ts +6 -0
  513. package/umd/src/utils/database/uniqueConstraint.d.ts +28 -0
  514. package/umd/src/utils/files/decodeAttachmentAsText.d.ts +81 -0
  515. package/umd/src/utils/files/decodeAttachmentAsText.test.d.ts +1 -0
  516. package/umd/src/utils/files/readResponseBytes.d.ts +14 -0
  517. package/umd/src/utils/random/EnglishNamePool.d.ts +9 -1
  518. package/umd/src/utils/toolCalls/getToolCallIdentity.d.ts +1 -1
  519. package/umd/src/utils/toolCalls/mergeToolCalls.d.ts +12 -0
  520. package/umd/src/utils/toolCalls/resolveToolCallIdempotencyKey.d.ts +10 -0
  521. package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +8 -0
  522. package/umd/src/utils/validators/url/extractUrlsFromText.test.d.ts +1 -0
  523. package/umd/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +12 -1
  524. package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +8 -2
  525. package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +11 -0
  526. package/umd/src/utils/validators/url/normalizeDomainForMatching.test.d.ts +1 -0
  527. package/umd/src/version.d.ts +1 -1
@@ -0,0 +1,10 @@
1
+ import type { ChatAttachment } from '../chatAttachments';
2
+ /**
3
+ * Appends attachment metadata context to message content so chat models can see uploaded file URLs.
4
+ *
5
+ * @param {string} messageContent - The original message content.
6
+ * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
7
+ * @returns {string} The updated message content.
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare function appendChatAttachmentContext(messageContent: string, attachments: ReadonlyArray<ChatAttachment>): string;
@@ -0,0 +1,14 @@
1
+ import type { ChatAttachment, ResolveChatAttachmentOptions } from '../chatAttachments';
2
+ /**
3
+ * Appends attachment metadata and inline attachment content to message content.
4
+ *
5
+ * The helper never throws because attachment downloads are best-effort and should
6
+ * not block chat requests.
7
+ *
8
+ * @param {string} messageContent - The original message content.
9
+ * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
10
+ * @param {ResolveChatAttachmentOptions} options - Options for resolution.
11
+ * @returns {Promise<string>} The updated message content.
12
+ * @public exported from `@promptbook/core`
13
+ */
14
+ export declare function appendChatAttachmentContextWithContent(messageContent: string, attachments: ReadonlyArray<ChatAttachment>, options?: ResolveChatAttachmentOptions): Promise<string>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Appends one or more context sections to message content.
3
+ *
4
+ * @private function of appendChatAttachmentContext
5
+ */
6
+ export declare function appendChatContextSections(messageContent: string, contextSections: ReadonlyArray<string>): string;
@@ -0,0 +1,9 @@
1
+ import type { ResolvedChatAttachmentContent } from '../chatAttachments';
2
+ /**
3
+ * Formats inline attachment-content context section for the model.
4
+ *
5
+ * @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
6
+ * @returns {string} The formatted context.
7
+ * @public exported from `@promptbook/core`
8
+ */
9
+ export declare function formatChatAttachmentContentContext(resolvedContents: ReadonlyArray<ResolvedChatAttachmentContent>): string;
@@ -0,0 +1,9 @@
1
+ import type { ChatAttachment } from '../chatAttachments';
2
+ /**
3
+ * Builds a markdown section that lists attachment URLs for the model.
4
+ *
5
+ * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
6
+ * @returns {string} The formatted context.
7
+ * @public exported from `@promptbook/core`
8
+ */
9
+ export declare function formatChatAttachmentContext(attachments: ReadonlyArray<ChatAttachment>): string;
@@ -0,0 +1,11 @@
1
+ import type { ChatAttachment } from '../chatAttachments';
2
+ /**
3
+ * Normalizes a potentially invalid attachments payload from the client request.
4
+ *
5
+ * Invalid items are skipped and duplicate URLs are de-duplicated.
6
+ *
7
+ * @param {unknown} rawAttachments - The raw attachments to normalize.
8
+ * @returns {Array<ChatAttachment>} The normalized attachments.
9
+ * @public exported from `@promptbook/core`
10
+ */
11
+ export declare function normalizeChatAttachments(rawAttachments: unknown): Array<ChatAttachment>;
@@ -0,0 +1,11 @@
1
+ import type { ChatAttachment, ResolveChatAttachmentOptions, ResolvedChatAttachmentContent } from '../chatAttachments';
2
+ /**
3
+ * Downloads and resolves one attachment into inline text context when possible.
4
+ *
5
+ * @param {ChatAttachment} attachment - The attachment to resolve.
6
+ * @param {number} maxInlineCharacters - Maximum number of characters to inline.
7
+ * @param {ResolveChatAttachmentOptions} options - Options for resolution.
8
+ * @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
9
+ * @private function of resolveChatAttachmentContents
10
+ */
11
+ export declare function resolveChatAttachmentContent(attachment: ChatAttachment, maxInlineCharacters: number, options?: ResolveChatAttachmentOptions): Promise<ResolvedChatAttachmentContent>;
@@ -0,0 +1,10 @@
1
+ import type { ChatAttachment, ResolveChatAttachmentOptions, ResolvedChatAttachmentContent } from '../chatAttachments';
2
+ /**
3
+ * Resolves inline content previews for each attachment while enforcing global prompt-size limits.
4
+ *
5
+ * @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
6
+ * @param {ResolveChatAttachmentOptions} options - Options for resolution.
7
+ * @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
8
+ * @public exported from `@promptbook/core`
9
+ */
10
+ export declare function resolveChatAttachmentContents(attachments: ReadonlyArray<ChatAttachment>, options?: ResolveChatAttachmentOptions): Promise<Array<ResolvedChatAttachmentContent>>;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Attachment payload expected by chat routes and prompt formatting helpers.
3
+ *
4
+ * @public exported from `@promptbook/core`
5
+ */
6
+ export type ChatAttachment = {
7
+ readonly name: string;
8
+ readonly type: string;
9
+ readonly url: string;
10
+ };
11
+ /**
12
+ * Resolved inline content of one chat attachment.
13
+ *
14
+ * @public exported from `@promptbook/core`
15
+ */
16
+ export type ResolvedChatAttachmentContent = {
17
+ readonly attachment: ChatAttachment;
18
+ readonly content: string | null;
19
+ readonly isTruncated: boolean;
20
+ readonly reason: string | null;
21
+ readonly encodingUsed: string | null;
22
+ readonly encodingConfidence: number | null;
23
+ readonly warnings: ReadonlyArray<string>;
24
+ readonly wasBinary: boolean;
25
+ };
26
+ /**
27
+ * Options for resolving chat attachment contents.
28
+ *
29
+ * @public exported from `@promptbook/core`
30
+ */
31
+ export type ResolveChatAttachmentOptions = {
32
+ /**
33
+ * Whether to allow localhost URLs.
34
+ *
35
+ * @default false
36
+ */
37
+ readonly allowLocalhost?: boolean;
38
+ /**
39
+ * Forces text decoding even when the attachment looks binary.
40
+ *
41
+ * @default false
42
+ */
43
+ readonly forceText?: boolean;
44
+ };
45
+ export { normalizeChatAttachments } from './chatAttachments/normalizeChatAttachments';
46
+ export { formatChatAttachmentContext } from './chatAttachments/formatChatAttachmentContext';
47
+ export { resolveChatAttachmentContent } from './chatAttachments/resolveChatAttachmentContent';
48
+ export { resolveChatAttachmentContents } from './chatAttachments/resolveChatAttachmentContents';
49
+ export { formatChatAttachmentContentContext } from './chatAttachments/formatChatAttachmentContentContext';
50
+ export { appendChatAttachmentContext } from './chatAttachments/appendChatAttachmentContext';
51
+ export { appendChatAttachmentContextWithContent } from './chatAttachments/appendChatAttachmentContextWithContent';
52
+ /**
53
+ * Note: [💞] Ignore a discrepancy between file name and entity name
54
+ */
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @@@
3
+ *
4
+ * @private internal mechanism for chat stream whitespace encoding/decoding
5
+ */
6
+ export declare const CHAT_STREAM_WHITESPACE_ENCODERS: ReadonlyArray<{
7
+ pattern: RegExp;
8
+ token: string;
9
+ }>;
10
+ /**
11
+ * @@@
12
+ *
13
+ * @private internal mechanism for chat stream whitespace encoding/decoding
14
+ */
15
+ export declare const CHAT_STREAM_WHITESPACE_DECODERS: ReadonlyArray<{
16
+ token: string;
17
+ value: string;
18
+ }>;
19
+ /**
20
+ * Note: [💞] Ignore a discrepancy between file name and entity name
21
+ */
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Converts encoded whitespace markers back into real whitespace so the UI can render the message
3
+ * exactly as it was generated.
4
+ *
5
+ * @private internal mechanism for chat stream whitespace encoding/decoding
6
+ */
7
+ export declare function decodeChatStreamWhitespaceFromTransport(content: string): string;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Replaces whitespace characters inside a streamed chunk with special markers so the transport
3
+ * never emits content that would otherwise be treated as empty.
4
+ *
5
+ * @private internal mechanism for chat stream whitespace encoding/decoding
6
+ */
7
+ export declare function encodeChatStreamWhitespaceForTransport(content: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @@@
3
+ *
4
+ * @public exported from `@promptbook/utils`
5
+ */
6
+ export declare function escapeRegExp(value: string): string;
@@ -0,0 +1,28 @@
1
+ import type { PostgrestError } from '@supabase/postgrest-js';
2
+ /**
3
+ * Holds the data necessary to translate a Postgres constraint name into a user-facing error.
4
+ *
5
+ * @private Internal helper for Supabase-backed collections
6
+ */
7
+ export type UniqueConstraintTranslation = {
8
+ /**
9
+ * The suffix of the constraint name that should trigger this translation.
10
+ */
11
+ readonly suffix: string;
12
+ /**
13
+ * Builds the domain-specific error to throw when the constraint matches.
14
+ */
15
+ readonly buildError: () => Error;
16
+ };
17
+ /**
18
+ * Converts a Supabase unique constraint violation into a domain-specific error.
19
+ *
20
+ * @param error - Resulting Postgrest error from Supabase.
21
+ * @param translations - Array of translations keyed by constraint suffix.
22
+ * @returns A translated error when the constraint suffix matches, otherwise `null`.
23
+ * @private Internal helper for Supabase-backed collections
24
+ */
25
+ export declare function translateSupabaseUniqueConstraintError(error: PostgrestError | null, translations: ReadonlyArray<UniqueConstraintTranslation>): Error | null;
26
+ /**
27
+ * Note: [💞] Ignore a discrepancy between file name and entity name
28
+ */
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Input payload accepted by `decodeAttachmentAsText`.
3
+ *
4
+ * @private internal utility for shared text decoding
5
+ */
6
+ export type DecodeAttachmentAsTextInput = {
7
+ /**
8
+ * Raw file bytes to inspect and decode.
9
+ */
10
+ readonly bytes: ArrayBuffer | ArrayBufferView;
11
+ /**
12
+ * Original filename used for diagnostics.
13
+ */
14
+ readonly filename: string;
15
+ /**
16
+ * Optional MIME type from transport or storage metadata.
17
+ */
18
+ readonly mimeType?: string | null;
19
+ };
20
+ /**
21
+ * Optional settings for `decodeAttachmentAsText`.
22
+ *
23
+ * @private internal utility for shared text decoding
24
+ */
25
+ export type DecodeAttachmentAsTextOptions = {
26
+ /**
27
+ * Max bytes to decode before truncating the payload.
28
+ *
29
+ * @default 524288
30
+ */
31
+ readonly maxBytes?: number;
32
+ /**
33
+ * Forces text decoding even when the bytes look binary.
34
+ *
35
+ * @default false
36
+ */
37
+ readonly forceText?: boolean;
38
+ };
39
+ /**
40
+ * Best-effort text-decoding result for one attachment or file.
41
+ *
42
+ * @private internal utility for shared text decoding
43
+ */
44
+ export type DecodeAttachmentAsTextResult = {
45
+ /**
46
+ * Decoded text. Empty string when decoding is skipped for binary content.
47
+ */
48
+ readonly text: string;
49
+ /**
50
+ * Encoding label used for decoding, or `binary` when decoding was skipped.
51
+ */
52
+ readonly encodingUsed: string;
53
+ /**
54
+ * Confidence score from `0` to `1`.
55
+ */
56
+ readonly confidence?: number;
57
+ /**
58
+ * Human-readable warnings describing truncation or guessed encodings.
59
+ */
60
+ readonly warnings: Array<string>;
61
+ /**
62
+ * Whether the payload was classified as binary and therefore not decoded.
63
+ */
64
+ readonly wasBinary: boolean;
65
+ /**
66
+ * Whether the byte payload had to be truncated before decoding.
67
+ */
68
+ readonly isTruncated: boolean;
69
+ };
70
+ /**
71
+ * Default byte limit for one best-effort text decode.
72
+ *
73
+ * @private constant of decodeAttachmentAsText
74
+ */
75
+ export declare const DEFAULT_ATTACHMENT_TEXT_DECODE_BYTES: number;
76
+ /**
77
+ * Best-effort decoder for uploaded or remote file bytes whose extension or encoding may be unknown.
78
+ *
79
+ * @private internal utility for shared text decoding
80
+ */
81
+ export declare function decodeAttachmentAsText(input: DecodeAttachmentAsTextInput, options?: DecodeAttachmentAsTextOptions): DecodeAttachmentAsTextResult;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Reads a bounded byte prefix from a fetch `Response`.
3
+ *
4
+ * @param {Response} response - HTTP response whose body should be consumed.
5
+ * @param {number} maxBytes - Maximum number of bytes to capture.
6
+ * @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
7
+ * @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
8
+ * @private internal utility for bounded response reads
9
+ */
10
+ export declare function readResponseBytes(response: Response, maxBytes: number, options?: {
11
+ captureOverflowByte?: boolean;
12
+ }): Promise<{
13
+ readonly bytes: Uint8Array;
14
+ }>;
@@ -1,4 +1,12 @@
1
- import type { NamePool } from './NamePool';
1
+ import type { GenerateNameResult, NamePool } from './NamePool';
2
+ /**
3
+ * Generates a deterministic English full name from an arbitrary seed text.
4
+ *
5
+ * @param seed - Input seed used to derive a stable pseudonym.
6
+ * @returns Deterministic English full name with color metadata.
7
+ * @private internal helper for deterministic pseudonym generation
8
+ */
9
+ export declare function generateDeterministicEnglishName(seed: string): GenerateNameResult;
2
10
  /**
3
11
  * Name pool for English names
4
12
  *
@@ -5,6 +5,6 @@ import type { ToolCall } from '../../types/ToolCall';
5
5
  * @param toolCall - Tool call entry to identify.
6
6
  * @returns Stable identity string for deduplication.
7
7
  *
8
- * @private function of <Chat/>
8
+ * @private function of `<Chat/>`
9
9
  */
10
10
  export declare function getToolCallIdentity(toolCall: ToolCall): string;
@@ -0,0 +1,12 @@
1
+ import type { ToolCall } from '../../types/ToolCall';
2
+ /**
3
+ * Merges streamed tool-call snapshots by stable identity while preserving incremental logs,
4
+ * warnings, and partial results.
5
+ *
6
+ * @param existingToolCalls - Previously known tool-call snapshots.
7
+ * @param incomingToolCalls - Newly observed tool-call snapshots.
8
+ * @returns Aggregated tool-call list with newer snapshots merged in place.
9
+ *
10
+ * @private shared helper for streaming chat surfaces
11
+ */
12
+ export declare function mergeToolCalls(existingToolCalls: ReadonlyArray<ToolCall> | undefined, incomingToolCalls: ReadonlyArray<ToolCall> | undefined): Array<ToolCall>;
@@ -0,0 +1,10 @@
1
+ import type { ToolCall } from '../../types/ToolCall';
2
+ /**
3
+ * Builds a deterministic idempotency key for tool calls so the UI can track updates.
4
+ *
5
+ * @param toolCall - Tool call payload or snapshot.
6
+ * @returns Stable key that identifies the same tool call instance.
7
+ *
8
+ * @private internal helper for tool call streaming
9
+ */
10
+ export declare function resolveToolCallIdempotencyKey(toolCall: ToolCall): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
3
+ *
4
+ * @param text - Input text that may contain one or more URLs.
5
+ * @returns Unique URLs in their first-seen order.
6
+ * @private utility of KNOWLEDGE parsing
7
+ */
8
+ export declare function extractUrlsFromText(text: string): string[];
@@ -1,4 +1,15 @@
1
1
  import type { string_hostname } from '../../../types/typeAliases';
2
+ /**
3
+ * Options for `isHostnameOnPrivateNetwork`
4
+ */
5
+ export type IsHostnameOnPrivateNetworkOptions = {
6
+ /**
7
+ * Whether to allow localhost
8
+ *
9
+ * @default false
10
+ */
11
+ readonly allowLocalhost?: boolean;
12
+ };
2
13
  /**
3
14
  * Checks if an URL is reserved for private networks or localhost.
4
15
  *
@@ -8,4 +19,4 @@ import type { string_hostname } from '../../../types/typeAliases';
8
19
  *
9
20
  * @public exported from `@promptbook/utils`
10
21
  */
11
- export declare function isHostnameOnPrivateNetwork(hostname: string_hostname): boolean;
22
+ export declare function isHostnameOnPrivateNetwork(hostname: string_hostname, options?: IsHostnameOnPrivateNetworkOptions): boolean;
@@ -1,4 +1,9 @@
1
1
  import type { string_url } from '../../../types/typeAliases';
2
+ import { type IsHostnameOnPrivateNetworkOptions } from './isHostnameOnPrivateNetwork';
3
+ /**
4
+ * Options for `isUrlOnPrivateNetwork`
5
+ */
6
+ export type IsUrlOnPrivateNetworkOptions = IsHostnameOnPrivateNetworkOptions;
2
7
  /**
3
8
  * Checks if an IP address or hostname is reserved for private networks or localhost.
4
9
  *
@@ -6,8 +11,9 @@ import type { string_url } from '../../../types/typeAliases';
6
11
  * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
7
12
  * - `isHostnameOnPrivateNetwork` which tests just hostname
8
13
  *
9
- * @param {string} ipAddress - The IP address to check.
14
+ * @param {string} url - The URL to check.
15
+ * @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
10
16
  * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
11
17
  * @public exported from `@promptbook/utils`
12
18
  */
13
- export declare function isUrlOnPrivateNetwork(url: URL | string_url): boolean;
19
+ export declare function isUrlOnPrivateNetwork(url: URL | string_url, options?: IsUrlOnPrivateNetworkOptions): boolean;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Normalizes a domain-like string into a comparable hostname form.
3
+ *
4
+ * The returned value is lowercased and stripped to hostname only
5
+ * (protocol, path, query, hash, and port are removed).
6
+ *
7
+ * @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
8
+ * @returns Normalized hostname or `null` when the value cannot be normalized.
9
+ * @private utility for host/domain matching
10
+ */
11
+ export declare function normalizeDomainForMatching(rawDomain: string): string | null;
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.111.0-6`).
18
+ * It follows semantic versioning (e.g., `0.112.0-11`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/utils",
3
- "version": "0.111.0-7",
3
+ "version": "0.112.0-12",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
package/umd/index.umd.js CHANGED
@@ -23,7 +23,7 @@
23
23
  * @generated
24
24
  * @see https://github.com/webgptorg/promptbook
25
25
  */
26
- const PROMPTBOOK_ENGINE_VERSION = '0.111.0-7';
26
+ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-12';
27
27
  /**
28
28
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
29
29
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -734,16 +734,14 @@
734
734
  }
735
735
  toHex() {
736
736
  if (this.alpha === 255) {
737
- return `#${this.red.toString(16).padStart(2, '0')}${this.green
737
+ return `#${this.red.toString(16).padStart(2, '0')}${this.green.toString(16).padStart(2, '0')}${this.blue
738
738
  .toString(16)
739
- .padStart(2, '0')}${this.blue.toString(16).padStart(2, '0')}`;
739
+ .padStart(2, '0')}`;
740
740
  }
741
741
  else {
742
- return `#${this.red.toString(16).padStart(2, '0')}${this.green
743
- .toString(16)
744
- .padStart(2, '0')}${this.blue.toString(16).padStart(2, '0')}${this.alpha
742
+ return `#${this.red.toString(16).padStart(2, '0')}${this.green.toString(16).padStart(2, '0')}${this.blue
745
743
  .toString(16)
746
- .padStart(2, '0')}`;
744
+ .padStart(2, '0')}${this.alpha.toString(16).padStart(2, '0')}`;
747
745
  }
748
746
  }
749
747
  toRgb() {
@@ -953,6 +951,9 @@
953
951
  LINE: Color.fromHex('#eeeeee'),
954
952
  SEPARATOR: Color.fromHex('#cccccc'),
955
953
  COMMITMENT: Color.fromHex('#DA0F78'),
954
+ NOTE_COMMITMENT: Color.fromHex('#8080807e'),
955
+ TODO_COMMITMENT_TEXT: Color.fromHex('#000000'),
956
+ TODO_COMMITMENT_BACKGROUND: Color.fromHex('#FFEB3B'),
956
957
  PARAMETER: Color.fromHex('#8e44ad'),
957
958
  CODE_BLOCK: Color.fromHex('#7700ffff'),
958
959
  });
@@ -2091,6 +2092,19 @@
2091
2092
  }
2092
2093
  }
2093
2094
 
2095
+ /**
2096
+ * Signals that the requested operation could not be completed because the target already exists.
2097
+ *
2098
+ * @public exported from `@promptbook/core`
2099
+ */
2100
+ class ConflictError extends Error {
2101
+ constructor(message) {
2102
+ super(message);
2103
+ this.name = 'ConflictError';
2104
+ Object.setPrototypeOf(this, ConflictError.prototype);
2105
+ }
2106
+ }
2107
+
2094
2108
  /**
2095
2109
  * This error indicates error from the database
2096
2110
  *
@@ -2346,6 +2360,7 @@
2346
2360
  WrappedError,
2347
2361
  NotAllowed,
2348
2362
  DatabaseError,
2363
+ ConflictError,
2349
2364
  // TODO: [🪑]> VersionMismatchError,
2350
2365
  };
2351
2366
  /**
@@ -2763,11 +2778,7 @@
2763
2778
  * @private function of ParameterEscaping
2764
2779
  */
2765
2780
  function hideBrackets(value) {
2766
- return value
2767
- .split('{')
2768
- .join(`${REPLACING_NONCE}beginbracket`)
2769
- .split('}')
2770
- .join(`${REPLACING_NONCE}endbracket`);
2781
+ return value.split('{').join(`${REPLACING_NONCE}beginbracket`).split('}').join(`${REPLACING_NONCE}endbracket`);
2771
2782
  }
2772
2783
  /**
2773
2784
  * Restores hidden brackets.
@@ -2776,11 +2787,7 @@
2776
2787
  * @private function of ParameterEscaping
2777
2788
  */
2778
2789
  function restoreBrackets(value) {
2779
- return value
2780
- .split(`${REPLACING_NONCE}beginbracket`)
2781
- .join('{')
2782
- .split(`${REPLACING_NONCE}endbracket`)
2783
- .join('}');
2790
+ return value.split(`${REPLACING_NONCE}beginbracket`).join('{').split(`${REPLACING_NONCE}endbracket`).join('}');
2784
2791
  }
2785
2792
  /**
2786
2793
  * Decides whether a parameter can be inlined safely.
@@ -3159,6 +3166,15 @@
3159
3166
  * Note: [💞] Ignore a discrepancy between file name and entity name
3160
3167
  */
3161
3168
 
3169
+ /**
3170
+ * @@@
3171
+ *
3172
+ * @public exported from `@promptbook/utils`
3173
+ */
3174
+ function escapeRegExp(value) {
3175
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
3176
+ }
3177
+
3162
3178
  /**
3163
3179
  * HTTP header used by Promptbook clients to advertise their release version.
3164
3180
  *
@@ -5737,7 +5753,8 @@
5737
5753
  *
5738
5754
  * @public exported from `@promptbook/utils`
5739
5755
  */
5740
- function isHostnameOnPrivateNetwork(hostname) {
5756
+ function isHostnameOnPrivateNetwork(hostname, options = {}) {
5757
+ const { allowLocalhost = false } = options;
5741
5758
  if (hostname === 'example.com' ||
5742
5759
  hostname === 'localhost' ||
5743
5760
  hostname.endsWith('.localhost') ||
@@ -5745,7 +5762,7 @@
5745
5762
  hostname.endsWith('.test') ||
5746
5763
  hostname === '127.0.0.1' ||
5747
5764
  hostname === '::1') {
5748
- return true;
5765
+ return !allowLocalhost;
5749
5766
  }
5750
5767
  if (hostname.includes(':')) {
5751
5768
  // IPv6
@@ -5768,15 +5785,16 @@
5768
5785
  * - `isUrlOnPrivateNetwork` *(this one)* which tests full URL
5769
5786
  * - `isHostnameOnPrivateNetwork` which tests just hostname
5770
5787
  *
5771
- * @param {string} ipAddress - The IP address to check.
5788
+ * @param {string} url - The URL to check.
5789
+ * @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
5772
5790
  * @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
5773
5791
  * @public exported from `@promptbook/utils`
5774
5792
  */
5775
- function isUrlOnPrivateNetwork(url) {
5793
+ function isUrlOnPrivateNetwork(url, options = {}) {
5776
5794
  if (typeof url === 'string') {
5777
5795
  url = new URL(url);
5778
5796
  }
5779
- return isHostnameOnPrivateNetwork(url.hostname);
5797
+ return isHostnameOnPrivateNetwork(url.hostname, options);
5780
5798
  }
5781
5799
 
5782
5800
  /**
@@ -5894,6 +5912,7 @@
5894
5912
  exports.deepClone = deepClone;
5895
5913
  exports.deserializeError = deserializeError;
5896
5914
  exports.difference = difference;
5915
+ exports.escapeRegExp = escapeRegExp;
5897
5916
  exports.exportJson = exportJson;
5898
5917
  exports.extractParameterNames = extractParameterNames;
5899
5918
  exports.forEachAsync = forEachAsync;