@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.
- package/esm/index.es.js +41 -23
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +2 -0
- package/esm/src/_packages/core.index.d.ts +26 -0
- package/esm/src/_packages/markdown-utils.index.d.ts +5 -5
- package/esm/src/_packages/types.index.d.ts +250 -228
- package/esm/src/_packages/utils.index.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +4 -1
- package/esm/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -1
- package/esm/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +2 -2
- package/esm/src/book-2.0/agent-source/createAgentModelRequirements.writing.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.knowledge.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/createTeamToolName.d.ts +12 -0
- package/esm/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +12 -0
- package/esm/src/book-2.0/agent-source/extractOpenTeacherInstructions.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +38 -0
- package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +3 -0
- package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.title.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +110 -0
- package/esm/src/book-2.0/agent-source/removeCommentsFromSystemMessage.d.ts +2 -2
- package/esm/src/book-components/BookEditor/BookEditor.d.ts +15 -0
- package/esm/src/book-components/BookEditor/BookEditorActionbar.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoConstants.d.ts +1 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +14 -7
- package/esm/src/book-components/BookEditor/BookEditorMonacoTokenization.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +27 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.test.d.ts +1 -0
- package/esm/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatActionsBar.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatInputArea.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +6 -1
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +3 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +56 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +11 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.test.d.ts +2 -0
- package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/chatCssClassNames.d.ts +41 -0
- package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +44 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +40 -0
- package/esm/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +5 -0
- package/esm/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.d.ts +18 -0
- package/esm/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.test.d.ts +1 -0
- package/esm/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +16 -0
- package/esm/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +1 -1
- package/esm/src/book-components/Chat/hooks/useChatAutoScroll.test.d.ts +1 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
- package/esm/src/book-components/Chat/utils/ChatPersistence.d.ts +16 -0
- package/esm/src/book-components/Chat/utils/ChatPersistence.test.d.ts +4 -0
- package/esm/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +2 -2
- package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.timeout.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -5
- package/esm/src/book-components/Chat/utils/parseMessageButtons.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/resolveToolCallFromChatMessages.d.ts +13 -0
- package/esm/src/book-components/Chat/utils/resolveToolCallState.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +29 -1
- package/esm/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +16 -3
- package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +24 -0
- package/esm/src/book-components/Chat/utils/thinkingMessageVariants.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +123 -0
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/RunBrowserToolResult.d.ts +50 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/TeamToolResult.d.ts +30 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +19 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +9 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +9 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +8 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing.d.ts +10 -68
- package/esm/src/book-components/Chat/utils/toolCallParsing.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +52 -0
- package/esm/src/book-components/Chat/utils/walletCredentialToolCall.test.d.ts +1 -0
- package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +14 -0
- package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -0
- package/esm/src/book-components/_common/MonacoEditorWithShadowDom.d.ts +17 -0
- package/esm/src/book-components/icons/ArrowIcon.d.ts +30 -5
- package/esm/src/book-components/icons/SolidArrowButton.d.ts +28 -0
- package/esm/src/book-components/icons/StopIcon.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tag.d.ts +14 -0
- package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +14 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +14 -0
- package/esm/src/cli/cli-commands/coder/run.d.ts +14 -0
- package/esm/src/cli/cli-commands/coder/verify.d.ts +14 -0
- package/esm/src/cli/cli-commands/coder.d.ts +21 -0
- package/esm/src/collection/agent-collection/CreateAgentInput.d.ts +59 -0
- package/esm/src/collection/agent-collection/CreateAgentInput.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +52 -8
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +36 -0
- package/esm/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -3
- package/esm/src/commitments/MEMORY/MEMORY.d.ts +4 -59
- package/esm/src/commitments/MEMORY/MemoryToolNames.d.ts +11 -0
- package/esm/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +149 -0
- package/esm/src/commitments/MEMORY/createMemorySystemMessage.d.ts +6 -0
- package/esm/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +8 -0
- package/esm/src/commitments/MEMORY/createMemoryTools.d.ts +14 -0
- package/esm/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +6 -0
- package/esm/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
- package/esm/src/commitments/MEMORY/getMemoryToolTitles.d.ts +7 -0
- package/esm/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +61 -0
- package/esm/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +8 -0
- package/esm/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +13 -0
- package/esm/src/commitments/MESSAGE/InternalMessageCommitmentDefinition.d.ts +33 -0
- package/esm/src/commitments/MESSAGE/MESSAGE.d.ts +2 -2
- package/esm/src/commitments/META/META.d.ts +4 -0
- package/esm/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +33 -0
- package/esm/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +33 -0
- package/esm/src/commitments/META_VOICE/META_VOICE.d.ts +39 -0
- package/esm/src/commitments/SAMPLE/SAMPLE.d.ts +13 -13
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +1 -1
- package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +10 -0
- package/esm/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +1 -0
- package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +42 -0
- package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.test.d.ts +1 -0
- package/esm/src/commitments/USE_CALENDAR/UseCalendarToolNames.d.ts +13 -0
- package/esm/src/commitments/USE_CALENDAR/UseCalendarWallet.d.ts +9 -0
- package/esm/src/commitments/USE_CALENDAR/calendarReference.d.ts +68 -0
- package/esm/src/commitments/USE_CALENDAR/callGoogleCalendarApi.d.ts +19 -0
- package/esm/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +8 -0
- package/esm/src/commitments/USE_CALENDAR/createUseCalendarTools.d.ts +7 -0
- package/esm/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +7 -0
- package/esm/src/commitments/USE_CALENDAR/normalizeConfiguredCalendars.d.ts +19 -0
- package/esm/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +34 -0
- package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +4 -11
- package/esm/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +1 -0
- package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +21 -0
- package/esm/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +1 -0
- package/esm/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +2 -7
- package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +49 -0
- package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +39 -0
- package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.test.d.ts +1 -0
- package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +42 -0
- package/esm/src/commitments/USE_PROJECT/USE_PROJECT.test.d.ts +1 -0
- package/esm/src/commitments/USE_PROJECT/UseProjectToolNames.d.ts +13 -0
- package/esm/src/commitments/USE_PROJECT/UseProjectWallet.d.ts +9 -0
- package/esm/src/commitments/USE_PROJECT/callGitHubApi.d.ts +69 -0
- package/esm/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +8 -0
- package/esm/src/commitments/USE_PROJECT/createUseProjectTools.d.ts +7 -0
- package/esm/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +7 -0
- package/esm/src/commitments/USE_PROJECT/normalizeConfiguredProjects.d.ts +16 -0
- package/esm/src/commitments/USE_PROJECT/normalizeOptionalToolText.d.ts +12 -0
- package/esm/src/commitments/USE_PROJECT/projectReference.d.ts +52 -0
- package/esm/src/commitments/USE_PROJECT/projectReference.test.d.ts +1 -0
- package/esm/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +34 -0
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +41 -0
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +1 -0
- package/esm/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +9 -0
- package/esm/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +12 -0
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +9 -0
- package/esm/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +90 -0
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +41 -0
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +1 -0
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +6 -0
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +8 -0
- package/esm/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +7 -0
- package/esm/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
- package/esm/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +34 -0
- package/esm/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +8 -0
- package/esm/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +13 -0
- package/esm/src/commitments/WALLET/WALLET.d.ts +24 -0
- package/esm/src/commitments/WALLET/WALLET.test.d.ts +1 -0
- package/esm/src/commitments/WALLET/WalletToolNames.d.ts +12 -0
- package/esm/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +163 -0
- package/esm/src/commitments/WALLET/createWalletSystemMessage.d.ts +6 -0
- package/esm/src/commitments/WALLET/createWalletToolFunctions.d.ts +8 -0
- package/esm/src/commitments/WALLET/createWalletTools.d.ts +7 -0
- package/esm/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +6 -0
- package/esm/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +16 -0
- package/esm/src/commitments/WALLET/getWalletToolTitles.d.ts +7 -0
- package/esm/src/commitments/WALLET/parseWalletToolArgs.d.ts +51 -0
- package/esm/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +8 -0
- package/esm/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +13 -0
- package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +29 -0
- package/esm/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +29 -0
- package/esm/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
- package/esm/src/commitments/_base/CommitmentDefinition.d.ts +23 -0
- package/esm/src/commitments/_common/createWritingCommitmentSections.d.ts +19 -0
- package/esm/src/commitments/_common/getGroupedCommitmentDefinitions.writing.test.d.ts +1 -0
- package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +22 -0
- package/esm/src/commitments/_common/toolRuntimeContext.d.ts +99 -0
- package/esm/src/commitments/index.d.ts +13 -1
- package/esm/src/config.d.ts +3 -0
- package/esm/src/errors/0-index.d.ts +3 -0
- package/esm/src/errors/ConflictError.d.ts +9 -0
- package/esm/src/executables/apps/locateVscode.d.ts +7 -0
- package/esm/src/executables/apps/locateVscode.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateBrowser.d.ts +10 -0
- package/esm/src/executables/browsers/locateBrowser.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateChrome.d.ts +7 -0
- package/esm/src/executables/browsers/locateChrome.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +10 -0
- package/esm/src/executables/browsers/locateDefaultSystemBrowser.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateEdge.d.ts +7 -0
- package/esm/src/executables/browsers/locateEdge.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateFirefox.d.ts +7 -0
- package/esm/src/executables/browsers/locateFirefox.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateInternetExplorer.d.ts +7 -0
- package/esm/src/executables/browsers/locateInternetExplorer.test.d.ts +1 -0
- package/esm/src/executables/browsers/locateSafari.d.ts +7 -0
- package/esm/src/execution/LlmExecutionTools.d.ts +12 -1
- package/esm/src/execution/Usage.d.ts +4 -0
- package/esm/src/execution/utils/usageToHuman.d.ts +1 -0
- package/esm/src/file-security-checkers/FileSecurityCheckResult.d.ts +32 -0
- package/esm/src/file-security-checkers/FileSecurityChecker.d.ts +34 -0
- package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +36 -0
- package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.test.d.ts +1 -0
- package/esm/src/llm-providers/agent/Agent.d.ts +2 -2
- package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -2
- package/esm/src/llm-providers/agent/RemoteAgent.d.ts +2 -1
- package/esm/src/llm-providers/agent/self-learning/SelfLearningManager.test.d.ts +1 -0
- package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +3 -1
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +33 -3
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
- package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +2 -2
- package/esm/src/llm-providers/openai/computeOpenAiUsage.d.ts +3 -1
- package/esm/src/playground/playground.d.ts +1 -0
- package/esm/src/speech-recognition/OpenAiSpeechRecognition.d.ts +49 -1
- package/esm/src/types/SpeechRecognition.d.ts +14 -0
- package/esm/src/types/ToolCall.d.ts +56 -0
- package/esm/src/types/number_usd.d.ts +110 -0
- package/esm/src/types/string_filename.d.ts +39 -0
- package/esm/src/types/string_knowledge_source_content.d.ts +29 -0
- package/esm/src/types/string_markdown.d.ts +138 -0
- package/esm/src/types/string_parameter_name.d.ts +170 -0
- package/esm/src/types/string_person_fullname.d.ts +85 -0
- package/esm/src/types/string_sha256.d.ts +44 -0
- package/esm/src/types/string_token.d.ts +58 -0
- package/esm/src/types/string_url.d.ts +146 -0
- package/esm/src/types/typeAliases.d.ts +9 -741
- package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +10 -0
- package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +14 -0
- package/esm/src/utils/chat/chatAttachments/appendChatContextSections.d.ts +6 -0
- package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +9 -0
- package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +9 -0
- package/esm/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +11 -0
- package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +11 -0
- package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +10 -0
- package/esm/src/utils/chat/chatAttachments.d.ts +54 -0
- package/esm/src/utils/chat/chatAttachments.test.d.ts +1 -0
- package/esm/src/utils/chat/constants.d.ts +21 -0
- package/esm/src/utils/chat/decodeChatStreamWhitespaceFromTransport.d.ts +7 -0
- package/esm/src/utils/chat/encodeChatStreamWhitespaceForTransport.d.ts +7 -0
- package/esm/src/utils/chat/escapeRegExp.d.ts +6 -0
- package/esm/src/utils/database/uniqueConstraint.d.ts +28 -0
- package/esm/src/utils/files/decodeAttachmentAsText.d.ts +81 -0
- package/esm/src/utils/files/decodeAttachmentAsText.test.d.ts +1 -0
- package/esm/src/utils/files/readResponseBytes.d.ts +14 -0
- package/esm/src/utils/random/EnglishNamePool.d.ts +9 -1
- package/esm/src/utils/toolCalls/getToolCallIdentity.d.ts +1 -1
- package/esm/src/utils/toolCalls/mergeToolCalls.d.ts +12 -0
- package/esm/src/utils/toolCalls/resolveToolCallIdempotencyKey.d.ts +10 -0
- package/esm/src/utils/validators/url/extractUrlsFromText.d.ts +8 -0
- package/esm/src/utils/validators/url/extractUrlsFromText.test.d.ts +1 -0
- package/esm/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +12 -1
- package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +8 -2
- package/esm/src/utils/validators/url/normalizeDomainForMatching.d.ts +11 -0
- package/esm/src/utils/validators/url/normalizeDomainForMatching.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +41 -22
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +2 -0
- package/umd/src/_packages/core.index.d.ts +26 -0
- package/umd/src/_packages/markdown-utils.index.d.ts +5 -5
- package/umd/src/_packages/types.index.d.ts +250 -228
- package/umd/src/_packages/utils.index.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +4 -1
- package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -1
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +2 -2
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.writing.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.knowledge.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +12 -0
- package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +12 -0
- package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +38 -0
- package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +3 -0
- package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.title.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +110 -0
- package/umd/src/book-2.0/agent-source/removeCommentsFromSystemMessage.d.ts +2 -2
- package/umd/src/book-components/BookEditor/BookEditor.d.ts +15 -0
- package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoConstants.d.ts +1 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.d.ts +14 -7
- package/umd/src/book-components/BookEditor/BookEditorMonacoTokenization.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +28 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +27 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.test.d.ts +1 -0
- package/umd/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatInputArea.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +6 -1
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +3 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +56 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +11 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.test.d.ts +2 -0
- package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +41 -0
- package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +44 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +40 -0
- package/umd/src/book-components/Chat/CodeBlock/CodeBlock.d.ts +5 -0
- package/umd/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.d.ts +18 -0
- package/umd/src/book-components/Chat/CodeBlock/resolveCodeBlockLanguage.test.d.ts +1 -0
- package/umd/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +16 -0
- package/umd/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +1 -1
- package/umd/src/book-components/Chat/hooks/useChatAutoScroll.test.d.ts +1 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +16 -0
- package/umd/src/book-components/Chat/utils/ChatPersistence.d.ts +16 -0
- package/umd/src/book-components/Chat/utils/ChatPersistence.test.d.ts +4 -0
- package/umd/src/book-components/Chat/utils/createTeamToolNameFromUrl.d.ts +2 -2
- package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.timeout.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -5
- package/umd/src/book-components/Chat/utils/parseMessageButtons.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/resolveToolCallFromChatMessages.d.ts +13 -0
- package/umd/src/book-components/Chat/utils/resolveToolCallState.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +29 -1
- package/umd/src/book-components/Chat/utils/splitMessageContentIntoSegments.d.ts +16 -3
- package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +24 -0
- package/umd/src/book-components/Chat/utils/thinkingMessageVariants.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +123 -0
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/RunBrowserToolResult.d.ts +50 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/TeamToolResult.d.ts +30 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +19 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +9 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +9 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +8 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing.d.ts +10 -68
- package/umd/src/book-components/Chat/utils/toolCallParsing.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +52 -0
- package/umd/src/book-components/Chat/utils/walletCredentialToolCall.test.d.ts +1 -0
- package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +14 -0
- package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -0
- package/umd/src/book-components/_common/MonacoEditorWithShadowDom.d.ts +17 -0
- package/umd/src/book-components/icons/ArrowIcon.d.ts +30 -5
- package/umd/src/book-components/icons/SolidArrowButton.d.ts +28 -0
- package/umd/src/book-components/icons/StopIcon.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tag.d.ts +14 -0
- package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +14 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +14 -0
- package/umd/src/cli/cli-commands/coder/run.d.ts +14 -0
- package/umd/src/cli/cli-commands/coder/verify.d.ts +14 -0
- package/umd/src/cli/cli-commands/coder.d.ts +21 -0
- package/umd/src/collection/agent-collection/CreateAgentInput.d.ts +59 -0
- package/umd/src/collection/agent-collection/CreateAgentInput.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +52 -8
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +6 -3
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/prepareAgentSourceForPersistence.d.ts +36 -0
- package/umd/src/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +0 -3
- package/umd/src/commitments/MEMORY/MEMORY.d.ts +4 -59
- package/umd/src/commitments/MEMORY/MemoryToolNames.d.ts +11 -0
- package/umd/src/commitments/MEMORY/MemoryToolRuntimeAdapter.d.ts +149 -0
- package/umd/src/commitments/MEMORY/createMemorySystemMessage.d.ts +6 -0
- package/umd/src/commitments/MEMORY/createMemoryToolFunctions.d.ts +8 -0
- package/umd/src/commitments/MEMORY/createMemoryTools.d.ts +14 -0
- package/umd/src/commitments/MEMORY/getMemoryCommitmentDocumentation.d.ts +6 -0
- package/umd/src/commitments/MEMORY/getMemoryToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
- package/umd/src/commitments/MEMORY/getMemoryToolTitles.d.ts +7 -0
- package/umd/src/commitments/MEMORY/parseMemoryToolArgs.d.ts +61 -0
- package/umd/src/commitments/MEMORY/resolveMemoryRuntimeContext.d.ts +8 -0
- package/umd/src/commitments/MEMORY/setMemoryToolRuntimeAdapter.d.ts +13 -0
- package/umd/src/commitments/MESSAGE/InternalMessageCommitmentDefinition.d.ts +33 -0
- package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +2 -2
- package/umd/src/commitments/META/META.d.ts +4 -0
- package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +33 -0
- package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +33 -0
- package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +39 -0
- package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +13 -13
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +1 -1
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.d.ts +10 -0
- package/umd/src/commitments/USE_BROWSER/resolveRunBrowserToolForNode.test.d.ts +1 -0
- package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +42 -0
- package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.test.d.ts +1 -0
- package/umd/src/commitments/USE_CALENDAR/UseCalendarToolNames.d.ts +13 -0
- package/umd/src/commitments/USE_CALENDAR/UseCalendarWallet.d.ts +9 -0
- package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +68 -0
- package/umd/src/commitments/USE_CALENDAR/callGoogleCalendarApi.d.ts +19 -0
- package/umd/src/commitments/USE_CALENDAR/createUseCalendarToolFunctions.d.ts +8 -0
- package/umd/src/commitments/USE_CALENDAR/createUseCalendarTools.d.ts +7 -0
- package/umd/src/commitments/USE_CALENDAR/getUseCalendarToolTitles.d.ts +7 -0
- package/umd/src/commitments/USE_CALENDAR/normalizeConfiguredCalendars.d.ts +19 -0
- package/umd/src/commitments/USE_CALENDAR/resolveUseCalendarToolRuntimeOrWalletCredentialResult.d.ts +34 -0
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +4 -11
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.test.d.ts +1 -0
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.d.ts +21 -0
- package/umd/src/commitments/USE_EMAIL/parseUseEmailCommitmentContent.test.d.ts +1 -0
- package/umd/src/commitments/USE_EMAIL/sendEmailViaBrowser.d.ts +2 -7
- package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +49 -0
- package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +39 -0
- package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.test.d.ts +1 -0
- package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +42 -0
- package/umd/src/commitments/USE_PROJECT/USE_PROJECT.test.d.ts +1 -0
- package/umd/src/commitments/USE_PROJECT/UseProjectToolNames.d.ts +13 -0
- package/umd/src/commitments/USE_PROJECT/UseProjectWallet.d.ts +9 -0
- package/umd/src/commitments/USE_PROJECT/callGitHubApi.d.ts +69 -0
- package/umd/src/commitments/USE_PROJECT/createUseProjectToolFunctions.d.ts +8 -0
- package/umd/src/commitments/USE_PROJECT/createUseProjectTools.d.ts +7 -0
- package/umd/src/commitments/USE_PROJECT/getUseProjectToolTitles.d.ts +7 -0
- package/umd/src/commitments/USE_PROJECT/normalizeConfiguredProjects.d.ts +16 -0
- package/umd/src/commitments/USE_PROJECT/normalizeOptionalToolText.d.ts +12 -0
- package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +52 -0
- package/umd/src/commitments/USE_PROJECT/projectReference.test.d.ts +1 -0
- package/umd/src/commitments/USE_PROJECT/resolveUseProjectToolRuntimeOrWalletCredentialResult.d.ts +34 -0
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +41 -0
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.test.d.ts +1 -0
- package/umd/src/commitments/USE_SPAWN/resolveSpawnAgentToolForNode.d.ts +9 -0
- package/umd/src/commitments/USE_SPAWN/spawnAgentViaBrowser.d.ts +12 -0
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolNames.d.ts +9 -0
- package/umd/src/commitments/USE_TIMEOUT/TimeoutToolRuntimeAdapter.d.ts +90 -0
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +41 -0
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.test.d.ts +1 -0
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutSystemMessage.d.ts +6 -0
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutToolFunctions.d.ts +8 -0
- package/umd/src/commitments/USE_TIMEOUT/createTimeoutTools.d.ts +7 -0
- package/umd/src/commitments/USE_TIMEOUT/getTimeoutToolRuntimeAdapterOrDisabledResult.d.ts +17 -0
- package/umd/src/commitments/USE_TIMEOUT/parseTimeoutToolArgs.d.ts +34 -0
- package/umd/src/commitments/USE_TIMEOUT/resolveTimeoutRuntimeContext.d.ts +8 -0
- package/umd/src/commitments/USE_TIMEOUT/setTimeoutToolRuntimeAdapter.d.ts +13 -0
- package/umd/src/commitments/WALLET/WALLET.d.ts +24 -0
- package/umd/src/commitments/WALLET/WALLET.test.d.ts +1 -0
- package/umd/src/commitments/WALLET/WalletToolNames.d.ts +12 -0
- package/umd/src/commitments/WALLET/WalletToolRuntimeAdapter.d.ts +163 -0
- package/umd/src/commitments/WALLET/createWalletSystemMessage.d.ts +6 -0
- package/umd/src/commitments/WALLET/createWalletToolFunctions.d.ts +8 -0
- package/umd/src/commitments/WALLET/createWalletTools.d.ts +7 -0
- package/umd/src/commitments/WALLET/getWalletCommitmentDocumentation.d.ts +6 -0
- package/umd/src/commitments/WALLET/getWalletToolRuntimeAdapterOrDisabledResult.d.ts +16 -0
- package/umd/src/commitments/WALLET/getWalletToolTitles.d.ts +7 -0
- package/umd/src/commitments/WALLET/parseWalletToolArgs.d.ts +51 -0
- package/umd/src/commitments/WALLET/resolveWalletRuntimeContext.d.ts +8 -0
- package/umd/src/commitments/WALLET/setWalletToolRuntimeAdapter.d.ts +13 -0
- package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +29 -0
- package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +29 -0
- package/umd/src/commitments/_base/BaseCommitmentDefinition.d.ts +12 -0
- package/umd/src/commitments/_base/CommitmentDefinition.d.ts +23 -0
- package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +19 -0
- package/umd/src/commitments/_common/getGroupedCommitmentDefinitions.writing.test.d.ts +1 -0
- package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +22 -0
- package/umd/src/commitments/_common/toolRuntimeContext.d.ts +99 -0
- package/umd/src/commitments/index.d.ts +13 -1
- package/umd/src/config.d.ts +3 -0
- package/umd/src/errors/0-index.d.ts +3 -0
- package/umd/src/errors/ConflictError.d.ts +9 -0
- package/umd/src/executables/apps/locateVscode.d.ts +7 -0
- package/umd/src/executables/apps/locateVscode.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateBrowser.d.ts +10 -0
- package/umd/src/executables/browsers/locateBrowser.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateChrome.d.ts +7 -0
- package/umd/src/executables/browsers/locateChrome.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +10 -0
- package/umd/src/executables/browsers/locateDefaultSystemBrowser.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateEdge.d.ts +7 -0
- package/umd/src/executables/browsers/locateEdge.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateFirefox.d.ts +7 -0
- package/umd/src/executables/browsers/locateFirefox.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateInternetExplorer.d.ts +7 -0
- package/umd/src/executables/browsers/locateInternetExplorer.test.d.ts +1 -0
- package/umd/src/executables/browsers/locateSafari.d.ts +7 -0
- package/umd/src/execution/LlmExecutionTools.d.ts +12 -1
- package/umd/src/execution/Usage.d.ts +4 -0
- package/umd/src/execution/utils/usageToHuman.d.ts +1 -0
- package/umd/src/file-security-checkers/FileSecurityCheckResult.d.ts +32 -0
- package/umd/src/file-security-checkers/FileSecurityChecker.d.ts +34 -0
- package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +36 -0
- package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.test.d.ts +1 -0
- package/umd/src/llm-providers/agent/Agent.d.ts +2 -2
- package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +2 -2
- package/umd/src/llm-providers/agent/RemoteAgent.d.ts +2 -1
- package/umd/src/llm-providers/agent/self-learning/SelfLearningManager.test.d.ts +1 -0
- package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +3 -1
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +33 -3
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +2 -2
- package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +2 -2
- package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +3 -1
- package/umd/src/playground/playground.d.ts +1 -0
- package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +49 -1
- package/umd/src/types/SpeechRecognition.d.ts +14 -0
- package/umd/src/types/ToolCall.d.ts +56 -0
- package/umd/src/types/number_usd.d.ts +110 -0
- package/umd/src/types/string_filename.d.ts +39 -0
- package/umd/src/types/string_knowledge_source_content.d.ts +29 -0
- package/umd/src/types/string_markdown.d.ts +138 -0
- package/umd/src/types/string_parameter_name.d.ts +170 -0
- package/umd/src/types/string_person_fullname.d.ts +85 -0
- package/umd/src/types/string_sha256.d.ts +44 -0
- package/umd/src/types/string_token.d.ts +58 -0
- package/umd/src/types/string_url.d.ts +146 -0
- package/umd/src/types/typeAliases.d.ts +9 -741
- package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +10 -0
- package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +14 -0
- package/umd/src/utils/chat/chatAttachments/appendChatContextSections.d.ts +6 -0
- package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +9 -0
- package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +9 -0
- package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +11 -0
- package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +11 -0
- package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +10 -0
- package/umd/src/utils/chat/chatAttachments.d.ts +54 -0
- package/umd/src/utils/chat/chatAttachments.test.d.ts +1 -0
- package/umd/src/utils/chat/constants.d.ts +21 -0
- package/umd/src/utils/chat/decodeChatStreamWhitespaceFromTransport.d.ts +7 -0
- package/umd/src/utils/chat/encodeChatStreamWhitespaceForTransport.d.ts +7 -0
- package/umd/src/utils/chat/escapeRegExp.d.ts +6 -0
- package/umd/src/utils/database/uniqueConstraint.d.ts +28 -0
- package/umd/src/utils/files/decodeAttachmentAsText.d.ts +81 -0
- package/umd/src/utils/files/decodeAttachmentAsText.test.d.ts +1 -0
- package/umd/src/utils/files/readResponseBytes.d.ts +14 -0
- package/umd/src/utils/random/EnglishNamePool.d.ts +9 -1
- package/umd/src/utils/toolCalls/getToolCallIdentity.d.ts +1 -1
- package/umd/src/utils/toolCalls/mergeToolCalls.d.ts +12 -0
- package/umd/src/utils/toolCalls/resolveToolCallIdempotencyKey.d.ts +10 -0
- package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +8 -0
- package/umd/src/utils/validators/url/extractUrlsFromText.test.d.ts +1 -0
- package/umd/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +12 -1
- package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +8 -2
- package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +11 -0
- package/umd/src/utils/validators/url/normalizeDomainForMatching.test.d.ts +1 -0
- 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,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,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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
|
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[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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}
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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.
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-11`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
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.
|
|
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')}
|
|
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
|
|
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}
|
|
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;
|