@promptbook/javascript 0.111.0-7 → 0.112.0-11

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 (467) hide show
  1. package/esm/index.es.js +14 -7
  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/TeamToolCallModalContent.d.ts +32 -0
  39. package/esm/src/book-components/Chat/Chat/chatCssClassNames.d.ts +41 -0
  40. package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +44 -0
  41. package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +36 -0
  42. package/esm/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +5 -0
  43. package/esm/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.d.ts +18 -0
  44. package/esm/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.test.d.ts +1 -0
  45. package/esm/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +16 -0
  46. package/esm/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +1 -1
  47. package/esm/src/book-components/Chat/hooks/useChatAutoScroll.test.d.ts +1 -0
  48. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
  49. package/esm/src/book-components/Chat/utils/ChatPersistence.d.ts +16 -0
  50. package/esm/src/book-components/Chat/utils/ChatPersistence.test.d.ts +4 -0
  51. package/esm/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +2 -2
  52. package/esm/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -5
  53. package/esm/src/book-components/Chat/utils/parseMessageButtons.test.d.ts +1 -0
  54. package/esm/src/book-components/Chat/utils/resolveToolCallFromChatMessages.d.ts +13 -0
  55. package/esm/src/book-components/Chat/utils/resolveToolCallState.d.ts +10 -0
  56. package/esm/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +29 -1
  57. package/esm/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +16 -3
  58. package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +24 -0
  59. package/esm/src/book-components/Chat/utils/thinkingMessageVariants.test.d.ts +1 -0
  60. package/esm/src/book-components/Chat/utils/toolCallParsing/RunBrowserToolResult.d.ts +50 -0
  61. package/esm/src/book-components/Chat/utils/toolCallParsing/TeamToolResult.d.ts +30 -0
  62. package/esm/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +19 -0
  63. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +9 -0
  64. package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +9 -0
  65. package/esm/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +10 -0
  66. package/esm/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +10 -0
  67. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +10 -0
  68. package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +10 -0
  69. package/esm/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +8 -0
  70. package/esm/src/book-components/Chat/utils/toolCallParsing.d.ts +10 -68
  71. package/esm/src/book-components/Chat/utils/toolCallParsing.test.d.ts +1 -0
  72. package/esm/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +52 -0
  73. package/esm/src/book-components/Chat/utils/walletCredentialToolCall.test.d.ts +1 -0
  74. package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +14 -0
  75. package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -0
  76. package/esm/src/book-components/_common/MonacoEditorWithShadowDom.d.ts +17 -0
  77. package/esm/src/book-components/icons/ArrowIcon.d.ts +30 -5
  78. package/esm/src/book-components/icons/SolidArrowButton.d.ts +28 -0
  79. package/esm/src/book-components/icons/StopIcon.d.ts +8 -0
  80. package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tag.d.ts +14 -0
  81. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +14 -0
  82. package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +14 -0
  83. package/esm/src/cli/cli-commands/coder/run.d.ts +14 -0
  84. package/esm/src/cli/cli-commands/coder/verify.d.ts +14 -0
  85. package/esm/src/cli/cli-commands/coder.d.ts +21 -0
  86. package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +59 -0
  87. package/esm/src/collection/agent-collection/CreateAgentInput.test.d.ts +1 -0
  88. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +52 -8
  89. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
  90. package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +36 -0
  91. package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -3
  92. package/esm/src/commitments/MEMORY/MEMORY.d.ts +4 -59
  93. package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +11 -0
  94. package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +149 -0
  95. package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +6 -0
  96. package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +8 -0
  97. package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +14 -0
  98. package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +6 -0
  99. package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  100. package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +7 -0
  101. package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +61 -0
  102. package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +8 -0
  103. package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +13 -0
  104. package/esm/src/commitments/MESSAGE/InternalMessageCommitmentDefinition.d.ts +33 -0
  105. package/esm/src/commitments/MESSAGE/MESSAGE.d.ts +2 -2
  106. package/esm/src/commitments/META/META.d.ts +4 -0
  107. package/esm/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +33 -0
  108. package/esm/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +33 -0
  109. package/esm/src/commitments/META_VOICE/META_VOICE.d.ts +39 -0
  110. package/esm/src/commitments/SAMPLE/SAMPLE.d.ts +13 -13
  111. package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +1 -1
  112. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +10 -0
  113. package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +1 -0
  114. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +4 -11
  115. package/esm/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +1 -0
  116. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +21 -0
  117. package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +1 -0
  118. package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +2 -7
  119. package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +49 -0
  120. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +39 -0
  121. package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.test.d.ts +1 -0
  122. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +42 -0
  123. package/esm/src/commitments/USE_PROJECT/USE_PROJECT.test.d.ts +1 -0
  124. package/esm/src/commitments/USE_PROJECT/UseProjectToolNames.d.ts +13 -0
  125. package/esm/src/commitments/USE_PROJECT/UseProjectWallet.d.ts +9 -0
  126. package/esm/src/commitments/USE_PROJECT/callGitHubApi.d.ts +69 -0
  127. package/esm/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +8 -0
  128. package/esm/src/commitments/USE_PROJECT/createUseProjectTools.d.ts +7 -0
  129. package/esm/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +7 -0
  130. package/esm/src/commitments/USE_PROJECT/normalizeConfiguredProjects.d.ts +16 -0
  131. package/esm/src/commitments/USE_PROJECT/normalizeOptionalToolText.d.ts +12 -0
  132. package/esm/src/commitments/USE_PROJECT/projectReference.d.ts +52 -0
  133. package/esm/src/commitments/USE_PROJECT/projectReference.test.d.ts +1 -0
  134. package/esm/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +34 -0
  135. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +41 -0
  136. package/esm/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +1 -0
  137. package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +9 -0
  138. package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +12 -0
  139. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +9 -0
  140. package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +90 -0
  141. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +41 -0
  142. package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +1 -0
  143. package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +6 -0
  144. package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +8 -0
  145. package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +7 -0
  146. package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  147. package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +34 -0
  148. package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +8 -0
  149. package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +13 -0
  150. package/esm/src/commitments/WALLET/WALLET.d.ts +24 -0
  151. package/esm/src/commitments/WALLET/WALLET.test.d.ts +1 -0
  152. package/esm/src/commitments/WALLET/WalletToolNames.d.ts +12 -0
  153. package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +163 -0
  154. package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +6 -0
  155. package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +8 -0
  156. package/esm/src/commitments/WALLET/createWalletTools.d.ts +7 -0
  157. package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +6 -0
  158. package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +16 -0
  159. package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +7 -0
  160. package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +51 -0
  161. package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +8 -0
  162. package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +13 -0
  163. package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +29 -0
  164. package/esm/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +29 -0
  165. package/esm/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
  166. package/esm/src/commitments/_base/CommitmentDefinition.d.ts +23 -0
  167. package/esm/src/commitments/_common/createWritingCommitmentSections.d.ts +19 -0
  168. package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.writing.test.d.ts +1 -0
  169. package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +22 -0
  170. package/esm/src/commitments/_common/toolRuntimeContext.d.ts +90 -0
  171. package/esm/src/commitments/index.d.ts +12 -1
  172. package/esm/src/config.d.ts +3 -0
  173. package/esm/src/errors/0-index.d.ts +3 -0
  174. package/esm/src/errors/ConflictError.d.ts +9 -0
  175. package/esm/src/execution/LlmExecutionTools.d.ts +12 -1
  176. package/esm/src/execution/Usage.d.ts +4 -0
  177. package/esm/src/execution/utils/usageToHuman.d.ts +1 -0
  178. package/esm/src/file-security-checkers/FileSecurityCheckResult.d.ts +32 -0
  179. package/esm/src/file-security-checkers/FileSecurityChecker.d.ts +34 -0
  180. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +36 -0
  181. package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.test.d.ts +1 -0
  182. package/esm/src/llm-providers/agent/Agent.d.ts +2 -2
  183. package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -2
  184. package/esm/src/llm-providers/agent/RemoteAgent.d.ts +2 -1
  185. package/esm/src/llm-providers/agent/self-learning/SelfLearningManager.test.d.ts +1 -0
  186. package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +3 -1
  187. package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +33 -3
  188. package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
  189. package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +2 -2
  190. package/esm/src/llm-providers/openai/computeOpenAiUsage.d.ts +3 -1
  191. package/esm/src/playground/playground.d.ts +1 -0
  192. package/esm/src/speech-recognition/OpenAiSpeechRecognition.d.ts +49 -1
  193. package/esm/src/types/SpeechRecognition.d.ts +14 -0
  194. package/esm/src/types/ToolCall.d.ts +56 -0
  195. package/esm/src/types/number_usd.d.ts +110 -0
  196. package/esm/src/types/string_filename.d.ts +39 -0
  197. package/esm/src/types/string_knowledge_source_content.d.ts +29 -0
  198. package/esm/src/types/string_markdown.d.ts +138 -0
  199. package/esm/src/types/string_parameter_name.d.ts +170 -0
  200. package/esm/src/types/string_person_fullname.d.ts +85 -0
  201. package/esm/src/types/string_sha256.d.ts +44 -0
  202. package/esm/src/types/string_token.d.ts +58 -0
  203. package/esm/src/types/string_url.d.ts +146 -0
  204. package/esm/src/types/typeAliases.d.ts +9 -741
  205. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +10 -0
  206. package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +14 -0
  207. package/esm/src/utils/chat/chatAttachments/appendChatContextSections.d.ts +6 -0
  208. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +9 -0
  209. package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +9 -0
  210. package/esm/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +11 -0
  211. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +11 -0
  212. package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +10 -0
  213. package/esm/src/utils/chat/chatAttachments.d.ts +54 -0
  214. package/esm/src/utils/chat/chatAttachments.test.d.ts +1 -0
  215. package/esm/src/utils/chat/constants.d.ts +21 -0
  216. package/esm/src/utils/chat/decodeChatStreamWhitespaceFromTransport.d.ts +7 -0
  217. package/esm/src/utils/chat/encodeChatStreamWhitespaceForTransport.d.ts +7 -0
  218. package/esm/src/utils/chat/escapeRegExp.d.ts +6 -0
  219. package/esm/src/utils/database/uniqueConstraint.d.ts +28 -0
  220. package/esm/src/utils/files/decodeAttachmentAsText.d.ts +81 -0
  221. package/esm/src/utils/files/decodeAttachmentAsText.test.d.ts +1 -0
  222. package/esm/src/utils/files/readResponseBytes.d.ts +14 -0
  223. package/esm/src/utils/random/EnglishNamePool.d.ts +9 -1
  224. package/esm/src/utils/toolCalls/getToolCallIdentity.d.ts +1 -1
  225. package/esm/src/utils/toolCalls/mergeToolCalls.d.ts +12 -0
  226. package/esm/src/utils/toolCalls/resolveToolCallIdempotencyKey.d.ts +10 -0
  227. package/esm/src/utils/validators/url/extractUrlsFromText.d.ts +8 -0
  228. package/esm/src/utils/validators/url/extractUrlsFromText.test.d.ts +1 -0
  229. package/esm/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +12 -1
  230. package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +8 -2
  231. package/esm/src/utils/validators/url/normalizeDomainForMatching.d.ts +11 -0
  232. package/esm/src/utils/validators/url/normalizeDomainForMatching.test.d.ts +1 -0
  233. package/esm/src/version.d.ts +1 -1
  234. package/package.json +2 -2
  235. package/umd/index.umd.js +14 -7
  236. package/umd/index.umd.js.map +1 -1
  237. package/umd/src/_packages/components.index.d.ts +2 -0
  238. package/umd/src/_packages/core.index.d.ts +26 -0
  239. package/umd/src/_packages/markdown-utils.index.d.ts +5 -5
  240. package/umd/src/_packages/types.index.d.ts +250 -228
  241. package/umd/src/_packages/utils.index.d.ts +2 -0
  242. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +4 -1
  243. package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -1
  244. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +2 -2
  245. package/umd/src/book-2.0/agent-source/createAgentModelRequirements.writing.test.d.ts +1 -0
  246. package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.knowledge.test.d.ts +1 -0
  247. package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +12 -0
  248. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +12 -0
  249. package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.test.d.ts +1 -0
  250. package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +38 -0
  251. package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +3 -0
  252. package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.title.test.d.ts +1 -0
  253. package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +110 -0
  254. package/umd/src/book-2.0/agent-source/removeCommentsFromSystemMessage.d.ts +2 -2
  255. package/umd/src/book-components/BookEditor/BookEditor.d.ts +15 -0
  256. package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +2 -0
  257. package/umd/src/book-components/BookEditor/BookEditorMonacoConstants.d.ts +1 -0
  258. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +14 -7
  259. package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.test.d.ts +1 -0
  260. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +28 -0
  261. package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.test.d.ts +1 -0
  262. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +27 -0
  263. package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.test.d.ts +1 -0
  264. package/umd/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
  265. package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +1 -0
  266. package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +2 -0
  267. package/umd/src/book-components/Chat/Chat/ChatInputArea.test.d.ts +2 -0
  268. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +6 -1
  269. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +3 -0
  270. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +56 -0
  271. package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +11 -0
  272. package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +32 -0
  273. package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +41 -0
  274. package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +44 -0
  275. package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +36 -0
  276. package/umd/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +5 -0
  277. package/umd/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.d.ts +18 -0
  278. package/umd/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.test.d.ts +1 -0
  279. package/umd/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +16 -0
  280. package/umd/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +1 -1
  281. package/umd/src/book-components/Chat/hooks/useChatAutoScroll.test.d.ts +1 -0
  282. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
  283. package/umd/src/book-components/Chat/utils/ChatPersistence.d.ts +16 -0
  284. package/umd/src/book-components/Chat/utils/ChatPersistence.test.d.ts +4 -0
  285. package/umd/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +2 -2
  286. package/umd/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -5
  287. package/umd/src/book-components/Chat/utils/parseMessageButtons.test.d.ts +1 -0
  288. package/umd/src/book-components/Chat/utils/resolveToolCallFromChatMessages.d.ts +13 -0
  289. package/umd/src/book-components/Chat/utils/resolveToolCallState.d.ts +10 -0
  290. package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +29 -1
  291. package/umd/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +16 -3
  292. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +24 -0
  293. package/umd/src/book-components/Chat/utils/thinkingMessageVariants.test.d.ts +1 -0
  294. package/umd/src/book-components/Chat/utils/toolCallParsing/RunBrowserToolResult.d.ts +50 -0
  295. package/umd/src/book-components/Chat/utils/toolCallParsing/TeamToolResult.d.ts +30 -0
  296. package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +19 -0
  297. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +9 -0
  298. package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +9 -0
  299. package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +10 -0
  300. package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +10 -0
  301. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +10 -0
  302. package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +10 -0
  303. package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +8 -0
  304. package/umd/src/book-components/Chat/utils/toolCallParsing.d.ts +10 -68
  305. package/umd/src/book-components/Chat/utils/toolCallParsing.test.d.ts +1 -0
  306. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +52 -0
  307. package/umd/src/book-components/Chat/utils/walletCredentialToolCall.test.d.ts +1 -0
  308. package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +14 -0
  309. package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -0
  310. package/umd/src/book-components/_common/MonacoEditorWithShadowDom.d.ts +17 -0
  311. package/umd/src/book-components/icons/ArrowIcon.d.ts +30 -5
  312. package/umd/src/book-components/icons/SolidArrowButton.d.ts +28 -0
  313. package/umd/src/book-components/icons/StopIcon.d.ts +8 -0
  314. package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tag.d.ts +14 -0
  315. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +14 -0
  316. package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +14 -0
  317. package/umd/src/cli/cli-commands/coder/run.d.ts +14 -0
  318. package/umd/src/cli/cli-commands/coder/verify.d.ts +14 -0
  319. package/umd/src/cli/cli-commands/coder.d.ts +21 -0
  320. package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +59 -0
  321. package/umd/src/collection/agent-collection/CreateAgentInput.test.d.ts +1 -0
  322. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +52 -8
  323. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
  324. package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +36 -0
  325. package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -3
  326. package/umd/src/commitments/MEMORY/MEMORY.d.ts +4 -59
  327. package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +11 -0
  328. package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +149 -0
  329. package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +6 -0
  330. package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +8 -0
  331. package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +14 -0
  332. package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +6 -0
  333. package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  334. package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +7 -0
  335. package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +61 -0
  336. package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +8 -0
  337. package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +13 -0
  338. package/umd/src/commitments/MESSAGE/InternalMessageCommitmentDefinition.d.ts +33 -0
  339. package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +2 -2
  340. package/umd/src/commitments/META/META.d.ts +4 -0
  341. package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +33 -0
  342. package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +33 -0
  343. package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +39 -0
  344. package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +13 -13
  345. package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +1 -1
  346. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +10 -0
  347. package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +1 -0
  348. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +4 -11
  349. package/umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +1 -0
  350. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +21 -0
  351. package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +1 -0
  352. package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +2 -7
  353. package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +49 -0
  354. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +39 -0
  355. package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.test.d.ts +1 -0
  356. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +42 -0
  357. package/umd/src/commitments/USE_PROJECT/USE_PROJECT.test.d.ts +1 -0
  358. package/umd/src/commitments/USE_PROJECT/UseProjectToolNames.d.ts +13 -0
  359. package/umd/src/commitments/USE_PROJECT/UseProjectWallet.d.ts +9 -0
  360. package/umd/src/commitments/USE_PROJECT/callGitHubApi.d.ts +69 -0
  361. package/umd/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +8 -0
  362. package/umd/src/commitments/USE_PROJECT/createUseProjectTools.d.ts +7 -0
  363. package/umd/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +7 -0
  364. package/umd/src/commitments/USE_PROJECT/normalizeConfiguredProjects.d.ts +16 -0
  365. package/umd/src/commitments/USE_PROJECT/normalizeOptionalToolText.d.ts +12 -0
  366. package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +52 -0
  367. package/umd/src/commitments/USE_PROJECT/projectReference.test.d.ts +1 -0
  368. package/umd/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +34 -0
  369. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +41 -0
  370. package/umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +1 -0
  371. package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +9 -0
  372. package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +12 -0
  373. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +9 -0
  374. package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +90 -0
  375. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +41 -0
  376. package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +1 -0
  377. package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +6 -0
  378. package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +8 -0
  379. package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +7 -0
  380. package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
  381. package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +34 -0
  382. package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +8 -0
  383. package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +13 -0
  384. package/umd/src/commitments/WALLET/WALLET.d.ts +24 -0
  385. package/umd/src/commitments/WALLET/WALLET.test.d.ts +1 -0
  386. package/umd/src/commitments/WALLET/WalletToolNames.d.ts +12 -0
  387. package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +163 -0
  388. package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +6 -0
  389. package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +8 -0
  390. package/umd/src/commitments/WALLET/createWalletTools.d.ts +7 -0
  391. package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +6 -0
  392. package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +16 -0
  393. package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +7 -0
  394. package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +51 -0
  395. package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +8 -0
  396. package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +13 -0
  397. package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +29 -0
  398. package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +29 -0
  399. package/umd/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
  400. package/umd/src/commitments/_base/CommitmentDefinition.d.ts +23 -0
  401. package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +19 -0
  402. package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.writing.test.d.ts +1 -0
  403. package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +22 -0
  404. package/umd/src/commitments/_common/toolRuntimeContext.d.ts +90 -0
  405. package/umd/src/commitments/index.d.ts +12 -1
  406. package/umd/src/config.d.ts +3 -0
  407. package/umd/src/errors/0-index.d.ts +3 -0
  408. package/umd/src/errors/ConflictError.d.ts +9 -0
  409. package/umd/src/execution/LlmExecutionTools.d.ts +12 -1
  410. package/umd/src/execution/Usage.d.ts +4 -0
  411. package/umd/src/execution/utils/usageToHuman.d.ts +1 -0
  412. package/umd/src/file-security-checkers/FileSecurityCheckResult.d.ts +32 -0
  413. package/umd/src/file-security-checkers/FileSecurityChecker.d.ts +34 -0
  414. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +36 -0
  415. package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.test.d.ts +1 -0
  416. package/umd/src/llm-providers/agent/Agent.d.ts +2 -2
  417. package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -2
  418. package/umd/src/llm-providers/agent/RemoteAgent.d.ts +2 -1
  419. package/umd/src/llm-providers/agent/self-learning/SelfLearningManager.test.d.ts +1 -0
  420. package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +3 -1
  421. package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +33 -3
  422. package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
  423. package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +2 -2
  424. package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +3 -1
  425. package/umd/src/playground/playground.d.ts +1 -0
  426. package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +49 -1
  427. package/umd/src/types/SpeechRecognition.d.ts +14 -0
  428. package/umd/src/types/ToolCall.d.ts +56 -0
  429. package/umd/src/types/number_usd.d.ts +110 -0
  430. package/umd/src/types/string_filename.d.ts +39 -0
  431. package/umd/src/types/string_knowledge_source_content.d.ts +29 -0
  432. package/umd/src/types/string_markdown.d.ts +138 -0
  433. package/umd/src/types/string_parameter_name.d.ts +170 -0
  434. package/umd/src/types/string_person_fullname.d.ts +85 -0
  435. package/umd/src/types/string_sha256.d.ts +44 -0
  436. package/umd/src/types/string_token.d.ts +58 -0
  437. package/umd/src/types/string_url.d.ts +146 -0
  438. package/umd/src/types/typeAliases.d.ts +9 -741
  439. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +10 -0
  440. package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +14 -0
  441. package/umd/src/utils/chat/chatAttachments/appendChatContextSections.d.ts +6 -0
  442. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +9 -0
  443. package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +9 -0
  444. package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +11 -0
  445. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +11 -0
  446. package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +10 -0
  447. package/umd/src/utils/chat/chatAttachments.d.ts +54 -0
  448. package/umd/src/utils/chat/chatAttachments.test.d.ts +1 -0
  449. package/umd/src/utils/chat/constants.d.ts +21 -0
  450. package/umd/src/utils/chat/decodeChatStreamWhitespaceFromTransport.d.ts +7 -0
  451. package/umd/src/utils/chat/encodeChatStreamWhitespaceForTransport.d.ts +7 -0
  452. package/umd/src/utils/chat/escapeRegExp.d.ts +6 -0
  453. package/umd/src/utils/database/uniqueConstraint.d.ts +28 -0
  454. package/umd/src/utils/files/decodeAttachmentAsText.d.ts +81 -0
  455. package/umd/src/utils/files/decodeAttachmentAsText.test.d.ts +1 -0
  456. package/umd/src/utils/files/readResponseBytes.d.ts +14 -0
  457. package/umd/src/utils/random/EnglishNamePool.d.ts +9 -1
  458. package/umd/src/utils/toolCalls/getToolCallIdentity.d.ts +1 -1
  459. package/umd/src/utils/toolCalls/mergeToolCalls.d.ts +12 -0
  460. package/umd/src/utils/toolCalls/resolveToolCallIdempotencyKey.d.ts +10 -0
  461. package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +8 -0
  462. package/umd/src/utils/validators/url/extractUrlsFromText.test.d.ts +1 -0
  463. package/umd/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +12 -1
  464. package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +8 -2
  465. package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +11 -0
  466. package/umd/src/utils/validators/url/normalizeDomainForMatching.test.d.ts +1 -0
  467. package/umd/src/version.d.ts +1 -1
