@promptbook/node 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 +135 -107
- 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 +135 -107
- 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/umd/index.umd.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* @generated
|
|
49
49
|
* @see https://github.com/webgptorg/promptbook
|
|
50
50
|
*/
|
|
51
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
51
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-34';
|
|
52
52
|
/**
|
|
53
53
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
54
54
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2178,9 +2178,7 @@
|
|
|
2178
2178
|
}
|
|
2179
2179
|
return collectionJson;
|
|
2180
2180
|
}
|
|
2181
|
-
/**
|
|
2182
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
2183
|
-
*/
|
|
2181
|
+
/** Note: [🟢] Code for Node archive helper [loadArchive](src/conversion/archive/loadArchive.ts) should never be published into packages that could be imported into browser environment */
|
|
2184
2182
|
|
|
2185
2183
|
var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book",formfactorName:"GENERIC",parameters:[{name:"knowledgeContent",description:"Markdown document content",isInput:true,isOutput:false},{name:"knowledgePieces",description:"The knowledge JSON object",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}",resultingParameterName:"knowledgePieces",dependentParameterNames:["knowledgeContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge from Markdown\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-from-markdown.book`\n- INPUT PARAMETER `{knowledgeContent}` Markdown document content\n- OUTPUT PARAMETER `{knowledgePieces}` The knowledge JSON object\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, extract the important knowledge from the document.\n\n# Rules\n\n- Make pieces of information concise, clear, and easy to understand\n- One piece of information should be approximately 1 paragraph\n- Divide the paragraphs by markdown horizontal lines ---\n- Omit irrelevant information\n- Group redundant information\n- Write just extracted information, nothing else\n\n# The document\n\nTake information from this document:\n\n> {knowledgeContent}\n```\n\n`-> {knowledgePieces}`\n"}],sourceFile:"./books/prepare-knowledge-from-markdown.book"},{title:"Prepare Keywords",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-keywords.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"keywords",description:"Keywords separated by comma",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}",resultingParameterName:"keywords",dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Keywords\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-keywords.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{keywords}` Keywords separated by comma\n\n## Knowledge\n\n<!-- TODO: [🍆] -FORMAT JSON -->\n\n```markdown\nYou are experienced data researcher, detect the important keywords in the document.\n\n# Rules\n\n- Write just keywords separated by comma\n\n# The document\n\nTake information from this document:\n\n> {knowledgePieceContent}\n```\n\n`-> {keywords}`\n"}],sourceFile:"./books/prepare-knowledge-keywords.book"},{title:"Prepare Knowledge-piece Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-knowledge-title.book",formfactorName:"GENERIC",parameters:[{name:"knowledgePieceContent",description:"The content",isInput:true,isOutput:false},{name:"title",description:"The title of the document",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"knowledge",title:"Knowledge",content:"You are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}",resultingParameterName:"title",expectations:{words:{min:1,max:8}},dependentParameterNames:["knowledgePieceContent"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Knowledge-piece Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-knowledge-title.book`\n- INPUT PARAMETER `{knowledgePieceContent}` The content\n- OUTPUT PARAMETER `{title}` The title of the document\n\n## Knowledge\n\n- EXPECT MIN 1 WORD\n- EXPECT MAX 8 WORDS\n\n```markdown\nYou are experienced content creator, write best title for the document.\n\n# Rules\n\n- Write just title, nothing else\n- Write maximum 5 words for the title\n\n# The document\n\n> {knowledgePieceContent}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-knowledge-title.book"},{title:"Prepare Persona",pipelineUrl:"https://promptbook.studio/promptbook/prepare-persona.book",formfactorName:"GENERIC",parameters:[{name:"availableModels",description:"List of available model names together with their descriptions as JSON",isInput:true,isOutput:false},{name:"personaDescription",description:"Description of the persona",isInput:true,isOutput:false},{name:"modelsRequirements",description:"Specific requirements for the model",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-model-requirements",title:"Make modelRequirements",content:"You are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n```json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n```\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n```json\n{availableModels}\n```\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}",resultingParameterName:"modelsRequirements",format:"JSON",dependentParameterNames:["availableModels","personaDescription"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Persona\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-persona.book`\n- INPUT PARAMETER `{availableModels}` List of available model names together with their descriptions as JSON\n- INPUT PARAMETER `{personaDescription}` Description of the persona\n- OUTPUT PARAMETER `{modelsRequirements}` Specific requirements for the model\n\n## Make modelRequirements\n\n- FORMAT JSON\n\n```markdown\nYou are an experienced AI engineer, you need to find the best models for virtual assistants:\n\n## Example\n\n\\`\\`\\`json\n[\n {\n \"modelName\": \"gpt-4o\",\n \"systemMessage\": \"You are experienced AI engineer and helpful assistant.\",\n \"temperature\": 0.7\n },\n {\n \"modelName\": \"claude-3-5-sonnet\",\n \"systemMessage\": \"You are a friendly and knowledgeable chatbot.\",\n \"temperature\": 0.5\n }\n]\n\\`\\`\\`\n\n## Instructions\n\n- Your output format is JSON array\n- Sort best-fitting models first\n- Omit any models that are not suitable\n- Write just the JSON, no other text should be present\n- Array contain items with following keys:\n - `modelName`: The name of the model to use\n - `systemMessage`: The system message to provide context to the model\n - `temperature`: The sampling temperature to use\n\n### Key `modelName`\n\nHere are the available models:\n\n\\`\\`\\`json\n{availableModels}\n\\`\\`\\`\n\n### Key `systemMessage`\n\nThe system message is used to communicate instructions or provide context to the model at the beginning of a conversation. It is displayed in a different format compared to user messages, helping the model understand its role in the conversation. The system message typically guides the model's behavior, sets the tone, or specifies desired output from the model. By utilizing the system message effectively, users can steer the model towards generating more accurate and relevant responses.\n\nFor example:\n\n> You are an experienced AI engineer and helpful assistant.\n\n> You are a friendly and knowledgeable chatbot.\n\n### Key `temperature`\n\nThe sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use log probability to automatically increase the temperature until certain thresholds are hit.\n\nYou can pick a value between 0 and 2. For example:\n\n- `0.1`: Low temperature, extremely conservative and deterministic\n- `0.5`: Medium temperature, balanced between conservative and creative\n- `1.0`: High temperature, creative and bit random\n- `1.5`: Very high temperature, extremely creative and often chaotic and unpredictable\n- `2.0`: Maximum temperature, completely random and unpredictable, for some extreme creative use cases\n\n# The assistant\n\nTake this description of the persona:\n\n> {personaDescription}\n```\n\n`-> {modelsRequirements}`\n"}],sourceFile:"./books/prepare-persona.book"},{title:"Prepare Title",pipelineUrl:"https://promptbook.studio/promptbook/prepare-title.book",formfactorName:"GENERIC",parameters:[{name:"book",description:"The book to prepare the title for",isInput:true,isOutput:false},{name:"title",description:"Best title for the book",isInput:false,isOutput:true}],tasks:[{taskType:"PROMPT_TASK",name:"make-title",title:"Make title",content:"Make best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}",resultingParameterName:"title",expectations:{words:{min:1,max:8},lines:{min:1,max:1}},dependentParameterNames:["book"]}],personas:[],preparations:[],knowledgeSources:[],knowledgePieces:[],sources:[{type:"BOOK",path:null,content:"# Prepare Title\n\n- PIPELINE URL `https://promptbook.studio/promptbook/prepare-title.book`\n- INPUT PARAMETER `{book}` The book to prepare the title for\n- OUTPUT PARAMETER `{title}` Best title for the book\n\n## Make title\n\n- EXPECT MIN 1 Word\n- EXPECT MAX 8 Words\n- EXPECT EXACTLY 1 Line\n\n```markdown\nMake best title for given text which describes the workflow:\n\n## Rules\n\n- Write just title, nothing else\n- Title should be concise and clear - Write maximum ideally 2 words, maximum 5 words\n- Title starts with emoticon\n- Title should not mention the input and output of the workflow but the main purpose of the workflow\n _For example, not \"✍ Convert Knowledge-piece to title\" but \"✍ Title\"_\n\n## The workflow\n\n> {book}\n```\n\n`-> {title}`\n"}],sourceFile:"./books/prepare-title.book"}];
|
|
2186
2184
|
|
|
@@ -13286,10 +13284,8 @@
|
|
|
13286
13284
|
watch: promises.watch,
|
|
13287
13285
|
};
|
|
13288
13286
|
}
|
|
13289
|
-
/**
|
|
13290
|
-
|
|
13291
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
13292
|
-
*/
|
|
13287
|
+
/** Note: [🟢] Code for Node scraper registration helper [$provideFilesystemForNode](src/scrapers/_common/register/$provideFilesystemForNode.ts) should never be published into packages that could be imported into browser environment */
|
|
13288
|
+
/** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
|
|
13293
13289
|
|
|
13294
13290
|
/**
|
|
13295
13291
|
* Retrieves an intermediate source for a scraper based on the knowledge source.
|
|
@@ -13353,12 +13349,12 @@
|
|
|
13353
13349
|
};
|
|
13354
13350
|
return fileHandler;
|
|
13355
13351
|
}
|
|
13352
|
+
/** Note: [🟢] Code for Node scraper helper [getScraperIntermediateSource](src/scrapers/_common/utils/getScraperIntermediateSource.ts) should never be published into packages that could be imported into browser environment */
|
|
13356
13353
|
/**
|
|
13357
13354
|
* Note: Not using `FileCacheStorage` for two reasons:
|
|
13358
13355
|
* 1) Need to store more than serialized JSONs
|
|
13359
13356
|
* 2) Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
|
|
13360
13357
|
* TODO: [🐱🐉][🧠] Make some smart crop
|
|
13361
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13362
13358
|
*/
|
|
13363
13359
|
|
|
13364
13360
|
/**
|
|
@@ -13690,11 +13686,11 @@
|
|
|
13690
13686
|
return knowledge;
|
|
13691
13687
|
}
|
|
13692
13688
|
}
|
|
13689
|
+
/** Note: [🟢] Code for Node scraper implementation [WebsiteScraper](src/scrapers/website/WebsiteScraper.ts) should never be published into packages that could be imported into browser environment */
|
|
13693
13690
|
/**
|
|
13694
13691
|
* TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
|
|
13695
13692
|
* TODO: [🪂] Do it in parallel 11:11
|
|
13696
13693
|
* Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
13697
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13698
13694
|
*/
|
|
13699
13695
|
|
|
13700
13696
|
/**
|
|
@@ -13817,9 +13813,7 @@
|
|
|
13817
13813
|
`);
|
|
13818
13814
|
}
|
|
13819
13815
|
}
|
|
13820
|
-
/**
|
|
13821
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
13822
|
-
*/
|
|
13816
|
+
/** Note: [🟢] Code for Node browser-fetch helper [fetchUrlContent](src/commitments/USE_BROWSER/fetchUrlContent.ts) should never be published into packages that could be imported into browser environment */
|
|
13823
13817
|
|
|
13824
13818
|
/**
|
|
13825
13819
|
* Cached implementation of `run_browser` when it can be resolved.
|
|
@@ -18410,10 +18404,6 @@
|
|
|
18410
18404
|
* Prefix used for TEAM tool names.
|
|
18411
18405
|
*/
|
|
18412
18406
|
const TEAM_TOOL_PREFIX = 'team_chat_';
|
|
18413
|
-
/**
|
|
18414
|
-
* Length of URL hash suffix appended to TEAM tool names.
|
|
18415
|
-
*/
|
|
18416
|
-
const TEAM_TOOL_HASH_LENGTH = 10;
|
|
18417
18407
|
/**
|
|
18418
18408
|
* Fallback normalized name when teammate label is empty.
|
|
18419
18409
|
*/
|
|
@@ -18430,20 +18420,19 @@
|
|
|
18430
18420
|
return normalized || TEAM_TOOL_FALLBACK_NAME;
|
|
18431
18421
|
}
|
|
18432
18422
|
/**
|
|
18433
|
-
* Builds a deterministic TEAM tool name from teammate
|
|
18423
|
+
* Builds a deterministic TEAM tool name from the teammate label.
|
|
18434
18424
|
*
|
|
18435
|
-
* The
|
|
18436
|
-
*
|
|
18425
|
+
* The tool name is derived solely from the human-readable label so that it
|
|
18426
|
+
* remains stable and predictable regardless of internal technical identifiers.
|
|
18437
18427
|
*
|
|
18438
|
-
* @param
|
|
18439
|
-
* @param teammateLabel - Human-readable teammate label.
|
|
18440
|
-
* @returns
|
|
18428
|
+
* @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
|
|
18429
|
+
* @param teammateLabel - Human-readable teammate label used as the basis for the name.
|
|
18430
|
+
* @returns TEAM tool name derived from the label.
|
|
18441
18431
|
* @private internal utility of TEAM commitments and chat UI mapping
|
|
18442
18432
|
*/
|
|
18443
|
-
function createTeamToolName(
|
|
18433
|
+
function createTeamToolName(_teammateUrl, teammateLabel) {
|
|
18444
18434
|
const normalizedLabel = normalizeTeammateToolNamePart(teammateLabel);
|
|
18445
|
-
|
|
18446
|
-
return `${TEAM_TOOL_PREFIX}${normalizedLabel}_${hash}`;
|
|
18435
|
+
return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
|
|
18447
18436
|
}
|
|
18448
18437
|
|
|
18449
18438
|
const urlRegex = /https?:\/\/[^\s]+/gi;
|
|
@@ -18648,7 +18637,7 @@
|
|
|
18648
18637
|
`);
|
|
18649
18638
|
}
|
|
18650
18639
|
applyToAgentModelRequirements(requirements, content) {
|
|
18651
|
-
var _a, _b;
|
|
18640
|
+
var _a, _b, _c;
|
|
18652
18641
|
const trimmedContent = content.trim();
|
|
18653
18642
|
if (!trimmedContent) {
|
|
18654
18643
|
return requirements;
|
|
@@ -18660,14 +18649,18 @@
|
|
|
18660
18649
|
}
|
|
18661
18650
|
const agentName = ((_a = requirements._metadata) === null || _a === void 0 ? void 0 : _a.agentName) || 'Agent';
|
|
18662
18651
|
const existingTeammates = ((_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.teammates) || [];
|
|
18652
|
+
const preResolvedProfiles = (((_c = requirements._metadata) === null || _c === void 0 ? void 0 : _c.preResolvedTeammateProfiles) || {});
|
|
18663
18653
|
const resolvedTeammates = resolveTeamTeammateLabels(trimmedContent, teammates);
|
|
18664
18654
|
const teamEntries = resolvedTeammates.map((teammate) => {
|
|
18655
|
+
const profile = preResolvedProfiles[teammate.url];
|
|
18656
|
+
const resolvedLabel = (profile === null || profile === void 0 ? void 0 : profile.agentName) || teammate.label;
|
|
18665
18657
|
const existingTeammate = existingTeammates.find((entry) => entry.url === teammate.url);
|
|
18666
18658
|
return {
|
|
18667
18659
|
toolName: ((existingTeammate === null || existingTeammate === void 0 ? void 0 : existingTeammate.toolName) ||
|
|
18668
|
-
createTeamToolName(teammate.url,
|
|
18669
|
-
teammate,
|
|
18660
|
+
createTeamToolName(teammate.url, resolvedLabel)),
|
|
18661
|
+
teammate: { ...teammate, label: resolvedLabel },
|
|
18670
18662
|
agentName,
|
|
18663
|
+
description: (profile === null || profile === void 0 ? void 0 : profile.personaDescription) || null,
|
|
18671
18664
|
};
|
|
18672
18665
|
});
|
|
18673
18666
|
for (const entry of teamEntries) {
|
|
@@ -18679,9 +18672,12 @@
|
|
|
18679
18672
|
if (updatedTools.some((tool) => tool.name === entry.toolName)) {
|
|
18680
18673
|
continue;
|
|
18681
18674
|
}
|
|
18675
|
+
const toolDescription = entry.description
|
|
18676
|
+
? `Consult teammate ${entry.teammate.label}\n${entry.description}`
|
|
18677
|
+
: `Consult teammate ${entry.teammate.label}`;
|
|
18682
18678
|
updatedTools.push({
|
|
18683
18679
|
name: entry.toolName,
|
|
18684
|
-
description:
|
|
18680
|
+
description: toolDescription,
|
|
18685
18681
|
parameters: {
|
|
18686
18682
|
type: 'object',
|
|
18687
18683
|
properties: {
|
|
@@ -18710,8 +18706,7 @@
|
|
|
18710
18706
|
toolName: entry.toolName,
|
|
18711
18707
|
});
|
|
18712
18708
|
}
|
|
18713
|
-
const
|
|
18714
|
-
const teamSystemMessage = this.createSystemMessageSection('Teammates:', buildTeamSystemMessageBody(teamOverviewText, teamEntries));
|
|
18709
|
+
const teamSystemMessage = this.createSystemMessageSection('Teammates:', buildTeamSystemMessageBody(teamEntries));
|
|
18715
18710
|
return this.appendToSystemMessage({
|
|
18716
18711
|
...requirements,
|
|
18717
18712
|
tools: updatedTools,
|
|
@@ -18748,25 +18743,24 @@
|
|
|
18748
18743
|
};
|
|
18749
18744
|
});
|
|
18750
18745
|
}
|
|
18751
|
-
/**
|
|
18752
|
-
* Rewrites TEAM commitment content into a URL-free teammate overview text.
|
|
18753
|
-
*/
|
|
18754
|
-
function createTeamOverviewText(teamContent, teamEntries) {
|
|
18755
|
-
let overviewText = teamContent;
|
|
18756
|
-
for (const entry of teamEntries) {
|
|
18757
|
-
overviewText = overviewText.split(entry.teammate.url).join(entry.teammate.label);
|
|
18758
|
-
}
|
|
18759
|
-
return overviewText.trim();
|
|
18760
|
-
}
|
|
18761
18746
|
/**
|
|
18762
18747
|
* Builds the textual TEAM section body for the final system message.
|
|
18748
|
+
*
|
|
18749
|
+
* Each teammate is listed with its tool name and, when available, a one-line description.
|
|
18750
|
+
* Uses `spaceTrim` to ensure consistent whitespace and indentation.
|
|
18763
18751
|
*/
|
|
18764
|
-
function buildTeamSystemMessageBody(
|
|
18765
|
-
const
|
|
18766
|
-
|
|
18767
|
-
|
|
18768
|
-
|
|
18769
|
-
|
|
18752
|
+
function buildTeamSystemMessageBody(teamEntries) {
|
|
18753
|
+
const lines = teamEntries.map((entry, index) => {
|
|
18754
|
+
const toolLine = `${index + 1}) ${entry.teammate.label} tool \`${entry.toolName}\``;
|
|
18755
|
+
if (!entry.description) {
|
|
18756
|
+
return toolLine;
|
|
18757
|
+
}
|
|
18758
|
+
return _spaceTrim.spaceTrim(`
|
|
18759
|
+
${toolLine}
|
|
18760
|
+
${entry.description}
|
|
18761
|
+
`);
|
|
18762
|
+
});
|
|
18763
|
+
return lines.join('\n');
|
|
18770
18764
|
}
|
|
18771
18765
|
/**
|
|
18772
18766
|
* Registers tool function and title for a teammate tool.
|
|
@@ -25426,9 +25420,7 @@
|
|
|
25426
25420
|
}
|
|
25427
25421
|
});
|
|
25428
25422
|
}
|
|
25429
|
-
/**
|
|
25430
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25431
|
-
*/
|
|
25423
|
+
/** Note: [🟢] Code for Node command-execution helper [$execCommand](src/utils/execCommand/$execCommand.ts) should never be published into packages that could be imported into browser environment */
|
|
25432
25424
|
|
|
25433
25425
|
/**
|
|
25434
25426
|
* Attempts to locate the specified application on a Linux system using the 'which' command.
|
|
@@ -25446,10 +25438,8 @@
|
|
|
25446
25438
|
return null;
|
|
25447
25439
|
}
|
|
25448
25440
|
}
|
|
25449
|
-
/**
|
|
25450
|
-
|
|
25451
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25452
|
-
*/
|
|
25441
|
+
/** Note: [🟢] Code for Node executable locator [locateAppOnLinux](src/executables/platforms/locateAppOnLinux.ts) should never be published into packages that could be imported into browser environment */
|
|
25442
|
+
/** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
|
|
25453
25443
|
|
|
25454
25444
|
/**
|
|
25455
25445
|
* Checks if the file is executable
|
|
@@ -25502,10 +25492,8 @@
|
|
|
25502
25492
|
return null;
|
|
25503
25493
|
}
|
|
25504
25494
|
}
|
|
25505
|
-
/**
|
|
25506
|
-
|
|
25507
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25508
|
-
*/
|
|
25495
|
+
/** Note: [🟢] Code for Node executable locator [locateAppOnMacOs](src/executables/platforms/locateAppOnMacOs.ts) should never be published into packages that could be imported into browser environment */
|
|
25496
|
+
/** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
|
|
25509
25497
|
|
|
25510
25498
|
/**
|
|
25511
25499
|
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
@@ -25534,10 +25522,8 @@
|
|
|
25534
25522
|
return null;
|
|
25535
25523
|
}
|
|
25536
25524
|
}
|
|
25537
|
-
/**
|
|
25538
|
-
|
|
25539
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25540
|
-
*/
|
|
25525
|
+
/** Note: [🟢] Code for Node executable locator [locateAppOnWindows](src/executables/platforms/locateAppOnWindows.ts) should never be published into packages that could be imported into browser environment */
|
|
25526
|
+
/** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
|
|
25541
25527
|
|
|
25542
25528
|
/**
|
|
25543
25529
|
* Locates an application on the system
|
|
@@ -25574,10 +25560,8 @@
|
|
|
25574
25560
|
}
|
|
25575
25561
|
}
|
|
25576
25562
|
}
|
|
25577
|
-
/**
|
|
25578
|
-
|
|
25579
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25580
|
-
*/
|
|
25563
|
+
/** Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment */
|
|
25564
|
+
/** TODO: [🧠][♿] Maybe export through `@promptbook/node` */
|
|
25581
25565
|
|
|
25582
25566
|
/**
|
|
25583
25567
|
* Locates the LibreOffice executable on the current system by searching platform-specific paths.
|
|
@@ -25593,10 +25577,8 @@
|
|
|
25593
25577
|
macOsName: 'LibreOffice',
|
|
25594
25578
|
});
|
|
25595
25579
|
}
|
|
25596
|
-
/**
|
|
25597
|
-
|
|
25598
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25599
|
-
*/
|
|
25580
|
+
/** Note: [🟢] Code for Node executable locator [locateLibreoffice](src/executables/apps/locateLibreoffice.ts) should never be published into packages that could be imported into browser environment */
|
|
25581
|
+
/** TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents` */
|
|
25600
25582
|
|
|
25601
25583
|
/**
|
|
25602
25584
|
* Locates the Pandoc executable on the current system by searching platform-specific paths.
|
|
@@ -25612,10 +25594,8 @@
|
|
|
25612
25594
|
macOsName: 'Pandoc',
|
|
25613
25595
|
});
|
|
25614
25596
|
}
|
|
25615
|
-
/**
|
|
25616
|
-
|
|
25617
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25618
|
-
*/
|
|
25597
|
+
/** Note: [🟢] Code for Node executable locator [locatePandoc](src/executables/apps/locatePandoc.ts) should never be published into packages that could be imported into browser environment */
|
|
25598
|
+
/** TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents` */
|
|
25619
25599
|
|
|
25620
25600
|
/**
|
|
25621
25601
|
* Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
|
|
@@ -25632,9 +25612,9 @@
|
|
|
25632
25612
|
// <- TODO: [🧠] `null` vs `undefined`
|
|
25633
25613
|
};
|
|
25634
25614
|
}
|
|
25615
|
+
/** Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment */
|
|
25635
25616
|
/**
|
|
25636
25617
|
* TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
|
|
25637
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25638
25618
|
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
25639
25619
|
*/
|
|
25640
25620
|
|
|
@@ -25842,9 +25822,7 @@
|
|
|
25842
25822
|
}
|
|
25843
25823
|
return null;
|
|
25844
25824
|
}
|
|
25845
|
-
/**
|
|
25846
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25847
|
-
*/
|
|
25825
|
+
/** Note: [🟢] Code for Node environment helper [$provideEnvFilename](src/llm-providers/_common/register/$provideEnvFilename.ts) should never be published into packages that could be imported into browser environment */
|
|
25848
25826
|
|
|
25849
25827
|
/**
|
|
25850
25828
|
* Provides LLM tools configuration by reading environment variables.
|
|
@@ -25874,9 +25852,7 @@
|
|
|
25874
25852
|
.filter((configuration) => configuration !== null);
|
|
25875
25853
|
return llmToolsConfiguration;
|
|
25876
25854
|
}
|
|
25877
|
-
/**
|
|
25878
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25879
|
-
*/
|
|
25855
|
+
/** Note: [🟢] Code for Node environment helper [$provideLlmToolsConfigurationFromEnv](src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.ts) should never be published into packages that could be imported into browser environment */
|
|
25880
25856
|
|
|
25881
25857
|
/**
|
|
25882
25858
|
* Creates LLM execution tools from provided configuration objects
|
|
@@ -25982,20 +25958,18 @@
|
|
|
25982
25958
|
}
|
|
25983
25959
|
return createLlmToolsFromConfiguration(configuration, options);
|
|
25984
25960
|
}
|
|
25961
|
+
/** Note: [🟢] Code for Node environment helper [$provideLlmToolsFromEnv](src/llm-providers/_common/register/$provideLlmToolsFromEnv.ts) should never be published into packages that could be imported into browser environment */
|
|
25985
25962
|
/**
|
|
25986
25963
|
* TODO: The architecture for LLM tools configuration consists of three key functions:
|
|
25987
25964
|
* 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
|
|
25988
25965
|
* 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
|
|
25989
25966
|
* 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
|
|
25990
|
-
*
|
|
25991
25967
|
* This layered approach allows flexibility in how tools are configured:
|
|
25992
25968
|
* - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
|
|
25993
25969
|
* - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
|
|
25994
25970
|
* - Use createLlmToolsFromConfiguration for explicit control over tool configurations
|
|
25995
|
-
*
|
|
25996
25971
|
* TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
|
|
25997
25972
|
* TODO: [🧠] Is there some meaningfull way how to test this util
|
|
25998
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25999
25973
|
* TODO: [🥃] Allow `ptbk make` without llm tools
|
|
26000
25974
|
* TODO: This should be maybe not under `_common` but under `utils`
|
|
26001
25975
|
* TODO: [®] DRY Register logic
|
|
@@ -26024,10 +25998,8 @@
|
|
|
26024
25998
|
}
|
|
26025
25999
|
return scrapers;
|
|
26026
26000
|
}
|
|
26027
|
-
/**
|
|
26028
|
-
|
|
26029
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
26030
|
-
*/
|
|
26001
|
+
/** Note: [🟢] Code for Node scraper registration helper [$provideScrapersForNode](src/scrapers/_common/register/$provideScrapersForNode.ts) should never be published into packages that could be imported into browser environment */
|
|
26002
|
+
/** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
|
|
26031
26003
|
|
|
26032
26004
|
/**
|
|
26033
26005
|
* Extracts code block from markdown.
|
|
@@ -26343,10 +26315,8 @@
|
|
|
26343
26315
|
};
|
|
26344
26316
|
return tools;
|
|
26345
26317
|
}
|
|
26346
|
-
/**
|
|
26347
|
-
|
|
26348
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
26349
|
-
*/
|
|
26318
|
+
/** Note: [🟢] Code for Node execution helper [$provideExecutionToolsForNode](src/execution/utils/$provideExecutionToolsForNode.ts) should never be published into packages that could be imported into browser environment */
|
|
26319
|
+
/** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
|
|
26350
26320
|
|
|
26351
26321
|
/**
|
|
26352
26322
|
* Checks if the directory exists
|
|
@@ -26669,10 +26639,8 @@
|
|
|
26669
26639
|
// TODO: [🔱] Do here auto-installation
|
|
26670
26640
|
return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
|
|
26671
26641
|
}
|
|
26672
|
-
/**
|
|
26673
|
-
|
|
26674
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
26675
|
-
*/
|
|
26642
|
+
/** Note: [🟢] Code for Node scraper registration helper [$provideScriptingForNode](src/scrapers/_common/register/$provideScriptingForNode.ts) should never be published into packages that could be imported into browser environment */
|
|
26643
|
+
/** TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming */
|
|
26676
26644
|
|
|
26677
26645
|
/**
|
|
26678
26646
|
* Stringify the PipelineJson with proper formatting
|
|
@@ -26795,10 +26763,8 @@
|
|
|
26795
26763
|
// [0] When `setItem` and `removeItem` called, the state of the file system should be the same
|
|
26796
26764
|
}
|
|
26797
26765
|
}
|
|
26798
|
-
/**
|
|
26799
|
-
|
|
26800
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
26801
|
-
*/
|
|
26766
|
+
/** Note: [🟢] Code for Node file-cache storage [FileCacheStorage](src/storage/file-cache-storage/FileCacheStorage.ts) should never be published into packages that could be imported into browser environment */
|
|
26767
|
+
/** TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values */
|
|
26802
26768
|
|
|
26803
26769
|
/**
|
|
26804
26770
|
* Run multiple commands in a shell in sequence
|
|
@@ -26815,9 +26781,7 @@
|
|
|
26815
26781
|
await $execCommand({ command, cwd, crashOnError });
|
|
26816
26782
|
}
|
|
26817
26783
|
}
|
|
26818
|
-
/**
|
|
26819
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
26820
|
-
*/
|
|
26784
|
+
/** Note: [🟢] Code for Node command-execution helper [$execCommands](src/utils/execCommand/$execCommands.ts) should never be published into packages that could be imported into browser environment */
|
|
26821
26785
|
|
|
26822
26786
|
/**
|
|
26823
26787
|
* Keep-alive helpers used for streaming chat responses.
|
|
@@ -27070,13 +27034,23 @@
|
|
|
27070
27034
|
*/
|
|
27071
27035
|
function mergeToolCalls(existingToolCalls, incomingToolCalls) {
|
|
27072
27036
|
if (!existingToolCalls || existingToolCalls.length === 0) {
|
|
27073
|
-
return incomingToolCalls ? [...incomingToolCalls] : [];
|
|
27037
|
+
return incomingToolCalls ? deduplicatePreparationToolCalls([...incomingToolCalls]) : [];
|
|
27074
27038
|
}
|
|
27075
27039
|
if (!incomingToolCalls || incomingToolCalls.length === 0) {
|
|
27076
27040
|
return [...existingToolCalls];
|
|
27077
27041
|
}
|
|
27078
27042
|
const mergedToolCalls = [...existingToolCalls];
|
|
27079
27043
|
for (const incomingToolCall of incomingToolCalls) {
|
|
27044
|
+
if (isAssistantPreparationToolCall(incomingToolCall)) {
|
|
27045
|
+
// A new preparation phase always replaces any previous assistant_preparation tool
|
|
27046
|
+
// call, regardless of phase argument, so only one chip is ever shown at a time.
|
|
27047
|
+
const existingPreparationIndex = mergedToolCalls.findIndex(isAssistantPreparationToolCall);
|
|
27048
|
+
if (existingPreparationIndex !== -1) {
|
|
27049
|
+
mergedToolCalls.splice(existingPreparationIndex, 1);
|
|
27050
|
+
}
|
|
27051
|
+
mergedToolCalls.push(incomingToolCall);
|
|
27052
|
+
continue;
|
|
27053
|
+
}
|
|
27080
27054
|
const incomingIdentity = getToolCallIdentity(incomingToolCall);
|
|
27081
27055
|
const existingIndex = mergedToolCalls.findIndex((existingToolCall) => getToolCallIdentity(existingToolCall) === incomingIdentity);
|
|
27082
27056
|
if (existingIndex === -1) {
|
|
@@ -27188,6 +27162,30 @@
|
|
|
27188
27162
|
return String(value);
|
|
27189
27163
|
}
|
|
27190
27164
|
}
|
|
27165
|
+
/**
|
|
27166
|
+
* Ensures at most one `assistant_preparation` tool call survives in the list,
|
|
27167
|
+
* keeping the last occurrence so the most recent preparation phase is shown.
|
|
27168
|
+
*
|
|
27169
|
+
* @param toolCalls - Mutable list to deduplicate in-place.
|
|
27170
|
+
* @returns The same array after removing redundant preparation entries.
|
|
27171
|
+
* @private helper of `mergeToolCalls`
|
|
27172
|
+
*/
|
|
27173
|
+
function deduplicatePreparationToolCalls(toolCalls) {
|
|
27174
|
+
let lastPreparationIndex = -1;
|
|
27175
|
+
for (let index = toolCalls.length - 1; index >= 0; index--) {
|
|
27176
|
+
if (!isAssistantPreparationToolCall(toolCalls[index])) {
|
|
27177
|
+
continue;
|
|
27178
|
+
}
|
|
27179
|
+
if (lastPreparationIndex === -1) {
|
|
27180
|
+
lastPreparationIndex = index;
|
|
27181
|
+
}
|
|
27182
|
+
else {
|
|
27183
|
+
// Remove earlier duplicate — keep only the last (most recent) one.
|
|
27184
|
+
toolCalls.splice(index, 1);
|
|
27185
|
+
}
|
|
27186
|
+
}
|
|
27187
|
+
return toolCalls;
|
|
27188
|
+
}
|
|
27191
27189
|
|
|
27192
27190
|
/**
|
|
27193
27191
|
* Computes SHA-256 hash of the agent source
|
|
@@ -28120,7 +28118,7 @@
|
|
|
28120
28118
|
* @private @@@
|
|
28121
28119
|
*/
|
|
28122
28120
|
async function createAgentModelRequirementsWithCommitments(agentSource, modelName, options) {
|
|
28123
|
-
var _a;
|
|
28121
|
+
var _a, _b, _c;
|
|
28124
28122
|
const agentReferenceResolver = options === null || options === void 0 ? void 0 : options.agentReferenceResolver;
|
|
28125
28123
|
// Parse the agent source to extract commitments
|
|
28126
28124
|
const parseResult = parseAgentSourceWithCommitments(agentSource);
|
|
@@ -28188,6 +28186,36 @@
|
|
|
28188
28186
|
if (commitment.type === 'CLOSED' && i !== filteredCommitments.length - 1) {
|
|
28189
28187
|
continue;
|
|
28190
28188
|
}
|
|
28189
|
+
// For TEAM commitments, pre-resolve teammate profiles if a resolver is provided
|
|
28190
|
+
// and store them in metadata before the commitment is applied.
|
|
28191
|
+
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;
|
|
28192
|
+
if (commitment.type === 'TEAM' && (profileResolver === null || profileResolver === void 0 ? void 0 : profileResolver.resolveTeammateProfile)) {
|
|
28193
|
+
try {
|
|
28194
|
+
const parsedTeammates = parseTeamCommitmentContent(commitmentContent, { strict: false });
|
|
28195
|
+
const preResolved = {
|
|
28196
|
+
...(_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.preResolvedTeammateProfiles,
|
|
28197
|
+
};
|
|
28198
|
+
for (const teammate of parsedTeammates) {
|
|
28199
|
+
if (preResolved[teammate.url]) {
|
|
28200
|
+
continue;
|
|
28201
|
+
}
|
|
28202
|
+
const profile = await profileResolver.resolveTeammateProfile(teammate.url);
|
|
28203
|
+
if (profile) {
|
|
28204
|
+
preResolved[teammate.url] = profile;
|
|
28205
|
+
}
|
|
28206
|
+
}
|
|
28207
|
+
requirements = {
|
|
28208
|
+
...requirements,
|
|
28209
|
+
_metadata: {
|
|
28210
|
+
...requirements._metadata,
|
|
28211
|
+
preResolvedTeammateProfiles: preResolved,
|
|
28212
|
+
},
|
|
28213
|
+
};
|
|
28214
|
+
}
|
|
28215
|
+
catch (error) {
|
|
28216
|
+
console.warn('Failed to pre-resolve teammate profiles for TEAM commitment:', error);
|
|
28217
|
+
}
|
|
28218
|
+
}
|
|
28191
28219
|
const definition = getCommitmentDefinition(commitment.type);
|
|
28192
28220
|
if (definition) {
|
|
28193
28221
|
try {
|
|
@@ -28283,7 +28311,7 @@
|
|
|
28283
28311
|
// Add example interactions to the system message
|
|
28284
28312
|
const examples = [];
|
|
28285
28313
|
// 1. Initial message as an example agent response
|
|
28286
|
-
const initialMessage = (
|
|
28314
|
+
const initialMessage = (_c = parseResult.commitments.find((c) => c.type === 'INITIAL MESSAGE')) === null || _c === void 0 ? void 0 : _c.content;
|
|
28287
28315
|
if (initialMessage) {
|
|
28288
28316
|
examples.push(`Agent: ${initialMessage}`);
|
|
28289
28317
|
}
|