@promptbook/browser 0.112.0-31 → 0.112.0-34
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 +112 -64
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +6 -0
- package/esm/src/_packages/types.index.d.ts +55 -49
- package/esm/src/book-2.0/agent-source/AgentReferenceResolver.d.ts +11 -0
- package/esm/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +8 -0
- package/esm/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +33 -0
- package/esm/src/book-2.0/agent-source/createTeamToolName.d.ts +7 -7
- package/esm/src/book-components/Chat/Chat/ChatActionsBar.d.ts +5 -0
- package/esm/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +42 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +18 -15
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.test.d.ts +1 -1
- package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +14 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +290 -0
- package/esm/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +16 -0
- package/esm/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +33 -0
- package/esm/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
- package/esm/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
- package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +4 -0
- package/esm/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +26 -0
- package/esm/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +31 -0
- package/esm/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +31 -0
- package/esm/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +31 -0
- package/esm/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +38 -0
- package/esm/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +38 -0
- package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +46 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +33 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +10 -1
- package/esm/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +29 -0
- package/esm/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +26 -0
- package/esm/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +9 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +76 -0
- package/esm/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
- package/esm/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -1
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.test.d.ts +2 -0
- package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +18 -0
- package/esm/src/book-components/Chat/hooks/useChatCompleteNotification.test.d.ts +2 -0
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +77 -1
- package/esm/src/book-components/Chat/utils/formatToolCallDateTime.d.ts +37 -0
- package/esm/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +11 -0
- package/esm/src/book-components/Chat/utils/formatToolCallTranslationTemplate.d.ts +10 -0
- package/esm/src/book-components/Chat/utils/getChatMessageTimingDisplay.d.ts +5 -1
- package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.d.ts +26 -1
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +26 -3
- package/esm/src/cli/$runPromptbookCli.d.ts +1 -3
- package/esm/src/cli/cli-commands/_boilerplate.d.ts +2 -4
- package/esm/src/cli/cli-commands/about.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +2 -4
- package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +2 -4
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -4
- package/esm/src/cli/cli-commands/coder/init.d.ts +2 -4
- package/esm/src/cli/cli-commands/coder/run.d.ts +2 -4
- package/esm/src/cli/cli-commands/coder/verify.d.ts +2 -4
- package/esm/src/cli/cli-commands/coder.d.ts +2 -4
- package/esm/src/cli/cli-commands/hello.d.ts +1 -1
- package/esm/src/cli/cli-commands/list-models.d.ts +2 -4
- package/esm/src/cli/cli-commands/list-scrapers.d.ts +2 -4
- package/esm/src/cli/cli-commands/login.d.ts +1 -1
- package/esm/src/cli/cli-commands/make.d.ts +1 -1
- package/esm/src/cli/cli-commands/prettify.d.ts +1 -1
- package/esm/src/cli/cli-commands/run.d.ts +1 -1
- package/esm/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
- package/esm/src/cli/cli-commands/start-agents-server.d.ts +2 -4
- package/esm/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
- package/esm/src/cli/cli-commands/test-command.d.ts +1 -1
- package/esm/src/cli/main.d.ts +2 -4
- package/esm/src/cli/promptbookCli.d.ts +1 -1
- package/esm/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +1 -3
- package/esm/src/conversion/archive/loadArchive.d.ts +1 -3
- package/esm/src/conversion/archive/saveArchive.d.ts +1 -1
- package/esm/src/conversion/validation/_importPipeline.d.ts +2 -4
- package/esm/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -3
- package/esm/src/executables/$provideExecutablesForNode.d.ts +1 -1
- package/esm/src/executables/apps/locateLibreoffice.d.ts +2 -4
- package/esm/src/executables/apps/locatePandoc.d.ts +2 -4
- package/esm/src/executables/locateApp.d.ts +2 -4
- package/esm/src/executables/platforms/locateAppOnLinux.d.ts +2 -4
- package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +2 -4
- package/esm/src/executables/platforms/locateAppOnWindows.d.ts +2 -4
- package/esm/src/execution/translation/automatic-translate/translateMessages.d.ts +2 -4
- package/esm/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
- package/esm/src/llm-providers/_common/register/$provideEnvFilename.d.ts +1 -3
- package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
- package/esm/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -3
- package/esm/src/llm-providers/_multiple/playground/playground.d.ts +1 -3
- package/esm/src/llm-providers/agent/playground/playground.d.ts +1 -1
- package/esm/src/llm-providers/anthropic-claude/playground/playground.d.ts +1 -1
- package/esm/src/llm-providers/azure-openai/playground/playground.d.ts +2 -4
- package/esm/src/llm-providers/ollama/playground/playground.d.ts +2 -4
- package/esm/src/llm-providers/openai/playground/playground.d.ts +2 -4
- package/esm/src/llm-providers/remote/playground/playground.d.ts +1 -3
- package/esm/src/llm-providers/vercel/playground/playground.d.ts +2 -4
- package/esm/src/playground/permanent/_boilerplate.d.ts +1 -3
- package/esm/src/playground/permanent/agent-with-browser-playground.d.ts +1 -3
- package/esm/src/playground/permanent/error-handling-playground.d.ts +1 -3
- package/esm/src/playground/playground.d.ts +2 -4
- package/esm/src/remote-server/startAgentServer.d.ts +1 -3
- package/esm/src/remote-server/startRemoteServer.d.ts +1 -2
- package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +4 -6
- package/esm/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +1 -3
- package/esm/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -4
- package/esm/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -4
- package/esm/src/scrapers/_common/register/$provideScriptingForNode.d.ts +2 -4
- package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -1
- package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -1
- package/esm/src/scrapers/document/playground/document-scraper-playground.d.ts +1 -3
- package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -1
- package/esm/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +1 -3
- package/esm/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +1 -3
- package/esm/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/esm/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +1 -3
- package/esm/src/scrapers/pdf/PdfScraper.d.ts +1 -1
- package/esm/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +1 -3
- package/esm/src/scrapers/website/WebsiteScraper.d.ts +1 -1
- package/esm/src/scrapers/website/playground/website-scraper-playground.d.ts +1 -3
- package/esm/src/speech-recognition/BrowserSpeechRecognition.d.ts +2 -4
- package/esm/src/storage/file-cache-storage/FileCacheStorage.d.ts +2 -4
- package/esm/src/storage/local-storage/getIndexedDbStorage.d.ts +1 -3
- package/esm/src/storage/local-storage/getLocalStorage.d.ts +1 -3
- package/esm/src/storage/local-storage/getSessionStorage.d.ts +1 -3
- package/esm/src/transpilers/openai-sdk/playground/playground.d.ts +1 -3
- package/esm/src/types/InputParameters_private.d.ts +11 -0
- package/esm/src/types/Parameters_private.d.ts +16 -0
- package/esm/src/types/ReservedParameters_private.d.ts +10 -0
- package/esm/src/types/number_bytes.d.ts +21 -0
- package/esm/src/types/number_id.d.ts +13 -0
- package/esm/src/types/number_likeness.d.ts +8 -0
- package/esm/src/types/number_milliseconds.d.ts +33 -0
- package/esm/src/types/number_percent.d.ts +18 -0
- package/esm/src/types/number_positive.d.ts +16 -0
- package/esm/src/types/number_usd.d.ts +6 -106
- package/esm/src/types/string_agent_hash_private.d.ts +9 -0
- package/esm/src/types/string_agent_name_in_book_private.d.ts +8 -0
- package/esm/src/types/string_agent_name_private.d.ts +9 -0
- package/esm/src/types/string_agent_permanent_id_private.d.ts +10 -0
- package/esm/src/types/string_base64_private.d.ts +17 -0
- package/esm/src/types/string_business_category_name_private.d.ts +6 -0
- package/esm/src/types/string_char_private.d.ts +8 -0
- package/esm/src/types/string_chat_prompt_private.d.ts +9 -0
- package/esm/src/types/string_completion_prompt_private.d.ts +9 -0
- package/esm/src/types/string_email_private.d.ts +16 -0
- package/esm/src/types/string_host_private.d.ts +55 -0
- package/esm/src/types/string_mime_type_private.d.ts +17 -0
- package/esm/src/types/string_model_description_private.d.ts +8 -0
- package/esm/src/types/string_model_name_private.d.ts +8 -0
- package/esm/src/types/string_name_private.d.ts +9 -0
- package/esm/src/types/string_page_private.d.ts +9 -0
- package/esm/src/types/string_parameter_name.d.ts +74 -31
- package/esm/src/types/string_parameter_value_private.d.ts +9 -0
- package/esm/src/types/string_persona_description_private.d.ts +8 -0
- package/esm/src/types/string_prompt_image_private.d.ts +8 -0
- package/esm/src/types/string_prompt_private.d.ts +8 -0
- package/esm/src/types/string_reserved_parameter_name_private.d.ts +11 -0
- package/esm/src/types/string_system_message_private.d.ts +9 -0
- package/esm/src/types/string_template_private.d.ts +8 -0
- package/esm/src/types/string_text_prompt_private.d.ts +9 -0
- package/esm/src/types/string_title_private.d.ts +9 -0
- package/esm/src/types/string_url.d.ts +50 -46
- package/esm/src/types/string_url_private.d.ts +88 -0
- package/esm/src/types/typeAliases.d.ts +7 -1
- package/esm/src/utils/execCommand/$execCommand.d.ts +1 -3
- package/esm/src/utils/execCommand/$execCommands.d.ts +1 -3
- package/esm/src/utils/files/$induceBookDownload.d.ts +1 -3
- package/esm/src/utils/files/$induceFileDownload.d.ts +1 -3
- package/esm/src/utils/files/ObjectUrl.d.ts +1 -3
- package/esm/src/utils/toolCalls/mergeToolCalls.d.ts +1 -1
- package/esm/src/version.d.ts +1 -1
- package/esm/src/wizard/$getCompiledBook.d.ts +2 -4
- package/esm/src/wizard/wizard.d.ts +2 -4
- package/package.json +2 -2
- package/umd/index.umd.js +112 -64
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +6 -0
- package/umd/src/_packages/types.index.d.ts +55 -49
- package/umd/src/book-2.0/agent-source/AgentReferenceResolver.d.ts +11 -0
- package/umd/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +8 -0
- package/umd/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +33 -0
- package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +7 -7
- package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +5 -0
- package/umd/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +42 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +18 -15
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.test.d.ts +1 -1
- package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +14 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageRichContent.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageToolCallChips.d.ts +22 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +290 -0
- package/umd/src/book-components/Chat/Chat/ChatToolCallModal.d.ts +16 -0
- package/umd/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +33 -0
- package/umd/src/book-components/Chat/Chat/createChatMessageToolCallRenderModel.d.ts +76 -0
- package/umd/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +16 -0
- package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +4 -0
- package/umd/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +26 -0
- package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +31 -0
- package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +31 -0
- package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +31 -0
- package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +38 -0
- package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +38 -0
- package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +46 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +33 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +10 -1
- package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +29 -0
- package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +26 -0
- package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +9 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +76 -0
- package/umd/src/book-components/Chat/Chat/useChatMessageAvatarTooltip.d.ts +31 -0
- package/umd/src/book-components/Chat/Chat/useChatMessageSpeechPlayback.d.ts +29 -0
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +2 -1
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.test.d.ts +2 -0
- package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.d.ts +18 -0
- package/umd/src/book-components/Chat/hooks/useChatCompleteNotification.test.d.ts +2 -0
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +77 -1
- package/umd/src/book-components/Chat/utils/formatToolCallDateTime.d.ts +37 -0
- package/umd/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +11 -0
- package/umd/src/book-components/Chat/utils/formatToolCallTranslationTemplate.d.ts +10 -0
- package/umd/src/book-components/Chat/utils/getChatMessageTimingDisplay.d.ts +5 -1
- package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.d.ts +26 -1
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +26 -3
- package/umd/src/cli/$runPromptbookCli.d.ts +1 -3
- package/umd/src/cli/cli-commands/_boilerplate.d.ts +2 -4
- package/umd/src/cli/cli-commands/about.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +2 -4
- package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +2 -4
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -4
- package/umd/src/cli/cli-commands/coder/init.d.ts +2 -4
- package/umd/src/cli/cli-commands/coder/run.d.ts +2 -4
- package/umd/src/cli/cli-commands/coder/verify.d.ts +2 -4
- package/umd/src/cli/cli-commands/coder.d.ts +2 -4
- package/umd/src/cli/cli-commands/hello.d.ts +1 -1
- package/umd/src/cli/cli-commands/list-models.d.ts +2 -4
- package/umd/src/cli/cli-commands/list-scrapers.d.ts +2 -4
- package/umd/src/cli/cli-commands/login.d.ts +1 -1
- package/umd/src/cli/cli-commands/make.d.ts +1 -1
- package/umd/src/cli/cli-commands/prettify.d.ts +1 -1
- package/umd/src/cli/cli-commands/run.d.ts +1 -1
- package/umd/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -1
- package/umd/src/cli/cli-commands/start-agents-server.d.ts +2 -4
- package/umd/src/cli/cli-commands/start-pipelines-server.d.ts +1 -1
- package/umd/src/cli/cli-commands/test-command.d.ts +1 -1
- package/umd/src/cli/main.d.ts +2 -4
- package/umd/src/cli/promptbookCli.d.ts +1 -1
- package/umd/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +1 -3
- package/umd/src/conversion/archive/loadArchive.d.ts +1 -3
- package/umd/src/conversion/archive/saveArchive.d.ts +1 -1
- package/umd/src/conversion/validation/_importPipeline.d.ts +2 -4
- package/umd/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -3
- package/umd/src/executables/$provideExecutablesForNode.d.ts +1 -1
- package/umd/src/executables/apps/locateLibreoffice.d.ts +2 -4
- package/umd/src/executables/apps/locatePandoc.d.ts +2 -4
- package/umd/src/executables/locateApp.d.ts +2 -4
- package/umd/src/executables/platforms/locateAppOnLinux.d.ts +2 -4
- package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +2 -4
- package/umd/src/executables/platforms/locateAppOnWindows.d.ts +2 -4
- package/umd/src/execution/translation/automatic-translate/translateMessages.d.ts +2 -4
- package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
- package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +1 -3
- package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
- package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -3
- package/umd/src/llm-providers/_multiple/playground/playground.d.ts +1 -3
- package/umd/src/llm-providers/agent/playground/playground.d.ts +1 -1
- package/umd/src/llm-providers/anthropic-claude/playground/playground.d.ts +1 -1
- package/umd/src/llm-providers/azure-openai/playground/playground.d.ts +2 -4
- package/umd/src/llm-providers/ollama/playground/playground.d.ts +2 -4
- package/umd/src/llm-providers/openai/playground/playground.d.ts +2 -4
- package/umd/src/llm-providers/remote/playground/playground.d.ts +1 -3
- package/umd/src/llm-providers/vercel/playground/playground.d.ts +2 -4
- package/umd/src/playground/permanent/_boilerplate.d.ts +1 -3
- package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +1 -3
- package/umd/src/playground/permanent/error-handling-playground.d.ts +1 -3
- package/umd/src/playground/playground.d.ts +2 -4
- package/umd/src/remote-server/startAgentServer.d.ts +1 -3
- package/umd/src/remote-server/startRemoteServer.d.ts +1 -2
- package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +4 -6
- package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +1 -3
- package/umd/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +2 -4
- package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +2 -4
- package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +2 -4
- package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +1 -1
- package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -1
- package/umd/src/scrapers/document/playground/document-scraper-playground.d.ts +1 -3
- package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -1
- package/umd/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +1 -3
- package/umd/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +1 -3
- package/umd/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -1
- package/umd/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +1 -3
- package/umd/src/scrapers/pdf/PdfScraper.d.ts +1 -1
- package/umd/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +1 -3
- package/umd/src/scrapers/website/WebsiteScraper.d.ts +1 -1
- package/umd/src/scrapers/website/playground/website-scraper-playground.d.ts +1 -3
- package/umd/src/speech-recognition/BrowserSpeechRecognition.d.ts +2 -4
- package/umd/src/storage/file-cache-storage/FileCacheStorage.d.ts +2 -4
- package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +1 -3
- package/umd/src/storage/local-storage/getLocalStorage.d.ts +1 -3
- package/umd/src/storage/local-storage/getSessionStorage.d.ts +1 -3
- package/umd/src/transpilers/openai-sdk/playground/playground.d.ts +1 -3
- package/umd/src/types/InputParameters_private.d.ts +11 -0
- package/umd/src/types/Parameters_private.d.ts +16 -0
- package/umd/src/types/ReservedParameters_private.d.ts +10 -0
- package/umd/src/types/number_bytes.d.ts +21 -0
- package/umd/src/types/number_id.d.ts +13 -0
- package/umd/src/types/number_likeness.d.ts +8 -0
- package/umd/src/types/number_milliseconds.d.ts +33 -0
- package/umd/src/types/number_percent.d.ts +18 -0
- package/umd/src/types/number_positive.d.ts +16 -0
- package/umd/src/types/number_usd.d.ts +6 -106
- package/umd/src/types/string_agent_hash_private.d.ts +9 -0
- package/umd/src/types/string_agent_name_in_book_private.d.ts +8 -0
- package/umd/src/types/string_agent_name_private.d.ts +9 -0
- package/umd/src/types/string_agent_permanent_id_private.d.ts +10 -0
- package/umd/src/types/string_base64_private.d.ts +17 -0
- package/umd/src/types/string_business_category_name_private.d.ts +6 -0
- package/umd/src/types/string_char_private.d.ts +8 -0
- package/umd/src/types/string_chat_prompt_private.d.ts +9 -0
- package/umd/src/types/string_completion_prompt_private.d.ts +9 -0
- package/umd/src/types/string_email_private.d.ts +16 -0
- package/umd/src/types/string_host_private.d.ts +55 -0
- package/umd/src/types/string_mime_type_private.d.ts +17 -0
- package/umd/src/types/string_model_description_private.d.ts +8 -0
- package/umd/src/types/string_model_name_private.d.ts +8 -0
- package/umd/src/types/string_name_private.d.ts +9 -0
- package/umd/src/types/string_page_private.d.ts +9 -0
- package/umd/src/types/string_parameter_name.d.ts +74 -31
- package/umd/src/types/string_parameter_value_private.d.ts +9 -0
- package/umd/src/types/string_persona_description_private.d.ts +8 -0
- package/umd/src/types/string_prompt_image_private.d.ts +8 -0
- package/umd/src/types/string_prompt_private.d.ts +8 -0
- package/umd/src/types/string_reserved_parameter_name_private.d.ts +11 -0
- package/umd/src/types/string_system_message_private.d.ts +9 -0
- package/umd/src/types/string_template_private.d.ts +8 -0
- package/umd/src/types/string_text_prompt_private.d.ts +9 -0
- package/umd/src/types/string_title_private.d.ts +9 -0
- package/umd/src/types/string_url.d.ts +50 -46
- package/umd/src/types/string_url_private.d.ts +88 -0
- package/umd/src/types/typeAliases.d.ts +7 -1
- package/umd/src/utils/execCommand/$execCommand.d.ts +1 -3
- package/umd/src/utils/execCommand/$execCommands.d.ts +1 -3
- package/umd/src/utils/files/$induceBookDownload.d.ts +1 -3
- package/umd/src/utils/files/$induceFileDownload.d.ts +1 -3
- package/umd/src/utils/files/ObjectUrl.d.ts +1 -3
- package/umd/src/utils/toolCalls/mergeToolCalls.d.ts +1 -1
- package/umd/src/version.d.ts +1 -1
- package/umd/src/wizard/$getCompiledBook.d.ts +2 -4
- package/umd/src/wizard/wizard.d.ts +2 -4
package/esm/index.es.js
CHANGED
|
@@ -29,7 +29,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
29
29
|
* @generated
|
|
30
30
|
* @see https://github.com/webgptorg/promptbook
|
|
31
31
|
*/
|
|
32
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
32
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-34';
|
|
33
33
|
/**
|
|
34
34
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
35
35
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -9900,10 +9900,6 @@ class StyleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9900
9900
|
* Prefix used for TEAM tool names.
|
|
9901
9901
|
*/
|
|
9902
9902
|
const TEAM_TOOL_PREFIX = 'team_chat_';
|
|
9903
|
-
/**
|
|
9904
|
-
* Length of URL hash suffix appended to TEAM tool names.
|
|
9905
|
-
*/
|
|
9906
|
-
const TEAM_TOOL_HASH_LENGTH = 10;
|
|
9907
9903
|
/**
|
|
9908
9904
|
* Fallback normalized name when teammate label is empty.
|
|
9909
9905
|
*/
|
|
@@ -9920,20 +9916,19 @@ function normalizeTeammateToolNamePart(teammateLabel) {
|
|
|
9920
9916
|
return normalized || TEAM_TOOL_FALLBACK_NAME;
|
|
9921
9917
|
}
|
|
9922
9918
|
/**
|
|
9923
|
-
* Builds a deterministic TEAM tool name from teammate
|
|
9919
|
+
* Builds a deterministic TEAM tool name from the teammate label.
|
|
9924
9920
|
*
|
|
9925
|
-
* The
|
|
9926
|
-
*
|
|
9921
|
+
* The tool name is derived solely from the human-readable label so that it
|
|
9922
|
+
* remains stable and predictable regardless of internal technical identifiers.
|
|
9927
9923
|
*
|
|
9928
|
-
* @param
|
|
9929
|
-
* @param teammateLabel - Human-readable teammate label.
|
|
9930
|
-
* @returns
|
|
9924
|
+
* @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
|
|
9925
|
+
* @param teammateLabel - Human-readable teammate label used as the basis for the name.
|
|
9926
|
+
* @returns TEAM tool name derived from the label.
|
|
9931
9927
|
* @private internal utility of TEAM commitments and chat UI mapping
|
|
9932
9928
|
*/
|
|
9933
|
-
function createTeamToolName(
|
|
9929
|
+
function createTeamToolName(_teammateUrl, teammateLabel) {
|
|
9934
9930
|
const normalizedLabel = normalizeTeammateToolNamePart(teammateLabel);
|
|
9935
|
-
|
|
9936
|
-
return `${TEAM_TOOL_PREFIX}${normalizedLabel}_${hash}`;
|
|
9931
|
+
return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
|
|
9937
9932
|
}
|
|
9938
9933
|
|
|
9939
9934
|
const urlRegex = /https?:\/\/[^\s]+/gi;
|
|
@@ -10138,7 +10133,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
10138
10133
|
`);
|
|
10139
10134
|
}
|
|
10140
10135
|
applyToAgentModelRequirements(requirements, content) {
|
|
10141
|
-
var _a, _b;
|
|
10136
|
+
var _a, _b, _c;
|
|
10142
10137
|
const trimmedContent = content.trim();
|
|
10143
10138
|
if (!trimmedContent) {
|
|
10144
10139
|
return requirements;
|
|
@@ -10150,14 +10145,18 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
10150
10145
|
}
|
|
10151
10146
|
const agentName = ((_a = requirements._metadata) === null || _a === void 0 ? void 0 : _a.agentName) || 'Agent';
|
|
10152
10147
|
const existingTeammates = ((_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.teammates) || [];
|
|
10148
|
+
const preResolvedProfiles = (((_c = requirements._metadata) === null || _c === void 0 ? void 0 : _c.preResolvedTeammateProfiles) || {});
|
|
10153
10149
|
const resolvedTeammates = resolveTeamTeammateLabels(trimmedContent, teammates);
|
|
10154
10150
|
const teamEntries = resolvedTeammates.map((teammate) => {
|
|
10151
|
+
const profile = preResolvedProfiles[teammate.url];
|
|
10152
|
+
const resolvedLabel = (profile === null || profile === void 0 ? void 0 : profile.agentName) || teammate.label;
|
|
10155
10153
|
const existingTeammate = existingTeammates.find((entry) => entry.url === teammate.url);
|
|
10156
10154
|
return {
|
|
10157
10155
|
toolName: ((existingTeammate === null || existingTeammate === void 0 ? void 0 : existingTeammate.toolName) ||
|
|
10158
|
-
createTeamToolName(teammate.url,
|
|
10159
|
-
teammate,
|
|
10156
|
+
createTeamToolName(teammate.url, resolvedLabel)),
|
|
10157
|
+
teammate: { ...teammate, label: resolvedLabel },
|
|
10160
10158
|
agentName,
|
|
10159
|
+
description: (profile === null || profile === void 0 ? void 0 : profile.personaDescription) || null,
|
|
10161
10160
|
};
|
|
10162
10161
|
});
|
|
10163
10162
|
for (const entry of teamEntries) {
|
|
@@ -10169,9 +10168,12 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
10169
10168
|
if (updatedTools.some((tool) => tool.name === entry.toolName)) {
|
|
10170
10169
|
continue;
|
|
10171
10170
|
}
|
|
10171
|
+
const toolDescription = entry.description
|
|
10172
|
+
? `Consult teammate ${entry.teammate.label}\n${entry.description}`
|
|
10173
|
+
: `Consult teammate ${entry.teammate.label}`;
|
|
10172
10174
|
updatedTools.push({
|
|
10173
10175
|
name: entry.toolName,
|
|
10174
|
-
description:
|
|
10176
|
+
description: toolDescription,
|
|
10175
10177
|
parameters: {
|
|
10176
10178
|
type: 'object',
|
|
10177
10179
|
properties: {
|
|
@@ -10200,8 +10202,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
10200
10202
|
toolName: entry.toolName,
|
|
10201
10203
|
});
|
|
10202
10204
|
}
|
|
10203
|
-
const
|
|
10204
|
-
const teamSystemMessage = this.createSystemMessageSection('Teammates:', buildTeamSystemMessageBody(teamOverviewText, teamEntries));
|
|
10205
|
+
const teamSystemMessage = this.createSystemMessageSection('Teammates:', buildTeamSystemMessageBody(teamEntries));
|
|
10205
10206
|
return this.appendToSystemMessage({
|
|
10206
10207
|
...requirements,
|
|
10207
10208
|
tools: updatedTools,
|
|
@@ -10238,25 +10239,24 @@ function resolveTeamTeammateLabels(teamContent, teammates) {
|
|
|
10238
10239
|
};
|
|
10239
10240
|
});
|
|
10240
10241
|
}
|
|
10241
|
-
/**
|
|
10242
|
-
* Rewrites TEAM commitment content into a URL-free teammate overview text.
|
|
10243
|
-
*/
|
|
10244
|
-
function createTeamOverviewText(teamContent, teamEntries) {
|
|
10245
|
-
let overviewText = teamContent;
|
|
10246
|
-
for (const entry of teamEntries) {
|
|
10247
|
-
overviewText = overviewText.split(entry.teammate.url).join(entry.teammate.label);
|
|
10248
|
-
}
|
|
10249
|
-
return overviewText.trim();
|
|
10250
|
-
}
|
|
10251
10242
|
/**
|
|
10252
10243
|
* Builds the textual TEAM section body for the final system message.
|
|
10244
|
+
*
|
|
10245
|
+
* Each teammate is listed with its tool name and, when available, a one-line description.
|
|
10246
|
+
* Uses `spaceTrim` to ensure consistent whitespace and indentation.
|
|
10253
10247
|
*/
|
|
10254
|
-
function buildTeamSystemMessageBody(
|
|
10255
|
-
const
|
|
10256
|
-
|
|
10257
|
-
|
|
10258
|
-
|
|
10259
|
-
|
|
10248
|
+
function buildTeamSystemMessageBody(teamEntries) {
|
|
10249
|
+
const lines = teamEntries.map((entry, index) => {
|
|
10250
|
+
const toolLine = `${index + 1}) ${entry.teammate.label} tool \`${entry.toolName}\``;
|
|
10251
|
+
if (!entry.description) {
|
|
10252
|
+
return toolLine;
|
|
10253
|
+
}
|
|
10254
|
+
return spaceTrim$1(`
|
|
10255
|
+
${toolLine}
|
|
10256
|
+
${entry.description}
|
|
10257
|
+
`);
|
|
10258
|
+
});
|
|
10259
|
+
return lines.join('\n');
|
|
10260
10260
|
}
|
|
10261
10261
|
/**
|
|
10262
10262
|
* Registers tool function and title for a teammate tool.
|
|
@@ -16756,9 +16756,7 @@ class SimplePromptInterfaceTools {
|
|
|
16756
16756
|
return answer;
|
|
16757
16757
|
}
|
|
16758
16758
|
}
|
|
16759
|
-
/**
|
|
16760
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
16761
|
-
*/
|
|
16759
|
+
/** Note: [🔵] Code for browser dialog helper [SimplePromptInterfaceTools](src/dialogs/simple-prompt/SimplePromptInterfaceTools.ts) should never be published outside of `@promptbook/browser` */
|
|
16762
16760
|
|
|
16763
16761
|
/**
|
|
16764
16762
|
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
@@ -16957,10 +16955,8 @@ class BrowserSpeechRecognition {
|
|
|
16957
16955
|
}
|
|
16958
16956
|
}
|
|
16959
16957
|
}
|
|
16960
|
-
/**
|
|
16961
|
-
|
|
16962
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
16963
|
-
*/
|
|
16958
|
+
/** Note: [🔵] Code for browser speech-recognition adapter [BrowserSpeechRecognition](src/speech-recognition/BrowserSpeechRecognition.ts) should never be published outside of `@promptbook/browser` */
|
|
16959
|
+
/** TODO: !!!! Search ACRY for `window` and put -> [🔵] */
|
|
16964
16960
|
|
|
16965
16961
|
/**
|
|
16966
16962
|
* Creates a PromptbookStorage backed by IndexedDB.
|
|
@@ -17037,9 +17033,7 @@ function getIndexedDbStorage(options) {
|
|
|
17037
17033
|
indexedDbStorageCache.set(cacheKey, storage);
|
|
17038
17034
|
return storage;
|
|
17039
17035
|
}
|
|
17040
|
-
/**
|
|
17041
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
17042
|
-
*/
|
|
17036
|
+
/** Note: [🔵] Code for browser storage helper [getIndexedDbStorage](src/storage/local-storage/getIndexedDbStorage.ts) should never be published outside of `@promptbook/browser` */
|
|
17043
17037
|
|
|
17044
17038
|
/**
|
|
17045
17039
|
* Stringify the PipelineJson with proper formatting
|
|
@@ -17129,9 +17123,7 @@ function getLocalStorage() {
|
|
|
17129
17123
|
promptbookLocalStorage = makePromptbookStorageFromWebStorage(localStorage);
|
|
17130
17124
|
return promptbookLocalStorage;
|
|
17131
17125
|
}
|
|
17132
|
-
/**
|
|
17133
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
17134
|
-
*/
|
|
17126
|
+
/** Note: [🔵] Code for browser storage helper [getLocalStorage](src/storage/local-storage/getLocalStorage.ts) should never be published outside of `@promptbook/browser` */
|
|
17135
17127
|
|
|
17136
17128
|
/**
|
|
17137
17129
|
* Cache storage
|
|
@@ -17154,9 +17146,7 @@ function getSessionStorage() {
|
|
|
17154
17146
|
promptbookSessionStorage = makePromptbookStorageFromWebStorage(sessionStorage);
|
|
17155
17147
|
return promptbookSessionStorage;
|
|
17156
17148
|
}
|
|
17157
|
-
/**
|
|
17158
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
17159
|
-
*/
|
|
17149
|
+
/** Note: [🔵] Code for browser storage helper [getSessionStorage](src/storage/local-storage/getSessionStorage.ts) should never be published outside of `@promptbook/browser` */
|
|
17160
17150
|
|
|
17161
17151
|
/**
|
|
17162
17152
|
* Normalizes a domain-like string into a comparable hostname form.
|
|
@@ -17911,9 +17901,7 @@ class ObjectUrl extends Registration {
|
|
|
17911
17901
|
return new URL(this.src);
|
|
17912
17902
|
}
|
|
17913
17903
|
}
|
|
17914
|
-
/**
|
|
17915
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
17916
|
-
*/
|
|
17904
|
+
/** Note: [🔵] Code for browser file helper [ObjectUrl](src/utils/files/ObjectUrl.ts) should never be published outside of `@promptbook/browser` */
|
|
17917
17905
|
|
|
17918
17906
|
/**
|
|
17919
17907
|
* Download a File in a browser
|
|
@@ -17933,9 +17921,7 @@ async function $induceFileDownload(fileOrBlobOrUrl) {
|
|
|
17933
17921
|
link.click();
|
|
17934
17922
|
await objectUrl.destroy();
|
|
17935
17923
|
}
|
|
17936
|
-
/**
|
|
17937
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
17938
|
-
*/
|
|
17924
|
+
/** Note: [🔵] Code for browser file helper [$induceFileDownload](src/utils/files/$induceFileDownload.ts) should never be published outside of `@promptbook/browser` */
|
|
17939
17925
|
|
|
17940
17926
|
/**
|
|
17941
17927
|
* Download a Book in a browser
|
|
@@ -17954,9 +17940,7 @@ async function $induceBookDownload(book) {
|
|
|
17954
17940
|
});
|
|
17955
17941
|
return /* not await */ $induceFileDownload(bookFile);
|
|
17956
17942
|
}
|
|
17957
|
-
/**
|
|
17958
|
-
* Note: [🔵] Code in this file should never be published outside of `@promptbook/browser`
|
|
17959
|
-
*/
|
|
17943
|
+
/** Note: [🔵] Code for browser file helper [$induceBookDownload](src/utils/files/$induceBookDownload.ts) should never be published outside of `@promptbook/browser` */
|
|
17960
17944
|
|
|
17961
17945
|
/**
|
|
17962
17946
|
* Keep-alive helpers used for streaming chat responses.
|
|
@@ -18282,13 +18266,23 @@ function getToolCallIdentity(toolCall) {
|
|
|
18282
18266
|
*/
|
|
18283
18267
|
function mergeToolCalls(existingToolCalls, incomingToolCalls) {
|
|
18284
18268
|
if (!existingToolCalls || existingToolCalls.length === 0) {
|
|
18285
|
-
return incomingToolCalls ? [...incomingToolCalls] : [];
|
|
18269
|
+
return incomingToolCalls ? deduplicatePreparationToolCalls([...incomingToolCalls]) : [];
|
|
18286
18270
|
}
|
|
18287
18271
|
if (!incomingToolCalls || incomingToolCalls.length === 0) {
|
|
18288
18272
|
return [...existingToolCalls];
|
|
18289
18273
|
}
|
|
18290
18274
|
const mergedToolCalls = [...existingToolCalls];
|
|
18291
18275
|
for (const incomingToolCall of incomingToolCalls) {
|
|
18276
|
+
if (isAssistantPreparationToolCall(incomingToolCall)) {
|
|
18277
|
+
// A new preparation phase always replaces any previous assistant_preparation tool
|
|
18278
|
+
// call, regardless of phase argument, so only one chip is ever shown at a time.
|
|
18279
|
+
const existingPreparationIndex = mergedToolCalls.findIndex(isAssistantPreparationToolCall);
|
|
18280
|
+
if (existingPreparationIndex !== -1) {
|
|
18281
|
+
mergedToolCalls.splice(existingPreparationIndex, 1);
|
|
18282
|
+
}
|
|
18283
|
+
mergedToolCalls.push(incomingToolCall);
|
|
18284
|
+
continue;
|
|
18285
|
+
}
|
|
18292
18286
|
const incomingIdentity = getToolCallIdentity(incomingToolCall);
|
|
18293
18287
|
const existingIndex = mergedToolCalls.findIndex((existingToolCall) => getToolCallIdentity(existingToolCall) === incomingIdentity);
|
|
18294
18288
|
if (existingIndex === -1) {
|
|
@@ -18400,6 +18394,30 @@ function serializeValueForMerge(value) {
|
|
|
18400
18394
|
return String(value);
|
|
18401
18395
|
}
|
|
18402
18396
|
}
|
|
18397
|
+
/**
|
|
18398
|
+
* Ensures at most one `assistant_preparation` tool call survives in the list,
|
|
18399
|
+
* keeping the last occurrence so the most recent preparation phase is shown.
|
|
18400
|
+
*
|
|
18401
|
+
* @param toolCalls - Mutable list to deduplicate in-place.
|
|
18402
|
+
* @returns The same array after removing redundant preparation entries.
|
|
18403
|
+
* @private helper of `mergeToolCalls`
|
|
18404
|
+
*/
|
|
18405
|
+
function deduplicatePreparationToolCalls(toolCalls) {
|
|
18406
|
+
let lastPreparationIndex = -1;
|
|
18407
|
+
for (let index = toolCalls.length - 1; index >= 0; index--) {
|
|
18408
|
+
if (!isAssistantPreparationToolCall(toolCalls[index])) {
|
|
18409
|
+
continue;
|
|
18410
|
+
}
|
|
18411
|
+
if (lastPreparationIndex === -1) {
|
|
18412
|
+
lastPreparationIndex = index;
|
|
18413
|
+
}
|
|
18414
|
+
else {
|
|
18415
|
+
// Remove earlier duplicate — keep only the last (most recent) one.
|
|
18416
|
+
toolCalls.splice(index, 1);
|
|
18417
|
+
}
|
|
18418
|
+
}
|
|
18419
|
+
return toolCalls;
|
|
18420
|
+
}
|
|
18403
18421
|
|
|
18404
18422
|
/**
|
|
18405
18423
|
* Gets all tool titles provided by all commitments
|
|
@@ -22655,7 +22673,7 @@ function getSafeReferenceCommitmentFallback(commitmentType, originalContent) {
|
|
|
22655
22673
|
* @private @@@
|
|
22656
22674
|
*/
|
|
22657
22675
|
async function createAgentModelRequirementsWithCommitments(agentSource, modelName, options) {
|
|
22658
|
-
var _a;
|
|
22676
|
+
var _a, _b, _c;
|
|
22659
22677
|
const agentReferenceResolver = options === null || options === void 0 ? void 0 : options.agentReferenceResolver;
|
|
22660
22678
|
// Parse the agent source to extract commitments
|
|
22661
22679
|
const parseResult = parseAgentSourceWithCommitments(agentSource);
|
|
@@ -22723,6 +22741,36 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
|
|
|
22723
22741
|
if (commitment.type === 'CLOSED' && i !== filteredCommitments.length - 1) {
|
|
22724
22742
|
continue;
|
|
22725
22743
|
}
|
|
22744
|
+
// For TEAM commitments, pre-resolve teammate profiles if a resolver is provided
|
|
22745
|
+
// and store them in metadata before the commitment is applied.
|
|
22746
|
+
const profileResolver = (_a = options === null || options === void 0 ? void 0 : options.teammateProfileResolver) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.agentReferenceResolver;
|
|
22747
|
+
if (commitment.type === 'TEAM' && (profileResolver === null || profileResolver === void 0 ? void 0 : profileResolver.resolveTeammateProfile)) {
|
|
22748
|
+
try {
|
|
22749
|
+
const parsedTeammates = parseTeamCommitmentContent(commitmentContent, { strict: false });
|
|
22750
|
+
const preResolved = {
|
|
22751
|
+
...(_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.preResolvedTeammateProfiles,
|
|
22752
|
+
};
|
|
22753
|
+
for (const teammate of parsedTeammates) {
|
|
22754
|
+
if (preResolved[teammate.url]) {
|
|
22755
|
+
continue;
|
|
22756
|
+
}
|
|
22757
|
+
const profile = await profileResolver.resolveTeammateProfile(teammate.url);
|
|
22758
|
+
if (profile) {
|
|
22759
|
+
preResolved[teammate.url] = profile;
|
|
22760
|
+
}
|
|
22761
|
+
}
|
|
22762
|
+
requirements = {
|
|
22763
|
+
...requirements,
|
|
22764
|
+
_metadata: {
|
|
22765
|
+
...requirements._metadata,
|
|
22766
|
+
preResolvedTeammateProfiles: preResolved,
|
|
22767
|
+
},
|
|
22768
|
+
};
|
|
22769
|
+
}
|
|
22770
|
+
catch (error) {
|
|
22771
|
+
console.warn('Failed to pre-resolve teammate profiles for TEAM commitment:', error);
|
|
22772
|
+
}
|
|
22773
|
+
}
|
|
22726
22774
|
const definition = getCommitmentDefinition(commitment.type);
|
|
22727
22775
|
if (definition) {
|
|
22728
22776
|
try {
|
|
@@ -22818,7 +22866,7 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
|
|
|
22818
22866
|
// Add example interactions to the system message
|
|
22819
22867
|
const examples = [];
|
|
22820
22868
|
// 1. Initial message as an example agent response
|
|
22821
|
-
const initialMessage = (
|
|
22869
|
+
const initialMessage = (_c = parseResult.commitments.find((c) => c.type === 'INITIAL MESSAGE')) === null || _c === void 0 ? void 0 : _c.content;
|
|
22822
22870
|
if (initialMessage) {
|
|
22823
22871
|
examples.push(`Agent: ${initialMessage}`);
|
|
22824
22872
|
}
|