@@ -19,17 +19,65 @@ export type OpenAiSpeechRecognitionOptions = {
19
19
  export declare class OpenAiSpeechRecognition implements SpeechRecognition {
20
20
  private readonly options;
21
21
  private mediaRecorder;
22
+ private mediaStream;
22
23
  private audioContext;
24
+ private mediaStreamSource;
23
25
  private analyser;
24
- private silenceTimeout;
26
+ private silenceCheckAnimationFrameId;
25
27
  private audioChunks;
26
28
  private callbacks;
27
29
  private _state;
30
+ private pendingStopDuringStart;
31
+ private isStopping;
32
+ private recordingStartedAt;
33
+ private lastSpeechDetectedAt;
34
+ private ambientNoiseLevel;
35
+ private voiceLevelMultiplier;
36
+ private silenceAutoStopDelayMs;
28
37
  get state(): SpeechRecognitionState;
29
38
  constructor(options?: OpenAiSpeechRecognitionOptions);
30
39
  $start(options?: SpeechRecognitionStartOptions): Promise<void>;
31
40
  $stop(): void;
32
41
  private transcribe;
42
+ /**
43
+ * Handles `MediaRecorder.onstop` by releasing audio resources and forwarding the clip to transcription.
44
+ *
45
+ * @param language Optional language hint for Whisper.
46
+ */
47
+ private handleRecorderStop;
48
+ /**
49
+ * Starts continuous silence detection and auto-stops recording shortly after speech ends.
50
+ */
51
+ private startSilenceDetection;
52
+ /**
53
+ * Stops the silence-detection animation loop.
54
+ */
55
+ private stopSilenceDetection;
56
+ /**
57
+ * Measures current voice intensity from the waveform (`0` silent .. `1` loud).
58
+ *
59
+ * @param sampleBuffer Buffer reused across animation frames.
60
+ * @returns RMS-based volume level.
61
+ */
62
+ private measureVoiceLevel;
63
+ /**
64
+ * Returns an adaptive speech threshold based on recently observed ambient noise.
65
+ */
66
+ private resolveAdaptiveVoiceThreshold;
67
+ /**
68
+ * Updates the rolling ambient noise estimate during silent frames.
69
+ *
70
+ * @param voiceLevel Observed frame loudness.
71
+ */
72
+ private updateAmbientNoiseLevel;
73
+ /**
74
+ * Releases browser audio resources so the microphone is fully freed for other apps.
75
+ */
76
+ private releaseRecordingResources;
77
+ /**
78
+ * Stops all microphone tracks if an active media stream exists.
79
+ */
80
+ private stopMediaStreamTracks;
33
81
  subscribe(callback: (event: SpeechRecognitionEvent) => void): () => void;
34
82
  private emit;
35
83
  }
@@ -1,4 +1,8 @@
1
1
  import type { string_language } from './typeAliases';
2
+ /**
3
+ * Stable speech-recognition error codes consumed by UI and telemetry.
4
+ */
5
+ export type SpeechRecognitionErrorCode = 'permission-denied' | 'audio-capture' | 'network' | 'no-speech' | 'aborted' | 'unsupported-browser' | 'unknown';
2
6
  /**
3
7
  * Interface for speech-to-text recognition
4
8
  *
@@ -36,6 +40,10 @@ export type SpeechRecognitionStartOptions = {
36
40
  * @default true
37
41
  */
38
42
  readonly interimResults?: boolean;
43
+ /**
44
+ * Enables a more sensitive profile for quiet speech.
45
+ */
46
+ readonly whisperMode?: boolean;
39
47
  };
40
48
  /**
41
49
  * Current state of the speech recognition
@@ -46,6 +54,8 @@ export type SpeechRecognitionState = 'IDLE' | 'STARTING' | 'RECORDING' | 'TRANSC
46
54
  */
47
55
  export type SpeechRecognitionEvent = {
48
56
  readonly type: 'START';
57
+ } | {
58
+ readonly type: 'TRANSCRIBING';
49
59
  } | {
50
60
  readonly type: 'RESULT';
51
61
  readonly text: string;
@@ -53,6 +63,10 @@ export type SpeechRecognitionEvent = {
53
63
  } | {
54
64
  readonly type: 'ERROR';
55
65
  readonly message: string;
66
+ readonly code?: SpeechRecognitionErrorCode;
67
+ readonly providerId?: string;
68
+ readonly canRetry?: boolean;
69
+ readonly canOpenBrowserSettings?: boolean;
56
70
  } | {
57
71
  readonly type: 'STOP';
58
72
  };
@@ -1,5 +1,45 @@
1
1
  import type { TODO_any } from '../utils/organization/TODO_any';
2
2
  import type { string_date_iso8601 } from './typeAliases';
3
+ /**
4
+ * Explicit lifecycle state of one tool call snapshot.
5
+ */
6
+ export type ToolCallState = 'PENDING' | 'PARTIAL' | 'COMPLETE' | 'ERROR';
7
+ /**
8
+ * Severity level attached to one tool-call log entry.
9
+ */
10
+ export type ToolCallLogLevel = 'info' | 'warning' | 'error';
11
+ /**
12
+ * Incremental log entry emitted while one tool call is running.
13
+ *
14
+ * These logs are designed to stream progressively so chat chips can expose
15
+ * partial details before the final result is available.
16
+ */
17
+ export type ToolCallLogEntry = {
18
+ /**
19
+ * Timestamp when this log entry was observed.
20
+ */
21
+ readonly createdAt?: string_date_iso8601;
22
+ /**
23
+ * Stable machine-friendly log kind such as `request`, `browser-action`, or `result`.
24
+ */
25
+ readonly kind?: string;
26
+ /**
27
+ * Severity level used by UI renderers.
28
+ */
29
+ readonly level?: ToolCallLogLevel;
30
+ /**
31
+ * Short human-readable title for the log row.
32
+ */
33
+ readonly title?: string;
34
+ /**
35
+ * Human-readable message associated with the log row.
36
+ */
37
+ readonly message?: string;
38
+ /**
39
+ * Optional structured payload for advanced/raw inspection.
40
+ */
41
+ readonly payload?: TODO_any;
42
+ };
3
43
  /**
4
44
  * Represents a single tool call with its inputs, outputs, and timing.
5
45
  *
@@ -22,6 +62,18 @@ export type ToolCall = {
22
62
  * Raw tool call payload from the model.
23
63
  */
24
64
  readonly rawToolCall?: TODO_any;
65
+ /**
66
+ * Explicit lifecycle state of this tool call snapshot.
67
+ *
68
+ * When omitted, consumers should infer the state from available result/error data.
69
+ */
70
+ readonly state?: ToolCallState;
71
+ /**
72
+ * Idempotency identifier that should not change between partial updates of the same tool call.
73
+ *
74
+ * @public exported from `@promptbook/types`
75
+ */
76
+ readonly idempotencyKey?: string;
25
77
  /**
26
78
  * Timestamp when the tool call was initiated.
27
79
  */
@@ -34,6 +86,10 @@ export type ToolCall = {
34
86
  * Warnings reported during tool execution.
35
87
  */
36
88
  readonly warnings?: ReadonlyArray<TODO_any>;
89
+ /**
90
+ * Incremental logs observed while the tool call is running.
91
+ */
92
+ readonly logs?: ReadonlyArray<ToolCallLogEntry>;
37
93
  };
38
94
  /**
39
95
  * Breakdown of teacher-learned commitment categories for self-learning.
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Semantic helper for US Dollars
3
+ */
4
+ export type number_usd = number;
5
+ /**
6
+ * Semantic helper for incremental IDs
7
+ */
8
+ export type number_id = number_integer & (number_positive | 0);
9
+ /**
10
+ * Semantic helper for number of rows and columns
11
+ */
12
+ export type number_linecol_number = number_integer & number_positive;
13
+ /**
14
+ * Semantic helper for number of tokens
15
+ */
16
+ export type number_tokens = number_integer & (number_positive | 0);
17
+ /**
18
+ * Positive number helper.
19
+ */
20
+ export type number_positive = number;
21
+ /**
22
+ * Negative number helper.
23
+ */
24
+ export type number_negative = number;
25
+ /**
26
+ * Integer number helper.
27
+ */
28
+ export type number_integer = number;
29
+ /**
30
+ * TCP/UDP port helper.
31
+ */
32
+ export type number_port = number_positive & number_integer;
33
+ /**
34
+ * Semantic helper;
35
+ * Percentage from 0 to 1 (100%) (and below and above)
36
+ */
37
+ export type number_percent = number;
38
+ /**
39
+ * Semantic helper;
40
+ * Model temperature
41
+ */
42
+ export type number_model_temperature = number_percent;
43
+ /**
44
+ * Semantic helper;
45
+ * Seed for random generator
46
+ *
47
+ * Percentage from 0 to 1 (100%)
48
+ * TODO: Is seed (in OpenAI) number from 0 to 1?
49
+ */
50
+ export type number_seed = number_percent;
51
+ /**
52
+ * Likeness of the wallpaper
53
+ *
54
+ * - 👍 is equivalent to 1
55
+ * - 👎 is equivalent to -1
56
+ * - ❤ is equivalent to more than 1
57
+ */
58
+ export type number_likeness = number;
59
+ /**
60
+ * Milliseconds helper.
61
+ */
62
+ export type number_milliseconds = number_integer;
63
+ /**
64
+ * Seconds helper.
65
+ */
66
+ export type number_seconds = number;
67
+ /**
68
+ * Minutes helper.
69
+ */
70
+ export type number_minutes = number;
71
+ /**
72
+ * Hours helper.
73
+ */
74
+ export type number_hours = number;
75
+ /**
76
+ * Days helper.
77
+ */
78
+ export type number_days = number;
79
+ /**
80
+ * Weeks helper.
81
+ */
82
+ export type number_weeks = number;
83
+ /**
84
+ * Months helper.
85
+ */
86
+ export type number_months = number;
87
+ /**
88
+ * Years helper.
89
+ */
90
+ export type number_years = number;
91
+ /**
92
+ * Byte count helper.
93
+ */
94
+ export type number_bytes = number_integer & number_positive;
95
+ /**
96
+ * Kilobyte count helper.
97
+ */
98
+ export type number_kilobytes = number_positive;
99
+ /**
100
+ * Megabyte count helper.
101
+ */
102
+ export type number_megabytes = number_positive;
103
+ /**
104
+ * Gigabyte count helper.
105
+ */
106
+ export type number_gigabytes = number_positive;
107
+ /**
108
+ * Terabyte count helper.
109
+ */
110
+ export type number_terabytes = number_positive;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Semantic helper
3
+ *
4
+ * For example `"C:/Users/me/work/collboard/modules-sdk/src/colldev/commands/develop/ColldevDevelop.tsx"`
5
+ */
6
+ export type string_absolute_filename = string;
7
+ /**
8
+ * Semantic helper
9
+ *
10
+ * For example `"./src/colldev/commands/develop/ColldevDevelop.tsx"`
11
+ */
12
+ export type string_relative_filename = string;
13
+ /**
14
+ * Semantic helper
15
+ */
16
+ export type string_filename = string_absolute_filename | string_relative_filename;
17
+ /**
18
+ * Semantic helper
19
+ *
20
+ * For example `"C:/Users/me/work/collboard/modules-sdk/src/colldev/commands/develop/ColldevDevelop.tsx"`
21
+ */
22
+ export type string_absolute_dirname = string;
23
+ /**
24
+ * Semantic helper
25
+ *
26
+ * For example `"./src/colldev/commands/develop/ColldevDevelop.tsx"`
27
+ */
28
+ export type string_relative_dirname = string;
29
+ /**
30
+ * Semantic helper
31
+ */
32
+ export type string_dirname = string_absolute_dirname | string_relative_dirname;
33
+ /**
34
+ * Semantic helper
35
+ *
36
+ * For example `"C:/Users/me/AppData/Local/Pandoc/pandoc.exe"`
37
+ * For example `"C:/Program Files/LibreOffice/program/swriter.exe"`
38
+ */
39
+ export type string_executable_path = string;
@@ -0,0 +1,29 @@
1
+ import type { string_filename } from './string_filename';
2
+ import type { string_markdown } from './string_markdown';
3
+ import type { string_url } from './string_url';
4
+ /**
5
+ * Source of one knowledge piece.
6
+ *
7
+ * It can be a link, a relative path to file or direct text content.
8
+ *
9
+ * For example `"https://pavolhejny.com/"`
10
+ * For example `"./pavol-hejny-cv.pdf"`
11
+ * For example `"Pavol Hejný has web https://pavolhejny.com/"`
12
+ * For example `"Pavol Hejný is web developer and creator of Promptbook and Collboard"`
13
+ *
14
+ * Note: Distinguishes between `string_knowledge_source_content` and `string_knowledge_source_link`:
15
+ * `string_knowledge_source_content` refers to the actual content or source of knowledge
16
+ * `string_knowledge_source_link` refers to a reference or link to the knowledge source
17
+ */
18
+ export type string_knowledge_source_content = string_knowledge_source_link | string_markdown;
19
+ /**
20
+ * One link to a knowledge source.
21
+ *
22
+ * It can be a URL or relative path.
23
+ *
24
+ * For example `"https://pavolhejny.com/"`
25
+ * For example `"./pavol-hejny-cv.pdf"`
26
+ *
27
+ * Note: string_knowledge_source_link refers to a reference or link to the knowledge source, while string_knowledge_source_content can be the link or the actual content.
28
+ */
29
+ export type string_knowledge_source_link = string_url | string_filename;
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Semantic helper
3
+ *
4
+ * For example `"<div>Hello World!</div>"`
5
+ */
6
+ export type string_html = string;
7
+ /**
8
+ * Semantic helper
9
+ *
10
+ * For example `"<foo>bar</foo>"`
11
+ *
12
+ *
13
+ * TODO: [🎞️] Probably use some object-based method for working with XMLs
14
+ */
15
+ export type string_xml = string;
16
+ /**
17
+ * Semantic helper
18
+ *
19
+ * For example `"**Hello** World!"`
20
+ *
21
+ * @public exported from `@promptbook/markdown-utils`
22
+ */
23
+ export type string_markdown = string;
24
+ /**
25
+ * Semantic helper
26
+ *
27
+ * Markdown text with exactly ONE heading on first line NO less NO more
28
+ *
29
+ * @public exported from `@promptbook/markdown-utils`
30
+ */
31
+ export type string_markdown_section = string;
32
+ /**
33
+ * Semantic helper
34
+ *
35
+ * Markdown without any headings like h1, h2
36
+ * BUT with formatting, lists, blockquotes, blocks, etc. is allowed
37
+ *
38
+ * @public exported from `@promptbook/markdown-utils`
39
+ */
40
+ export type string_markdown_section_content = string;
41
+ /**
42
+ * Semantic helper
43
+ *
44
+ * Markdown text without any structure like h1, h2, lists, blockquotes, blocks, etc.
45
+ * BUT with bold, italic, etc. is allowed
46
+ *
47
+ * For example `"**Hello** World!"`
48
+ *
49
+ * @public exported from `@promptbook/markdown-utils`
50
+ */
51
+ export type string_markdown_text = string;
52
+ /**
53
+ * Semantic helper
54
+ *
55
+ * Markdown code block language
56
+ *
57
+ * For example ```js -> `"js"`
58
+ *
59
+ * @public exported from `@promptbook/markdown-utils`
60
+ */
61
+ export type string_markdown_codeblock_language = 'book' | 'markdown' | 'text' | 'javascript' | 'css' | 'json';
62
+ /**
63
+ * A URL pointing to Promptbook documentation or a specific discussion.
64
+ *
65
+ * For example: `https://github.com/webgptorg/promptbook/discussions/123`
66
+ */
67
+ export type string_promptbook_documentation_url = `https://github.com/webgptorg/promptbook/discussions/${number | `@@${string}`}`;
68
+ /**
69
+ * Semantic helper
70
+ *
71
+ * For example `.foo{border: 1px solid red}`
72
+ */
73
+ export type string_css = string;
74
+ /**
75
+ * Semantic helper
76
+ *
77
+ * For example `"<svg><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /></svg>"`
78
+ */
79
+ export type string_svg = string;
80
+ /**
81
+ * Semantic helper
82
+ *
83
+ * For example `console.info("Hello World!")` or `print("Hello World!")`
84
+ */
85
+ export type string_script = string;
86
+ /**
87
+ * Semantic helper
88
+ *
89
+ * For example `console.info("Hello World!")`
90
+ */
91
+ export type string_javascript = string;
92
+ /**
93
+ * Semantic helper
94
+ *
95
+ * For example `console.info("Hello World!" as string)`
96
+ */
97
+ export type string_typescript = string;
98
+ /**
99
+ * Semantic helper for JSON strings
100
+ *
101
+ * Note: TType is a type of the JSON object inside the string
102
+ *
103
+ * For example `{"foo": "bar"}`
104
+ */
105
+ export type string_json<TType> = string & {
106
+ _type: 'string_json';
107
+ scheme: TType;
108
+ };
109
+ /**
110
+ * Semantic helper
111
+ *
112
+ * For example `menu`
113
+ */
114
+ export type string_css_class = string;
115
+ /**
116
+ * Semantic helper
117
+ *
118
+ * For example `border`
119
+ */
120
+ export type string_css_property = string;
121
+ /**
122
+ * Semantic helper
123
+ *
124
+ * For example `"Arial, sans-serif"`
125
+ */
126
+ export type string_fonts = string;
127
+ /**
128
+ * Semantic helper
129
+ *
130
+ * For example `13px`
131
+ */
132
+ export type string_css_value = string | number;
133
+ /**
134
+ * Semantic helper
135
+ *
136
+ * For example `.foo`
137
+ */
138
+ export type string_css_selector = string;
@@ -0,0 +1,170 @@
1
+ import type { TupleToUnion } from 'type-fest';
2
+ import { RESERVED_PARAMETER_NAMES } from '../constants';
3
+ import type { really_unknown } from '../utils/organization/really_unknown';
4
+ import { string_base_58, string_sha256 } from './string_sha256';
5
+ /**
6
+ * Semantic helper
7
+ */
8
+ export type string_business_category_name = 'restaurant' | 'grocery' | 'person' | 'conference' | string;
9
+ /**
10
+ * Semantic helper
11
+ *
12
+ * For example `"gpt-4"`
13
+ */
14
+ export type string_model_name = 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-16k-0613' | string;
15
+ /**
16
+ * Semantic helper
17
+ *
18
+ * For example `"How many eyes does a cat have?"`
19
+ */
20
+ export type string_prompt = string;
21
+ /**
22
+ * Semantic helper
23
+ *
24
+ * For example `"A cat wearing a hat"`
25
+ */
26
+ export type string_prompt_image = string;
27
+ /**
28
+ * Semantic helper
29
+ *
30
+ * For example `"A cat wearing a {item}"`
31
+ */
32
+ export type string_template = string;
33
+ /**
34
+ * Semantic helper
35
+ *
36
+ * For example `"How many hats does the cat wear?"`
37
+ */
38
+ export type string_text_prompt = string_prompt;
39
+ /**
40
+ * Semantic helper
41
+ *
42
+ * For example `"How many hats does the cat wear?"`
43
+ */
44
+ export type string_chat_prompt = string_text_prompt;
45
+ /**
46
+ * Semantic helper
47
+ *
48
+ * For example `"You are an AI assistant. You are here to help me with my work."`
49
+ */
50
+ export type string_system_message = string_text_prompt;
51
+ /**
52
+ * Semantic helper
53
+ *
54
+ * For example `"Following is a text about cats: Once upon a time there was a cat"`
55
+ */
56
+ export type string_completion_prompt = string_text_prompt;
57
+ /**
58
+ * Semantic helper
59
+ *
60
+ * For example `"index"` or `"explanation"`
61
+ * Always in kebab-case
62
+ */
63
+ export type string_page = 'index' | string;
64
+ /**
65
+ * Semantic helper
66
+ *
67
+ * For example `"a"`
68
+ */
69
+ export type string_char = string;
70
+ /**
71
+ * Semantic helper
72
+ * Unique identifier of anything
73
+ *
74
+ * For example `"ainautes"`
75
+ */
76
+ export type string_name = string;
77
+ /**
78
+ * Semantic helper
79
+ * Unique identifier of anything
80
+ *
81
+ * For example `"eventTitle"`
82
+ */
83
+ export type string_parameter_name = string_name;
84
+ /**
85
+ * Semantic helper
86
+ * Unique identifier of parameter
87
+ *
88
+ * For example `"DevConf 2024"`
89
+ */
90
+ export type string_parameter_value = string;
91
+ /**
92
+ * Parameters of the pipeline
93
+ *
94
+ * There are three types of parameters:
95
+ * - **INPUT PARAMETERs** are required to execute the pipeline.
96
+ * - **Intermediate parameters** are used internally in the pipeline.
97
+ * - **OUTPUT PARAMETERs** are not used internally in the pipeline, but are returned as the result of the pipeline execution.
98
+ *
99
+ * Note: [🚉] This is fully serializable as JSON
100
+ * @see https://ptbk.io/parameters
101
+ */
102
+ export type Parameters = Exclude<Record<string_parameter_name, string_parameter_value>, ReservedParameters>;
103
+ /**
104
+ * Parameters to pass to execution of the pipeline
105
+ *
106
+ * Note: [🚉] This should be fully serializable as JSON
107
+ * @see https://ptbk.io/parameters
108
+ */
109
+ export type InputParameters = Exclude<Record<string_parameter_name, really_unknown>, ReservedParameters>;
110
+ /**
111
+ * Semantic helper
112
+ * Unique identifier of reserved parameter
113
+ *
114
+ * For example `"context"`
115
+ */
116
+ export type string_reserved_parameter_name = TupleToUnion<typeof RESERVED_PARAMETER_NAMES>;
117
+ /**
118
+ * Represents a mapping of reserved parameter names to their values.
119
+ * Reserved parameters are used internally by the pipeline and should not be set by users.
120
+ *
121
+ * Note: [🚉] This is fully serializable as JSON
122
+ */
123
+ export type ReservedParameters = Record<string_reserved_parameter_name, string_parameter_value>;
124
+ /**
125
+ * Semantic helper
126
+ * Title of anything
127
+ *
128
+ * For example `"Ai*nautes"`
129
+ */
130
+ export type string_title = string;
131
+ /**
132
+ * Semantic helper
133
+ *
134
+ * For example `"My AI Assistant"`
135
+ *
136
+ * TODO: !!!! Brand the type
137
+ */
138
+ export type string_agent_name = string;
139
+ /**
140
+ * Semantic helper
141
+ *
142
+ * For example `"My AI Assistant"`
143
+ */
144
+ export type string_agent_name_in_book = string;
145
+ /**
146
+ * Semantic helper
147
+ *
148
+ * For example `"b126926439c5fcb83609888a11283723c1ef137c0ad599a77a1be81812bd221d"`
149
+ */
150
+ export type string_agent_hash = string_sha256;
151
+ /**
152
+ * Semantic helper
153
+ *
154
+ * For example `"3mJr7AoUXx2Wqd"`
155
+ *
156
+ * TODO: !!!! Brand the type
157
+ */
158
+ export type string_agent_permanent_id = string_base_58;
159
+ /**
160
+ * Unstructured description of the persona
161
+ *
162
+ * For example `"Skilled copywriter"`
163
+ */
164
+ export type string_persona_description = string;
165
+ /**
166
+ * Unstructured description of the model
167
+ *
168
+ * For example `"Model with logical reasoning and creative mindset"`
169
+ */
170
+ export type string_model_description = string;