@promptbook/remote-server 0.112.0-32 → 0.112.0-35
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/README.md +18 -0
- package/esm/index.es.js +711 -694
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/types.index.d.ts +94 -94
- package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -4
- package/esm/src/book-2.0/agent-source/AgentModelRequirements.d.ts +0 -4
- package/esm/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +7 -0
- package/esm/src/book-2.0/agent-source/createTeamToolName.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/padBook.d.ts +1 -4
- package/esm/src/book-2.0/agent-source/parseAgentSource.d.ts +0 -3
- package/esm/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/parseParameters.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/parseTeamCommitment.d.ts +0 -3
- package/esm/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +8 -3
- package/esm/src/book-2.0/agent-source/string_book.d.ts +1 -0
- package/esm/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +0 -3
- package/esm/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +0 -3
- package/esm/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +0 -3
- package/esm/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +4 -0
- package/esm/src/book-components/BookEditor/BookEditor.d.ts +0 -3
- package/esm/src/book-components/BookEditor/BookEditorActionbar.d.ts +4 -0
- package/esm/src/book-components/BookEditor/BookEditorMonaco.d.ts +2 -0
- package/esm/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +3 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +1 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoDecorations.d.ts +6 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoDiagnostics.d.ts +9 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +7 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +3 -0
- package/esm/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +24 -0
- package/esm/src/book-components/Chat/AgentChat/AgentChat.d.ts +0 -3
- package/esm/src/book-components/Chat/AgentChip/AgentChip.d.ts +6 -5
- package/esm/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +38 -0
- package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -14
- 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 +2 -3
- package/esm/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
- package/esm/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
- package/esm/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +34 -0
- package/esm/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/constants.d.ts +4 -3
- 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/insertDictationChunk.d.ts +16 -0
- package/esm/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
- package/esm/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
- package/esm/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
- package/esm/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +27 -0
- package/esm/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +33 -0
- package/esm/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +39 -0
- package/esm/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +39 -0
- package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +47 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +34 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +3 -2
- package/esm/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +30 -0
- package/esm/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +27 -0
- package/esm/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
- package/esm/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +10 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +53 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -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/LlmChat/defaults.d.ts +0 -3
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
- package/esm/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
- package/esm/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
- package/esm/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
- package/esm/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
- package/esm/src/book-components/Chat/effects/index.d.ts +0 -4
- package/esm/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
- package/esm/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
- package/esm/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
- package/esm/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
- package/esm/src/book-components/Chat/save/index.d.ts +0 -3
- package/esm/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
- package/esm/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
- package/esm/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
- package/esm/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
- package/esm/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
- package/esm/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
- package/esm/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
- package/esm/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
- package/esm/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
- package/esm/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
- package/esm/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
- package/esm/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
- package/esm/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
- package/esm/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
- package/esm/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
- package/esm/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
- package/esm/src/book-components/Qr/GenericQrCode.d.ts +5 -0
- package/esm/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
- package/esm/src/book-components/Qr/useQrCode.d.ts +4 -1
- package/esm/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
- package/esm/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
- package/esm/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
- package/esm/src/book-components/_common/Modal/Modal.d.ts +1 -3
- package/esm/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
- package/esm/src/book-components/icons/AboutIcon.d.ts +1 -0
- package/esm/src/book-components/icons/AttachmentIcon.d.ts +4 -0
- package/esm/src/book-components/icons/CameraIcon.d.ts +4 -0
- package/esm/src/book-components/icons/DownloadIcon.d.ts +1 -0
- package/esm/src/book-components/icons/EmailIcon.d.ts +1 -0
- package/esm/src/book-components/icons/MenuIcon.d.ts +1 -3
- package/esm/src/book-components/icons/SaveIcon.d.ts +1 -0
- package/esm/src/book-components/icons/SendIcon.d.ts +0 -3
- package/esm/src/book-components/icons/TeacherIcon.d.ts +1 -0
- package/esm/src/cli/$runPromptbookCli.d.ts +0 -3
- package/esm/src/cli/cli-commands/_boilerplate.d.ts +0 -4
- package/esm/src/cli/cli-commands/about.d.ts +0 -6
- package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
- package/esm/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -4
- package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -4
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -4
- package/esm/src/cli/cli-commands/coder/init.d.ts +0 -4
- package/esm/src/cli/cli-commands/coder/run.d.ts +1 -5
- package/esm/src/cli/cli-commands/coder/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/verify.d.ts +0 -4
- package/esm/src/cli/cli-commands/coder.d.ts +0 -4
- package/esm/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
- package/esm/src/cli/cli-commands/hello.d.ts +0 -5
- package/esm/src/cli/cli-commands/list-models.d.ts +0 -4
- package/esm/src/cli/cli-commands/list-scrapers.d.ts +0 -4
- package/esm/src/cli/cli-commands/login.d.ts +0 -5
- package/esm/src/cli/cli-commands/make.d.ts +1 -1
- package/esm/src/cli/cli-commands/prettify.d.ts +0 -6
- package/esm/src/cli/cli-commands/run.d.ts +0 -8
- package/esm/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
- package/esm/src/cli/cli-commands/start-agents-server.d.ts +0 -4
- package/esm/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
- package/esm/src/cli/cli-commands/test-command.d.ts +0 -7
- package/esm/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
- package/esm/src/cli/main.d.ts +0 -4
- package/esm/src/cli/promptbookCli.d.ts +0 -7
- package/esm/src/collection/agent-collection/AgentCollection.d.ts +0 -3
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
- package/esm/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
- package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
- package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
- package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
- package/esm/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
- package/esm/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
- package/esm/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
- package/esm/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
- package/esm/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
- package/esm/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
- package/esm/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
- package/esm/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
- package/esm/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
- package/esm/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
- package/esm/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
- package/esm/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
- package/esm/src/commands/JOKER/JokerCommand.d.ts +1 -0
- package/esm/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
- package/esm/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
- package/esm/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
- package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
- package/esm/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
- package/esm/src/commands/MODEL/ModelCommand.d.ts +1 -0
- package/esm/src/commands/MODEL/modelCommandParser.d.ts +1 -0
- package/esm/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
- package/esm/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
- package/esm/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
- package/esm/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
- package/esm/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
- package/esm/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
- package/esm/src/commands/SECTION/SectionCommand.d.ts +1 -0
- package/esm/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
- package/esm/src/commands/URL/UrlCommand.d.ts +1 -0
- package/esm/src/commands/URL/urlCommandParser.d.ts +1 -0
- package/esm/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
- package/esm/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
- package/esm/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
- package/esm/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
- package/esm/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
- package/esm/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
- package/esm/src/commands/_common/stringifyCommand.d.ts +1 -1
- package/esm/src/commands/_common/types/CommandParser.d.ts +0 -4
- package/esm/src/commands/index.d.ts +0 -3
- package/esm/src/commitments/ACTION/ACTION.d.ts +0 -3
- package/esm/src/commitments/CLOSED/CLOSED.d.ts +0 -3
- package/esm/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
- package/esm/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
- package/esm/src/commitments/DELETE/DELETE.d.ts +0 -3
- package/esm/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
- package/esm/src/commitments/FORMAT/FORMAT.d.ts +0 -3
- package/esm/src/commitments/FROM/FROM.d.ts +0 -3
- package/esm/src/commitments/GOAL/GOAL.d.ts +0 -3
- package/esm/src/commitments/IMPORT/IMPORT.d.ts +0 -3
- package/esm/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
- package/esm/src/commitments/MEMORY/MEMORY.d.ts +0 -3
- package/esm/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
- package/esm/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
- package/esm/src/commitments/META/META.d.ts +0 -3
- package/esm/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
- package/esm/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
- package/esm/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
- package/esm/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
- package/esm/src/commitments/META_FONT/META_FONT.d.ts +0 -3
- package/esm/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
- package/esm/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
- package/esm/src/commitments/META_LINK/META_LINK.d.ts +0 -3
- package/esm/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
- package/esm/src/commitments/MODEL/MODEL.d.ts +0 -3
- package/esm/src/commitments/OPEN/OPEN.d.ts +0 -3
- package/esm/src/commitments/PERSONA/PERSONA.d.ts +0 -3
- package/esm/src/commitments/RULE/RULE.d.ts +0 -3
- package/esm/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
- package/esm/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
- package/esm/src/commitments/TEAM/TEAM.d.ts +0 -3
- package/esm/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
- package/esm/src/commitments/USE/USE.d.ts +0 -3
- package/esm/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
- package/esm/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
- package/esm/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -7
- package/esm/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
- package/esm/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
- package/esm/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
- package/esm/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
- package/esm/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
- package/esm/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
- package/esm/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
- package/esm/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
- package/esm/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
- package/esm/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
- package/esm/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
- package/esm/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
- package/esm/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
- package/esm/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
- package/esm/src/commitments/WALLET/WALLET.d.ts +0 -3
- package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
- package/esm/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
- package/esm/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
- package/esm/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
- package/esm/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
- package/esm/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
- package/esm/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
- package/esm/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
- package/esm/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
- package/esm/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
- package/esm/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
- package/esm/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
- package/esm/src/commitments/index.d.ts +0 -4
- package/esm/src/config.test.d.ts +0 -3
- package/esm/src/constants/streaming.d.ts +0 -3
- package/esm/src/constants.d.ts +0 -3
- package/esm/src/conversion/archive/loadArchive.d.ts +0 -3
- package/esm/src/conversion/archive/saveArchive.d.ts +0 -5
- package/esm/src/conversion/compilePipeline.d.ts +2 -7
- package/esm/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
- package/esm/src/conversion/parsePipeline.d.ts +1 -11
- package/esm/src/conversion/pipelineJsonToString.d.ts +1 -7
- package/esm/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
- package/esm/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
- package/esm/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
- package/esm/src/conversion/validation/_importPipeline.d.ts +6 -4
- package/esm/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
- package/esm/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
- package/esm/src/conversion/validation/validatePipeline.d.ts +3 -9
- package/esm/src/conversion/validation/validatePipeline.test.d.ts +0 -3
- package/esm/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -4
- package/esm/src/errors/0-BoilerplateError.d.ts +0 -3
- package/esm/src/errors/0-index.d.ts +0 -3
- package/esm/src/errors/DatabaseError.d.ts +0 -3
- package/esm/src/errors/ExpectError.d.ts +2 -1
- package/esm/src/errors/ParseError.d.ts +0 -3
- package/esm/src/errors/PipelineExecutionError.d.ts +0 -3
- package/esm/src/executables/$provideExecutablesForNode.d.ts +0 -5
- package/esm/src/executables/apps/locateLibreoffice.d.ts +0 -4
- package/esm/src/executables/apps/locatePandoc.d.ts +0 -4
- package/esm/src/executables/browsers/locateBrowser.d.ts +0 -1
- package/esm/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
- package/esm/src/executables/locateApp.d.ts +0 -4
- package/esm/src/executables/platforms/locateAppOnLinux.d.ts +0 -4
- package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +0 -4
- package/esm/src/executables/platforms/locateAppOnWindows.d.ts +0 -4
- package/esm/src/execution/AbstractTaskResult.d.ts +0 -4
- package/esm/src/execution/AvailableModel.d.ts +0 -4
- package/esm/src/execution/CommonToolsOptions.d.ts +0 -5
- package/esm/src/execution/ExecutionTask.d.ts +4 -4
- package/esm/src/execution/FilesystemTools.d.ts +0 -3
- package/esm/src/execution/LlmExecutionTools.d.ts +3 -9
- package/esm/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
- package/esm/src/execution/PipelineExecutor.d.ts +0 -3
- package/esm/src/execution/PipelineExecutorResult.d.ts +0 -3
- package/esm/src/execution/PromptResult.d.ts +1 -9
- package/esm/src/execution/PromptbookFetch.test-type.d.ts +0 -4
- package/esm/src/execution/ScriptExecutionTools.d.ts +0 -4
- package/esm/src/execution/Usage.d.ts +0 -3
- package/esm/src/execution/UserInterfaceTools.d.ts +3 -0
- package/esm/src/execution/assertsTaskSuccessful.d.ts +1 -3
- package/esm/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
- package/esm/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
- package/esm/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
- package/esm/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
- package/esm/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
- package/esm/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
- package/esm/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
- package/esm/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
- package/esm/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
- package/esm/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
- package/esm/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
- package/esm/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
- package/esm/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
- package/esm/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -5
- package/esm/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -6
- package/esm/src/execution/utils/checkExpectations.d.ts +2 -5
- package/esm/src/execution/utils/forEachAsync.d.ts +5 -1
- package/esm/src/execution/utils/usage-constants.d.ts +0 -3
- package/esm/src/execution/utils/usageToHuman.d.ts +0 -8
- package/esm/src/execution/utils/validatePromptResult.d.ts +1 -0
- package/esm/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
- package/esm/src/formats/_common/FormatParser.d.ts +2 -9
- package/esm/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
- package/esm/src/formats/csv/CsvFormatParser.d.ts +2 -8
- package/esm/src/formats/index.d.ts +0 -3
- package/esm/src/formats/json/JsonFormatParser.d.ts +0 -11
- package/esm/src/formats/text/TextFormatParser.d.ts +0 -9
- package/esm/src/formats/xml/XmlFormatParser.d.ts +0 -11
- package/esm/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
- package/esm/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
- package/esm/src/formfactors/index.d.ts +0 -3
- package/esm/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
- package/esm/src/high-level-abstractions/index.d.ts +0 -4
- package/esm/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
- package/esm/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
- package/esm/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
- package/esm/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -3
- package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
- package/esm/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
- package/esm/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
- package/esm/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -18
- package/esm/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
- package/esm/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
- package/esm/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
- package/esm/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
- package/esm/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
- package/esm/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
- package/esm/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
- package/esm/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
- package/esm/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
- package/esm/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
- package/esm/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
- package/esm/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
- package/esm/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
- package/esm/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
- package/esm/src/llm-providers/_multiple/playground/playground.d.ts +0 -3
- package/esm/src/llm-providers/agent/Agent.d.ts +0 -3
- package/esm/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
- package/esm/src/llm-providers/agent/playground/playground.d.ts +0 -6
- package/esm/src/llm-providers/agent/register-configuration.d.ts +0 -5
- package/esm/src/llm-providers/agent/register-constructor.d.ts +0 -4
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
- package/esm/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
- package/esm/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
- package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
- package/esm/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
- package/esm/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
- package/esm/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
- package/esm/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
- package/esm/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
- package/esm/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
- package/esm/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/azure-openai/playground/playground.d.ts +0 -4
- package/esm/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
- package/esm/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
- package/esm/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
- package/esm/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
- package/esm/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
- package/esm/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
- package/esm/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
- package/esm/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
- package/esm/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/google/google-models.d.ts +1 -6
- package/esm/src/llm-providers/google/register-configuration.d.ts +0 -3
- package/esm/src/llm-providers/google/register-constructor.d.ts +0 -4
- package/esm/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
- package/esm/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
- package/esm/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
- package/esm/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
- package/esm/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
- package/esm/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
- package/esm/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
- package/esm/src/llm-providers/ollama/ollama-models.d.ts +1 -4
- package/esm/src/llm-providers/ollama/playground/playground.d.ts +0 -4
- package/esm/src/llm-providers/ollama/register-configuration.d.ts +0 -3
- package/esm/src/llm-providers/ollama/register-constructor.d.ts +0 -4
- package/esm/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
- package/esm/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
- package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
- package/esm/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
- package/esm/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
- package/esm/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
- package/esm/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
- package/esm/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/esm/src/llm-providers/openai/openai-models.test.d.ts +0 -3
- package/esm/src/llm-providers/openai/playground/playground.d.ts +0 -4
- package/esm/src/llm-providers/openai/register-configuration.d.ts +0 -3
- package/esm/src/llm-providers/openai/register-constructor.d.ts +0 -4
- package/esm/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
- package/esm/src/llm-providers/remote/playground/playground.d.ts +0 -3
- package/esm/src/llm-providers/vercel/playground/playground.d.ts +0 -4
- package/esm/src/other/templates/getBookTemplates.d.ts +2 -5
- package/esm/src/personas/preparePersona.d.ts +1 -7
- package/esm/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
- package/esm/src/pipeline/PipelineInterface/constants.d.ts +0 -3
- package/esm/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
- package/esm/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
- package/esm/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
- package/esm/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
- package/esm/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
- package/esm/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
- package/esm/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
- package/esm/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
- package/esm/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
- package/esm/src/pipeline/book-notation.d.ts +1 -4
- package/esm/src/pipeline/isValidPipelineString.d.ts +1 -3
- package/esm/src/pipeline/isValidPipelineString.test.d.ts +0 -3
- package/esm/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
- package/esm/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
- package/esm/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
- package/esm/src/pipeline/prompt-notation.d.ts +2 -5
- package/esm/src/pipeline/prompt-notation.test.d.ts +0 -3
- package/esm/src/pipeline/validatePipelineString.d.ts +1 -3
- package/esm/src/playground/permanent/_boilerplate.d.ts +0 -3
- package/esm/src/playground/permanent/agent-with-browser-playground.d.ts +0 -3
- package/esm/src/playground/permanent/error-handling-playground.d.ts +0 -3
- package/esm/src/playground/playground.d.ts +0 -4
- package/esm/src/postprocessing/utils/extractBlock.d.ts +2 -1
- package/esm/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
- package/esm/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
- package/esm/src/prepare/preparePipeline.d.ts +3 -2
- package/esm/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
- package/esm/src/prepare/prepareTasks.d.ts +6 -10
- package/esm/src/prepare/unpreparePipeline.d.ts +1 -5
- package/esm/src/remote-server/RemoteServer.d.ts +3 -0
- package/esm/src/remote-server/openapi.d.ts +3 -4
- package/esm/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
- package/esm/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
- package/esm/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
- package/esm/src/remote-server/startAgentServer.d.ts +6 -4
- package/esm/src/remote-server/startRemoteServer.d.ts +1 -16
- package/esm/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
- package/esm/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
- package/esm/src/remote-server/ui/ServerApp.d.ts +1 -0
- package/esm/src/remote-server/ui/types.d.ts +3 -0
- package/esm/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -6
- package/esm/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
- package/esm/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
- package/esm/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
- package/esm/src/scrapers/_common/Scraper.d.ts +0 -5
- package/esm/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
- package/esm/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
- package/esm/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -4
- package/esm/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -4
- package/esm/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -4
- package/esm/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
- package/esm/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
- package/esm/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
- package/esm/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
- package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
- package/esm/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
- package/esm/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
- package/esm/src/scrapers/document/DocumentScraper.d.ts +1 -6
- package/esm/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
- package/esm/src/scrapers/document/createDocumentScraper.d.ts +0 -3
- package/esm/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/document/register-constructor.d.ts +0 -4
- package/esm/src/scrapers/document/register-metadata.d.ts +0 -3
- package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
- package/esm/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
- package/esm/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
- package/esm/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
- package/esm/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
- package/esm/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
- package/esm/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
- package/esm/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
- package/esm/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/markdown/register-constructor.d.ts +0 -4
- package/esm/src/scrapers/markdown/register-metadata.d.ts +0 -3
- package/esm/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
- package/esm/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
- package/esm/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/markitdown/register-constructor.d.ts +0 -5
- package/esm/src/scrapers/markitdown/register-metadata.d.ts +0 -3
- package/esm/src/scrapers/pdf/PdfScraper.d.ts +1 -6
- package/esm/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
- package/esm/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/pdf/register-constructor.d.ts +0 -4
- package/esm/src/scrapers/pdf/register-metadata.d.ts +0 -3
- package/esm/src/scrapers/website/WebsiteScraper.d.ts +1 -6
- package/esm/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
- package/esm/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -3
- package/esm/src/scrapers/website/register-constructor.d.ts +0 -4
- package/esm/src/scrapers/website/register-metadata.d.ts +0 -3
- package/esm/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
- package/esm/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
- package/esm/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
- package/esm/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
- package/esm/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
- package/esm/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
- package/esm/src/search-engines/SearchEngine.d.ts +3 -0
- package/esm/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -4
- package/esm/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
- package/esm/src/storage/_common/PromptbookStorage.d.ts +0 -4
- package/esm/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
- package/esm/src/storage/env-storage/$EnvStorage.d.ts +0 -3
- package/esm/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -4
- package/esm/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -3
- package/esm/src/storage/local-storage/getLocalStorage.d.ts +0 -3
- package/esm/src/storage/local-storage/getSessionStorage.d.ts +0 -3
- package/esm/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
- package/esm/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
- package/esm/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
- package/esm/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
- package/esm/src/transpilers/openai-sdk/playground/playground.d.ts +0 -3
- package/esm/src/transpilers/openai-sdk/register.d.ts +2 -5
- package/esm/src/types/Arrayable.d.ts +1 -0
- package/esm/src/types/InputParameters_private.d.ts +13 -0
- package/esm/src/types/IntermediateFilesStrategy.d.ts +0 -3
- package/esm/src/types/LlmCall.d.ts +0 -3
- package/esm/src/types/ModelRequirements.d.ts +1 -0
- package/esm/src/types/ModelVariant.d.ts +3 -0
- package/esm/src/types/Parameters.d.ts +31 -0
- package/esm/src/types/Parameters_private.d.ts +18 -0
- package/esm/src/types/Prompt.d.ts +1 -6
- package/esm/src/types/ReservedParameters_private.d.ts +11 -0
- package/esm/src/types/ToolCall.d.ts +0 -2
- package/esm/src/types/Updatable.d.ts +1 -3
- 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.d.ts +32 -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 +10 -0
- package/esm/src/types/string_agent_permanent_id_private.d.ts +11 -0
- package/esm/src/types/string_base64_private.d.ts +17 -0
- package/esm/src/types/string_business_category_name.d.ts +5 -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_markdown.d.ts +0 -1
- package/esm/src/types/string_mime_type_private.d.ts +18 -0
- package/esm/src/types/string_model_description_private.d.ts +8 -0
- package/esm/src/types/string_model_name.d.ts +7 -0
- package/esm/src/types/string_model_name_private.d.ts +8 -0
- package/esm/src/types/string_name.d.ts +31 -0
- package/esm/src/types/string_name_private.d.ts +9 -0
- package/esm/src/types/string_page.d.ts +15 -0
- package/esm/src/types/string_page_private.d.ts +9 -0
- package/esm/src/types/string_parameter_name.d.ts +11 -167
- package/esm/src/types/string_parameter_value_private.d.ts +9 -0
- package/esm/src/types/string_persona_description.d.ts +14 -0
- package/esm/src/types/string_persona_description_private.d.ts +8 -0
- package/esm/src/types/string_prompt.d.ts +49 -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_sha256.d.ts +2 -2
- 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.d.ts +8 -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/typeAliasEmoji.d.ts +0 -3
- package/esm/src/types/typeAliases.d.ts +7 -7
- package/esm/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
- package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
- package/esm/src/utils/chat/chatAttachments.d.ts +0 -3
- package/esm/src/utils/chat/constants.d.ts +0 -3
- package/esm/src/utils/clientVersion.d.ts +0 -3
- package/esm/src/utils/color/$randomColor.d.ts +0 -5
- package/esm/src/utils/color/css-colors.d.ts +0 -3
- package/esm/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
- package/esm/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
- package/esm/src/utils/color/operators/ColorTransformer.d.ts +2 -0
- package/esm/src/utils/color/operators/lighten.d.ts +0 -3
- package/esm/src/utils/color/operators/saturate.d.ts +0 -3
- package/esm/src/utils/color/utils/areColorsEqual.d.ts +0 -3
- package/esm/src/utils/color/utils/colorDistance.d.ts +2 -2
- package/esm/src/utils/color/utils/colorHue.d.ts +0 -1
- package/esm/src/utils/color/utils/colorHueDistance.d.ts +0 -1
- package/esm/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
- package/esm/src/utils/database/uniqueConstraint.d.ts +1 -3
- package/esm/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
- package/esm/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
- package/esm/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
- package/esm/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
- package/esm/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
- package/esm/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
- package/esm/src/utils/environment/$getGlobalScope.d.ts +1 -1
- package/esm/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
- package/esm/src/utils/environment/$isRunningInJest.d.ts +0 -3
- package/esm/src/utils/environment/$isRunningInNode.d.ts +0 -3
- package/esm/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
- package/esm/src/utils/execCommand/$execCommand.d.ts +0 -4
- package/esm/src/utils/execCommand/$execCommands.d.ts +0 -3
- package/esm/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
- package/esm/src/utils/expectation-counters/constants.d.ts +0 -4
- package/esm/src/utils/expectation-counters/countCharacters.d.ts +0 -4
- package/esm/src/utils/expectation-counters/countLines.d.ts +0 -4
- package/esm/src/utils/expectation-counters/countPages.d.ts +0 -4
- package/esm/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
- package/esm/src/utils/expectation-counters/countSentences.d.ts +0 -4
- package/esm/src/utils/expectation-counters/countWords.d.ts +0 -5
- package/esm/src/utils/expectation-counters/index.d.ts +0 -4
- package/esm/src/utils/files/$induceBookDownload.d.ts +0 -3
- package/esm/src/utils/files/$induceFileDownload.d.ts +0 -3
- package/esm/src/utils/files/ObjectUrl.d.ts +0 -3
- package/esm/src/utils/files/isDirectoryExisting.d.ts +0 -6
- package/esm/src/utils/files/isExecutable.d.ts +0 -4
- package/esm/src/utils/files/isFileExisting.d.ts +0 -5
- package/esm/src/utils/files/listAllFiles.d.ts +1 -5
- package/esm/src/utils/files/readResponseBytes.d.ts +1 -0
- package/esm/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
- package/esm/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
- package/esm/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
- package/esm/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
- package/esm/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
- package/esm/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
- package/esm/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
- package/esm/src/utils/markdown/createMarkdownTable.d.ts +0 -3
- package/esm/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
- package/esm/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
- package/esm/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
- package/esm/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
- package/esm/src/utils/markdown/humanizeAiText.d.ts +0 -3
- package/esm/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
- package/esm/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
- package/esm/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
- package/esm/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
- package/esm/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
- package/esm/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
- package/esm/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
- package/esm/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
- package/esm/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
- package/esm/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
- package/esm/src/utils/markdown/trimCodeBlock.d.ts +1 -1
- package/esm/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
- package/esm/src/utils/misc/$getCurrentDate.d.ts +1 -0
- package/esm/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
- package/esm/src/utils/misc/computeHash.d.ts +0 -3
- package/esm/src/utils/misc/debounce.d.ts +2 -0
- package/esm/src/utils/misc/emojis.d.ts +3 -8
- package/esm/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
- package/esm/src/utils/misc/parseNumber.d.ts +0 -4
- package/esm/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
- package/esm/src/utils/normalization/IKeywords.d.ts +0 -3
- package/esm/src/utils/normalization/nameToUriPart.d.ts +1 -0
- package/esm/src/utils/normalization/nameToUriParts.d.ts +1 -0
- package/esm/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
- package/esm/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
- package/esm/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
- package/esm/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
- package/esm/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
- package/esm/src/utils/normalization/orderJson.d.ts +1 -0
- package/esm/src/utils/normalization/orderJson.test.d.ts +0 -3
- package/esm/src/utils/normalization/parseKeywords.d.ts +1 -4
- package/esm/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
- package/esm/src/utils/normalization/removeDiacritics.d.ts +1 -3
- package/esm/src/utils/normalization/removeEmojis.d.ts +1 -0
- package/esm/src/utils/normalization/removeQuotes.d.ts +1 -0
- package/esm/src/utils/normalization/searchKeywords.d.ts +1 -3
- package/esm/src/utils/normalization/titleToName.d.ts +1 -0
- package/esm/src/utils/normalization/unwrapResult.d.ts +1 -3
- package/esm/src/utils/organization/$sideEffect.d.ts +1 -0
- package/esm/src/utils/organization/TODO_USE.d.ts +1 -0
- package/esm/src/utils/organization/just.d.ts +1 -0
- package/esm/src/utils/organization/keepImported.d.ts +1 -0
- package/esm/src/utils/organization/keepTypeImported.d.ts +1 -0
- package/esm/src/utils/organization/keepUnused.d.ts +1 -0
- package/esm/src/utils/organization/preserve.d.ts +1 -3
- package/esm/src/utils/organization/really_any.d.ts +1 -0
- package/esm/src/utils/organization/spaceTrim.d.ts +3 -2
- package/esm/src/utils/parameters/extractParameterNames.d.ts +1 -0
- package/esm/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
- package/esm/src/utils/parameters/templateParameters.d.ts +2 -1
- package/esm/src/utils/parameters/valueToString.d.ts +2 -2
- package/esm/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
- package/esm/src/utils/random/$randomAgentPersona.d.ts +1 -3
- package/esm/src/utils/random/$randomAgentRule.d.ts +1 -3
- package/esm/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
- package/esm/src/utils/random/$randomItem.d.ts +0 -3
- package/esm/src/utils/random/$randomSeed.d.ts +0 -3
- package/esm/src/utils/random/$randomToken.d.ts +2 -5
- package/esm/src/utils/random/EnglishNamePool.d.ts +1 -0
- package/esm/src/utils/serialization/$deepFreeze.d.ts +1 -3
- package/esm/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
- package/esm/src/utils/serialization/clonePipeline.d.ts +1 -3
- package/esm/src/utils/serialization/deepClone.d.ts +1 -3
- package/esm/src/utils/serialization/exportJson.d.ts +1 -3
- package/esm/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
- package/esm/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
- package/esm/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
- package/esm/src/utils/sets/difference.d.ts +1 -3
- package/esm/src/utils/sets/intersection.d.ts +1 -0
- package/esm/src/utils/sets/union.d.ts +1 -0
- package/esm/src/utils/take/classes/TakeChain.d.ts +4 -1
- package/esm/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
- package/esm/src/utils/take/interfaces/Takeable.d.ts +2 -1
- package/esm/src/utils/take/take.d.ts +1 -1
- package/esm/src/utils/validators/filePath/isRootPath.d.ts +1 -3
- package/esm/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
- package/esm/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
- package/esm/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
- package/esm/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
- package/esm/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
- package/esm/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
- package/esm/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
- package/esm/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
- package/esm/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
- package/esm/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/esm/src/wizard/$getCompiledBook.d.ts +0 -4
- package/esm/src/wizard/wizard.d.ts +1 -4
- package/package.json +2 -2
- package/umd/index.umd.js +711 -694
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/types.index.d.ts +94 -94
- package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +3 -4
- package/umd/src/book-2.0/agent-source/AgentModelRequirements.d.ts +0 -4
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +7 -0
- package/umd/src/book-2.0/agent-source/createTeamToolName.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/extractOpenTeacherInstructions.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/padBook.d.ts +1 -4
- package/umd/src/book-2.0/agent-source/parseAgentSource.d.ts +0 -3
- package/umd/src/book-2.0/agent-source/parseAgentSourcePrelude.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/parseParameters.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/parseTeamCommitment.d.ts +0 -3
- package/umd/src/book-2.0/agent-source/pseudoAgentReferences.d.ts +8 -3
- package/umd/src/book-2.0/agent-source/string_book.d.ts +1 -0
- package/umd/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +0 -3
- package/umd/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +0 -3
- package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +0 -3
- package/umd/src/book-components/AvatarProfile/AvatarProfile/AvatarProfileTooltip.d.ts +4 -0
- package/umd/src/book-components/BookEditor/BookEditor.d.ts +0 -3
- package/umd/src/book-components/BookEditor/BookEditorActionbar.d.ts +4 -0
- package/umd/src/book-components/BookEditor/BookEditorMonaco.d.ts +2 -0
- package/umd/src/book-components/BookEditor/BookEditorMonacoUploadPanel.d.ts +3 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.d.ts +1 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoDecorations.d.ts +6 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoDiagnostics.d.ts +9 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoLanguage.d.ts +7 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoStyles.d.ts +3 -0
- package/umd/src/book-components/BookEditor/useBookEditorMonacoUploads.d.ts +24 -0
- package/umd/src/book-components/Chat/AgentChat/AgentChat.d.ts +0 -3
- package/umd/src/book-components/Chat/AgentChip/AgentChip.d.ts +6 -5
- package/umd/src/book-components/Chat/Chat/ChatInputAreaDictationPanel.d.ts +38 -0
- package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +1 -14
- 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 +2 -3
- package/umd/src/book-components/Chat/Chat/ChatSelfLearningSummary.d.ts +0 -3
- package/umd/src/book-components/Chat/Chat/ChatToolCallModalComponents.d.ts +0 -3
- package/umd/src/book-components/Chat/Chat/StreamingFeaturePlaceholder.d.ts +34 -0
- package/umd/src/book-components/Chat/Chat/TeamToolCallModalContent.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/chatCssClassNames.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/constants.d.ts +4 -3
- 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/insertDictationChunk.d.ts +16 -0
- package/umd/src/book-components/Chat/Chat/learnDictationDictionary.d.ts +7 -0
- package/umd/src/book-components/Chat/Chat/refineFinalDictationChunk.d.ts +36 -0
- package/umd/src/book-components/Chat/Chat/renderAdvancedToolCallDetails.d.ts +3 -0
- package/umd/src/book-components/Chat/Chat/renderEmailToolCallDetails.d.ts +27 -0
- package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +33 -0
- package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +39 -0
- package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +39 -0
- package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +47 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +34 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +3 -2
- package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +30 -0
- package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +27 -0
- package/umd/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
- package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +10 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaAttachments.d.ts +32 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +53 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationPersistence.d.ts +20 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaDictationSupport.d.ts +29 -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/LlmChat/defaults.d.ts +0 -3
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +3 -3
- package/umd/src/book-components/Chat/MockedChat/constants.d.ts +0 -3
- package/umd/src/book-components/Chat/SourceChip/SourceChip.d.ts +4 -3
- package/umd/src/book-components/Chat/effects/components/ConfettiEffect.d.ts +3 -0
- package/umd/src/book-components/Chat/effects/components/HeartsEffect.d.ts +3 -0
- package/umd/src/book-components/Chat/effects/index.d.ts +0 -4
- package/umd/src/book-components/Chat/effects/utils/detectEffects.d.ts +1 -0
- package/umd/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +4 -4
- package/umd/src/book-components/Chat/save/_common/string_chat_format_name.d.ts +1 -0
- package/umd/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +0 -3
- package/umd/src/book-components/Chat/save/index.d.ts +0 -3
- package/umd/src/book-components/Chat/save/pdf/buildChatPdf.d.ts +1 -0
- package/umd/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +0 -4
- package/umd/src/book-components/Chat/types/ChatMessage.d.ts +3 -5
- package/umd/src/book-components/Chat/types/ChatParticipant.d.ts +0 -3
- package/umd/src/book-components/Chat/utils/ExportFormat.d.ts +2 -0
- package/umd/src/book-components/Chat/utils/citationHelpers.d.ts +4 -3
- package/umd/src/book-components/Chat/utils/collectTeamToolCallSummary.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/createCitationFootnoteRenderModel.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/exportChatHistory.d.ts +0 -3
- package/umd/src/book-components/Chat/utils/formatToolCallLocalTime.d.ts +2 -1
- package/umd/src/book-components/Chat/utils/loadAgentProfile.d.ts +12 -0
- package/umd/src/book-components/Chat/utils/parseCitationsFromContent.d.ts +0 -3
- package/umd/src/book-components/Chat/utils/parseImagePrompts.d.ts +1 -3
- package/umd/src/book-components/Chat/utils/sanitizeStreamingMessageContent.d.ts +14 -0
- package/umd/src/book-components/Chat/utils/thinkingMessageVariants.d.ts +3 -0
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +0 -3
- package/umd/src/book-components/Chat/utils/toolCallParsing/extractSearchResults.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallResultDate.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/getToolCallTimestamp.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseRunBrowserToolResult.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseTeamToolResult.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallArguments.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/parseToolCallResult.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/toolCallParsing/resolveRunBrowserArtifactUrl.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/walletCredentialToolCall.d.ts +3 -3
- package/umd/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +3 -5
- package/umd/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +3 -5
- package/umd/src/book-components/Qr/BrandedQrCode.d.ts +5 -0
- package/umd/src/book-components/Qr/GenericQrCode.d.ts +5 -0
- package/umd/src/book-components/Qr/PromptbookQrCode.d.ts +5 -0
- package/umd/src/book-components/Qr/useQrCode.d.ts +4 -1
- package/umd/src/book-components/_common/Dropdown/Dropdown.d.ts +4 -0
- package/umd/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +4 -0
- package/umd/src/book-components/_common/MenuHoisting/MenuHoistingContext.d.ts +3 -3
- package/umd/src/book-components/_common/Modal/Modal.d.ts +1 -3
- package/umd/src/book-components/_common/Tooltip/Tooltip.d.ts +3 -0
- package/umd/src/book-components/icons/AboutIcon.d.ts +1 -0
- package/umd/src/book-components/icons/AttachmentIcon.d.ts +4 -0
- package/umd/src/book-components/icons/CameraIcon.d.ts +4 -0
- package/umd/src/book-components/icons/DownloadIcon.d.ts +1 -0
- package/umd/src/book-components/icons/EmailIcon.d.ts +1 -0
- package/umd/src/book-components/icons/MenuIcon.d.ts +1 -3
- package/umd/src/book-components/icons/SaveIcon.d.ts +1 -0
- package/umd/src/book-components/icons/SendIcon.d.ts +0 -3
- package/umd/src/book-components/icons/TeacherIcon.d.ts +1 -0
- package/umd/src/cli/$runPromptbookCli.d.ts +0 -3
- package/umd/src/cli/cli-commands/_boilerplate.d.ts +0 -4
- package/umd/src/cli/cli-commands/about.d.ts +0 -6
- package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +18 -0
- package/umd/src/cli/cli-commands/coder/find-fresh-emoji-tags.d.ts +0 -4
- package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -4
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -4
- package/umd/src/cli/cli-commands/coder/init.d.ts +0 -4
- package/umd/src/cli/cli-commands/coder/run.d.ts +1 -5
- package/umd/src/cli/cli-commands/coder/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/verify.d.ts +0 -4
- package/umd/src/cli/cli-commands/coder.d.ts +0 -4
- package/umd/src/cli/cli-commands/common/handleActionErrors.d.ts +4 -0
- package/umd/src/cli/cli-commands/hello.d.ts +0 -5
- package/umd/src/cli/cli-commands/list-models.d.ts +0 -4
- package/umd/src/cli/cli-commands/list-scrapers.d.ts +0 -4
- package/umd/src/cli/cli-commands/login.d.ts +0 -5
- package/umd/src/cli/cli-commands/make.d.ts +1 -1
- package/umd/src/cli/cli-commands/prettify.d.ts +0 -6
- package/umd/src/cli/cli-commands/run.d.ts +0 -8
- package/umd/src/cli/cli-commands/runInteractiveChatbot.d.ts +1 -5
- package/umd/src/cli/cli-commands/start-agents-server.d.ts +0 -4
- package/umd/src/cli/cli-commands/start-pipelines-server.d.ts +0 -5
- package/umd/src/cli/cli-commands/test-command.d.ts +0 -7
- package/umd/src/cli/common/$provideLlmToolsForCli.d.ts +5 -0
- package/umd/src/cli/main.d.ts +0 -4
- package/umd/src/cli/promptbookCli.d.ts +0 -7
- package/umd/src/collection/agent-collection/AgentCollection.d.ts +0 -3
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +2 -6
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +3 -0
- package/umd/src/collection/pipeline-collection/SimplePipelineCollection.d.ts +2 -1
- package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts +2 -5
- package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +1 -0
- package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts +4 -3
- package/umd/src/collection/pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts +2 -3
- package/umd/src/collection/pipeline-collection/constructors/createPipelineSubcollection.d.ts +1 -0
- package/umd/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +0 -3
- package/umd/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +1 -0
- package/umd/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +1 -0
- package/umd/src/commands/EXPECT/ExpectCommand.d.ts +0 -3
- package/umd/src/commands/EXPECT/expectCommandParser.d.ts +3 -2
- package/umd/src/commands/FOREACH/ForeachCommand.d.ts +1 -0
- package/umd/src/commands/FOREACH/foreachCommandParser.d.ts +1 -3
- package/umd/src/commands/FORMAT/formatCommandParser.d.ts +1 -0
- package/umd/src/commands/FORMFACTOR/FormfactorCommand.d.ts +1 -0
- package/umd/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +1 -0
- package/umd/src/commands/JOKER/JokerCommand.d.ts +1 -0
- package/umd/src/commands/JOKER/jokerCommandParser.d.ts +1 -0
- package/umd/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +1 -0
- package/umd/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +1 -3
- package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.d.ts +0 -3
- package/umd/src/commands/KNOWLEDGE/utils/knowledgeSourceContentToName.test.d.ts +0 -3
- package/umd/src/commands/MODEL/ModelCommand.d.ts +1 -0
- package/umd/src/commands/MODEL/modelCommandParser.d.ts +1 -0
- package/umd/src/commands/PARAMETER/ParameterCommand.d.ts +1 -0
- package/umd/src/commands/PARAMETER/parameterCommandParser.d.ts +1 -0
- package/umd/src/commands/PERSONA/PersonaCommand.d.ts +1 -0
- package/umd/src/commands/PERSONA/personaCommandParser.d.ts +1 -0
- package/umd/src/commands/POSTPROCESS/PostprocessCommand.d.ts +1 -0
- package/umd/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +1 -0
- package/umd/src/commands/SECTION/SectionCommand.d.ts +1 -0
- package/umd/src/commands/SECTION/sectionCommandParser.d.ts +1 -0
- package/umd/src/commands/URL/UrlCommand.d.ts +1 -0
- package/umd/src/commands/URL/urlCommandParser.d.ts +1 -0
- package/umd/src/commands/X_ACTION/ActionCommand.d.ts +1 -0
- package/umd/src/commands/X_ACTION/actionCommandParser.d.ts +1 -3
- package/umd/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +1 -0
- package/umd/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +1 -3
- package/umd/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +1 -0
- package/umd/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +1 -0
- package/umd/src/commands/_common/stringifyCommand.d.ts +1 -1
- package/umd/src/commands/_common/types/CommandParser.d.ts +0 -4
- package/umd/src/commands/index.d.ts +0 -3
- package/umd/src/commitments/ACTION/ACTION.d.ts +0 -3
- package/umd/src/commitments/CLOSED/CLOSED.d.ts +0 -3
- package/umd/src/commitments/CLOSED/CLOSED.test.d.ts +0 -3
- package/umd/src/commitments/COMPONENT/COMPONENT.d.ts +0 -3
- package/umd/src/commitments/DELETE/DELETE.d.ts +0 -3
- package/umd/src/commitments/DICTIONARY/DICTIONARY.d.ts +0 -3
- package/umd/src/commitments/FORMAT/FORMAT.d.ts +0 -3
- package/umd/src/commitments/FROM/FROM.d.ts +0 -3
- package/umd/src/commitments/GOAL/GOAL.d.ts +0 -3
- package/umd/src/commitments/IMPORT/IMPORT.d.ts +0 -3
- package/umd/src/commitments/LANGUAGE/LANGUAGE.d.ts +0 -3
- package/umd/src/commitments/MEMORY/MEMORY.d.ts +0 -3
- package/umd/src/commitments/MESSAGE/MESSAGE.d.ts +0 -3
- package/umd/src/commitments/MESSAGE_SUFFIX/MESSAGE_SUFFIX.d.ts +0 -3
- package/umd/src/commitments/META/META.d.ts +0 -3
- package/umd/src/commitments/META/META_DESCRIPTION.d.ts +0 -3
- package/umd/src/commitments/META_COLOR/META_COLOR.d.ts +0 -3
- package/umd/src/commitments/META_DISCLAIMER/META_DISCLAIMER.d.ts +0 -3
- package/umd/src/commitments/META_DOMAIN/META_DOMAIN.d.ts +0 -3
- package/umd/src/commitments/META_FONT/META_FONT.d.ts +0 -3
- package/umd/src/commitments/META_IMAGE/META_IMAGE.d.ts +0 -3
- package/umd/src/commitments/META_INPUT_PLACEHOLDER/META_INPUT_PLACEHOLDER.d.ts +0 -3
- package/umd/src/commitments/META_LINK/META_LINK.d.ts +0 -3
- package/umd/src/commitments/META_VOICE/META_VOICE.d.ts +0 -3
- package/umd/src/commitments/MODEL/MODEL.d.ts +0 -3
- package/umd/src/commitments/OPEN/OPEN.d.ts +0 -3
- package/umd/src/commitments/PERSONA/PERSONA.d.ts +0 -3
- package/umd/src/commitments/RULE/RULE.d.ts +0 -3
- package/umd/src/commitments/SAMPLE/SAMPLE.d.ts +0 -3
- package/umd/src/commitments/SCENARIO/SCENARIO.d.ts +0 -3
- package/umd/src/commitments/TEAM/TEAM.d.ts +0 -3
- package/umd/src/commitments/TEMPLATE/TEMPLATE.d.ts +0 -3
- package/umd/src/commitments/USE/USE.d.ts +0 -3
- package/umd/src/commitments/USE/aggregateUseCommitmentSystemMessages.d.ts +2 -0
- package/umd/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +0 -3
- package/umd/src/commitments/USE_BROWSER/fetchUrlContent.d.ts +4 -7
- package/umd/src/commitments/USE_CALENDAR/USE_CALENDAR.d.ts +0 -3
- package/umd/src/commitments/USE_CALENDAR/calendarReference.d.ts +0 -3
- package/umd/src/commitments/USE_EMAIL/USE_EMAIL.d.ts +0 -3
- package/umd/src/commitments/USE_IMAGE_GENERATOR/USE_IMAGE_GENERATOR.d.ts +0 -3
- package/umd/src/commitments/USE_MCP/USE_MCP.d.ts +0 -3
- package/umd/src/commitments/USE_POPUP/USE_POPUP.d.ts +0 -3
- package/umd/src/commitments/USE_PRIVACY/USE_PRIVACY.d.ts +0 -3
- package/umd/src/commitments/USE_PROJECT/USE_PROJECT.d.ts +0 -3
- package/umd/src/commitments/USE_PROJECT/projectReference.d.ts +0 -3
- package/umd/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +0 -3
- package/umd/src/commitments/USE_SPAWN/USE_SPAWN.d.ts +0 -3
- package/umd/src/commitments/USE_TIME/USE_TIME.d.ts +0 -3
- package/umd/src/commitments/USE_TIMEOUT/USE_TIMEOUT.d.ts +0 -3
- package/umd/src/commitments/USE_USER_LOCATION/USE_USER_LOCATION.d.ts +0 -3
- package/umd/src/commitments/WALLET/WALLET.d.ts +0 -3
- package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +0 -3
- package/umd/src/commitments/WRITING_SAMPLE/WRITING_SAMPLE.d.ts +0 -3
- package/umd/src/commitments/_base/createEmptyAgentModelRequirements.d.ts +0 -3
- package/umd/src/commitments/_common/commitmentToolFunctions.d.ts +2 -3
- package/umd/src/commitments/_common/createWritingCommitmentSections.d.ts +2 -3
- package/umd/src/commitments/_common/getAllCommitmentDefinitions.d.ts +1 -0
- package/umd/src/commitments/_common/getAllCommitmentTypes.d.ts +1 -0
- package/umd/src/commitments/_common/getAllCommitmentsToolFunctionsForNode.d.ts +0 -4
- package/umd/src/commitments/_common/getCommitmentDefinition.d.ts +1 -0
- package/umd/src/commitments/_common/isCommitmentSupported.d.ts +1 -0
- package/umd/src/commitments/_common/toolExecutionEnvelope.d.ts +0 -3
- package/umd/src/commitments/_common/toolRuntimeContext.d.ts +3 -3
- package/umd/src/commitments/index.d.ts +0 -4
- package/umd/src/config.test.d.ts +0 -3
- package/umd/src/constants/streaming.d.ts +0 -3
- package/umd/src/constants.d.ts +0 -3
- package/umd/src/conversion/archive/loadArchive.d.ts +0 -3
- package/umd/src/conversion/archive/saveArchive.d.ts +0 -5
- package/umd/src/conversion/compilePipeline.d.ts +2 -7
- package/umd/src/conversion/compilePipelineOnRemoteServer.d.ts +2 -5
- package/umd/src/conversion/parsePipeline.d.ts +1 -11
- package/umd/src/conversion/pipelineJsonToString.d.ts +1 -7
- package/umd/src/conversion/prettify/prettifyPipelineString.d.ts +0 -4
- package/umd/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +0 -7
- package/umd/src/conversion/utils/extractParameterNamesFromTask.d.ts +1 -3
- package/umd/src/conversion/validation/_importPipeline.d.ts +6 -4
- package/umd/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +0 -3
- package/umd/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +0 -3
- package/umd/src/conversion/validation/validatePipeline.d.ts +3 -9
- package/umd/src/conversion/validation/validatePipeline.test.d.ts +0 -3
- package/umd/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -4
- package/umd/src/errors/0-BoilerplateError.d.ts +0 -3
- package/umd/src/errors/0-index.d.ts +0 -3
- package/umd/src/errors/DatabaseError.d.ts +0 -3
- package/umd/src/errors/ExpectError.d.ts +2 -1
- package/umd/src/errors/ParseError.d.ts +0 -3
- package/umd/src/errors/PipelineExecutionError.d.ts +0 -3
- package/umd/src/executables/$provideExecutablesForNode.d.ts +0 -5
- package/umd/src/executables/apps/locateLibreoffice.d.ts +0 -4
- package/umd/src/executables/apps/locatePandoc.d.ts +0 -4
- package/umd/src/executables/browsers/locateBrowser.d.ts +0 -1
- package/umd/src/executables/browsers/locateDefaultSystemBrowser.d.ts +0 -1
- package/umd/src/executables/locateApp.d.ts +0 -4
- package/umd/src/executables/platforms/locateAppOnLinux.d.ts +0 -4
- package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +0 -4
- package/umd/src/executables/platforms/locateAppOnWindows.d.ts +0 -4
- package/umd/src/execution/AbstractTaskResult.d.ts +0 -4
- package/umd/src/execution/AvailableModel.d.ts +0 -4
- package/umd/src/execution/CommonToolsOptions.d.ts +0 -5
- package/umd/src/execution/ExecutionTask.d.ts +4 -4
- package/umd/src/execution/FilesystemTools.d.ts +0 -3
- package/umd/src/execution/LlmExecutionTools.d.ts +3 -9
- package/umd/src/execution/LlmExecutionToolsConstructor.d.ts +0 -3
- package/umd/src/execution/PipelineExecutor.d.ts +0 -3
- package/umd/src/execution/PipelineExecutorResult.d.ts +0 -3
- package/umd/src/execution/PromptResult.d.ts +1 -9
- package/umd/src/execution/PromptbookFetch.test-type.d.ts +0 -4
- package/umd/src/execution/ScriptExecutionTools.d.ts +0 -4
- package/umd/src/execution/Usage.d.ts +0 -3
- package/umd/src/execution/UserInterfaceTools.d.ts +3 -0
- package/umd/src/execution/assertsTaskSuccessful.d.ts +1 -3
- package/umd/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +1 -0
- package/umd/src/execution/createPipelineExecutor/20-executeTask.d.ts +0 -3
- package/umd/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -3
- package/umd/src/execution/createPipelineExecutor/getContextForTask.d.ts +1 -0
- package/umd/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +0 -4
- package/umd/src/execution/createPipelineExecutor/knowledgePiecesToString.d.ts +0 -1
- package/umd/src/execution/execution-report/ExecutionReportJson.d.ts +1 -0
- package/umd/src/execution/execution-report/ExecutionReportString.d.ts +0 -3
- package/umd/src/execution/execution-report/executionReportJsonToString.d.ts +0 -5
- package/umd/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +3 -1
- package/umd/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +3 -1
- package/umd/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +3 -1
- package/umd/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +2 -0
- package/umd/src/execution/translation/automatic-translate/translateMessages.d.ts +3 -5
- package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -6
- package/umd/src/execution/utils/checkExpectations.d.ts +2 -5
- package/umd/src/execution/utils/forEachAsync.d.ts +5 -1
- package/umd/src/execution/utils/usage-constants.d.ts +0 -3
- package/umd/src/execution/utils/usageToHuman.d.ts +0 -8
- package/umd/src/execution/utils/validatePromptResult.d.ts +1 -0
- package/umd/src/file-security-checkers/virustotal/VirusTotalFileSecurityChecker.d.ts +1 -0
- package/umd/src/formats/_common/FormatParser.d.ts +2 -9
- package/umd/src/formats/_common/FormatSubvalueParser.d.ts +0 -3
- package/umd/src/formats/csv/CsvFormatParser.d.ts +2 -8
- package/umd/src/formats/index.d.ts +0 -3
- package/umd/src/formats/json/JsonFormatParser.d.ts +0 -11
- package/umd/src/formats/text/TextFormatParser.d.ts +0 -9
- package/umd/src/formats/xml/XmlFormatParser.d.ts +0 -11
- package/umd/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +1 -3
- package/umd/src/formfactors/_common/FormfactorDefinition.d.ts +1 -0
- package/umd/src/formfactors/index.d.ts +0 -3
- package/umd/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +0 -5
- package/umd/src/high-level-abstractions/index.d.ts +0 -4
- package/umd/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +0 -3
- package/umd/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +2 -3
- package/umd/src/llm-providers/_common/register/$llmToolsRegister.d.ts +2 -3
- package/umd/src/llm-providers/_common/register/$provideEnvFilename.d.ts +0 -3
- package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -3
- package/umd/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +3 -6
- package/umd/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +3 -7
- package/umd/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +1 -18
- package/umd/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +0 -4
- package/umd/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +0 -5
- package/umd/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +0 -6
- package/umd/src/llm-providers/_common/register/LlmToolsOptions.d.ts +0 -4
- package/umd/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +1 -0
- package/umd/src/llm-providers/_common/utils/assertUniqueModels.d.ts +0 -3
- package/umd/src/llm-providers/_common/utils/cache/CacheItem.d.ts +0 -3
- package/umd/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -0
- package/umd/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +0 -4
- package/umd/src/llm-providers/_common/utils/count-total-usage/countUsage.d.ts +1 -0
- package/umd/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +0 -7
- package/umd/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +4 -0
- package/umd/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +1 -0
- package/umd/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +3 -7
- package/umd/src/llm-providers/_multiple/playground/playground.d.ts +0 -3
- package/umd/src/llm-providers/agent/Agent.d.ts +0 -3
- package/umd/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/agent/RemoteAgent.d.ts +0 -4
- package/umd/src/llm-providers/agent/playground/playground.d.ts +0 -6
- package/umd/src/llm-providers/agent/register-configuration.d.ts +0 -5
- package/umd/src/llm-providers/agent/register-constructor.d.ts +0 -4
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -10
- package/umd/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +3 -3
- package/umd/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -8
- package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +1 -3
- package/umd/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +0 -3
- package/umd/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +0 -7
- package/umd/src/llm-providers/anthropic-claude/playground/playground.d.ts +0 -5
- package/umd/src/llm-providers/anthropic-claude/register-configuration.d.ts +0 -3
- package/umd/src/llm-providers/anthropic-claude/register-constructor.d.ts +0 -5
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +0 -6
- package/umd/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
- package/umd/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/azure-openai/playground/playground.d.ts +0 -4
- package/umd/src/llm-providers/azure-openai/register-configuration.d.ts +0 -3
- package/umd/src/llm-providers/azure-openai/register-constructor.d.ts +0 -4
- package/umd/src/llm-providers/deepseek/DeepseekExecutionToolsOptions.d.ts +1 -0
- package/umd/src/llm-providers/deepseek/createDeepseekExecutionTools.d.ts +0 -3
- package/umd/src/llm-providers/deepseek/deepseek-models.d.ts +1 -6
- package/umd/src/llm-providers/deepseek/register-configuration.d.ts +0 -3
- package/umd/src/llm-providers/deepseek/register-constructor.d.ts +0 -4
- package/umd/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +1 -0
- package/umd/src/llm-providers/google/createGoogleExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/google/google-models.d.ts +1 -6
- package/umd/src/llm-providers/google/register-configuration.d.ts +0 -3
- package/umd/src/llm-providers/google/register-constructor.d.ts +0 -4
- package/umd/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -5
- package/umd/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +0 -3
- package/umd/src/llm-providers/mocked/test/joker.test.d.ts +0 -3
- package/umd/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -4
- package/umd/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -3
- package/umd/src/llm-providers/ollama/OllamaExecutionTools.d.ts +0 -3
- package/umd/src/llm-providers/ollama/OllamaExecutionToolsOptions.d.ts +1 -0
- package/umd/src/llm-providers/ollama/ollama-models.d.ts +1 -4
- package/umd/src/llm-providers/ollama/playground/playground.d.ts +0 -4
- package/umd/src/llm-providers/ollama/register-configuration.d.ts +0 -3
- package/umd/src/llm-providers/ollama/register-constructor.d.ts +0 -4
- package/umd/src/llm-providers/openai/OpenAiAgentKitExecutionTools.d.ts +10 -0
- package/umd/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +1 -8
- package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +0 -7
- package/umd/src/llm-providers/openai/OpenAiCompatibleExecutionToolsOptions.d.ts +2 -0
- package/umd/src/llm-providers/openai/computeOpenAiUsage.d.ts +1 -3
- package/umd/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +0 -3
- package/umd/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +0 -4
- package/umd/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/umd/src/llm-providers/openai/openai-models.test.d.ts +0 -3
- package/umd/src/llm-providers/openai/playground/playground.d.ts +0 -4
- package/umd/src/llm-providers/openai/register-configuration.d.ts +0 -3
- package/umd/src/llm-providers/openai/register-constructor.d.ts +0 -4
- package/umd/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -9
- package/umd/src/llm-providers/remote/playground/playground.d.ts +0 -3
- package/umd/src/llm-providers/vercel/playground/playground.d.ts +0 -4
- package/umd/src/other/templates/getBookTemplates.d.ts +2 -5
- package/umd/src/personas/preparePersona.d.ts +1 -7
- package/umd/src/pipeline/PipelineInterface/PipelineInterface.d.ts +1 -0
- package/umd/src/pipeline/PipelineInterface/constants.d.ts +0 -3
- package/umd/src/pipeline/PipelineJson/CommonTaskJson.d.ts +0 -4
- package/umd/src/pipeline/PipelineJson/DialogTaskJson.d.ts +1 -3
- package/umd/src/pipeline/PipelineJson/Expectations.d.ts +4 -3
- package/umd/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +0 -4
- package/umd/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +0 -3
- package/umd/src/pipeline/PipelineJson/PersonaJson.d.ts +0 -3
- package/umd/src/pipeline/PipelineJson/PreparationJson.d.ts +3 -5
- package/umd/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +1 -4
- package/umd/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +1 -3
- package/umd/src/pipeline/book-notation.d.ts +1 -4
- package/umd/src/pipeline/isValidPipelineString.d.ts +1 -3
- package/umd/src/pipeline/isValidPipelineString.test.d.ts +0 -3
- package/umd/src/pipeline/prompt-notation/helpers/ParameterEscaping.d.ts +5 -0
- package/umd/src/pipeline/prompt-notation/helpers/ParameterNaming.d.ts +1 -0
- package/umd/src/pipeline/prompt-notation/helpers/ParameterSection.d.ts +2 -0
- package/umd/src/pipeline/prompt-notation.d.ts +2 -5
- package/umd/src/pipeline/prompt-notation.test.d.ts +0 -3
- package/umd/src/pipeline/validatePipelineString.d.ts +1 -3
- package/umd/src/playground/permanent/_boilerplate.d.ts +0 -3
- package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +0 -3
- package/umd/src/playground/permanent/error-handling-playground.d.ts +0 -3
- package/umd/src/playground/playground.d.ts +0 -4
- package/umd/src/postprocessing/utils/extractBlock.d.ts +2 -1
- package/umd/src/postprocessing/utils/extractJsonBlock.d.ts +2 -5
- package/umd/src/prepare/PrepareAndScrapeOptions.d.ts +0 -4
- package/umd/src/prepare/preparePipeline.d.ts +3 -2
- package/umd/src/prepare/preparePipelineOnRemoteServer.d.ts +2 -5
- package/umd/src/prepare/prepareTasks.d.ts +6 -10
- package/umd/src/prepare/unpreparePipeline.d.ts +1 -5
- package/umd/src/remote-server/RemoteServer.d.ts +3 -0
- package/umd/src/remote-server/openapi.d.ts +3 -4
- package/umd/src/remote-server/socket-types/_subtypes/Identification.d.ts +1 -5
- package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Request.d.ts +0 -3
- package/umd/src/remote-server/socket-types/listModels/PromptbookServer_ListModels_Response.d.ts +0 -3
- package/umd/src/remote-server/startAgentServer.d.ts +6 -4
- package/umd/src/remote-server/startRemoteServer.d.ts +1 -16
- package/umd/src/remote-server/types/RemoteClientOptions.d.ts +0 -5
- package/umd/src/remote-server/types/RemoteServerOptions.d.ts +10 -4
- package/umd/src/remote-server/ui/ServerApp.d.ts +1 -0
- package/umd/src/remote-server/ui/types.d.ts +3 -0
- package/umd/src/scrapers/_boilerplate/BoilerplateScraper.d.ts +1 -6
- package/umd/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
- package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/_boilerplate/register-constructor.d.ts +0 -4
- package/umd/src/scrapers/_boilerplate/register-metadata.d.ts +0 -3
- package/umd/src/scrapers/_common/Scraper.d.ts +0 -5
- package/umd/src/scrapers/_common/ScraperIntermediateSource.d.ts +0 -3
- package/umd/src/scrapers/_common/prepareKnowledgePieces.d.ts +1 -0
- package/umd/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +0 -4
- package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -4
- package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -4
- package/umd/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +0 -3
- package/umd/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +2 -3
- package/umd/src/scrapers/_common/register/$scrapersRegister.d.ts +2 -3
- package/umd/src/scrapers/_common/register/ScraperConstructor.d.ts +0 -3
- package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +0 -7
- package/umd/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +0 -3
- package/umd/src/scrapers/_common/utils/promptbookFetch.d.ts +0 -3
- package/umd/src/scrapers/document/DocumentScraper.d.ts +1 -6
- package/umd/src/scrapers/document/DocumentScraper.test.d.ts +0 -3
- package/umd/src/scrapers/document/createDocumentScraper.d.ts +0 -3
- package/umd/src/scrapers/document/playground/document-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/document/register-constructor.d.ts +0 -4
- package/umd/src/scrapers/document/register-metadata.d.ts +0 -3
- package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -6
- package/umd/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +0 -3
- package/umd/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +0 -3
- package/umd/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/document-legacy/register-constructor.d.ts +0 -4
- package/umd/src/scrapers/document-legacy/register-metadata.d.ts +0 -3
- package/umd/src/scrapers/markdown/MarkdownScraper.d.ts +1 -4
- package/umd/src/scrapers/markdown/MarkdownScraper.test.d.ts +0 -3
- package/umd/src/scrapers/markdown/createMarkdownScraper.d.ts +0 -3
- package/umd/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/markdown/register-constructor.d.ts +0 -4
- package/umd/src/scrapers/markdown/register-metadata.d.ts +0 -3
- package/umd/src/scrapers/markitdown/MarkitdownScraper.d.ts +1 -7
- package/umd/src/scrapers/markitdown/createMarkitdownScraper.d.ts +0 -4
- package/umd/src/scrapers/markitdown/playground/markitdown-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/markitdown/register-constructor.d.ts +0 -5
- package/umd/src/scrapers/markitdown/register-metadata.d.ts +0 -3
- package/umd/src/scrapers/pdf/PdfScraper.d.ts +1 -6
- package/umd/src/scrapers/pdf/createPdfScraper.d.ts +0 -3
- package/umd/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/pdf/register-constructor.d.ts +0 -4
- package/umd/src/scrapers/pdf/register-metadata.d.ts +0 -3
- package/umd/src/scrapers/website/WebsiteScraper.d.ts +1 -6
- package/umd/src/scrapers/website/createWebsiteScraper.d.ts +0 -3
- package/umd/src/scrapers/website/playground/website-scraper-playground.d.ts +0 -3
- package/umd/src/scrapers/website/register-constructor.d.ts +0 -4
- package/umd/src/scrapers/website/register-metadata.d.ts +0 -3
- package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +1 -5
- package/umd/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +0 -3
- package/umd/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
- package/umd/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +0 -3
- package/umd/src/scripting/javascript/postprocessing-functions.d.ts +0 -4
- package/umd/src/scripting/javascript/utils/extractVariablesFromJavascript.d.ts +1 -3
- package/umd/src/search-engines/SearchEngine.d.ts +3 -0
- package/umd/src/speech-recognition/BrowserSpeechRecognition.d.ts +0 -4
- package/umd/src/speech-recognition/OpenAiSpeechRecognition.d.ts +2 -2
- package/umd/src/storage/_common/PromptbookStorage.d.ts +0 -4
- package/umd/src/storage/_common/PromptbookStorage.test-type.d.ts +0 -4
- package/umd/src/storage/env-storage/$EnvStorage.d.ts +0 -3
- package/umd/src/storage/file-cache-storage/FileCacheStorage.d.ts +0 -4
- package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -3
- package/umd/src/storage/local-storage/getLocalStorage.d.ts +0 -3
- package/umd/src/storage/local-storage/getSessionStorage.d.ts +0 -3
- package/umd/src/storage/local-storage/utils/makePromptbookStorageFromIndexedDb.d.ts +1 -0
- package/umd/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +0 -4
- package/umd/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +1 -3
- package/umd/src/transpilers/formatted-book-in-markdown/register.d.ts +2 -5
- package/umd/src/transpilers/openai-sdk/playground/playground.d.ts +0 -3
- package/umd/src/transpilers/openai-sdk/register.d.ts +2 -5
- package/umd/src/types/Arrayable.d.ts +1 -0
- package/umd/src/types/InputParameters_private.d.ts +13 -0
- package/umd/src/types/IntermediateFilesStrategy.d.ts +0 -3
- package/umd/src/types/LlmCall.d.ts +0 -3
- package/umd/src/types/ModelRequirements.d.ts +1 -0
- package/umd/src/types/ModelVariant.d.ts +3 -0
- package/umd/src/types/Parameters.d.ts +31 -0
- package/umd/src/types/Parameters_private.d.ts +18 -0
- package/umd/src/types/Prompt.d.ts +1 -6
- package/umd/src/types/ReservedParameters_private.d.ts +11 -0
- package/umd/src/types/ToolCall.d.ts +0 -2
- package/umd/src/types/Updatable.d.ts +1 -3
- 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.d.ts +32 -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 +10 -0
- package/umd/src/types/string_agent_permanent_id_private.d.ts +11 -0
- package/umd/src/types/string_base64_private.d.ts +17 -0
- package/umd/src/types/string_business_category_name.d.ts +5 -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_markdown.d.ts +0 -1
- package/umd/src/types/string_mime_type_private.d.ts +18 -0
- package/umd/src/types/string_model_description_private.d.ts +8 -0
- package/umd/src/types/string_model_name.d.ts +7 -0
- package/umd/src/types/string_model_name_private.d.ts +8 -0
- package/umd/src/types/string_name.d.ts +31 -0
- package/umd/src/types/string_name_private.d.ts +9 -0
- package/umd/src/types/string_page.d.ts +15 -0
- package/umd/src/types/string_page_private.d.ts +9 -0
- package/umd/src/types/string_parameter_name.d.ts +11 -167
- package/umd/src/types/string_parameter_value_private.d.ts +9 -0
- package/umd/src/types/string_persona_description.d.ts +14 -0
- package/umd/src/types/string_persona_description_private.d.ts +8 -0
- package/umd/src/types/string_prompt.d.ts +49 -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_sha256.d.ts +2 -2
- 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.d.ts +8 -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/typeAliasEmoji.d.ts +0 -3
- package/umd/src/types/typeAliases.d.ts +7 -7
- package/umd/src/utils/DEFAULT_THINKING_MESSAGES.d.ts +5 -1
- package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContext.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments/appendChatAttachmentContextWithContent.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContentContext.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments/formatChatAttachmentContext.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments/normalizeChatAttachments.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContent.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments/resolveChatAttachmentContents.d.ts +1 -0
- package/umd/src/utils/chat/chatAttachments.d.ts +0 -3
- package/umd/src/utils/chat/constants.d.ts +0 -3
- package/umd/src/utils/clientVersion.d.ts +0 -3
- package/umd/src/utils/color/$randomColor.d.ts +0 -5
- package/umd/src/utils/color/css-colors.d.ts +0 -3
- package/umd/src/utils/color/internal-utils/hslToRgb.d.ts +0 -3
- package/umd/src/utils/color/internal-utils/rgbToHsl.d.ts +0 -3
- package/umd/src/utils/color/operators/ColorTransformer.d.ts +2 -0
- package/umd/src/utils/color/operators/lighten.d.ts +0 -3
- package/umd/src/utils/color/operators/saturate.d.ts +0 -3
- package/umd/src/utils/color/utils/areColorsEqual.d.ts +0 -3
- package/umd/src/utils/color/utils/colorDistance.d.ts +2 -2
- package/umd/src/utils/color/utils/colorHue.d.ts +0 -1
- package/umd/src/utils/color/utils/colorHueDistance.d.ts +0 -1
- package/umd/src/utils/color/utils/colorToDataUrl.d.ts +0 -3
- package/umd/src/utils/database/uniqueConstraint.d.ts +1 -3
- package/umd/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +3 -4
- package/umd/src/utils/editable/edit-pipeline-string/deflatePipeline.d.ts +0 -3
- package/umd/src/utils/editable/types/PipelineEditableSerialized.d.ts +2 -2
- package/umd/src/utils/editable/utils/renamePipelineParameter.d.ts +4 -3
- package/umd/src/utils/editable/utils/stringifyPipelineJson.d.ts +0 -6
- package/umd/src/utils/environment/$detectRuntimeEnvironment.d.ts +0 -3
- package/umd/src/utils/environment/$getGlobalScope.d.ts +1 -1
- package/umd/src/utils/environment/$isRunningInBrowser.d.ts +0 -3
- package/umd/src/utils/environment/$isRunningInJest.d.ts +0 -3
- package/umd/src/utils/environment/$isRunningInNode.d.ts +0 -3
- package/umd/src/utils/environment/$isRunningInWebWorker.d.ts +0 -3
- package/umd/src/utils/execCommand/$execCommand.d.ts +0 -4
- package/umd/src/utils/execCommand/$execCommands.d.ts +0 -3
- package/umd/src/utils/execCommand/ExecCommandOptions.d.ts +3 -4
- package/umd/src/utils/expectation-counters/constants.d.ts +0 -4
- package/umd/src/utils/expectation-counters/countCharacters.d.ts +0 -4
- package/umd/src/utils/expectation-counters/countLines.d.ts +0 -4
- package/umd/src/utils/expectation-counters/countPages.d.ts +0 -4
- package/umd/src/utils/expectation-counters/countParagraphs.d.ts +0 -4
- package/umd/src/utils/expectation-counters/countSentences.d.ts +0 -4
- package/umd/src/utils/expectation-counters/countWords.d.ts +0 -5
- package/umd/src/utils/expectation-counters/index.d.ts +0 -4
- package/umd/src/utils/files/$induceBookDownload.d.ts +0 -3
- package/umd/src/utils/files/$induceFileDownload.d.ts +0 -3
- package/umd/src/utils/files/ObjectUrl.d.ts +0 -3
- package/umd/src/utils/files/isDirectoryExisting.d.ts +0 -6
- package/umd/src/utils/files/isExecutable.d.ts +0 -4
- package/umd/src/utils/files/isFileExisting.d.ts +0 -5
- package/umd/src/utils/files/listAllFiles.d.ts +1 -5
- package/umd/src/utils/files/readResponseBytes.d.ts +1 -0
- package/umd/src/utils/knowledge/inlineKnowledgeSource.d.ts +11 -6
- package/umd/src/utils/knowledge/simplifyKnowledgeLabel.d.ts +2 -0
- package/umd/src/utils/linguistic-hash/linguisticHash.d.ts +2 -1
- package/umd/src/utils/linguistic-hash/linguisticHashTypes.d.ts +0 -3
- package/umd/src/utils/linguistic-hash/linguisticHashWords.cs.d.ts +0 -3
- package/umd/src/utils/linguistic-hash/linguisticHashWords.en.d.ts +0 -3
- package/umd/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -3
- package/umd/src/utils/markdown/createMarkdownTable.d.ts +0 -3
- package/umd/src/utils/markdown/escapeMarkdownBlock.d.ts +0 -3
- package/umd/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -3
- package/umd/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +1 -0
- package/umd/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +2 -4
- package/umd/src/utils/markdown/humanizeAiText.d.ts +0 -3
- package/umd/src/utils/markdown/humanizeAiTextEllipsis.d.ts +0 -3
- package/umd/src/utils/markdown/humanizeAiTextEmdashed.d.ts +0 -3
- package/umd/src/utils/markdown/humanizeAiTextQuotes.d.ts +0 -3
- package/umd/src/utils/markdown/humanizeAiTextSources.d.ts +0 -3
- package/umd/src/utils/markdown/humanizeAiTextWhitespace.d.ts +0 -3
- package/umd/src/utils/markdown/prettifyMarkdown.d.ts +4 -2
- package/umd/src/utils/markdown/promptbookifyAiText.d.ts +0 -3
- package/umd/src/utils/markdown/removeMarkdownComments.d.ts +1 -0
- package/umd/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
- package/umd/src/utils/markdown/removeMarkdownLinks.d.ts +1 -0
- package/umd/src/utils/markdown/trimCodeBlock.d.ts +1 -1
- package/umd/src/utils/markdown/trimEndOfCodeBlock.d.ts +1 -1
- package/umd/src/utils/misc/$getCurrentDate.d.ts +1 -0
- package/umd/src/utils/misc/aboutPromptbookInformation.d.ts +3 -3
- package/umd/src/utils/misc/computeHash.d.ts +0 -3
- package/umd/src/utils/misc/debounce.d.ts +2 -0
- package/umd/src/utils/misc/emojis.d.ts +3 -8
- package/umd/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +7 -2
- package/umd/src/utils/misc/parseNumber.d.ts +0 -4
- package/umd/src/utils/misc/xAboutPromptbookInformation.d.ts +3 -4
- package/umd/src/utils/normalization/IKeywords.d.ts +0 -3
- package/umd/src/utils/normalization/nameToUriPart.d.ts +1 -0
- package/umd/src/utils/normalization/nameToUriParts.d.ts +1 -0
- package/umd/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -3
- package/umd/src/utils/normalization/normalizeTo_PascalCase.d.ts +2 -0
- package/umd/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +2 -0
- package/umd/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -3
- package/umd/src/utils/normalization/normalizeTo_snake_case.d.ts +1 -0
- package/umd/src/utils/normalization/orderJson.d.ts +1 -0
- package/umd/src/utils/normalization/orderJson.test.d.ts +0 -3
- package/umd/src/utils/normalization/parseKeywords.d.ts +1 -4
- package/umd/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
- package/umd/src/utils/normalization/removeDiacritics.d.ts +1 -3
- package/umd/src/utils/normalization/removeEmojis.d.ts +1 -0
- package/umd/src/utils/normalization/removeQuotes.d.ts +1 -0
- package/umd/src/utils/normalization/searchKeywords.d.ts +1 -3
- package/umd/src/utils/normalization/titleToName.d.ts +1 -0
- package/umd/src/utils/normalization/unwrapResult.d.ts +1 -3
- package/umd/src/utils/organization/$sideEffect.d.ts +1 -0
- package/umd/src/utils/organization/TODO_USE.d.ts +1 -0
- package/umd/src/utils/organization/just.d.ts +1 -0
- package/umd/src/utils/organization/keepImported.d.ts +1 -0
- package/umd/src/utils/organization/keepTypeImported.d.ts +1 -0
- package/umd/src/utils/organization/keepUnused.d.ts +1 -0
- package/umd/src/utils/organization/preserve.d.ts +1 -3
- package/umd/src/utils/organization/really_any.d.ts +1 -0
- package/umd/src/utils/organization/spaceTrim.d.ts +3 -2
- package/umd/src/utils/parameters/extractParameterNames.d.ts +1 -0
- package/umd/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +1 -0
- package/umd/src/utils/parameters/templateParameters.d.ts +2 -1
- package/umd/src/utils/parameters/valueToString.d.ts +2 -2
- package/umd/src/utils/random/$generateBookBoilerplate.d.ts +3 -3
- package/umd/src/utils/random/$randomAgentPersona.d.ts +1 -3
- package/umd/src/utils/random/$randomAgentRule.d.ts +1 -3
- package/umd/src/utils/random/$randomFullnameWithColor.d.ts +4 -3
- package/umd/src/utils/random/$randomItem.d.ts +0 -3
- package/umd/src/utils/random/$randomSeed.d.ts +0 -3
- package/umd/src/utils/random/$randomToken.d.ts +2 -5
- package/umd/src/utils/random/EnglishNamePool.d.ts +1 -0
- package/umd/src/utils/serialization/$deepFreeze.d.ts +1 -3
- package/umd/src/utils/serialization/checkSerializableAsJson.d.ts +1 -5
- package/umd/src/utils/serialization/clonePipeline.d.ts +1 -3
- package/umd/src/utils/serialization/deepClone.d.ts +1 -3
- package/umd/src/utils/serialization/exportJson.d.ts +1 -3
- package/umd/src/utils/serialization/isSerializableAsJson.d.ts +0 -5
- package/umd/src/utils/serialization/jsonStringsToJsons.d.ts +1 -4
- package/umd/src/utils/serialization/serializeToPromptbookJavascript.d.ts +3 -3
- package/umd/src/utils/sets/difference.d.ts +1 -3
- package/umd/src/utils/sets/intersection.d.ts +1 -0
- package/umd/src/utils/sets/union.d.ts +1 -0
- package/umd/src/utils/take/classes/TakeChain.d.ts +4 -1
- package/umd/src/utils/take/interfaces/ITakeChain.d.ts +5 -1
- package/umd/src/utils/take/interfaces/Takeable.d.ts +2 -1
- package/umd/src/utils/take/take.d.ts +1 -1
- package/umd/src/utils/validators/filePath/isRootPath.d.ts +1 -3
- package/umd/src/utils/validators/filePath/isRootPath.test.d.ts +0 -3
- package/umd/src/utils/validators/filePath/isValidFilePath.d.ts +1 -3
- package/umd/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +1 -0
- package/umd/src/utils/validators/parameterName/validateParameterName.d.ts +1 -0
- package/umd/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -1
- package/umd/src/utils/validators/url/extractUrlsFromText.d.ts +1 -0
- package/umd/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
- package/umd/src/utils/validators/url/isValidAgentUrl.d.ts +0 -3
- package/umd/src/utils/validators/url/isValidPipelineUrl.d.ts +0 -3
- package/umd/src/utils/validators/url/normalizeDomainForMatching.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/umd/src/wizard/$getCompiledBook.d.ts +0 -4
- package/umd/src/wizard/wizard.d.ts +1 -4
package/umd/index.umd.js
CHANGED
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
* @generated
|
|
51
51
|
* @see https://github.com/webgptorg/promptbook
|
|
52
52
|
*/
|
|
53
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
53
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
|
|
54
54
|
/**
|
|
55
55
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
56
56
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -60,16 +60,20 @@
|
|
|
60
60
|
* Trims string from all 4 sides
|
|
61
61
|
*
|
|
62
62
|
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
63
|
-
*
|
|
63
|
+
* Developed by same author @hejny as this package
|
|
64
64
|
*
|
|
65
|
-
* @public exported from `@promptbook/utils`
|
|
66
65
|
* @see https://github.com/hejny/spacetrim#usage
|
|
66
|
+
*
|
|
67
|
+
* @public exported from `@promptbook/utils`
|
|
67
68
|
*/
|
|
68
69
|
const spaceTrim = _spaceTrim.spaceTrim;
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
|
-
*
|
|
72
|
+
* Class implementing take chain.
|
|
73
|
+
*
|
|
72
74
|
* @de
|
|
75
|
+
*
|
|
76
|
+
* @private util of `@promptbook/color`
|
|
73
77
|
*/
|
|
74
78
|
class TakeChain {
|
|
75
79
|
constructor(value) {
|
|
@@ -86,9 +90,9 @@
|
|
|
86
90
|
*
|
|
87
91
|
* @param {*} initialValue - The initial value.
|
|
88
92
|
* @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
|
|
93
|
+
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
89
94
|
*
|
|
90
95
|
* @private util of `@promptbook/color`
|
|
91
|
-
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
92
96
|
*/
|
|
93
97
|
function take(initialValue) {
|
|
94
98
|
if (initialValue instanceof TakeChain) {
|
|
@@ -266,9 +270,7 @@
|
|
|
266
270
|
yellow: '#ffff00',
|
|
267
271
|
yellowgreen: '#9acd32',
|
|
268
272
|
};
|
|
269
|
-
|
|
270
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
271
|
-
*/
|
|
273
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
272
274
|
|
|
273
275
|
/**
|
|
274
276
|
* Validates that a channel value is a valid number within the range of 0 to 255.
|
|
@@ -298,7 +300,13 @@
|
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
|
|
303
|
+
/**
|
|
304
|
+
* Constant for short hex lengths.
|
|
305
|
+
*/
|
|
301
306
|
const SHORT_HEX_LENGTHS = new Set([3, 4]);
|
|
307
|
+
/**
|
|
308
|
+
* Constant for long hex lengths.
|
|
309
|
+
*/
|
|
302
310
|
const LONG_HEX_LENGTHS = new Set([6, 8]);
|
|
303
311
|
/**
|
|
304
312
|
* Parses a hex string into RGBA channel values.
|
|
@@ -331,6 +339,9 @@
|
|
|
331
339
|
}
|
|
332
340
|
return throwInvalidHex();
|
|
333
341
|
}
|
|
342
|
+
/**
|
|
343
|
+
* Parses short hex channel.
|
|
344
|
+
*/
|
|
334
345
|
function parseShortHexChannel(char, onError) {
|
|
335
346
|
if (!char) {
|
|
336
347
|
return onError();
|
|
@@ -341,6 +352,9 @@
|
|
|
341
352
|
}
|
|
342
353
|
return parsed * 16;
|
|
343
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* Parses long hex channel.
|
|
357
|
+
*/
|
|
344
358
|
function parseLongHexChannel(hex, start, onError) {
|
|
345
359
|
const segment = hex.substr(start, 2);
|
|
346
360
|
if (segment.length < 2) {
|
|
@@ -353,6 +367,9 @@
|
|
|
353
367
|
return parsed;
|
|
354
368
|
}
|
|
355
369
|
|
|
370
|
+
/**
|
|
371
|
+
* Pattern matching hsl.
|
|
372
|
+
*/
|
|
356
373
|
const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
|
|
357
374
|
/**
|
|
358
375
|
* Parses an HSL string into RGBA channel values.
|
|
@@ -378,6 +395,9 @@
|
|
|
378
395
|
alpha: 255,
|
|
379
396
|
};
|
|
380
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Handles convert hsl to Rgb.
|
|
400
|
+
*/
|
|
381
401
|
function convertHslToRgb(h, s, l) {
|
|
382
402
|
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
383
403
|
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
@@ -416,7 +436,13 @@
|
|
|
416
436
|
};
|
|
417
437
|
}
|
|
418
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Pattern matching RGB.
|
|
441
|
+
*/
|
|
419
442
|
const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
443
|
+
/**
|
|
444
|
+
* Pattern matching rgba.
|
|
445
|
+
*/
|
|
420
446
|
const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
421
447
|
/**
|
|
422
448
|
* Parses an RGB string into RGBA channel values.
|
|
@@ -458,6 +484,9 @@
|
|
|
458
484
|
alpha: parseAlphaValue(match[4]),
|
|
459
485
|
};
|
|
460
486
|
}
|
|
487
|
+
/**
|
|
488
|
+
* Parses channel value.
|
|
489
|
+
*/
|
|
461
490
|
function parseChannelValue(value) {
|
|
462
491
|
if (value.endsWith('%')) {
|
|
463
492
|
const percent = parseFloat(value);
|
|
@@ -465,6 +494,9 @@
|
|
|
465
494
|
}
|
|
466
495
|
return Math.round(parseFloat(value));
|
|
467
496
|
}
|
|
497
|
+
/**
|
|
498
|
+
* Parses alpha value.
|
|
499
|
+
*/
|
|
468
500
|
function parseAlphaValue(value) {
|
|
469
501
|
if (value.endsWith('%')) {
|
|
470
502
|
const percent = parseFloat(value);
|
|
@@ -477,8 +509,17 @@
|
|
|
477
509
|
return Math.round(parsed);
|
|
478
510
|
}
|
|
479
511
|
|
|
512
|
+
/**
|
|
513
|
+
* Pattern matching hsl regex.
|
|
514
|
+
*/
|
|
480
515
|
const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
|
|
516
|
+
/**
|
|
517
|
+
* Pattern matching RGB regex.
|
|
518
|
+
*/
|
|
481
519
|
const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
520
|
+
/**
|
|
521
|
+
* Pattern matching rgba regex.
|
|
522
|
+
*/
|
|
482
523
|
const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
483
524
|
/**
|
|
484
525
|
* Color object represents an RGB color with alpha channel
|
|
@@ -844,9 +885,7 @@
|
|
|
844
885
|
}
|
|
845
886
|
return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
|
|
846
887
|
}
|
|
847
|
-
|
|
848
|
-
* TODO: Properly name all used internal variables
|
|
849
|
-
*/
|
|
888
|
+
// TODO: Properly name all used internal variables
|
|
850
889
|
|
|
851
890
|
/**
|
|
852
891
|
* Converts RGB values to HSL values
|
|
@@ -892,9 +931,7 @@
|
|
|
892
931
|
}
|
|
893
932
|
return [hue, saturation, lightness];
|
|
894
933
|
}
|
|
895
|
-
|
|
896
|
-
* TODO: Properly name all used internal variables
|
|
897
|
-
*/
|
|
934
|
+
// TODO: Properly name all used internal variables
|
|
898
935
|
|
|
899
936
|
/**
|
|
900
937
|
* Makes color transformer which lighten the given color
|
|
@@ -912,9 +949,7 @@
|
|
|
912
949
|
return Color.fromValues(r, g, b, alpha);
|
|
913
950
|
};
|
|
914
951
|
}
|
|
915
|
-
|
|
916
|
-
* TODO: Maybe implement by mix+hsl
|
|
917
|
-
*/
|
|
952
|
+
// TODO: Maybe implement by mix+hsl
|
|
918
953
|
|
|
919
954
|
/**
|
|
920
955
|
* Makes color transformer which saturate the given color
|
|
@@ -932,9 +967,7 @@
|
|
|
932
967
|
return Color.fromValues(r, g, b, alpha);
|
|
933
968
|
};
|
|
934
969
|
}
|
|
935
|
-
|
|
936
|
-
* TODO: Maybe implement by mix+hsl
|
|
937
|
-
*/
|
|
970
|
+
// TODO: Maybe implement by mix+hsl
|
|
938
971
|
|
|
939
972
|
/**
|
|
940
973
|
* Returns the same value that is passed as argument.
|
|
@@ -947,6 +980,7 @@
|
|
|
947
980
|
*
|
|
948
981
|
* @param value any values
|
|
949
982
|
* @returns the same values
|
|
983
|
+
*
|
|
950
984
|
* @private within the repository
|
|
951
985
|
*/
|
|
952
986
|
function just(value) {
|
|
@@ -1229,9 +1263,7 @@
|
|
|
1229
1263
|
return false;
|
|
1230
1264
|
}
|
|
1231
1265
|
}
|
|
1232
|
-
|
|
1233
|
-
* TODO: [🎺]
|
|
1234
|
-
*/
|
|
1266
|
+
// TODO: [🎺]
|
|
1235
1267
|
|
|
1236
1268
|
/**
|
|
1237
1269
|
* Normalize options for `execCommand` and `execCommands`
|
|
@@ -1299,7 +1331,6 @@
|
|
|
1299
1331
|
/**
|
|
1300
1332
|
* Run one command in a shell
|
|
1301
1333
|
*
|
|
1302
|
-
*
|
|
1303
1334
|
* Note: There are 2 similar functions in the codebase:
|
|
1304
1335
|
* - `$execCommand` which runs a single command
|
|
1305
1336
|
* - `$execCommands` which runs multiple commands
|
|
@@ -1398,9 +1429,7 @@
|
|
|
1398
1429
|
}
|
|
1399
1430
|
});
|
|
1400
1431
|
}
|
|
1401
|
-
|
|
1402
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
1403
|
-
*/
|
|
1432
|
+
// 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
|
|
1404
1433
|
|
|
1405
1434
|
/**
|
|
1406
1435
|
* [🐱🚀]
|
|
@@ -1409,9 +1438,11 @@
|
|
|
1409
1438
|
* You can simply use `RemoteExecutionTools` on client-side javascript and connect to your remote server.
|
|
1410
1439
|
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
1411
1440
|
*
|
|
1441
|
+
* TODO: [🐱🚀] Change to `@promptbook/agent-server`
|
|
1442
|
+
*
|
|
1412
1443
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
1444
|
+
*
|
|
1413
1445
|
* @public exported from `@promptbook/remote-server`
|
|
1414
|
-
* <- TODO: [🐱🚀] Change to `@promptbook/agent-server`
|
|
1415
1446
|
*/
|
|
1416
1447
|
async function startAgentServer(options) {
|
|
1417
1448
|
const { port = 4440 } = options;
|
|
@@ -1427,9 +1458,7 @@
|
|
|
1427
1458
|
isVerbose: true,
|
|
1428
1459
|
});
|
|
1429
1460
|
}
|
|
1430
|
-
|
|
1431
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
1432
|
-
*/
|
|
1461
|
+
// Note: [🟢] Code for Node server bootstrap [startAgentServer](src/remote-server/startAgentServer.ts) should never be published into packages that could be imported into browser environment
|
|
1433
1462
|
|
|
1434
1463
|
/**
|
|
1435
1464
|
* Make error report URL for the given error
|
|
@@ -1566,16 +1595,15 @@
|
|
|
1566
1595
|
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
1567
1596
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
1568
1597
|
*
|
|
1569
|
-
* @private internal helper function
|
|
1570
1598
|
* @returns secure random token
|
|
1599
|
+
*
|
|
1600
|
+
* @private internal helper function
|
|
1571
1601
|
*/
|
|
1572
1602
|
function $randomToken(randomness) {
|
|
1573
1603
|
return crypto.randomBytes(randomness).toString('hex');
|
|
1574
1604
|
}
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
1578
|
-
*/
|
|
1605
|
+
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
1606
|
+
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
1579
1607
|
|
|
1580
1608
|
/**
|
|
1581
1609
|
* This error indicates errors during the execution of the pipeline
|
|
@@ -1592,9 +1620,7 @@
|
|
|
1592
1620
|
Object.setPrototypeOf(this, PipelineExecutionError.prototype);
|
|
1593
1621
|
}
|
|
1594
1622
|
}
|
|
1595
|
-
|
|
1596
|
-
* TODO: [🧠][🌂] Add id to all errors
|
|
1597
|
-
*/
|
|
1623
|
+
// TODO: [🧠][🌂] Add id to all errors
|
|
1598
1624
|
|
|
1599
1625
|
/**
|
|
1600
1626
|
* This error indicates problems parsing the format value
|
|
@@ -1664,17 +1690,16 @@
|
|
|
1664
1690
|
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
1665
1691
|
}
|
|
1666
1692
|
}
|
|
1667
|
-
|
|
1668
|
-
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
1669
|
-
*/
|
|
1693
|
+
// TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
1670
1694
|
|
|
1671
1695
|
/**
|
|
1672
1696
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
1673
1697
|
*
|
|
1674
|
-
* @public exported from `@promptbook/core`
|
|
1675
1698
|
* Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
|
|
1676
1699
|
* Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
|
|
1677
1700
|
* Note: This is a kindof subtype of PipelineExecutionError
|
|
1701
|
+
*
|
|
1702
|
+
* @public exported from `@promptbook/core`
|
|
1678
1703
|
*/
|
|
1679
1704
|
class ExpectError extends Error {
|
|
1680
1705
|
constructor(message) {
|
|
@@ -1789,9 +1814,7 @@
|
|
|
1789
1814
|
Object.setPrototypeOf(this, ParseError.prototype);
|
|
1790
1815
|
}
|
|
1791
1816
|
}
|
|
1792
|
-
|
|
1793
|
-
* TODO: Maybe split `ParseError` and `ApplyError`
|
|
1794
|
-
*/
|
|
1817
|
+
// TODO: Maybe split `ParseError` and `ApplyError`
|
|
1795
1818
|
|
|
1796
1819
|
/**
|
|
1797
1820
|
* This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
|
|
@@ -1893,9 +1916,7 @@
|
|
|
1893
1916
|
...PROMPTBOOK_ERRORS,
|
|
1894
1917
|
...COMMON_JAVASCRIPT_ERRORS,
|
|
1895
1918
|
};
|
|
1896
|
-
|
|
1897
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1898
|
-
*/
|
|
1919
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1899
1920
|
|
|
1900
1921
|
/**
|
|
1901
1922
|
* Serializes an error into a [🚉] JSON-serializable object
|
|
@@ -1942,10 +1963,8 @@
|
|
|
1942
1963
|
return null;
|
|
1943
1964
|
}
|
|
1944
1965
|
}
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
1948
|
-
*/
|
|
1966
|
+
// 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
|
|
1967
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
1949
1968
|
|
|
1950
1969
|
/**
|
|
1951
1970
|
* Provides filesystem access (for example for Node.js-based scrapers)
|
|
@@ -1968,10 +1987,8 @@
|
|
|
1968
1987
|
watch: promises.watch,
|
|
1969
1988
|
};
|
|
1970
1989
|
}
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
1974
|
-
*/
|
|
1990
|
+
// 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
|
|
1991
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
1975
1992
|
|
|
1976
1993
|
/**
|
|
1977
1994
|
* Checks if the file is executable
|
|
@@ -1987,15 +2004,15 @@
|
|
|
1987
2004
|
return false;
|
|
1988
2005
|
}
|
|
1989
2006
|
}
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
* TODO: [🖇] What about symlinks?
|
|
1993
|
-
*/
|
|
2007
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
2008
|
+
// TODO: [🖇] What about symlinks?
|
|
1994
2009
|
|
|
1995
2010
|
// Note: Module `userhome` has no types available, so it is imported using `require`
|
|
1996
2011
|
// @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
|
|
1997
|
-
|
|
1998
|
-
|
|
2012
|
+
/**
|
|
2013
|
+
* Constant for userhome.
|
|
2014
|
+
*/
|
|
2015
|
+
const userhome = require('userhome'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
1999
2016
|
/**
|
|
2000
2017
|
* Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
|
|
2001
2018
|
* Returns the path to the executable if found, or null otherwise.
|
|
@@ -2024,10 +2041,8 @@
|
|
|
2024
2041
|
return null;
|
|
2025
2042
|
}
|
|
2026
2043
|
}
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
2030
|
-
*/
|
|
2044
|
+
// 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
|
|
2045
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
2031
2046
|
|
|
2032
2047
|
/**
|
|
2033
2048
|
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
@@ -2056,10 +2071,8 @@
|
|
|
2056
2071
|
return null;
|
|
2057
2072
|
}
|
|
2058
2073
|
}
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
2062
|
-
*/
|
|
2074
|
+
// 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
|
|
2075
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
2063
2076
|
|
|
2064
2077
|
/**
|
|
2065
2078
|
* Locates an application on the system
|
|
@@ -2096,10 +2109,8 @@
|
|
|
2096
2109
|
}
|
|
2097
2110
|
}
|
|
2098
2111
|
}
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
2102
|
-
*/
|
|
2112
|
+
// Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment
|
|
2113
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
2103
2114
|
|
|
2104
2115
|
/**
|
|
2105
2116
|
* Locates the LibreOffice executable on the current system by searching platform-specific paths.
|
|
@@ -2115,10 +2126,8 @@
|
|
|
2115
2126
|
macOsName: 'LibreOffice',
|
|
2116
2127
|
});
|
|
2117
2128
|
}
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
2121
|
-
*/
|
|
2129
|
+
// 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
|
|
2130
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
|
|
2122
2131
|
|
|
2123
2132
|
/**
|
|
2124
2133
|
* Locates the Pandoc executable on the current system by searching platform-specific paths.
|
|
@@ -2134,10 +2143,8 @@
|
|
|
2134
2143
|
macOsName: 'Pandoc',
|
|
2135
2144
|
});
|
|
2136
2145
|
}
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
2140
|
-
*/
|
|
2146
|
+
// 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
|
|
2147
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
|
|
2141
2148
|
|
|
2142
2149
|
/**
|
|
2143
2150
|
* Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
|
|
@@ -2154,16 +2161,15 @@
|
|
|
2154
2161
|
// <- TODO: [🧠] `null` vs `undefined`
|
|
2155
2162
|
};
|
|
2156
2163
|
}
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
2161
|
-
*/
|
|
2164
|
+
// Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment
|
|
2165
|
+
// TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
|
|
2166
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
2162
2167
|
|
|
2163
2168
|
/**
|
|
2164
2169
|
* Orders JSON object by keys
|
|
2165
2170
|
*
|
|
2166
2171
|
* @returns The same type of object as the input re-ordered
|
|
2172
|
+
*
|
|
2167
2173
|
* @public exported from `@promptbook/utils`
|
|
2168
2174
|
*/
|
|
2169
2175
|
function orderJson(options) {
|
|
@@ -2182,6 +2188,7 @@
|
|
|
2182
2188
|
* Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
|
|
2183
2189
|
*
|
|
2184
2190
|
* @returns The same object as the input, but deeply frozen
|
|
2191
|
+
*
|
|
2185
2192
|
* @public exported from `@promptbook/utils`
|
|
2186
2193
|
*/
|
|
2187
2194
|
function $deepFreeze(objectValue) {
|
|
@@ -2198,9 +2205,7 @@
|
|
|
2198
2205
|
Object.freeze(objectValue);
|
|
2199
2206
|
return objectValue;
|
|
2200
2207
|
}
|
|
2201
|
-
|
|
2202
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2203
|
-
*/
|
|
2208
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2204
2209
|
|
|
2205
2210
|
/**
|
|
2206
2211
|
* Checks if the value is [🚉] serializable as JSON
|
|
@@ -2220,6 +2225,7 @@
|
|
|
2220
2225
|
* - And much more...
|
|
2221
2226
|
*
|
|
2222
2227
|
* @throws UnexpectedError if the value is not serializable as JSON
|
|
2228
|
+
*
|
|
2223
2229
|
* @public exported from `@promptbook/utils`
|
|
2224
2230
|
*/
|
|
2225
2231
|
function checkSerializableAsJson(options) {
|
|
@@ -2334,11 +2340,9 @@
|
|
|
2334
2340
|
`));
|
|
2335
2341
|
}
|
|
2336
2342
|
}
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
2341
|
-
*/
|
|
2343
|
+
// TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
|
|
2344
|
+
// TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
2345
|
+
// Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
2342
2346
|
|
|
2343
2347
|
/**
|
|
2344
2348
|
* Creates a deep clone of the given object
|
|
@@ -2348,6 +2352,7 @@
|
|
|
2348
2352
|
*
|
|
2349
2353
|
* @param objectValue The object to clone.
|
|
2350
2354
|
* @returns A deep, writable clone of the input object.
|
|
2355
|
+
*
|
|
2351
2356
|
* @public exported from `@promptbook/utils`
|
|
2352
2357
|
*/
|
|
2353
2358
|
function deepClone(objectValue) {
|
|
@@ -2364,9 +2369,7 @@
|
|
|
2364
2369
|
> return Object.assign({}, objectValue);
|
|
2365
2370
|
*/
|
|
2366
2371
|
}
|
|
2367
|
-
|
|
2368
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2369
|
-
*/
|
|
2372
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2370
2373
|
|
|
2371
2374
|
/**
|
|
2372
2375
|
* Utility to export a JSON object from a function
|
|
@@ -2379,6 +2382,7 @@
|
|
|
2379
2382
|
* Note: This function does not mutates the given object
|
|
2380
2383
|
*
|
|
2381
2384
|
* @returns The same type of object as the input but read-only and re-ordered
|
|
2385
|
+
*
|
|
2382
2386
|
* @public exported from `@promptbook/utils`
|
|
2383
2387
|
*/
|
|
2384
2388
|
function exportJson(options) {
|
|
@@ -2398,9 +2402,7 @@
|
|
|
2398
2402
|
$deepFreeze(orderedValue);
|
|
2399
2403
|
return orderedValue;
|
|
2400
2404
|
}
|
|
2401
|
-
|
|
2402
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2403
|
-
*/
|
|
2405
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2404
2406
|
|
|
2405
2407
|
/**
|
|
2406
2408
|
* Order of keys in the pipeline JSON
|
|
@@ -2511,9 +2513,7 @@
|
|
|
2511
2513
|
*/
|
|
2512
2514
|
SHORT_NAME_LENGTH: 6,
|
|
2513
2515
|
};
|
|
2514
|
-
|
|
2515
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2516
|
-
*/
|
|
2516
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2517
2517
|
|
|
2518
2518
|
/**
|
|
2519
2519
|
* Tests if given string is valid semantic version
|
|
@@ -2538,12 +2538,13 @@
|
|
|
2538
2538
|
* Tests if given string is valid promptbook version
|
|
2539
2539
|
* It looks into list of known promptbook versions.
|
|
2540
2540
|
*
|
|
2541
|
-
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
2542
2541
|
* Note: When you are using for example promptbook 2.0.0 and there already is promptbook 3.0.0 it don`t know about it.
|
|
2543
2542
|
* Note: There are two similar functions:
|
|
2544
2543
|
* - `isValidSemanticVersion` which tests any semantic version
|
|
2545
2544
|
* - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
|
|
2546
2545
|
*
|
|
2546
|
+
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
2547
|
+
*
|
|
2547
2548
|
* @public exported from `@promptbook/utils`
|
|
2548
2549
|
*/
|
|
2549
2550
|
function isValidPromptbookVersion(version) {
|
|
@@ -2617,9 +2618,7 @@
|
|
|
2617
2618
|
*/
|
|
2618
2619
|
return true;
|
|
2619
2620
|
}
|
|
2620
|
-
|
|
2621
|
-
* TODO: [🐠] Maybe more info why the URL is invalid
|
|
2622
|
-
*/
|
|
2621
|
+
// TODO: [🐠] Maybe more info why the URL is invalid
|
|
2623
2622
|
|
|
2624
2623
|
/**
|
|
2625
2624
|
* Validates PipelineJson if it is logically valid
|
|
@@ -2636,6 +2635,7 @@
|
|
|
2636
2635
|
* @param pipeline valid or invalid PipelineJson
|
|
2637
2636
|
* @returns the same pipeline if it is logically valid
|
|
2638
2637
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
2638
|
+
*
|
|
2639
2639
|
* @public exported from `@promptbook/core`
|
|
2640
2640
|
*/
|
|
2641
2641
|
function validatePipeline(pipeline) {
|
|
@@ -2660,6 +2660,8 @@
|
|
|
2660
2660
|
return pipeline;
|
|
2661
2661
|
}
|
|
2662
2662
|
/**
|
|
2663
|
+
* Validates pipeline inner function.
|
|
2664
|
+
*
|
|
2663
2665
|
* @private internal function for `validatePipeline`
|
|
2664
2666
|
*/
|
|
2665
2667
|
function validatePipeline_InnerFunction(pipeline) {
|
|
@@ -2904,15 +2906,13 @@
|
|
|
2904
2906
|
* > * - ...
|
|
2905
2907
|
* > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
|
|
2906
2908
|
*/
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
2915
|
-
*/
|
|
2909
|
+
// TODO: [🧳][main] !!4 Validate that all examples match expectations
|
|
2910
|
+
// TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
|
|
2911
|
+
// TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
|
|
2912
|
+
// TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
|
|
2913
|
+
// TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
|
|
2914
|
+
// TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
|
|
2915
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
2916
2916
|
|
|
2917
2917
|
/**
|
|
2918
2918
|
* Determine if the pipeline is fully prepared
|
|
@@ -3014,7 +3014,7 @@
|
|
|
3014
3014
|
|
|
3015
3015
|
/**
|
|
3016
3016
|
* Recursively converts JSON strings to JSON objects
|
|
3017
|
-
|
|
3017
|
+
*
|
|
3018
3018
|
* @public exported from `@promptbook/utils`
|
|
3019
3019
|
*/
|
|
3020
3020
|
function jsonStringsToJsons(object) {
|
|
@@ -3038,9 +3038,7 @@
|
|
|
3038
3038
|
}
|
|
3039
3039
|
return newObject;
|
|
3040
3040
|
}
|
|
3041
|
-
|
|
3042
|
-
* TODO: Type the return type correctly
|
|
3043
|
-
*/
|
|
3041
|
+
// TODO: Type the return type correctly
|
|
3044
3042
|
|
|
3045
3043
|
/**
|
|
3046
3044
|
* Deserializes the error object
|
|
@@ -3075,6 +3073,7 @@
|
|
|
3075
3073
|
*
|
|
3076
3074
|
* @param executionResult - The partial result of the Promptbook execution
|
|
3077
3075
|
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
3076
|
+
*
|
|
3078
3077
|
* @private internal helper function of `asPromise` method of `ExecutionTask`
|
|
3079
3078
|
*/
|
|
3080
3079
|
function assertsTaskSuccessful(executionResult) {
|
|
@@ -3105,9 +3104,7 @@
|
|
|
3105
3104
|
`));
|
|
3106
3105
|
}
|
|
3107
3106
|
}
|
|
3108
|
-
|
|
3109
|
-
* TODO: [🧠] Can this return type be better typed than void
|
|
3110
|
-
*/
|
|
3107
|
+
// TODO: [🧠] Can this return type be better typed than void
|
|
3111
3108
|
|
|
3112
3109
|
/**
|
|
3113
3110
|
* Helper to create a new task
|
|
@@ -3298,10 +3295,8 @@
|
|
|
3298
3295
|
},
|
|
3299
3296
|
};
|
|
3300
3297
|
}
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
* TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
|
|
3304
|
-
*/
|
|
3298
|
+
// TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
|
|
3299
|
+
// TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
|
|
3305
3300
|
|
|
3306
3301
|
/**
|
|
3307
3302
|
* Represents the uncertain value
|
|
@@ -3369,9 +3364,7 @@
|
|
|
3369
3364
|
pagesCount: UNCERTAIN_ZERO_VALUE,
|
|
3370
3365
|
},
|
|
3371
3366
|
});
|
|
3372
|
-
|
|
3373
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3374
|
-
*/
|
|
3367
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3375
3368
|
|
|
3376
3369
|
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"}];
|
|
3377
3370
|
|
|
@@ -3394,6 +3387,7 @@
|
|
|
3394
3387
|
* Tests if given string is valid file path.
|
|
3395
3388
|
*
|
|
3396
3389
|
* Note: This does not check if the file exists only if the path is valid
|
|
3390
|
+
*
|
|
3397
3391
|
* @public exported from `@promptbook/utils`
|
|
3398
3392
|
*/
|
|
3399
3393
|
function isValidFilePath(filename) {
|
|
@@ -3442,9 +3436,7 @@
|
|
|
3442
3436
|
}
|
|
3443
3437
|
return false;
|
|
3444
3438
|
}
|
|
3445
|
-
|
|
3446
|
-
* TODO: [🍏] Implement for MacOs
|
|
3447
|
-
*/
|
|
3439
|
+
// TODO: [🍏] Implement for MacOs
|
|
3448
3440
|
|
|
3449
3441
|
/**
|
|
3450
3442
|
* Function `validatePipelineString` will validate the if the string is a valid pipeline string
|
|
@@ -3455,6 +3447,7 @@
|
|
|
3455
3447
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
3456
3448
|
* @returns {PipelineString} the same string as input, but validated as valid
|
|
3457
3449
|
* @throws {ParseError} if the string is not a valid pipeline string
|
|
3450
|
+
*
|
|
3458
3451
|
* @public exported from `@promptbook/core`
|
|
3459
3452
|
*/
|
|
3460
3453
|
function validatePipelineString(pipelineString) {
|
|
@@ -3473,17 +3466,16 @@
|
|
|
3473
3466
|
// <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
|
|
3474
3467
|
return pipelineString;
|
|
3475
3468
|
}
|
|
3476
|
-
|
|
3477
|
-
* TODO: [🧠][🈴] Where is the best location for this file
|
|
3478
|
-
*/
|
|
3469
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
3479
3470
|
|
|
3480
3471
|
/**
|
|
3481
3472
|
* Prettify the html code
|
|
3482
3473
|
*
|
|
3483
3474
|
* @param content raw html code
|
|
3484
3475
|
* @returns formatted html code
|
|
3485
|
-
* @private withing the package because of HUGE size of prettier dependency
|
|
3486
3476
|
* @deprecated Prettier removed from Promptbook due to package size
|
|
3477
|
+
*
|
|
3478
|
+
* @private withing the package because of HUGE size of prettier dependency
|
|
3487
3479
|
*/
|
|
3488
3480
|
function prettifyMarkdown(content) {
|
|
3489
3481
|
return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
|
|
@@ -3506,6 +3498,7 @@
|
|
|
3506
3498
|
* @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
|
|
3507
3499
|
* @param pipelineJson Promptbook in JSON format (.bookc)
|
|
3508
3500
|
* @returns Promptbook in string format (.book.md)
|
|
3501
|
+
*
|
|
3509
3502
|
* @public exported from `@promptbook/core`
|
|
3510
3503
|
*/
|
|
3511
3504
|
function pipelineJsonToString(pipelineJson) {
|
|
@@ -3622,6 +3615,8 @@
|
|
|
3622
3615
|
return validatePipelineString(pipelineString);
|
|
3623
3616
|
}
|
|
3624
3617
|
/**
|
|
3618
|
+
* Handles task parameter Json to string.
|
|
3619
|
+
*
|
|
3625
3620
|
* @private internal utility of `pipelineJsonToString`
|
|
3626
3621
|
*/
|
|
3627
3622
|
function taskParameterJsonToString(taskParameterJson) {
|
|
@@ -3632,19 +3627,18 @@
|
|
|
3632
3627
|
}
|
|
3633
3628
|
return parameterString;
|
|
3634
3629
|
}
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
* TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
3641
|
-
*/
|
|
3630
|
+
// TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
|
|
3631
|
+
// TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
|
|
3632
|
+
// TODO: [🏛] Maybe make some markdown builder
|
|
3633
|
+
// TODO: [🏛] Escape all
|
|
3634
|
+
// TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
3642
3635
|
|
|
3643
3636
|
/**
|
|
3644
3637
|
* Parses the task and returns the list of all parameter names
|
|
3645
3638
|
*
|
|
3646
3639
|
* @param template the string template with parameters in {curly} braces
|
|
3647
3640
|
* @returns the list of parameter names
|
|
3641
|
+
*
|
|
3648
3642
|
* @public exported from `@promptbook/utils`
|
|
3649
3643
|
*/
|
|
3650
3644
|
function extractParameterNames(template) {
|
|
@@ -3661,6 +3655,7 @@
|
|
|
3661
3655
|
* Unprepare just strips the preparation data of the pipeline
|
|
3662
3656
|
*
|
|
3663
3657
|
* @deprecated In future version this function will be removed or deprecated
|
|
3658
|
+
*
|
|
3664
3659
|
* @public exported from `@promptbook/core`
|
|
3665
3660
|
*/
|
|
3666
3661
|
function unpreparePipeline(pipeline) {
|
|
@@ -3689,18 +3684,17 @@
|
|
|
3689
3684
|
},
|
|
3690
3685
|
});
|
|
3691
3686
|
}
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
* TODO: [🍙] Make some standard order of json properties
|
|
3696
|
-
*/
|
|
3687
|
+
// TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
|
|
3688
|
+
// TODO: Write tests for `preparePipeline`
|
|
3689
|
+
// TODO: [🍙] Make some standard order of json properties
|
|
3697
3690
|
|
|
3698
3691
|
/**
|
|
3699
3692
|
* Library of pipelines that groups together pipelines for an application.
|
|
3700
3693
|
* This implementation is a very thin wrapper around the Array / Map of pipelines.
|
|
3701
3694
|
*
|
|
3702
|
-
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
3703
3695
|
* @see https://github.com/webgptorg/pipeline#pipeline-collection
|
|
3696
|
+
*
|
|
3697
|
+
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
3704
3698
|
*/
|
|
3705
3699
|
class SimplePipelineCollection {
|
|
3706
3700
|
/**
|
|
@@ -3804,6 +3798,7 @@
|
|
|
3804
3798
|
*
|
|
3805
3799
|
* @param promptbookSources
|
|
3806
3800
|
* @returns PipelineCollection
|
|
3801
|
+
*
|
|
3807
3802
|
* @public exported from `@promptbook/core`
|
|
3808
3803
|
*/
|
|
3809
3804
|
function createPipelineCollectionFromJson(...promptbooks) {
|
|
@@ -3816,8 +3811,9 @@
|
|
|
3816
3811
|
* @param array - Array to iterate over
|
|
3817
3812
|
* @param options - Options for the function
|
|
3818
3813
|
* @param callbackfunction - Function to call for each item
|
|
3819
|
-
* @public exported from `@promptbook/utils`
|
|
3820
3814
|
* @deprecated [🪂] Use queues instead
|
|
3815
|
+
*
|
|
3816
|
+
* @public exported from `@promptbook/utils`
|
|
3821
3817
|
*/
|
|
3822
3818
|
async function forEachAsync(array, options, callbackfunction) {
|
|
3823
3819
|
const { maxParallelCount = Infinity } = options;
|
|
@@ -3902,6 +3898,7 @@
|
|
|
3902
3898
|
*
|
|
3903
3899
|
* @param llmTools - The LLM tools to be intercepted and tracked
|
|
3904
3900
|
* @returns Full proxy of the tools with added usage tracking capabilities
|
|
3901
|
+
*
|
|
3905
3902
|
* @public exported from `@promptbook/core`
|
|
3906
3903
|
*/
|
|
3907
3904
|
function countUsage(llmTools) {
|
|
@@ -4026,6 +4023,7 @@
|
|
|
4026
4023
|
* Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
|
|
4027
4024
|
*
|
|
4028
4025
|
* Note: Internal utility of `joinLlmExecutionTools` but exposed type
|
|
4026
|
+
*
|
|
4029
4027
|
* @public exported from `@promptbook/core`
|
|
4030
4028
|
*/
|
|
4031
4029
|
class MultipleLlmExecutionTools {
|
|
@@ -4188,16 +4186,16 @@
|
|
|
4188
4186
|
* `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
|
|
4189
4187
|
*
|
|
4190
4188
|
* 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
|
|
4191
|
-
*
|
|
4189
|
+
* If the first provider doesn't support the requested model or fails, it tries the next one.
|
|
4192
4190
|
* 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
|
|
4193
4191
|
* 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
|
|
4194
4192
|
*
|
|
4193
|
+
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
4194
|
+
*
|
|
4195
4195
|
* @param title - A descriptive title for this collection of joined tools
|
|
4196
4196
|
* @param llmExecutionTools - An array of execution tools to be joined
|
|
4197
4197
|
* @returns A single unified execution tool wrapper
|
|
4198
4198
|
*
|
|
4199
|
-
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
4200
|
-
*
|
|
4201
4199
|
* @public exported from `@promptbook/core`
|
|
4202
4200
|
*/
|
|
4203
4201
|
function joinLlmExecutionTools(title, ...llmExecutionTools) {
|
|
@@ -4234,10 +4232,8 @@
|
|
|
4234
4232
|
}
|
|
4235
4233
|
return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
|
|
4236
4234
|
}
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
* TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4240
|
-
*/
|
|
4235
|
+
// TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4236
|
+
// TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4241
4237
|
|
|
4242
4238
|
/**
|
|
4243
4239
|
* Just returns the given `LlmExecutionTools` or joins multiple into one
|
|
@@ -4251,15 +4247,14 @@
|
|
|
4251
4247
|
: joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
|
|
4252
4248
|
return llmTools;
|
|
4253
4249
|
}
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
* TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4257
|
-
*/
|
|
4250
|
+
// TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4251
|
+
// TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4258
4252
|
|
|
4259
4253
|
/**
|
|
4260
4254
|
* Prepares the persona for the pipeline
|
|
4261
4255
|
*
|
|
4262
4256
|
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
4257
|
+
*
|
|
4263
4258
|
* @public exported from `@promptbook/core`
|
|
4264
4259
|
*/
|
|
4265
4260
|
async function preparePersona(personaDescription, tools, options) {
|
|
@@ -4316,13 +4311,11 @@
|
|
|
4316
4311
|
modelsRequirements,
|
|
4317
4312
|
};
|
|
4318
4313
|
}
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
* TODO: [🏢] Check validity of `temperature` in pipeline
|
|
4325
|
-
*/
|
|
4314
|
+
// TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
|
|
4315
|
+
// TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
|
|
4316
|
+
// TODO: [🏢] Check validity of `modelName` in pipeline
|
|
4317
|
+
// TODO: [🏢] Check validity of `systemMessage` in pipeline
|
|
4318
|
+
// TODO: [🏢] Check validity of `temperature` in pipeline
|
|
4326
4319
|
|
|
4327
4320
|
/**
|
|
4328
4321
|
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
@@ -4330,7 +4323,7 @@
|
|
|
4330
4323
|
*
|
|
4331
4324
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
4332
4325
|
*
|
|
4333
|
-
*
|
|
4326
|
+
* @private internal function of `$Register`
|
|
4334
4327
|
*/
|
|
4335
4328
|
function $getGlobalScope() {
|
|
4336
4329
|
return Function('return this')();
|
|
@@ -4345,6 +4338,7 @@
|
|
|
4345
4338
|
* @returns The normalized text in SCREAMING_CASE format.
|
|
4346
4339
|
* @example 'HELLO_WORLD'
|
|
4347
4340
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
4341
|
+
*
|
|
4348
4342
|
* @public exported from `@promptbook/utils`
|
|
4349
4343
|
*/
|
|
4350
4344
|
function normalizeTo_SCREAMING_CASE(text) {
|
|
@@ -4402,6 +4396,7 @@
|
|
|
4402
4396
|
* @returns The normalized text in snake_case format.
|
|
4403
4397
|
* @example 'hello_world'
|
|
4404
4398
|
* @example 'i_love_promptbook'
|
|
4399
|
+
*
|
|
4405
4400
|
* @public exported from `@promptbook/utils`
|
|
4406
4401
|
*/
|
|
4407
4402
|
function normalizeTo_snake_case(text) {
|
|
@@ -4460,26 +4455,26 @@
|
|
|
4460
4455
|
* Global registry for storing metadata about all available scrapers and converters.
|
|
4461
4456
|
*
|
|
4462
4457
|
* Note: `$` is used to indicate that this interacts with the global scope.
|
|
4458
|
+
*
|
|
4463
4459
|
* @singleton Only one instance of each register is created per build, but there can be more in different contexts (e.g., tests).
|
|
4460
|
+
*
|
|
4464
4461
|
* @public exported from `@promptbook/core`
|
|
4465
4462
|
*/
|
|
4466
4463
|
const $scrapersMetadataRegister = new $Register('scrapers_metadata');
|
|
4467
|
-
|
|
4468
|
-
* TODO: [®] DRY Register logic
|
|
4469
|
-
*/
|
|
4464
|
+
// TODO: [®] DRY Register logic
|
|
4470
4465
|
|
|
4471
4466
|
/**
|
|
4472
4467
|
* Registry for all available scrapers in the system.
|
|
4473
4468
|
* Central point for registering and accessing different types of content scrapers.
|
|
4474
4469
|
*
|
|
4475
4470
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
4471
|
+
*
|
|
4476
4472
|
* @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
|
|
4473
|
+
*
|
|
4477
4474
|
* @public exported from `@promptbook/core`
|
|
4478
4475
|
*/
|
|
4479
4476
|
const $scrapersRegister = new $Register('scraper_constructors');
|
|
4480
|
-
|
|
4481
|
-
* TODO: [®] DRY Register logic
|
|
4482
|
-
*/
|
|
4477
|
+
// TODO: [®] DRY Register logic
|
|
4483
4478
|
|
|
4484
4479
|
/**
|
|
4485
4480
|
* Creates a message with all registered scrapers
|
|
@@ -4564,10 +4559,11 @@
|
|
|
4564
4559
|
|
|
4565
4560
|
`);
|
|
4566
4561
|
}
|
|
4562
|
+
// TODO: [®] DRY Register logic
|
|
4563
|
+
|
|
4567
4564
|
/**
|
|
4568
|
-
*
|
|
4565
|
+
* Collection of default diacritics removal map.
|
|
4569
4566
|
*/
|
|
4570
|
-
|
|
4571
4567
|
const defaultDiacriticsRemovalMap = [
|
|
4572
4568
|
{
|
|
4573
4569
|
base: 'A',
|
|
@@ -4819,6 +4815,7 @@
|
|
|
4819
4815
|
*
|
|
4820
4816
|
* @param input The string containing diacritics to be normalized.
|
|
4821
4817
|
* @returns The string with diacritics removed or normalized.
|
|
4818
|
+
*
|
|
4822
4819
|
* @public exported from `@promptbook/utils`
|
|
4823
4820
|
*/
|
|
4824
4821
|
function removeDiacritics(input) {
|
|
@@ -4827,9 +4824,7 @@
|
|
|
4827
4824
|
return DIACRITIC_VARIANTS_LETTERS[character] || character;
|
|
4828
4825
|
});
|
|
4829
4826
|
}
|
|
4830
|
-
|
|
4831
|
-
* TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
|
|
4832
|
-
*/
|
|
4827
|
+
// TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
|
|
4833
4828
|
|
|
4834
4829
|
/**
|
|
4835
4830
|
* Converts a given text to kebab-case format.
|
|
@@ -4840,6 +4835,7 @@
|
|
|
4840
4835
|
* @returns The kebab-case formatted string.
|
|
4841
4836
|
* @example 'hello-world'
|
|
4842
4837
|
* @example 'i-love-promptbook'
|
|
4838
|
+
*
|
|
4843
4839
|
* @public exported from `@promptbook/utils`
|
|
4844
4840
|
*/
|
|
4845
4841
|
function normalizeToKebabCase(text) {
|
|
@@ -4880,9 +4876,7 @@
|
|
|
4880
4876
|
normalizedName = normalizedName.replace(/-$/, '');
|
|
4881
4877
|
return normalizedName;
|
|
4882
4878
|
}
|
|
4883
|
-
|
|
4884
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4885
|
-
*/
|
|
4879
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4886
4880
|
|
|
4887
4881
|
/**
|
|
4888
4882
|
* Creates unique name for the source
|
|
@@ -4901,9 +4895,7 @@
|
|
|
4901
4895
|
// <- TODO: Use MAX_FILENAME_LENGTH
|
|
4902
4896
|
return name;
|
|
4903
4897
|
}
|
|
4904
|
-
|
|
4905
|
-
* TODO: [🐱🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
|
|
4906
|
-
*/
|
|
4898
|
+
// TODO: [🐱🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
|
|
4907
4899
|
|
|
4908
4900
|
/**
|
|
4909
4901
|
* Converts a name to a properly formatted subfolder path for cache storage.
|
|
@@ -4953,11 +4945,9 @@
|
|
|
4953
4945
|
.catch(() => false);
|
|
4954
4946
|
return isFile;
|
|
4955
4947
|
}
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
* TODO: [🖇] What about symlinks?
|
|
4960
|
-
*/
|
|
4948
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
4949
|
+
// TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
4950
|
+
// TODO: [🖇] What about symlinks?
|
|
4961
4951
|
|
|
4962
4952
|
/**
|
|
4963
4953
|
* Convert mime type to file extension
|
|
@@ -4977,6 +4967,7 @@
|
|
|
4977
4967
|
*
|
|
4978
4968
|
* @param text with emojis
|
|
4979
4969
|
* @returns text without emojis
|
|
4970
|
+
*
|
|
4980
4971
|
* @public exported from `@promptbook/utils`
|
|
4981
4972
|
*/
|
|
4982
4973
|
function removeEmojis(text) {
|
|
@@ -4996,6 +4987,7 @@
|
|
|
4996
4987
|
* @param value The title string to be converted to a name.
|
|
4997
4988
|
* @returns A normalized name derived from the input title.
|
|
4998
4989
|
* @example 'Hello World!' -> 'hello-world'
|
|
4990
|
+
*
|
|
4999
4991
|
* @public exported from `@promptbook/utils`
|
|
5000
4992
|
*/
|
|
5001
4993
|
function titleToName(value) {
|
|
@@ -5041,9 +5033,7 @@
|
|
|
5041
5033
|
`));
|
|
5042
5034
|
}
|
|
5043
5035
|
};
|
|
5044
|
-
|
|
5045
|
-
* TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
|
|
5046
|
-
*/
|
|
5036
|
+
// TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
|
|
5047
5037
|
|
|
5048
5038
|
/**
|
|
5049
5039
|
* Factory function that creates a handler for processing knowledge sources.
|
|
@@ -5263,6 +5253,7 @@
|
|
|
5263
5253
|
* Prepares the knowledge pieces
|
|
5264
5254
|
*
|
|
5265
5255
|
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
5256
|
+
*
|
|
5266
5257
|
* @public exported from `@promptbook/core`
|
|
5267
5258
|
*/
|
|
5268
5259
|
async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
@@ -5404,25 +5395,24 @@
|
|
|
5404
5395
|
});
|
|
5405
5396
|
return { tasksPrepared };
|
|
5406
5397
|
}
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
5416
|
-
*/
|
|
5398
|
+
// TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
|
|
5399
|
+
// TODO: [🧠] Add context to each task (if missing)
|
|
5400
|
+
// TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
|
|
5401
|
+
// TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
|
|
5402
|
+
// TODO: Write tests for `preparePipeline`
|
|
5403
|
+
// TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
5404
|
+
// TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
5405
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
5417
5406
|
|
|
5418
5407
|
/**
|
|
5419
5408
|
* Prepare pipeline locally
|
|
5420
5409
|
*
|
|
5421
|
-
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
5422
|
-
*
|
|
5423
5410
|
* Note: This function does not validate logic of the pipeline
|
|
5424
5411
|
* Note: This function acts as part of compilation process
|
|
5425
5412
|
* Note: When the pipeline is already prepared, it returns the same pipeline
|
|
5413
|
+
*
|
|
5414
|
+
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
5415
|
+
*
|
|
5426
5416
|
* @public exported from `@promptbook/core`
|
|
5427
5417
|
*/
|
|
5428
5418
|
async function preparePipeline(pipeline, tools, options) {
|
|
@@ -5593,8 +5583,8 @@
|
|
|
5593
5583
|
* This is useful and used in the `templateParameters` function
|
|
5594
5584
|
*
|
|
5595
5585
|
* Note: This function is not just calling `toString` method
|
|
5596
|
-
*
|
|
5597
|
-
*
|
|
5586
|
+
* It's more complex and can handle this conversion specifically for LLM models
|
|
5587
|
+
* See `VALUE_STRINGS`
|
|
5598
5588
|
*
|
|
5599
5589
|
* Note: There are 2 similar functions
|
|
5600
5590
|
* - `valueToString` converts value to string for LLM models as human-readable string
|
|
@@ -5647,6 +5637,7 @@
|
|
|
5647
5637
|
* @param script from which to extract the variables
|
|
5648
5638
|
* @returns the list of variable names
|
|
5649
5639
|
* @throws {ParseError} if the script is invalid
|
|
5640
|
+
*
|
|
5650
5641
|
* @public exported from `@promptbook/javascript`
|
|
5651
5642
|
*/
|
|
5652
5643
|
function extractVariablesFromJavascript(script) {
|
|
@@ -5712,9 +5703,7 @@
|
|
|
5712
5703
|
}
|
|
5713
5704
|
return variables;
|
|
5714
5705
|
}
|
|
5715
|
-
|
|
5716
|
-
* TODO: [🔣] Support for multiple languages - python, java,...
|
|
5717
|
-
*/
|
|
5706
|
+
// TODO: [🔣] Support for multiple languages - python, java,...
|
|
5718
5707
|
|
|
5719
5708
|
/**
|
|
5720
5709
|
* Parses the task and returns the set of all used parameters
|
|
@@ -5722,6 +5711,7 @@
|
|
|
5722
5711
|
* @param task the task with used parameters
|
|
5723
5712
|
* @returns the set of parameter names
|
|
5724
5713
|
* @throws {ParseError} if the script is invalid
|
|
5714
|
+
*
|
|
5725
5715
|
* @public exported from `@promptbook/core` <- Note: [👖] This utility is so tightly interconnected with the Promptbook that it is not exported as util but in core
|
|
5726
5716
|
*/
|
|
5727
5717
|
function extractParameterNamesFromTask(task) {
|
|
@@ -5762,14 +5752,13 @@
|
|
|
5762
5752
|
}
|
|
5763
5753
|
return parameterNames;
|
|
5764
5754
|
}
|
|
5765
|
-
|
|
5766
|
-
* TODO: [🔣] If script require contentLanguage
|
|
5767
|
-
*/
|
|
5755
|
+
// TODO: [🔣] If script require contentLanguage
|
|
5768
5756
|
|
|
5769
5757
|
/**
|
|
5770
5758
|
* Create difference set of two sets.
|
|
5771
5759
|
*
|
|
5772
5760
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5761
|
+
*
|
|
5773
5762
|
* @public exported from `@promptbook/utils`
|
|
5774
5763
|
*/
|
|
5775
5764
|
function difference(a, b, isEqual = (a, b) => a === b) {
|
|
@@ -5781,14 +5770,13 @@
|
|
|
5781
5770
|
}
|
|
5782
5771
|
return diff;
|
|
5783
5772
|
}
|
|
5784
|
-
|
|
5785
|
-
* TODO: [🧠][💯] Maybe also implement symmetricDifference
|
|
5786
|
-
*/
|
|
5773
|
+
// TODO: [🧠][💯] Maybe also implement symmetricDifference
|
|
5787
5774
|
|
|
5788
5775
|
/**
|
|
5789
5776
|
* Creates a new set with all elements that are present in either set
|
|
5790
5777
|
*
|
|
5791
5778
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5779
|
+
*
|
|
5792
5780
|
* @public exported from `@promptbook/utils`
|
|
5793
5781
|
*/
|
|
5794
5782
|
function union(...sets) {
|
|
@@ -5854,8 +5842,9 @@
|
|
|
5854
5842
|
/**
|
|
5855
5843
|
* Definition for CSV spreadsheet
|
|
5856
5844
|
*
|
|
5845
|
+
* TODO: [🏢] Export from package `@promptbook/csv`
|
|
5846
|
+
*
|
|
5857
5847
|
* @public exported from `@promptbook/core`
|
|
5858
|
-
* <- TODO: [🏢] Export from package `@promptbook/csv`
|
|
5859
5848
|
*/
|
|
5860
5849
|
const CsvFormatParser = {
|
|
5861
5850
|
formatName: 'CSV',
|
|
@@ -5945,13 +5934,11 @@
|
|
|
5945
5934
|
},
|
|
5946
5935
|
],
|
|
5947
5936
|
};
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
* TODO: [🏢] Allow to expect something inside CSV objects and other formats
|
|
5954
|
-
*/
|
|
5937
|
+
// TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
|
|
5938
|
+
// TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
|
|
5939
|
+
// TODO: [🍓] In `CsvFormatParser` implement `heal
|
|
5940
|
+
// TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
|
|
5941
|
+
// TODO: [🏢] Allow to expect something inside CSV objects and other formats
|
|
5955
5942
|
|
|
5956
5943
|
/**
|
|
5957
5944
|
* Definition for JSON format
|
|
@@ -5972,17 +5959,15 @@
|
|
|
5972
5959
|
},
|
|
5973
5960
|
subvalueParsers: [],
|
|
5974
5961
|
};
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
* TODO: [🏢] Allow to expect something inside JSON objects and other formats
|
|
5985
|
-
*/
|
|
5962
|
+
// TODO: [🧠] Maybe proper instance of object
|
|
5963
|
+
// TODO: [0] Make string_serialized_json
|
|
5964
|
+
// TODO: [1] Make type for JSON Settings and Schema
|
|
5965
|
+
// TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
|
|
5966
|
+
// TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
|
|
5967
|
+
// TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
|
|
5968
|
+
// TODO: [🍓] In `JsonFormatParser` implement `heal
|
|
5969
|
+
// TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
|
|
5970
|
+
// TODO: [🏢] Allow to expect something inside JSON objects and other formats
|
|
5986
5971
|
|
|
5987
5972
|
/**
|
|
5988
5973
|
* Definition for any text - this will be always valid
|
|
@@ -6020,15 +6005,13 @@
|
|
|
6020
6005
|
// <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
6021
6006
|
],
|
|
6022
6007
|
};
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
* TODO: [🏢] Allow to expect something inside each item of list and other formats
|
|
6031
|
-
*/
|
|
6008
|
+
// TODO: [1] Make type for XML Text and Schema
|
|
6009
|
+
// TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
6010
|
+
// TODO: [🍓] In `TextFormatParser` implement simple `isValid`
|
|
6011
|
+
// TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
|
|
6012
|
+
// TODO: [🍓] In `TextFormatParser` implement `heal
|
|
6013
|
+
// TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
|
|
6014
|
+
// TODO: [🏢] Allow to expect something inside each item of list and other formats
|
|
6032
6015
|
|
|
6033
6016
|
/**
|
|
6034
6017
|
* Function to check if a string is valid XML
|
|
@@ -6073,17 +6056,15 @@
|
|
|
6073
6056
|
},
|
|
6074
6057
|
subvalueParsers: [],
|
|
6075
6058
|
};
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
* TODO: [🏢] Allow to expect something inside XML and other formats
|
|
6086
|
-
*/
|
|
6059
|
+
// TODO: [🧠] Maybe proper instance of object
|
|
6060
|
+
// TODO: [0] Make string_serialized_xml
|
|
6061
|
+
// TODO: [1] Make type for XML Settings and Schema
|
|
6062
|
+
// TODO: [🧠] What to use for validating XMLs - XSD,...
|
|
6063
|
+
// TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
|
|
6064
|
+
// TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
|
|
6065
|
+
// TODO: [🍓] In `XmlFormatParser` implement `heal
|
|
6066
|
+
// TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
|
|
6067
|
+
// TODO: [🏢] Allow to expect something inside XML and other formats
|
|
6087
6068
|
|
|
6088
6069
|
/**
|
|
6089
6070
|
* Definitions for all formats supported by Promptbook
|
|
@@ -6091,9 +6072,7 @@
|
|
|
6091
6072
|
* @private internal index of `...` <- TODO [🏢]
|
|
6092
6073
|
*/
|
|
6093
6074
|
const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
|
|
6094
|
-
|
|
6095
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6096
|
-
*/
|
|
6075
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6097
6076
|
|
|
6098
6077
|
/**
|
|
6099
6078
|
* Maps available parameters to expected parameters for a pipeline task.
|
|
@@ -6103,6 +6082,7 @@
|
|
|
6103
6082
|
* 2) Then, if there are unmatched expected and available parameters, map them by order.
|
|
6104
6083
|
*
|
|
6105
6084
|
* @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
|
|
6085
|
+
*
|
|
6106
6086
|
* @private within the repository used in `createPipelineExecutor`
|
|
6107
6087
|
*/
|
|
6108
6088
|
function mapAvailableToExpectedParameters(options) {
|
|
@@ -6173,6 +6153,7 @@
|
|
|
6173
6153
|
*
|
|
6174
6154
|
* @param value any values
|
|
6175
6155
|
* @returns void
|
|
6156
|
+
*
|
|
6176
6157
|
* @private within the repository
|
|
6177
6158
|
*/
|
|
6178
6159
|
function keepUnused(...valuesToKeep) {
|
|
@@ -6182,12 +6163,13 @@
|
|
|
6182
6163
|
* Replaces parameters in template with values from parameters object
|
|
6183
6164
|
*
|
|
6184
6165
|
* Note: This function is not places strings into string,
|
|
6185
|
-
*
|
|
6166
|
+
* It's more complex and can handle this operation specifically for LLM models
|
|
6186
6167
|
*
|
|
6187
6168
|
* @param template the template with parameters in {curly} braces
|
|
6188
6169
|
* @param parameters the object with parameters
|
|
6189
6170
|
* @returns the template with replaced parameters
|
|
6190
6171
|
* @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
|
|
6172
|
+
*
|
|
6191
6173
|
* @public exported from `@promptbook/utils`
|
|
6192
6174
|
*/
|
|
6193
6175
|
function templateParameters(template, parameters) {
|
|
@@ -6261,6 +6243,7 @@
|
|
|
6261
6243
|
* @param markdown any valid markdown
|
|
6262
6244
|
* @returns code blocks with language and content
|
|
6263
6245
|
* @throws {ParseError} if block is not closed properly
|
|
6246
|
+
*
|
|
6264
6247
|
* @public exported from `@promptbook/markdown-utils`
|
|
6265
6248
|
*/
|
|
6266
6249
|
function extractAllBlocksFromMarkdown(markdown) {
|
|
@@ -6311,9 +6294,7 @@
|
|
|
6311
6294
|
}
|
|
6312
6295
|
return codeBlocks;
|
|
6313
6296
|
}
|
|
6314
|
-
|
|
6315
|
-
* TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
6316
|
-
*/
|
|
6297
|
+
// TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
6317
6298
|
|
|
6318
6299
|
/**
|
|
6319
6300
|
* Extracts extracts exactly one valid JSON code block
|
|
@@ -6329,8 +6310,9 @@
|
|
|
6329
6310
|
* - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
|
|
6330
6311
|
* - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
|
|
6331
6312
|
*
|
|
6332
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
6333
6313
|
* @throws {ParseError} if there is no valid JSON block in the markdown
|
|
6314
|
+
*
|
|
6315
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
6334
6316
|
*/
|
|
6335
6317
|
function extractJsonBlock(markdown) {
|
|
6336
6318
|
if (isValidJsonString(markdown)) {
|
|
@@ -6346,10 +6328,8 @@
|
|
|
6346
6328
|
}
|
|
6347
6329
|
return jsonBlocks[0].content;
|
|
6348
6330
|
}
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
* TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
|
|
6352
|
-
*/
|
|
6331
|
+
// TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
|
|
6332
|
+
// TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
|
|
6353
6333
|
|
|
6354
6334
|
/**
|
|
6355
6335
|
* Counts number of characters in the text
|
|
@@ -6365,10 +6345,8 @@
|
|
|
6365
6345
|
text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
|
|
6366
6346
|
return text.length;
|
|
6367
6347
|
}
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6371
|
-
*/
|
|
6348
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
6349
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6372
6350
|
|
|
6373
6351
|
/**
|
|
6374
6352
|
* Number of characters per standard line with 11pt Arial font size.
|
|
@@ -6382,10 +6360,8 @@
|
|
|
6382
6360
|
* @public exported from `@promptbook/utils`
|
|
6383
6361
|
*/
|
|
6384
6362
|
const LINES_PER_STANDARD_PAGE = 44;
|
|
6385
|
-
|
|
6386
|
-
|
|
6387
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6388
|
-
*/
|
|
6363
|
+
// TODO: [🧠] Should be this `constants.ts` or `config.ts`?
|
|
6364
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6389
6365
|
|
|
6390
6366
|
/**
|
|
6391
6367
|
* Counts number of lines in the text
|
|
@@ -6403,10 +6379,8 @@
|
|
|
6403
6379
|
const lines = text.split(/\r?\n/);
|
|
6404
6380
|
return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
|
|
6405
6381
|
}
|
|
6406
|
-
|
|
6407
|
-
|
|
6408
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6409
|
-
*/
|
|
6382
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
6383
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6410
6384
|
|
|
6411
6385
|
/**
|
|
6412
6386
|
* Counts number of pages in the text
|
|
@@ -6418,10 +6392,8 @@
|
|
|
6418
6392
|
function countPages(text) {
|
|
6419
6393
|
return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
|
|
6420
6394
|
}
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6424
|
-
*/
|
|
6395
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
6396
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6425
6397
|
|
|
6426
6398
|
/**
|
|
6427
6399
|
* Counts number of paragraphs in the text
|
|
@@ -6431,10 +6403,8 @@
|
|
|
6431
6403
|
function countParagraphs(text) {
|
|
6432
6404
|
return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
|
|
6433
6405
|
}
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6437
|
-
*/
|
|
6406
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
6407
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6438
6408
|
|
|
6439
6409
|
/**
|
|
6440
6410
|
* Split text into sentences
|
|
@@ -6452,10 +6422,8 @@
|
|
|
6452
6422
|
function countSentences(text) {
|
|
6453
6423
|
return splitIntoSentences(text).length;
|
|
6454
6424
|
}
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6458
|
-
*/
|
|
6425
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
6426
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6459
6427
|
|
|
6460
6428
|
/**
|
|
6461
6429
|
* Counts number of words in the text
|
|
@@ -6469,11 +6437,9 @@
|
|
|
6469
6437
|
text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
|
|
6470
6438
|
return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
|
|
6471
6439
|
}
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
* TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
6476
|
-
*/
|
|
6440
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
6441
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
6442
|
+
// TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
6477
6443
|
|
|
6478
6444
|
/**
|
|
6479
6445
|
* Index of all counter functions
|
|
@@ -6488,10 +6454,8 @@
|
|
|
6488
6454
|
LINES: countLines,
|
|
6489
6455
|
PAGES: countPages,
|
|
6490
6456
|
};
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6494
|
-
*/
|
|
6457
|
+
// TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
|
|
6458
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6495
6459
|
|
|
6496
6460
|
/**
|
|
6497
6461
|
* Function checkExpectations will check if the expectations on given value are met
|
|
@@ -6502,6 +6466,7 @@
|
|
|
6502
6466
|
*
|
|
6503
6467
|
* @throws {ExpectError} if the expectations are not met
|
|
6504
6468
|
* @returns {void} Nothing
|
|
6469
|
+
*
|
|
6505
6470
|
* @private internal function of `createPipelineExecutor`
|
|
6506
6471
|
*/
|
|
6507
6472
|
function checkExpectations(expectations, value) {
|
|
@@ -6515,11 +6480,9 @@
|
|
|
6515
6480
|
}
|
|
6516
6481
|
}
|
|
6517
6482
|
}
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
* Note: [💝] and [🤠] are interconnected together
|
|
6522
|
-
*/
|
|
6483
|
+
// TODO: [💝] Unite object for expecting amount and format
|
|
6484
|
+
// TODO: [🧠][🤠] This should be part of `TextFormatParser`
|
|
6485
|
+
// Note: [💝] and [🤠] are interconnected together
|
|
6523
6486
|
|
|
6524
6487
|
/**
|
|
6525
6488
|
* Validates a prompt result against expectations and format requirements.
|
|
@@ -6530,6 +6493,7 @@
|
|
|
6530
6493
|
*
|
|
6531
6494
|
* @param options - The validation options including result string, expectations, and format
|
|
6532
6495
|
* @returns Validation result with processed string and validity status
|
|
6496
|
+
*
|
|
6533
6497
|
* @private internal function of `createPipelineExecutor` and `cacheLlmTools`
|
|
6534
6498
|
*/
|
|
6535
6499
|
function validatePromptResult(options) {
|
|
@@ -6592,6 +6556,7 @@
|
|
|
6592
6556
|
*
|
|
6593
6557
|
* @param options - The options for execution, including task, parameters, pipeline, and configuration.
|
|
6594
6558
|
* @returns The result string of the executed task.
|
|
6559
|
+
*
|
|
6595
6560
|
* @private internal utility of `createPipelineExecutor`
|
|
6596
6561
|
*/
|
|
6597
6562
|
async function executeAttempts(options) {
|
|
@@ -6915,9 +6880,7 @@
|
|
|
6915
6880
|
}
|
|
6916
6881
|
return $ongoingTaskResult.$resultString;
|
|
6917
6882
|
}
|
|
6918
|
-
|
|
6919
|
-
* TODO: Break into smaller functions
|
|
6920
|
-
*/
|
|
6883
|
+
// TODO: Break into smaller functions
|
|
6921
6884
|
|
|
6922
6885
|
/**
|
|
6923
6886
|
* Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
|
|
@@ -7060,6 +7023,7 @@
|
|
|
7060
7023
|
*
|
|
7061
7024
|
* @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
|
|
7062
7025
|
* @returns The context as a string, formatted as markdown and parameter value.
|
|
7026
|
+
*
|
|
7063
7027
|
* @private internal utility of `createPipelineExecutor`
|
|
7064
7028
|
*/
|
|
7065
7029
|
async function getContextForTask(task) {
|
|
@@ -7097,7 +7061,6 @@
|
|
|
7097
7061
|
}
|
|
7098
7062
|
|
|
7099
7063
|
/**
|
|
7100
|
-
*
|
|
7101
7064
|
* @param knowledgePieces
|
|
7102
7065
|
* @returns
|
|
7103
7066
|
*
|
|
@@ -7177,11 +7140,9 @@
|
|
|
7177
7140
|
// Note: If the LLM fails, just return all knowledge pieces
|
|
7178
7141
|
return knowledgePiecesToString(preparedPipeline.knowledgePieces);
|
|
7179
7142
|
}
|
|
7180
|
-
}
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
* TODO: [♨] Examples of values
|
|
7184
|
-
*/
|
|
7143
|
+
}
|
|
7144
|
+
// TODO: [♨] Implement Better - use keyword search
|
|
7145
|
+
// TODO: [♨] Examples of values
|
|
7185
7146
|
|
|
7186
7147
|
/**
|
|
7187
7148
|
* Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
|
|
@@ -7334,9 +7295,7 @@
|
|
|
7334
7295
|
resultString,
|
|
7335
7296
|
});
|
|
7336
7297
|
}
|
|
7337
|
-
|
|
7338
|
-
* TODO: [🤹♂️]
|
|
7339
|
-
*/
|
|
7298
|
+
// TODO: [🤹♂️]
|
|
7340
7299
|
|
|
7341
7300
|
/**
|
|
7342
7301
|
* Filters and returns only the output parameters from the provided pipeline execution options.
|
|
@@ -7666,6 +7625,7 @@
|
|
|
7666
7625
|
*
|
|
7667
7626
|
* @returns The executor function
|
|
7668
7627
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
7628
|
+
*
|
|
7669
7629
|
* @public exported from `@promptbook/core`
|
|
7670
7630
|
*/
|
|
7671
7631
|
function createPipelineExecutor(options) {
|
|
@@ -7830,9 +7790,7 @@
|
|
|
7830
7790
|
return false;
|
|
7831
7791
|
}
|
|
7832
7792
|
}
|
|
7833
|
-
|
|
7834
|
-
* TODO: [🎺]
|
|
7835
|
-
*/
|
|
7793
|
+
// TODO: [🎺]
|
|
7836
7794
|
|
|
7837
7795
|
/**
|
|
7838
7796
|
* Detects if the code is running in a web worker
|
|
@@ -7852,33 +7810,31 @@
|
|
|
7852
7810
|
return false;
|
|
7853
7811
|
}
|
|
7854
7812
|
}
|
|
7855
|
-
|
|
7856
|
-
* TODO: [🎺]
|
|
7857
|
-
*/
|
|
7813
|
+
// TODO: [🎺]
|
|
7858
7814
|
|
|
7859
7815
|
/**
|
|
7860
7816
|
* Register for LLM tools.
|
|
7861
7817
|
*
|
|
7862
7818
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
7819
|
+
*
|
|
7863
7820
|
* @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
|
|
7821
|
+
*
|
|
7864
7822
|
* @public exported from `@promptbook/core`
|
|
7865
7823
|
*/
|
|
7866
7824
|
const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
|
|
7867
|
-
|
|
7868
|
-
* TODO: [®] DRY Register logic
|
|
7869
|
-
*/
|
|
7825
|
+
// TODO: [®] DRY Register logic
|
|
7870
7826
|
|
|
7871
7827
|
/**
|
|
7872
7828
|
* Register for LLM tools metadata.
|
|
7873
7829
|
*
|
|
7874
7830
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
7831
|
+
*
|
|
7875
7832
|
* @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
|
|
7833
|
+
*
|
|
7876
7834
|
* @public exported from `@promptbook/core`
|
|
7877
7835
|
*/
|
|
7878
7836
|
const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
|
|
7879
|
-
|
|
7880
|
-
* TODO: [®] DRY Register logic
|
|
7881
|
-
*/
|
|
7837
|
+
// TODO: [®] DRY Register logic
|
|
7882
7838
|
|
|
7883
7839
|
/**
|
|
7884
7840
|
* Creates a message with all registered LLM tools
|
|
@@ -7999,10 +7955,8 @@
|
|
|
7999
7955
|
.join('\n'))}
|
|
8000
7956
|
`);
|
|
8001
7957
|
}
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
* TODO: [🧠][⚛] Maybe pass env as argument
|
|
8005
|
-
*/
|
|
7958
|
+
// TODO: [®] DRY Register logic
|
|
7959
|
+
// TODO: [🧠][⚛] Maybe pass env as argument
|
|
8006
7960
|
|
|
8007
7961
|
/**
|
|
8008
7962
|
* Creates LLM execution tools from provided configuration objects
|
|
@@ -8015,6 +7969,7 @@
|
|
|
8015
7969
|
* @param configuration Array of LLM tool configurations to instantiate
|
|
8016
7970
|
* @param options Additional options for configuring the LLM tools
|
|
8017
7971
|
* @returns A unified interface combining all successfully instantiated LLM tools
|
|
7972
|
+
*
|
|
8018
7973
|
* @public exported from `@promptbook/core`
|
|
8019
7974
|
*/
|
|
8020
7975
|
function createLlmToolsFromConfiguration(configuration, options = {}) {
|
|
@@ -8070,6 +8025,7 @@
|
|
|
8070
8025
|
* Provides a collection of scrapers optimized for Node.js environment.
|
|
8071
8026
|
* 1) `provideScrapersForNode` use as default
|
|
8072
8027
|
* 2) `provideScrapersForBrowser` use in limited browser environment *
|
|
8028
|
+
*
|
|
8073
8029
|
* @public exported from `@promptbook/node`
|
|
8074
8030
|
*/
|
|
8075
8031
|
async function $provideScrapersForNode(tools, options) {
|
|
@@ -8089,10 +8045,8 @@
|
|
|
8089
8045
|
}
|
|
8090
8046
|
return scrapers;
|
|
8091
8047
|
}
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
8095
|
-
*/
|
|
8048
|
+
// 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
|
|
8049
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
8096
8050
|
|
|
8097
8051
|
/**
|
|
8098
8052
|
* Normalizes a given text to camelCase format.
|
|
@@ -8104,6 +8058,7 @@
|
|
|
8104
8058
|
* @returns The camelCase formatted string.
|
|
8105
8059
|
* @example 'helloWorld'
|
|
8106
8060
|
* @example 'iLovePromptbook'
|
|
8061
|
+
*
|
|
8107
8062
|
* @public exported from `@promptbook/utils`
|
|
8108
8063
|
*/
|
|
8109
8064
|
function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
|
|
@@ -8144,9 +8099,7 @@
|
|
|
8144
8099
|
}
|
|
8145
8100
|
return normalizedName;
|
|
8146
8101
|
}
|
|
8147
|
-
|
|
8148
|
-
* TODO: [🌺] Use some intermediate util splitWords
|
|
8149
|
-
*/
|
|
8102
|
+
// TODO: [🌺] Use some intermediate util splitWords
|
|
8150
8103
|
|
|
8151
8104
|
/**
|
|
8152
8105
|
* Unsafe characters that prevent an inline parameter.
|
|
@@ -8170,6 +8123,7 @@
|
|
|
8170
8123
|
* Normalizes a JSON string so it can be safely rendered without double escaping.
|
|
8171
8124
|
*
|
|
8172
8125
|
* @param value Candidate JSON string.
|
|
8126
|
+
*
|
|
8173
8127
|
* @private function of ParameterEscaping
|
|
8174
8128
|
*/
|
|
8175
8129
|
function normalizeJsonString(value) {
|
|
@@ -8184,6 +8138,7 @@
|
|
|
8184
8138
|
* Hides brackets in a string to avoid confusion with template parameters.
|
|
8185
8139
|
*
|
|
8186
8140
|
* @param value Input string with literal brackets.
|
|
8141
|
+
*
|
|
8187
8142
|
* @private function of ParameterEscaping
|
|
8188
8143
|
*/
|
|
8189
8144
|
function hideBrackets(value) {
|
|
@@ -8193,6 +8148,7 @@
|
|
|
8193
8148
|
* Restores hidden brackets.
|
|
8194
8149
|
*
|
|
8195
8150
|
* @param value String with hidden brackets.
|
|
8151
|
+
*
|
|
8196
8152
|
* @private function of ParameterEscaping
|
|
8197
8153
|
*/
|
|
8198
8154
|
function restoreBrackets(value) {
|
|
@@ -8202,6 +8158,7 @@
|
|
|
8202
8158
|
* Decides whether a parameter can be inlined safely.
|
|
8203
8159
|
*
|
|
8204
8160
|
* @param value Parameter rendered as string.
|
|
8161
|
+
*
|
|
8205
8162
|
* @private function of ParameterEscaping
|
|
8206
8163
|
*/
|
|
8207
8164
|
function shouldInlineParameterValue(value) {
|
|
@@ -8215,6 +8172,7 @@
|
|
|
8215
8172
|
*
|
|
8216
8173
|
* @param value Parameter value to escape.
|
|
8217
8174
|
* @param options Escape options for additional characters.
|
|
8175
|
+
*
|
|
8218
8176
|
* @private function of ParameterEscaping
|
|
8219
8177
|
*/
|
|
8220
8178
|
function escapePromptParameterValue(value, options) {
|
|
@@ -8240,6 +8198,7 @@
|
|
|
8240
8198
|
* Builds numeric parameter names (1, 2, ...).
|
|
8241
8199
|
*
|
|
8242
8200
|
* @param index Zero-based parameter index.
|
|
8201
|
+
*
|
|
8243
8202
|
* @private function of ParameterNaming
|
|
8244
8203
|
*/
|
|
8245
8204
|
function buildNumericParameterName(index) {
|
|
@@ -8249,6 +8208,7 @@
|
|
|
8249
8208
|
* Builds alphabetic parameter names (a, b, ..., aa).
|
|
8250
8209
|
*
|
|
8251
8210
|
* @param index Zero-based parameter index.
|
|
8211
|
+
*
|
|
8252
8212
|
* @private function of ParameterNaming
|
|
8253
8213
|
*/
|
|
8254
8214
|
function buildAlphabeticParameterName(index) {
|
|
@@ -8265,6 +8225,7 @@
|
|
|
8265
8225
|
* Converts a positive integer into a Roman numeral string.
|
|
8266
8226
|
*
|
|
8267
8227
|
* @param value Positive integer value.
|
|
8228
|
+
*
|
|
8268
8229
|
* @private function of ParameterNaming
|
|
8269
8230
|
*/
|
|
8270
8231
|
function toRomanNumeral(value) {
|
|
@@ -8297,6 +8258,7 @@
|
|
|
8297
8258
|
* Builds Roman numeral parameter names (I, II, ...).
|
|
8298
8259
|
*
|
|
8299
8260
|
* @param index Zero-based parameter index.
|
|
8261
|
+
*
|
|
8300
8262
|
* @private function of ParameterNaming
|
|
8301
8263
|
*/
|
|
8302
8264
|
function buildRomanParameterName(index) {
|
|
@@ -8307,6 +8269,7 @@
|
|
|
8307
8269
|
*
|
|
8308
8270
|
* @param prefix Prefix string.
|
|
8309
8271
|
* @param builder Base builder function.
|
|
8272
|
+
*
|
|
8310
8273
|
* @private function of ParameterNaming
|
|
8311
8274
|
*/
|
|
8312
8275
|
function buildPrefixedParameterName(prefix, builder) {
|
|
@@ -8328,6 +8291,7 @@
|
|
|
8328
8291
|
* Collects bracketed tokens from parameter values to avoid placeholder collisions.
|
|
8329
8292
|
*
|
|
8330
8293
|
* @param values Parameter values to scan.
|
|
8294
|
+
*
|
|
8331
8295
|
* @private function of ParameterNaming
|
|
8332
8296
|
*/
|
|
8333
8297
|
function collectBracketedParameterTokens(values) {
|
|
@@ -8348,6 +8312,7 @@
|
|
|
8348
8312
|
* Builds placeholder names while avoiding collisions with parameter content.
|
|
8349
8313
|
*
|
|
8350
8314
|
* @param values Parameter values to scan for conflicting tokens.
|
|
8315
|
+
*
|
|
8351
8316
|
* @private function of ParameterNaming
|
|
8352
8317
|
*/
|
|
8353
8318
|
function buildParameterNames(values) {
|
|
@@ -8378,6 +8343,7 @@
|
|
|
8378
8343
|
* Formats the placeholder used in the prompt body for a parameter.
|
|
8379
8344
|
*
|
|
8380
8345
|
* @param name Parameter placeholder name.
|
|
8346
|
+
*
|
|
8381
8347
|
* @private function of ParameterSection
|
|
8382
8348
|
*/
|
|
8383
8349
|
function formatParameterPlaceholder(name) {
|
|
@@ -8387,6 +8353,7 @@
|
|
|
8387
8353
|
* Formats a single line entry for structured parameters.
|
|
8388
8354
|
*
|
|
8389
8355
|
* @param item Parameter entry data.
|
|
8356
|
+
*
|
|
8390
8357
|
* @private function of ParameterSection
|
|
8391
8358
|
*/
|
|
8392
8359
|
function formatParameterListItem(item) {
|
|
@@ -8398,6 +8365,7 @@
|
|
|
8398
8365
|
* Builds the structured parameters section appended to the prompt.
|
|
8399
8366
|
*
|
|
8400
8367
|
* @param items Parameter entries to include.
|
|
8368
|
+
*
|
|
8401
8369
|
* @private function of ParameterSection
|
|
8402
8370
|
*/
|
|
8403
8371
|
function buildParametersSection(items) {
|
|
@@ -8473,6 +8441,7 @@
|
|
|
8473
8441
|
* @param strings
|
|
8474
8442
|
* @param values
|
|
8475
8443
|
* @returns prompt content wrapped as a PromptString
|
|
8444
|
+
*
|
|
8476
8445
|
* @public exported from `@promptbook/utils`
|
|
8477
8446
|
*/
|
|
8478
8447
|
function prompt(strings, ...values) {
|
|
@@ -8557,11 +8526,9 @@
|
|
|
8557
8526
|
}
|
|
8558
8527
|
return new PromptString(pipelineString);
|
|
8559
8528
|
}
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8564
|
-
*/
|
|
8529
|
+
// TODO: Maybe split into multiple files
|
|
8530
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
8531
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8565
8532
|
|
|
8566
8533
|
/**
|
|
8567
8534
|
* @@@
|
|
@@ -8598,9 +8565,7 @@
|
|
|
8598
8565
|
[CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
|
|
8599
8566
|
};
|
|
8600
8567
|
}
|
|
8601
|
-
|
|
8602
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8603
|
-
*/
|
|
8568
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8604
8569
|
|
|
8605
8570
|
/**
|
|
8606
8571
|
* Computes SHA-256 hash of the given object
|
|
@@ -8610,9 +8575,7 @@
|
|
|
8610
8575
|
function computeHash(value) {
|
|
8611
8576
|
return cryptoJs.SHA256(hexEncoder__default["default"].parse(_spaceTrim.spaceTrim(valueToString(value)))).toString( /* hex */);
|
|
8612
8577
|
}
|
|
8613
|
-
|
|
8614
|
-
* TODO: [🥬][🥬] Use this ACRY
|
|
8615
|
-
*/
|
|
8578
|
+
// TODO: [🥬][🥬] Use this ACRY
|
|
8616
8579
|
|
|
8617
8580
|
// spell-checker: disable
|
|
8618
8581
|
/**
|
|
@@ -8778,6 +8741,9 @@
|
|
|
8778
8741
|
'prvotní',
|
|
8779
8742
|
'hbitý',
|
|
8780
8743
|
];
|
|
8744
|
+
/**
|
|
8745
|
+
* Collection of nouns.
|
|
8746
|
+
*/
|
|
8781
8747
|
const NOUNS$1 = [
|
|
8782
8748
|
'jablko',
|
|
8783
8749
|
'nebe',
|
|
@@ -8991,6 +8957,9 @@
|
|
|
8991
8957
|
'okno',
|
|
8992
8958
|
'chodba',
|
|
8993
8959
|
];
|
|
8960
|
+
/**
|
|
8961
|
+
* Collection of verbs.
|
|
8962
|
+
*/
|
|
8994
8963
|
const VERBS$1 = [
|
|
8995
8964
|
'skáče',
|
|
8996
8965
|
'tančí',
|
|
@@ -9163,9 +9132,7 @@
|
|
|
9163
9132
|
noun: NOUNS$1,
|
|
9164
9133
|
verb: VERBS$1,
|
|
9165
9134
|
};
|
|
9166
|
-
|
|
9167
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9168
|
-
*/
|
|
9135
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9169
9136
|
|
|
9170
9137
|
/**
|
|
9171
9138
|
* @@@
|
|
@@ -9421,6 +9388,9 @@
|
|
|
9421
9388
|
'macro',
|
|
9422
9389
|
'mini',
|
|
9423
9390
|
];
|
|
9391
|
+
/**
|
|
9392
|
+
* Collection of nouns.
|
|
9393
|
+
*/
|
|
9424
9394
|
const NOUNS = [
|
|
9425
9395
|
'apple',
|
|
9426
9396
|
'sky',
|
|
@@ -9660,6 +9630,9 @@
|
|
|
9660
9630
|
'roof',
|
|
9661
9631
|
'floor',
|
|
9662
9632
|
];
|
|
9633
|
+
/**
|
|
9634
|
+
* Collection of verbs.
|
|
9635
|
+
*/
|
|
9663
9636
|
const VERBS = [
|
|
9664
9637
|
'jumping',
|
|
9665
9638
|
'dancing',
|
|
@@ -9855,9 +9828,7 @@
|
|
|
9855
9828
|
noun: NOUNS,
|
|
9856
9829
|
verb: VERBS,
|
|
9857
9830
|
};
|
|
9858
|
-
|
|
9859
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9860
|
-
*/
|
|
9831
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9861
9832
|
|
|
9862
9833
|
/**
|
|
9863
9834
|
* Default language used for linguistic hashes.
|
|
@@ -10032,8 +10003,9 @@
|
|
|
10032
10003
|
/**
|
|
10033
10004
|
* Creates a human-readable hash as a short, story-like phrase.
|
|
10034
10005
|
*
|
|
10035
|
-
* @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
|
|
10036
10006
|
* {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
|
|
10007
|
+
*
|
|
10008
|
+
* @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
|
|
10037
10009
|
* @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
|
|
10038
10010
|
*
|
|
10039
10011
|
* @public exported from `@promptbook/utils`
|
|
@@ -10052,6 +10024,7 @@
|
|
|
10052
10024
|
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
|
|
10053
10025
|
*
|
|
10054
10026
|
* @returns string_date branded type
|
|
10027
|
+
*
|
|
10055
10028
|
* @public exported from `@promptbook/utils`
|
|
10056
10029
|
*/
|
|
10057
10030
|
function $getCurrentDate() {
|
|
@@ -10074,6 +10047,7 @@
|
|
|
10074
10047
|
*
|
|
10075
10048
|
* @param {string} input
|
|
10076
10049
|
* @returns {Set} of keywords without diacritics in lowercase
|
|
10050
|
+
*
|
|
10077
10051
|
* @public exported from `@promptbook/utils`
|
|
10078
10052
|
*/
|
|
10079
10053
|
function parseKeywordsFromString(input) {
|
|
@@ -10090,6 +10064,7 @@
|
|
|
10090
10064
|
* @param name The string to be converted to a URI-compatible format.
|
|
10091
10065
|
* @returns A URI-compatible string derived from the input name.
|
|
10092
10066
|
* @example 'Hello World' -> 'hello-world'
|
|
10067
|
+
*
|
|
10093
10068
|
* @public exported from `@promptbook/utils`
|
|
10094
10069
|
*/
|
|
10095
10070
|
function nameToUriPart(name) {
|
|
@@ -10108,6 +10083,7 @@
|
|
|
10108
10083
|
* @param name The name to be converted into URI parts.
|
|
10109
10084
|
* @returns An array of URI-compatible parts derived from the name.
|
|
10110
10085
|
* @example 'Example Name' -> ['example', 'name']
|
|
10086
|
+
*
|
|
10111
10087
|
* @public exported from `@promptbook/utils`
|
|
10112
10088
|
*/
|
|
10113
10089
|
function nameToUriParts(name) {
|
|
@@ -10137,6 +10113,7 @@
|
|
|
10137
10113
|
* @returns
|
|
10138
10114
|
* @example 'HelloWorld'
|
|
10139
10115
|
* @example 'ILovePromptbook'
|
|
10116
|
+
*
|
|
10140
10117
|
* @public exported from `@promptbook/utils`
|
|
10141
10118
|
*/
|
|
10142
10119
|
function normalizeTo_PascalCase(text) {
|
|
@@ -10166,6 +10143,7 @@
|
|
|
10166
10143
|
*
|
|
10167
10144
|
* @param text optionally quoted text
|
|
10168
10145
|
* @returns text without quotes
|
|
10146
|
+
*
|
|
10169
10147
|
* @public exported from `@promptbook/utils`
|
|
10170
10148
|
*/
|
|
10171
10149
|
function removeQuotes(text) {
|
|
@@ -10189,6 +10167,7 @@
|
|
|
10189
10167
|
*
|
|
10190
10168
|
* @param text optionally quoted text
|
|
10191
10169
|
* @returns text without quotes
|
|
10170
|
+
*
|
|
10192
10171
|
* @public exported from `@promptbook/utils`
|
|
10193
10172
|
*/
|
|
10194
10173
|
function unwrapResult(text, options) {
|
|
@@ -10263,9 +10242,7 @@
|
|
|
10263
10242
|
return processedText;
|
|
10264
10243
|
}
|
|
10265
10244
|
}
|
|
10266
|
-
|
|
10267
|
-
* TODO: [🧠] Should this also unwrap the (parenthesis)
|
|
10268
|
-
*/
|
|
10245
|
+
// TODO: [🧠] Should this also unwrap the (parenthesis)
|
|
10269
10246
|
|
|
10270
10247
|
/**
|
|
10271
10248
|
* Checks if an URL is reserved for private networks or localhost.
|
|
@@ -10311,6 +10288,7 @@
|
|
|
10311
10288
|
* @param {string} url - The URL to check.
|
|
10312
10289
|
* @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
|
|
10313
10290
|
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
10291
|
+
*
|
|
10314
10292
|
* @public exported from `@promptbook/utils`
|
|
10315
10293
|
*/
|
|
10316
10294
|
function isUrlOnPrivateNetwork(url, options = {}) {
|
|
@@ -10349,9 +10327,7 @@
|
|
|
10349
10327
|
*/
|
|
10350
10328
|
return true;
|
|
10351
10329
|
}
|
|
10352
|
-
|
|
10353
|
-
* TODO: [🐠] Maybe more info why the URL is invalid
|
|
10354
|
-
*/
|
|
10330
|
+
// TODO: [🐠] Maybe more info why the URL is invalid
|
|
10355
10331
|
|
|
10356
10332
|
/**
|
|
10357
10333
|
* Retrieves an intermediate source for a scraper based on the knowledge source.
|
|
@@ -10415,13 +10391,11 @@
|
|
|
10415
10391
|
};
|
|
10416
10392
|
return fileHandler;
|
|
10417
10393
|
}
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
10424
|
-
*/
|
|
10394
|
+
// 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
|
|
10395
|
+
// Note: Not using `FileCacheStorage` for two reasons:
|
|
10396
|
+
// 1. Need to store more than serialized JSONs.
|
|
10397
|
+
// 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
|
|
10398
|
+
// TODO: [🐱🐉][🧠] Make some smart crop
|
|
10425
10399
|
|
|
10426
10400
|
/**
|
|
10427
10401
|
* Metadata of the scraper
|
|
@@ -10448,14 +10422,13 @@
|
|
|
10448
10422
|
* @public exported from `@promptbook/cli`
|
|
10449
10423
|
*/
|
|
10450
10424
|
$scrapersMetadataRegister.register(markdownScraperMetadata);
|
|
10451
|
-
|
|
10452
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10453
|
-
*/
|
|
10425
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10454
10426
|
|
|
10455
10427
|
/**
|
|
10456
10428
|
* Scraper for markdown files
|
|
10457
10429
|
*
|
|
10458
10430
|
* @see `documentationUrl` for more details
|
|
10431
|
+
*
|
|
10459
10432
|
* @public exported from `@promptbook/markdown-utils`
|
|
10460
10433
|
*/
|
|
10461
10434
|
class MarkdownScraper {
|
|
@@ -10588,10 +10561,8 @@
|
|
|
10588
10561
|
return knowledge;
|
|
10589
10562
|
}
|
|
10590
10563
|
}
|
|
10591
|
-
|
|
10592
|
-
|
|
10593
|
-
* Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
10594
|
-
*/
|
|
10564
|
+
// TODO: [🪂] Do it in parallel 11:11
|
|
10565
|
+
// Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
10595
10566
|
|
|
10596
10567
|
/**
|
|
10597
10568
|
* Metadata of the scraper
|
|
@@ -10618,9 +10589,7 @@
|
|
|
10618
10589
|
* @public exported from `@promptbook/cli`
|
|
10619
10590
|
*/
|
|
10620
10591
|
$scrapersMetadataRegister.register(websiteScraperMetadata);
|
|
10621
|
-
|
|
10622
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10623
|
-
*/
|
|
10592
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10624
10593
|
|
|
10625
10594
|
/**
|
|
10626
10595
|
* Create a new showdown converter instance
|
|
@@ -10649,6 +10618,7 @@
|
|
|
10649
10618
|
* Scraper for websites
|
|
10650
10619
|
*
|
|
10651
10620
|
* @see `documentationUrl` for more details
|
|
10621
|
+
*
|
|
10652
10622
|
* @public exported from `@promptbook/website-crawler`
|
|
10653
10623
|
*/
|
|
10654
10624
|
class WebsiteScraper {
|
|
@@ -10752,12 +10722,10 @@
|
|
|
10752
10722
|
return knowledge;
|
|
10753
10723
|
}
|
|
10754
10724
|
}
|
|
10755
|
-
|
|
10756
|
-
|
|
10757
|
-
|
|
10758
|
-
|
|
10759
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
10760
|
-
*/
|
|
10725
|
+
// 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
|
|
10726
|
+
// TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
|
|
10727
|
+
// TODO: [🪂] Do it in parallel 11:11
|
|
10728
|
+
// Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
10761
10729
|
|
|
10762
10730
|
/**
|
|
10763
10731
|
* Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
|
|
@@ -10768,14 +10736,14 @@
|
|
|
10768
10736
|
* 3. Uses the appropriate scraper to convert to markdown
|
|
10769
10737
|
* 4. Returns the scraped markdown content
|
|
10770
10738
|
*
|
|
10739
|
+
* WARNING: This function should NOT be used directly in browser environments.
|
|
10740
|
+
* For browser environments, use fetchUrlContentViaBrowser which proxies through
|
|
10741
|
+
* the Agents Server API endpoint at /api/scrape
|
|
10742
|
+
*
|
|
10771
10743
|
* @param url The URL to fetch and scrape
|
|
10772
10744
|
* @returns Markdown content from the URL
|
|
10773
10745
|
*
|
|
10774
10746
|
* @private internal utility for USE BROWSER commitment
|
|
10775
|
-
*
|
|
10776
|
-
* WARNING: This function should NOT be used directly in browser environments.
|
|
10777
|
-
* For browser environments, use fetchUrlContentViaBrowser which proxies through
|
|
10778
|
-
* the Agents Server API endpoint at /api/scrape
|
|
10779
10747
|
*/
|
|
10780
10748
|
async function fetchUrlContent(url) {
|
|
10781
10749
|
try {
|
|
@@ -10879,9 +10847,7 @@
|
|
|
10879
10847
|
`);
|
|
10880
10848
|
}
|
|
10881
10849
|
}
|
|
10882
|
-
|
|
10883
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
10884
|
-
*/
|
|
10850
|
+
// 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
|
|
10885
10851
|
|
|
10886
10852
|
/**
|
|
10887
10853
|
* Cached implementation of `run_browser` when it can be resolved.
|
|
@@ -10899,6 +10865,7 @@
|
|
|
10899
10865
|
* Attempts to load the server-side `run_browser` tool lazily.
|
|
10900
10866
|
*
|
|
10901
10867
|
* @returns Loaded `run_browser` implementation
|
|
10868
|
+
*
|
|
10902
10869
|
* @private internal utility for USE BROWSER commitment
|
|
10903
10870
|
*/
|
|
10904
10871
|
function loadRunBrowserToolForNode() {
|
|
@@ -11268,9 +11235,7 @@
|
|
|
11268
11235
|
return this.appendToSystemMessage(requirements, actionSection, '\n\n');
|
|
11269
11236
|
}
|
|
11270
11237
|
}
|
|
11271
|
-
|
|
11272
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11273
|
-
*/
|
|
11238
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11274
11239
|
|
|
11275
11240
|
/**
|
|
11276
11241
|
* CLOSED commitment definition
|
|
@@ -11336,9 +11301,7 @@
|
|
|
11336
11301
|
};
|
|
11337
11302
|
}
|
|
11338
11303
|
}
|
|
11339
|
-
|
|
11340
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11341
|
-
*/
|
|
11304
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11342
11305
|
|
|
11343
11306
|
/**
|
|
11344
11307
|
* COMPONENT commitment definition
|
|
@@ -11397,9 +11360,7 @@
|
|
|
11397
11360
|
return this.appendToSystemMessage(requirements, componentSection, '\n\n');
|
|
11398
11361
|
}
|
|
11399
11362
|
}
|
|
11400
|
-
|
|
11401
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11402
|
-
*/
|
|
11363
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11403
11364
|
|
|
11404
11365
|
/**
|
|
11405
11366
|
* DELETE commitment definition
|
|
@@ -11521,9 +11482,7 @@
|
|
|
11521
11482
|
return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
|
|
11522
11483
|
}
|
|
11523
11484
|
}
|
|
11524
|
-
|
|
11525
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11526
|
-
*/
|
|
11485
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11527
11486
|
|
|
11528
11487
|
/**
|
|
11529
11488
|
* DICTIONARY commitment definition
|
|
@@ -11627,9 +11586,7 @@
|
|
|
11627
11586
|
};
|
|
11628
11587
|
}
|
|
11629
11588
|
}
|
|
11630
|
-
|
|
11631
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11632
|
-
*/
|
|
11589
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11633
11590
|
|
|
11634
11591
|
/**
|
|
11635
11592
|
* FORMAT commitment definition
|
|
@@ -11708,10 +11665,11 @@
|
|
|
11708
11665
|
return this.appendToSystemMessage(requirements, formatSection, '\n\n');
|
|
11709
11666
|
}
|
|
11710
11667
|
}
|
|
11668
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11669
|
+
|
|
11711
11670
|
/**
|
|
11712
|
-
*
|
|
11671
|
+
* Collection of firstnames.
|
|
11713
11672
|
*/
|
|
11714
|
-
|
|
11715
11673
|
const FIRSTNAMES = [
|
|
11716
11674
|
'Paul',
|
|
11717
11675
|
'George',
|
|
@@ -11748,6 +11706,9 @@
|
|
|
11748
11706
|
'Anthony',
|
|
11749
11707
|
'Christopher',
|
|
11750
11708
|
];
|
|
11709
|
+
/**
|
|
11710
|
+
* Collection of lastnames with colors.
|
|
11711
|
+
*/
|
|
11751
11712
|
const LASTNAMES_WITH_COLORS = [
|
|
11752
11713
|
{ lastname: 'Green', color: '#008000' },
|
|
11753
11714
|
{ lastname: 'Brown', color: '#A52A2A' },
|
|
@@ -11775,6 +11736,7 @@
|
|
|
11775
11736
|
*
|
|
11776
11737
|
* @param seed - Input seed used to derive a stable pseudonym.
|
|
11777
11738
|
* @returns Deterministic English full name with color metadata.
|
|
11739
|
+
*
|
|
11778
11740
|
* @private internal helper for deterministic pseudonym generation
|
|
11779
11741
|
*/
|
|
11780
11742
|
function generateDeterministicEnglishName(seed) {
|
|
@@ -11816,6 +11778,9 @@
|
|
|
11816
11778
|
* Legacy aliases that historically behaved like `FROM VOID`.
|
|
11817
11779
|
*/
|
|
11818
11780
|
const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
|
|
11781
|
+
/**
|
|
11782
|
+
* Constant for void alias entries.
|
|
11783
|
+
*/
|
|
11819
11784
|
const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
|
|
11820
11785
|
alias,
|
|
11821
11786
|
'VOID',
|
|
@@ -11864,6 +11829,7 @@
|
|
|
11864
11829
|
*
|
|
11865
11830
|
* @param rawReference - Raw reference token or payload.
|
|
11866
11831
|
* @returns Pseudo-agent kind or `null` when the reference is not pseudo.
|
|
11832
|
+
*
|
|
11867
11833
|
* @private internal utility of pseudo-agent resolution
|
|
11868
11834
|
*/
|
|
11869
11835
|
function resolvePseudoAgentKindFromReference(rawReference) {
|
|
@@ -11878,6 +11844,7 @@
|
|
|
11878
11844
|
*
|
|
11879
11845
|
* @param agentUrl - URL to inspect.
|
|
11880
11846
|
* @returns Pseudo-agent kind or `null` when the URL is not pseudo.
|
|
11847
|
+
*
|
|
11881
11848
|
* @private internal utility of pseudo-agent resolution
|
|
11882
11849
|
*/
|
|
11883
11850
|
function resolvePseudoAgentKindFromUrl(agentUrl) {
|
|
@@ -11898,6 +11865,7 @@
|
|
|
11898
11865
|
*
|
|
11899
11866
|
* @param teamCommitmentContent - TEAM commitment content after reference resolution.
|
|
11900
11867
|
* @returns Deterministic English full name representing pseudo-user in that TEAM context.
|
|
11868
|
+
*
|
|
11901
11869
|
* @private internal utility of TEAM commitment rendering
|
|
11902
11870
|
*/
|
|
11903
11871
|
function createPseudoUserTeammateLabel(teamCommitmentContent) {
|
|
@@ -11913,6 +11881,7 @@
|
|
|
11913
11881
|
*
|
|
11914
11882
|
* @param rawReference - Raw reference content.
|
|
11915
11883
|
* @returns True when the reference maps to void.
|
|
11884
|
+
*
|
|
11916
11885
|
* @private internal utility of pseudo-agent resolution
|
|
11917
11886
|
*/
|
|
11918
11887
|
function isVoidPseudoAgentReference(rawReference) {
|
|
@@ -11926,9 +11895,7 @@
|
|
|
11926
11895
|
const normalizedReference = normalizePseudoReferenceKey(rawReference);
|
|
11927
11896
|
return LEGACY_VOID_ALIASES.has(normalizedReference);
|
|
11928
11897
|
}
|
|
11929
|
-
|
|
11930
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11931
|
-
*/
|
|
11898
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11932
11899
|
|
|
11933
11900
|
/**
|
|
11934
11901
|
* FROM commitment definition
|
|
@@ -12007,9 +11974,7 @@
|
|
|
12007
11974
|
};
|
|
12008
11975
|
}
|
|
12009
11976
|
}
|
|
12010
|
-
|
|
12011
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12012
|
-
*/
|
|
11977
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12013
11978
|
|
|
12014
11979
|
/**
|
|
12015
11980
|
* GOAL commitment definition
|
|
@@ -12107,9 +12072,7 @@
|
|
|
12107
12072
|
return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
|
|
12108
12073
|
}
|
|
12109
12074
|
}
|
|
12110
|
-
|
|
12111
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12112
|
-
*/
|
|
12075
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12113
12076
|
|
|
12114
12077
|
/**
|
|
12115
12078
|
* IMPORT commitment definition
|
|
@@ -12188,19 +12151,26 @@
|
|
|
12188
12151
|
`));
|
|
12189
12152
|
}
|
|
12190
12153
|
}
|
|
12154
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12155
|
+
|
|
12191
12156
|
/**
|
|
12192
|
-
*
|
|
12157
|
+
* Matches URL-like candidates inside arbitrary text.
|
|
12158
|
+
*
|
|
12159
|
+
* @private
|
|
12193
12160
|
*/
|
|
12194
|
-
|
|
12195
|
-
/** @private Matches URL-like candidates inside arbitrary text. */
|
|
12196
12161
|
const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
|
|
12197
|
-
/**
|
|
12162
|
+
/**
|
|
12163
|
+
* Trims punctuation that commonly trails URLs in prose.
|
|
12164
|
+
*
|
|
12165
|
+
* @private
|
|
12166
|
+
*/
|
|
12198
12167
|
const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
|
|
12199
12168
|
/**
|
|
12200
12169
|
* Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
|
|
12201
12170
|
*
|
|
12202
12171
|
* @param text - Input text that may contain one or more URLs.
|
|
12203
12172
|
* @returns Unique URLs in their first-seen order.
|
|
12173
|
+
*
|
|
12204
12174
|
* @private utility of KNOWLEDGE parsing
|
|
12205
12175
|
*/
|
|
12206
12176
|
function extractUrlsFromText(text) {
|
|
@@ -12230,7 +12200,9 @@
|
|
|
12230
12200
|
return urls;
|
|
12231
12201
|
}
|
|
12232
12202
|
/**
|
|
12233
|
-
*
|
|
12203
|
+
* Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
|
|
12204
|
+
*
|
|
12205
|
+
* @private
|
|
12234
12206
|
*/
|
|
12235
12207
|
function normalizeUrlCandidate(candidate) {
|
|
12236
12208
|
let normalized = candidate.trim();
|
|
@@ -12250,7 +12222,9 @@
|
|
|
12250
12222
|
return normalized;
|
|
12251
12223
|
}
|
|
12252
12224
|
/**
|
|
12253
|
-
*
|
|
12225
|
+
* Removes trailing closing wrappers when they are unmatched in the candidate.
|
|
12226
|
+
*
|
|
12227
|
+
* @private
|
|
12254
12228
|
*/
|
|
12255
12229
|
function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
|
|
12256
12230
|
let normalized = candidate;
|
|
@@ -12265,7 +12239,9 @@
|
|
|
12265
12239
|
return normalized;
|
|
12266
12240
|
}
|
|
12267
12241
|
/**
|
|
12268
|
-
*
|
|
12242
|
+
* Counts character occurrences in a string.
|
|
12243
|
+
*
|
|
12244
|
+
* @private
|
|
12269
12245
|
*/
|
|
12270
12246
|
function countOccurrences(value, searchedChar) {
|
|
12271
12247
|
let count = 0;
|
|
@@ -12277,14 +12253,28 @@
|
|
|
12277
12253
|
return count;
|
|
12278
12254
|
}
|
|
12279
12255
|
|
|
12280
|
-
/**
|
|
12256
|
+
/**
|
|
12257
|
+
* The default base name for inline knowledge files when the content lacks identifying text.
|
|
12258
|
+
*
|
|
12259
|
+
* @private
|
|
12260
|
+
*/
|
|
12281
12261
|
const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
|
|
12282
|
-
/**
|
|
12262
|
+
/**
|
|
12263
|
+
* The default file extension used for inline knowledge uploads.
|
|
12264
|
+
*
|
|
12265
|
+
* @private
|
|
12266
|
+
*/
|
|
12283
12267
|
const INLINE_KNOWLEDGE_EXTENSION = '.txt';
|
|
12284
|
-
/**
|
|
12268
|
+
/**
|
|
12269
|
+
* Prefix that identifies base64 data URLs.
|
|
12270
|
+
*
|
|
12271
|
+
* @private
|
|
12272
|
+
*/
|
|
12285
12273
|
const DATA_URL_PREFIX = 'data:';
|
|
12286
12274
|
/**
|
|
12287
|
-
*
|
|
12275
|
+
* Retrieves the first meaningful line from the inline content.
|
|
12276
|
+
*
|
|
12277
|
+
* @private
|
|
12288
12278
|
*/
|
|
12289
12279
|
function getFirstNonEmptyLine(content) {
|
|
12290
12280
|
const lines = content.split(/\r?\n/);
|
|
@@ -12297,7 +12287,9 @@
|
|
|
12297
12287
|
return null;
|
|
12298
12288
|
}
|
|
12299
12289
|
/**
|
|
12300
|
-
*
|
|
12290
|
+
* Determines the base file name by normalizing the first non-empty line.
|
|
12291
|
+
*
|
|
12292
|
+
* @private
|
|
12301
12293
|
*/
|
|
12302
12294
|
function deriveBaseFilename(content) {
|
|
12303
12295
|
const firstLine = getFirstNonEmptyLine(content);
|
|
@@ -12308,7 +12300,9 @@
|
|
|
12308
12300
|
return normalized || INLINE_KNOWLEDGE_BASE_NAME;
|
|
12309
12301
|
}
|
|
12310
12302
|
/**
|
|
12311
|
-
*
|
|
12303
|
+
* Converts inline knowledge into the internal metadata form used for uploads.
|
|
12304
|
+
*
|
|
12305
|
+
* @private
|
|
12312
12306
|
*/
|
|
12313
12307
|
function createInlineKnowledgeSourceFile(content) {
|
|
12314
12308
|
const trimmedContent = content.trim();
|
|
@@ -12331,7 +12325,9 @@
|
|
|
12331
12325
|
return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
|
|
12332
12326
|
}
|
|
12333
12327
|
/**
|
|
12334
|
-
*
|
|
12328
|
+
* Converts a stored inline knowledge file into a data URL for backwards compatibility.
|
|
12329
|
+
*
|
|
12330
|
+
* @private
|
|
12335
12331
|
*/
|
|
12336
12332
|
function inlineKnowledgeSourceToDataUrl(source) {
|
|
12337
12333
|
const base64 = source.buffer.toString('base64');
|
|
@@ -12391,9 +12387,7 @@
|
|
|
12391
12387
|
return null;
|
|
12392
12388
|
}
|
|
12393
12389
|
}
|
|
12394
|
-
|
|
12395
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12396
|
-
*/
|
|
12390
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12397
12391
|
|
|
12398
12392
|
/**
|
|
12399
12393
|
* KNOWLEDGE commitment definition
|
|
@@ -12597,9 +12591,7 @@
|
|
|
12597
12591
|
return this.appendToSystemMessage(requirements, languageSection, '\n\n');
|
|
12598
12592
|
}
|
|
12599
12593
|
}
|
|
12600
|
-
|
|
12601
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12602
|
-
*/
|
|
12594
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12603
12595
|
|
|
12604
12596
|
/**
|
|
12605
12597
|
* @@@
|
|
@@ -12865,6 +12857,7 @@
|
|
|
12865
12857
|
*
|
|
12866
12858
|
* @param listener - Listener notified about tool progress.
|
|
12867
12859
|
* @returns Hidden token used to route progress updates.
|
|
12860
|
+
*
|
|
12868
12861
|
* @private internal runtime wiring for commitment tools
|
|
12869
12862
|
*/
|
|
12870
12863
|
function registerToolCallProgressListener(listener) {
|
|
@@ -12877,14 +12870,13 @@
|
|
|
12877
12870
|
* Unregisters one in-memory progress listener.
|
|
12878
12871
|
*
|
|
12879
12872
|
* @param token - Token previously created by `registerToolCallProgressListener`.
|
|
12873
|
+
*
|
|
12880
12874
|
* @private internal runtime wiring for commitment tools
|
|
12881
12875
|
*/
|
|
12882
12876
|
function unregisterToolCallProgressListener(token) {
|
|
12883
12877
|
toolCallProgressListeners.delete(token);
|
|
12884
12878
|
}
|
|
12885
|
-
|
|
12886
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12887
|
-
*/
|
|
12879
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12888
12880
|
|
|
12889
12881
|
/**
|
|
12890
12882
|
* Resolves runtime context from hidden tool arguments.
|
|
@@ -13245,9 +13237,7 @@
|
|
|
13245
13237
|
return createMemoryToolFunctions();
|
|
13246
13238
|
}
|
|
13247
13239
|
}
|
|
13248
|
-
|
|
13249
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13250
|
-
*/
|
|
13240
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13251
13241
|
|
|
13252
13242
|
/**
|
|
13253
13243
|
* AGENT MESSAGE commitment definition
|
|
@@ -13577,9 +13567,7 @@
|
|
|
13577
13567
|
return this.appendToSystemMessage(requirements, messageSection, '\n\n');
|
|
13578
13568
|
}
|
|
13579
13569
|
}
|
|
13580
|
-
|
|
13581
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13582
|
-
*/
|
|
13570
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13583
13571
|
|
|
13584
13572
|
/**
|
|
13585
13573
|
* USER MESSAGE commitment definition
|
|
@@ -13710,9 +13698,7 @@
|
|
|
13710
13698
|
return requirements;
|
|
13711
13699
|
}
|
|
13712
13700
|
}
|
|
13713
|
-
|
|
13714
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13715
|
-
*/
|
|
13701
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13716
13702
|
|
|
13717
13703
|
/**
|
|
13718
13704
|
* META commitment definition
|
|
@@ -13859,9 +13845,7 @@
|
|
|
13859
13845
|
return knownTypes.includes(metaType.toUpperCase());
|
|
13860
13846
|
}
|
|
13861
13847
|
}
|
|
13862
|
-
|
|
13863
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13864
|
-
*/
|
|
13848
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13865
13849
|
|
|
13866
13850
|
/**
|
|
13867
13851
|
* META COLOR commitment definition
|
|
@@ -13957,9 +13941,7 @@
|
|
|
13957
13941
|
return trimmedContent || null;
|
|
13958
13942
|
}
|
|
13959
13943
|
}
|
|
13960
|
-
|
|
13961
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13962
|
-
*/
|
|
13944
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13963
13945
|
|
|
13964
13946
|
/**
|
|
13965
13947
|
* META DOMAIN commitment definition
|
|
@@ -14024,9 +14006,7 @@
|
|
|
14024
14006
|
return trimmedContent || null;
|
|
14025
14007
|
}
|
|
14026
14008
|
}
|
|
14027
|
-
|
|
14028
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14029
|
-
*/
|
|
14009
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14030
14010
|
|
|
14031
14011
|
/**
|
|
14032
14012
|
* META DISCLAIMER commitment definition
|
|
@@ -14094,9 +14074,7 @@
|
|
|
14094
14074
|
return requirements;
|
|
14095
14075
|
}
|
|
14096
14076
|
}
|
|
14097
|
-
|
|
14098
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14099
|
-
*/
|
|
14077
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14100
14078
|
|
|
14101
14079
|
/**
|
|
14102
14080
|
* META FONT commitment definition
|
|
@@ -14179,9 +14157,7 @@
|
|
|
14179
14157
|
return trimmedContent || null;
|
|
14180
14158
|
}
|
|
14181
14159
|
}
|
|
14182
|
-
|
|
14183
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14184
|
-
*/
|
|
14160
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14185
14161
|
|
|
14186
14162
|
/**
|
|
14187
14163
|
* META IMAGE commitment definition
|
|
@@ -14266,9 +14242,7 @@
|
|
|
14266
14242
|
return trimmedContent || null;
|
|
14267
14243
|
}
|
|
14268
14244
|
}
|
|
14269
|
-
|
|
14270
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14271
|
-
*/
|
|
14245
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14272
14246
|
|
|
14273
14247
|
/**
|
|
14274
14248
|
* META INPUT PLACEHOLDER commitment definition.
|
|
@@ -14331,9 +14305,7 @@
|
|
|
14331
14305
|
return trimmedContent || null;
|
|
14332
14306
|
}
|
|
14333
14307
|
}
|
|
14334
|
-
|
|
14335
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14336
|
-
*/
|
|
14308
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14337
14309
|
|
|
14338
14310
|
/**
|
|
14339
14311
|
* META LINK commitment definition
|
|
@@ -14440,9 +14412,7 @@
|
|
|
14440
14412
|
}
|
|
14441
14413
|
}
|
|
14442
14414
|
}
|
|
14443
|
-
|
|
14444
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14445
|
-
*/
|
|
14415
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14446
14416
|
|
|
14447
14417
|
/**
|
|
14448
14418
|
* META VOICE commitment definition
|
|
@@ -14511,9 +14481,7 @@
|
|
|
14511
14481
|
return trimmedContent || null;
|
|
14512
14482
|
}
|
|
14513
14483
|
}
|
|
14514
|
-
|
|
14515
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14516
|
-
*/
|
|
14484
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14517
14485
|
|
|
14518
14486
|
/**
|
|
14519
14487
|
* MODEL commitment definition
|
|
@@ -14751,9 +14719,7 @@
|
|
|
14751
14719
|
return result;
|
|
14752
14720
|
}
|
|
14753
14721
|
}
|
|
14754
|
-
|
|
14755
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14756
|
-
*/
|
|
14722
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14757
14723
|
|
|
14758
14724
|
/**
|
|
14759
14725
|
* NOTE commitment definition
|
|
@@ -14915,9 +14881,7 @@
|
|
|
14915
14881
|
};
|
|
14916
14882
|
}
|
|
14917
14883
|
}
|
|
14918
|
-
|
|
14919
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14920
|
-
*/
|
|
14884
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14921
14885
|
|
|
14922
14886
|
/**
|
|
14923
14887
|
* PERSONA commitment definition
|
|
@@ -15056,9 +15020,7 @@
|
|
|
15056
15020
|
};
|
|
15057
15021
|
}
|
|
15058
15022
|
}
|
|
15059
|
-
|
|
15060
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15061
|
-
*/
|
|
15023
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15062
15024
|
|
|
15063
15025
|
/**
|
|
15064
15026
|
* RULE commitment definition
|
|
@@ -15139,15 +15101,14 @@
|
|
|
15139
15101
|
return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
|
|
15140
15102
|
}
|
|
15141
15103
|
}
|
|
15142
|
-
|
|
15143
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15144
|
-
*/
|
|
15104
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15145
15105
|
|
|
15146
15106
|
/**
|
|
15147
15107
|
* Creates the canonical system-message body for one writing-sample commitment.
|
|
15148
15108
|
*
|
|
15149
15109
|
* @param content - Explicit 1:1 sample text.
|
|
15150
15110
|
* @returns Writing-sample guidance ready for one system-message section.
|
|
15111
|
+
*
|
|
15151
15112
|
* @private internal utility of writing commitments
|
|
15152
15113
|
*/
|
|
15153
15114
|
function createWritingSampleSection(content) {
|
|
@@ -15165,6 +15126,7 @@
|
|
|
15165
15126
|
*
|
|
15166
15127
|
* @param content - Writing-only instructions.
|
|
15167
15128
|
* @returns Writing-rules guidance ready for one system-message section.
|
|
15129
|
+
*
|
|
15168
15130
|
* @private internal utility of writing commitments
|
|
15169
15131
|
*/
|
|
15170
15132
|
function createWritingRulesSection(content) {
|
|
@@ -15177,9 +15139,7 @@
|
|
|
15177
15139
|
${content}
|
|
15178
15140
|
`);
|
|
15179
15141
|
}
|
|
15180
|
-
|
|
15181
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15182
|
-
*/
|
|
15142
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15183
15143
|
|
|
15184
15144
|
/**
|
|
15185
15145
|
* Legacy `SAMPLE` / `EXAMPLE` commitment definition.
|
|
@@ -15258,9 +15218,7 @@
|
|
|
15258
15218
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
|
|
15259
15219
|
}
|
|
15260
15220
|
}
|
|
15261
|
-
|
|
15262
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15263
|
-
*/
|
|
15221
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15264
15222
|
|
|
15265
15223
|
/**
|
|
15266
15224
|
* SCENARIO commitment definition
|
|
@@ -15382,9 +15340,7 @@
|
|
|
15382
15340
|
return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
|
|
15383
15341
|
}
|
|
15384
15342
|
}
|
|
15385
|
-
|
|
15386
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15387
|
-
*/
|
|
15343
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15388
15344
|
|
|
15389
15345
|
/**
|
|
15390
15346
|
* STYLE commitment definition
|
|
@@ -15481,6 +15437,7 @@
|
|
|
15481
15437
|
*
|
|
15482
15438
|
* @param teammateLabel - Human-readable teammate label.
|
|
15483
15439
|
* @returns Normalized teammate identifier for TEAM tool names.
|
|
15440
|
+
*
|
|
15484
15441
|
* @private internal helper of TEAM tool-name generation
|
|
15485
15442
|
*/
|
|
15486
15443
|
function normalizeTeammateToolNamePart(teammateLabel) {
|
|
@@ -15496,6 +15453,7 @@
|
|
|
15496
15453
|
* @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
|
|
15497
15454
|
* @param teammateLabel - Human-readable teammate label used as the basis for the name.
|
|
15498
15455
|
* @returns TEAM tool name derived from the label.
|
|
15456
|
+
*
|
|
15499
15457
|
* @private internal utility of TEAM commitments and chat UI mapping
|
|
15500
15458
|
*/
|
|
15501
15459
|
function createTeamToolName(_teammateUrl, teammateLabel) {
|
|
@@ -15503,9 +15461,21 @@
|
|
|
15503
15461
|
return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
|
|
15504
15462
|
}
|
|
15505
15463
|
|
|
15464
|
+
/**
|
|
15465
|
+
* Pattern matching agent URLs inside TEAM commitment content.
|
|
15466
|
+
*/
|
|
15506
15467
|
const urlRegex = /https?:\/\/[^\s]+/gi;
|
|
15468
|
+
/**
|
|
15469
|
+
* Pattern matching punctuation that often trails teammate URLs in prose.
|
|
15470
|
+
*/
|
|
15507
15471
|
const trailingPunctuationRegex = /[),.;!?]+$/;
|
|
15472
|
+
/**
|
|
15473
|
+
* Clause separators used while splitting TEAM instruction context.
|
|
15474
|
+
*/
|
|
15508
15475
|
const clauseSeparators = ['.', '?', '!', ';', ','];
|
|
15476
|
+
/**
|
|
15477
|
+
* Conjunction separators used while splitting TEAM instruction context.
|
|
15478
|
+
*/
|
|
15509
15479
|
const conjunctionSeparators = [' and ', ' or '];
|
|
15510
15480
|
/**
|
|
15511
15481
|
* Parses TEAM commitment content into teammates with instructions.
|
|
@@ -15553,6 +15523,9 @@
|
|
|
15553
15523
|
}
|
|
15554
15524
|
return teammates;
|
|
15555
15525
|
}
|
|
15526
|
+
/**
|
|
15527
|
+
* Extracts the instruction fragment associated with one teammate URL.
|
|
15528
|
+
*/
|
|
15556
15529
|
function extractInstructionContext(line, matches, matchIndex) {
|
|
15557
15530
|
var _a;
|
|
15558
15531
|
const match = matches[matchIndex];
|
|
@@ -15578,6 +15551,9 @@
|
|
|
15578
15551
|
}
|
|
15579
15552
|
return `${prefix} ${suffix}`.trim();
|
|
15580
15553
|
}
|
|
15554
|
+
/**
|
|
15555
|
+
* Trims content after the last detected clause delimiter.
|
|
15556
|
+
*/
|
|
15581
15557
|
function trimAfterLastDelimiter(text) {
|
|
15582
15558
|
const match = findLastDelimiter(text);
|
|
15583
15559
|
if (!match) {
|
|
@@ -15585,6 +15561,9 @@
|
|
|
15585
15561
|
}
|
|
15586
15562
|
return text.slice(match.index + match.length);
|
|
15587
15563
|
}
|
|
15564
|
+
/**
|
|
15565
|
+
* Trims content before the last detected clause delimiter.
|
|
15566
|
+
*/
|
|
15588
15567
|
function trimBeforeLastDelimiter(text) {
|
|
15589
15568
|
const cleaned = text.replace(/^[,;:]\s*/g, '');
|
|
15590
15569
|
const match = findLastDelimiter(cleaned);
|
|
@@ -15593,6 +15572,9 @@
|
|
|
15593
15572
|
}
|
|
15594
15573
|
return cleaned.slice(0, match.index);
|
|
15595
15574
|
}
|
|
15575
|
+
/**
|
|
15576
|
+
* Finds the last clause or conjunction delimiter in a string.
|
|
15577
|
+
*/
|
|
15596
15578
|
function findLastDelimiter(text) {
|
|
15597
15579
|
let bestIndex = -1;
|
|
15598
15580
|
let bestLength = 0;
|
|
@@ -15616,6 +15598,9 @@
|
|
|
15616
15598
|
}
|
|
15617
15599
|
return { index: bestIndex, length: bestLength };
|
|
15618
15600
|
}
|
|
15601
|
+
/**
|
|
15602
|
+
* Normalizes teammate instruction text after URL extraction.
|
|
15603
|
+
*/
|
|
15619
15604
|
function normalizeInstructionText(text) {
|
|
15620
15605
|
if (!text) {
|
|
15621
15606
|
return '';
|
|
@@ -15629,6 +15614,9 @@
|
|
|
15629
15614
|
normalized = normalizeWhitespaces(normalized).trim();
|
|
15630
15615
|
return normalized;
|
|
15631
15616
|
}
|
|
15617
|
+
/**
|
|
15618
|
+
* Creates a readable teammate label from an agent URL.
|
|
15619
|
+
*/
|
|
15632
15620
|
function createTeammateLabel(url) {
|
|
15633
15621
|
try {
|
|
15634
15622
|
const parsed = new URL(url);
|
|
@@ -15648,12 +15636,19 @@
|
|
|
15648
15636
|
return url;
|
|
15649
15637
|
}
|
|
15650
15638
|
}
|
|
15639
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15640
|
+
|
|
15651
15641
|
/**
|
|
15652
|
-
*
|
|
15642
|
+
* Map of team tool functions.
|
|
15653
15643
|
*/
|
|
15654
|
-
|
|
15655
15644
|
const teamToolFunctions = {};
|
|
15645
|
+
/**
|
|
15646
|
+
* Map of team tool titles.
|
|
15647
|
+
*/
|
|
15656
15648
|
const teamToolTitles = {};
|
|
15649
|
+
/**
|
|
15650
|
+
* Constant for remote agents by Url.
|
|
15651
|
+
*/
|
|
15657
15652
|
const remoteAgentsByUrl = new Map();
|
|
15658
15653
|
/**
|
|
15659
15654
|
* TEAM commitment definition
|
|
@@ -16017,9 +16012,7 @@
|
|
|
16017
16012
|
return JSON.stringify(result);
|
|
16018
16013
|
};
|
|
16019
16014
|
}
|
|
16020
|
-
|
|
16021
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16022
|
-
*/
|
|
16015
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16023
16016
|
|
|
16024
16017
|
/**
|
|
16025
16018
|
* TEMPLATE commitment definition
|
|
@@ -16140,9 +16133,7 @@
|
|
|
16140
16133
|
};
|
|
16141
16134
|
}
|
|
16142
16135
|
}
|
|
16143
|
-
|
|
16144
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16145
|
-
*/
|
|
16136
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16146
16137
|
|
|
16147
16138
|
/**
|
|
16148
16139
|
* USE commitment definition
|
|
@@ -16254,9 +16245,7 @@
|
|
|
16254
16245
|
return knownTypes.includes(useType.toUpperCase());
|
|
16255
16246
|
}
|
|
16256
16247
|
}
|
|
16257
|
-
|
|
16258
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16259
|
-
*/
|
|
16248
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16260
16249
|
|
|
16261
16250
|
/**
|
|
16262
16251
|
* All `USE` commitment types currently participating in final system-message aggregation.
|
|
@@ -16279,6 +16268,7 @@
|
|
|
16279
16268
|
*
|
|
16280
16269
|
* @param type - Commitment type to check.
|
|
16281
16270
|
* @returns `true` when the commitment participates in `USE` system-message aggregation.
|
|
16271
|
+
*
|
|
16282
16272
|
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
16283
16273
|
*/
|
|
16284
16274
|
function isAggregatedUseCommitmentType(type) {
|
|
@@ -16289,6 +16279,7 @@
|
|
|
16289
16279
|
*
|
|
16290
16280
|
* @param type - Aggregated `USE` commitment type.
|
|
16291
16281
|
* @returns Single-line placeholder comment stored in the interim system message.
|
|
16282
|
+
*
|
|
16292
16283
|
* @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
|
|
16293
16284
|
*/
|
|
16294
16285
|
function getAggregatedUseCommitmentPlaceholder(type) {
|
|
@@ -16299,6 +16290,7 @@
|
|
|
16299
16290
|
*
|
|
16300
16291
|
* @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
|
|
16301
16292
|
* @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
|
|
16293
|
+
*
|
|
16302
16294
|
* @private internal utility of `createAggregatedUseCommitmentSystemMessage`
|
|
16303
16295
|
*/
|
|
16304
16296
|
function combineAdditionalInstructions(additionalInstructions) {
|
|
@@ -16310,6 +16302,7 @@
|
|
|
16310
16302
|
* @param type - Aggregated `USE` commitment type.
|
|
16311
16303
|
* @param additionalInstructions - Distinct additional instructions in source order.
|
|
16312
16304
|
* @returns Final system-message block for the commitment type.
|
|
16305
|
+
*
|
|
16313
16306
|
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
16314
16307
|
*/
|
|
16315
16308
|
function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
|
|
@@ -16348,6 +16341,7 @@
|
|
|
16348
16341
|
* @param requirements - Current model requirements.
|
|
16349
16342
|
* @param type - Aggregated `USE` commitment type being applied.
|
|
16350
16343
|
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
16344
|
+
*
|
|
16351
16345
|
* @private internal utility of `USE` commitments
|
|
16352
16346
|
*/
|
|
16353
16347
|
function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
|
|
@@ -16371,6 +16365,7 @@
|
|
|
16371
16365
|
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
16372
16366
|
* @param commitments - Filtered commitments in their original source order.
|
|
16373
16367
|
* @returns Requirements with aggregated `USE` system-message sections.
|
|
16368
|
+
*
|
|
16374
16369
|
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
16375
16370
|
*/
|
|
16376
16371
|
function aggregateUseCommitmentSystemMessages(requirements, commitments) {
|
|
@@ -16663,9 +16658,7 @@
|
|
|
16663
16658
|
};
|
|
16664
16659
|
}
|
|
16665
16660
|
}
|
|
16666
|
-
|
|
16667
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16668
|
-
*/
|
|
16661
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16669
16662
|
|
|
16670
16663
|
/**
|
|
16671
16664
|
* Base Google Calendar API URL.
|
|
@@ -16936,9 +16929,7 @@
|
|
|
16936
16929
|
const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
|
|
16937
16930
|
return filteredTokens.join(' ').trim();
|
|
16938
16931
|
}
|
|
16939
|
-
|
|
16940
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16941
|
-
*/
|
|
16932
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16942
16933
|
|
|
16943
16934
|
/**
|
|
16944
16935
|
* Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
|
|
@@ -17889,9 +17880,7 @@
|
|
|
17889
17880
|
...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
|
|
17890
17881
|
});
|
|
17891
17882
|
}
|
|
17892
|
-
|
|
17893
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17894
|
-
*/
|
|
17883
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17895
17884
|
|
|
17896
17885
|
/**
|
|
17897
17886
|
* Lightweight email token matcher used for `USE EMAIL` first-line parsing.
|
|
@@ -18157,9 +18146,7 @@
|
|
|
18157
18146
|
},
|
|
18158
18147
|
];
|
|
18159
18148
|
}
|
|
18160
|
-
|
|
18161
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18162
|
-
*/
|
|
18149
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18163
18150
|
|
|
18164
18151
|
/**
|
|
18165
18152
|
* USE IMAGE GENERATOR commitment definition
|
|
@@ -18250,9 +18237,7 @@
|
|
|
18250
18237
|
`));
|
|
18251
18238
|
}
|
|
18252
18239
|
}
|
|
18253
|
-
|
|
18254
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18255
|
-
*/
|
|
18240
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18256
18241
|
|
|
18257
18242
|
/**
|
|
18258
18243
|
* USE MCP commitment definition
|
|
@@ -18327,9 +18312,7 @@
|
|
|
18327
18312
|
};
|
|
18328
18313
|
}
|
|
18329
18314
|
}
|
|
18330
|
-
|
|
18331
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18332
|
-
*/
|
|
18315
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18333
18316
|
|
|
18334
18317
|
/**
|
|
18335
18318
|
* USE POPUP commitment definition
|
|
@@ -18465,9 +18448,7 @@
|
|
|
18465
18448
|
};
|
|
18466
18449
|
}
|
|
18467
18450
|
}
|
|
18468
|
-
|
|
18469
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18470
|
-
*/
|
|
18451
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18471
18452
|
|
|
18472
18453
|
/**
|
|
18473
18454
|
* Tool name used by the USE PRIVACY commitment.
|
|
@@ -18639,9 +18620,7 @@
|
|
|
18639
18620
|
};
|
|
18640
18621
|
}
|
|
18641
18622
|
}
|
|
18642
|
-
|
|
18643
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18644
|
-
*/
|
|
18623
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18645
18624
|
|
|
18646
18625
|
/* eslint-disable no-magic-numbers */
|
|
18647
18626
|
/**
|
|
@@ -19429,9 +19408,7 @@
|
|
|
19429
19408
|
defaultBranch,
|
|
19430
19409
|
};
|
|
19431
19410
|
}
|
|
19432
|
-
|
|
19433
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19434
|
-
*/
|
|
19411
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19435
19412
|
|
|
19436
19413
|
/**
|
|
19437
19414
|
* Wallet metadata used by USE PROJECT when resolving GitHub credentials.
|
|
@@ -20290,9 +20267,7 @@
|
|
|
20290
20267
|
defaultBranch: repositoryReference.defaultBranch,
|
|
20291
20268
|
});
|
|
20292
20269
|
}
|
|
20293
|
-
|
|
20294
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20295
|
-
*/
|
|
20270
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20296
20271
|
|
|
20297
20272
|
/**
|
|
20298
20273
|
* A search engine implementation that uses the SerpApi to fetch Google search results.
|
|
@@ -20503,9 +20478,7 @@
|
|
|
20503
20478
|
};
|
|
20504
20479
|
}
|
|
20505
20480
|
}
|
|
20506
|
-
|
|
20507
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20508
|
-
*/
|
|
20481
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20509
20482
|
|
|
20510
20483
|
/**
|
|
20511
20484
|
* Maximum allowed source length for create-agent payloads.
|
|
@@ -20702,9 +20675,7 @@
|
|
|
20702
20675
|
};
|
|
20703
20676
|
}
|
|
20704
20677
|
}
|
|
20705
|
-
|
|
20706
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20707
|
-
*/
|
|
20678
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20708
20679
|
|
|
20709
20680
|
/**
|
|
20710
20681
|
* Creates system-message instructions for `USE TIMEOUT`.
|
|
@@ -20769,9 +20740,7 @@
|
|
|
20769
20740
|
return null;
|
|
20770
20741
|
}
|
|
20771
20742
|
}
|
|
20772
|
-
|
|
20773
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20774
|
-
*/
|
|
20743
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20775
20744
|
|
|
20776
20745
|
/**
|
|
20777
20746
|
* Builds a disabled timeout-tool payload.
|
|
@@ -21505,9 +21474,7 @@
|
|
|
21505
21474
|
return createTimeoutToolFunctions();
|
|
21506
21475
|
}
|
|
21507
21476
|
}
|
|
21508
|
-
|
|
21509
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21510
|
-
*/
|
|
21477
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21511
21478
|
|
|
21512
21479
|
/**
|
|
21513
21480
|
* USE TIME commitment definition
|
|
@@ -21654,9 +21621,7 @@
|
|
|
21654
21621
|
};
|
|
21655
21622
|
}
|
|
21656
21623
|
}
|
|
21657
|
-
|
|
21658
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21659
|
-
*/
|
|
21624
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21660
21625
|
|
|
21661
21626
|
/**
|
|
21662
21627
|
* Tool name used by the USE USER LOCATION commitment.
|
|
@@ -21869,9 +21834,7 @@
|
|
|
21869
21834
|
};
|
|
21870
21835
|
}
|
|
21871
21836
|
}
|
|
21872
|
-
|
|
21873
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21874
|
-
*/
|
|
21837
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21875
21838
|
|
|
21876
21839
|
/**
|
|
21877
21840
|
* `WRITING RULES` commitment definition.
|
|
@@ -21947,9 +21910,7 @@
|
|
|
21947
21910
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
|
|
21948
21911
|
}
|
|
21949
21912
|
}
|
|
21950
|
-
|
|
21951
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21952
|
-
*/
|
|
21913
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21953
21914
|
|
|
21954
21915
|
/**
|
|
21955
21916
|
* `WRITING SAMPLE` commitment definition.
|
|
@@ -22019,9 +21980,7 @@
|
|
|
22019
21980
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
|
|
22020
21981
|
}
|
|
22021
21982
|
}
|
|
22022
|
-
|
|
22023
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22024
|
-
*/
|
|
21983
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22025
21984
|
|
|
22026
21985
|
/**
|
|
22027
21986
|
* Placeholder commitment definition for commitments that are not yet implemented
|
|
@@ -22183,13 +22142,12 @@
|
|
|
22183
22142
|
new NotYetImplementedCommitmentDefinition('CONTEXT'),
|
|
22184
22143
|
// <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
|
|
22185
22144
|
];
|
|
22186
|
-
|
|
22187
|
-
|
|
22188
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22189
|
-
*/
|
|
22145
|
+
// TODO: [🧠] Maybe create through standardized $register
|
|
22146
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22190
22147
|
|
|
22191
22148
|
/**
|
|
22192
22149
|
* Gets all available commitment definitions
|
|
22150
|
+
*
|
|
22193
22151
|
* @returns Array of all commitment definitions
|
|
22194
22152
|
*
|
|
22195
22153
|
* @public exported from `@promptbook/core`
|
|
@@ -22202,6 +22160,7 @@
|
|
|
22202
22160
|
* Collects tool functions from all commitment definitions.
|
|
22203
22161
|
*
|
|
22204
22162
|
* @returns Map of tool function implementations.
|
|
22163
|
+
*
|
|
22205
22164
|
* @private internal helper for commitment tool registry
|
|
22206
22165
|
*/
|
|
22207
22166
|
function collectCommitmentToolFunctions() {
|
|
@@ -22223,6 +22182,7 @@
|
|
|
22223
22182
|
*
|
|
22224
22183
|
* @param getFunctions - Provider of current tool functions.
|
|
22225
22184
|
* @returns Proxy exposing tool functions as properties.
|
|
22185
|
+
*
|
|
22226
22186
|
* @private internal helper for commitment tool registry
|
|
22227
22187
|
*/
|
|
22228
22188
|
function createToolFunctionsProxy(getFunctions) {
|
|
@@ -22260,10 +22220,11 @@
|
|
|
22260
22220
|
},
|
|
22261
22221
|
});
|
|
22262
22222
|
}
|
|
22223
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22224
|
+
|
|
22263
22225
|
/**
|
|
22264
|
-
*
|
|
22226
|
+
* Map of node tool functions.
|
|
22265
22227
|
*/
|
|
22266
|
-
|
|
22267
22228
|
const nodeToolFunctions = {
|
|
22268
22229
|
/**
|
|
22269
22230
|
* @@@
|
|
@@ -22295,6 +22256,9 @@
|
|
|
22295
22256
|
spawn_agent: resolveSpawnAgentToolForNode(),
|
|
22296
22257
|
// TODO: !!!! Unhardcode, make proper server function register from definitions
|
|
22297
22258
|
};
|
|
22259
|
+
/**
|
|
22260
|
+
* Constant for node tool functions proxy.
|
|
22261
|
+
*/
|
|
22298
22262
|
const nodeToolFunctionsProxy = createToolFunctionsProxy(() => ({
|
|
22299
22263
|
...collectCommitmentToolFunctions(),
|
|
22300
22264
|
...nodeToolFunctions,
|
|
@@ -22318,10 +22282,8 @@
|
|
|
22318
22282
|
}
|
|
22319
22283
|
return nodeToolFunctionsProxy;
|
|
22320
22284
|
}
|
|
22321
|
-
|
|
22322
|
-
|
|
22323
|
-
* TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
|
|
22324
|
-
*/
|
|
22285
|
+
// Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
|
|
22286
|
+
// TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
|
|
22325
22287
|
|
|
22326
22288
|
/**
|
|
22327
22289
|
* Extracts exactly ONE code block from markdown.
|
|
@@ -22336,8 +22298,9 @@
|
|
|
22336
22298
|
*
|
|
22337
22299
|
* @param markdown any valid markdown
|
|
22338
22300
|
* @returns code block with language and content
|
|
22339
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
22340
22301
|
* @throws {ParseError} if there is not exactly one code block in the markdown
|
|
22302
|
+
*
|
|
22303
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
22341
22304
|
*/
|
|
22342
22305
|
function extractOneBlockFromMarkdown(markdown) {
|
|
22343
22306
|
const codeBlocks = extractAllBlocksFromMarkdown(markdown);
|
|
@@ -22350,9 +22313,7 @@
|
|
|
22350
22313
|
}
|
|
22351
22314
|
return codeBlocks[0];
|
|
22352
22315
|
}
|
|
22353
|
-
|
|
22354
|
-
* TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
|
|
22355
|
-
*/
|
|
22316
|
+
// TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
|
|
22356
22317
|
|
|
22357
22318
|
/**
|
|
22358
22319
|
* Extracts code block from markdown.
|
|
@@ -22365,8 +22326,9 @@
|
|
|
22365
22326
|
* - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
|
|
22366
22327
|
* - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
|
|
22367
22328
|
*
|
|
22368
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
22369
22329
|
* @throws {ParseError} if there is not exactly one code block in the markdown
|
|
22330
|
+
*
|
|
22331
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
22370
22332
|
*/
|
|
22371
22333
|
function extractBlock(markdown) {
|
|
22372
22334
|
const { content } = extractOneBlockFromMarkdown(markdown);
|
|
@@ -22378,7 +22340,7 @@
|
|
|
22378
22340
|
*
|
|
22379
22341
|
* Note: [🔂] This function is idempotent.
|
|
22380
22342
|
* Note: This is useful for post-processing of the result of the chat LLM model
|
|
22381
|
-
*
|
|
22343
|
+
* when the model wraps the result in the (markdown) code block.
|
|
22382
22344
|
*
|
|
22383
22345
|
* @public exported from `@promptbook/markdown-utils`
|
|
22384
22346
|
*/
|
|
@@ -22397,7 +22359,7 @@
|
|
|
22397
22359
|
* Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
|
|
22398
22360
|
*
|
|
22399
22361
|
* Note: This is useful for post-processing of the result of the completion LLM model
|
|
22400
|
-
*
|
|
22362
|
+
* if you want to start code block in the prompt but you don't want to end it in the result.
|
|
22401
22363
|
*
|
|
22402
22364
|
* @public exported from `@promptbook/markdown-utils`
|
|
22403
22365
|
*/
|
|
@@ -22409,6 +22371,8 @@
|
|
|
22409
22371
|
}
|
|
22410
22372
|
|
|
22411
22373
|
/**
|
|
22374
|
+
* Collection of preserved.
|
|
22375
|
+
*
|
|
22412
22376
|
* @private internal for `preserve`
|
|
22413
22377
|
*/
|
|
22414
22378
|
const _preserved = [];
|
|
@@ -22418,21 +22382,20 @@
|
|
|
22418
22382
|
*
|
|
22419
22383
|
* @param value any function to preserve
|
|
22420
22384
|
* @returns nothing
|
|
22385
|
+
*
|
|
22421
22386
|
* @private within the repository
|
|
22422
22387
|
*/
|
|
22423
22388
|
function $preserve(...value) {
|
|
22424
22389
|
_preserved.push(...value);
|
|
22425
22390
|
}
|
|
22426
|
-
|
|
22427
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22428
|
-
*/
|
|
22391
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22429
22392
|
|
|
22430
22393
|
// Note: [💎]
|
|
22431
22394
|
/**
|
|
22432
22395
|
* ScriptExecutionTools for JavaScript implemented via eval
|
|
22433
22396
|
*
|
|
22434
22397
|
* Warning: It is used for testing and mocking
|
|
22435
|
-
*
|
|
22398
|
+
* **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
|
|
22436
22399
|
*
|
|
22437
22400
|
* @public exported from `@promptbook/javascript`
|
|
22438
22401
|
*/
|
|
@@ -22627,15 +22590,14 @@
|
|
|
22627
22590
|
return result;
|
|
22628
22591
|
}
|
|
22629
22592
|
}
|
|
22630
|
-
|
|
22631
|
-
|
|
22632
|
-
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
22633
|
-
*/
|
|
22593
|
+
// TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
|
|
22594
|
+
// TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
22634
22595
|
|
|
22635
22596
|
/**
|
|
22636
22597
|
* Placeholder for better implementation of JavascriptExecutionTools - some proper sandboxing
|
|
22637
22598
|
*
|
|
22638
22599
|
* @alias JavascriptExecutionTools
|
|
22600
|
+
*
|
|
22639
22601
|
* @public exported from `@promptbook/javascript`
|
|
22640
22602
|
*/
|
|
22641
22603
|
const JavascriptExecutionTools = JavascriptEvalExecutionTools;
|
|
@@ -22652,15 +22614,15 @@
|
|
|
22652
22614
|
// TODO: [🔱] Do here auto-installation
|
|
22653
22615
|
return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
|
|
22654
22616
|
}
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
22658
|
-
*/
|
|
22617
|
+
// 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
|
|
22618
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
22659
22619
|
|
|
22660
22620
|
// TODO: [🥺] List running services from REMOTE_SERVER_URLS
|
|
22661
22621
|
// TODO: [🥺] Import directly from YML
|
|
22662
22622
|
/**
|
|
22663
|
-
*
|
|
22623
|
+
* [🥺] Decide how to expose this.
|
|
22624
|
+
*
|
|
22625
|
+
* @private
|
|
22664
22626
|
*/
|
|
22665
22627
|
const openapiJson = {
|
|
22666
22628
|
openapi: '3.0.0',
|
|
@@ -23251,23 +23213,36 @@
|
|
|
23251
23213
|
},
|
|
23252
23214
|
],
|
|
23253
23215
|
};
|
|
23216
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23217
|
+
|
|
23254
23218
|
/**
|
|
23255
|
-
*
|
|
23219
|
+
* Constant for h.
|
|
23256
23220
|
*/
|
|
23257
|
-
|
|
23258
23221
|
const h = react.createElement;
|
|
23222
|
+
/**
|
|
23223
|
+
* Handles key val.
|
|
23224
|
+
*/
|
|
23259
23225
|
function KeyVal(props) {
|
|
23260
23226
|
return h('div', { className: 'flex items-start gap-2' }, h('div', { className: 'font-semibold min-w-[14rem]' }, props.label), h('div', { className: 'text-gray-800' }, props.value));
|
|
23261
23227
|
}
|
|
23228
|
+
/**
|
|
23229
|
+
* Handles list.
|
|
23230
|
+
*/
|
|
23262
23231
|
function List(props) {
|
|
23263
23232
|
var _a;
|
|
23264
23233
|
if (!((_a = props.items) === null || _a === void 0 ? void 0 : _a.length))
|
|
23265
23234
|
return h('span', { className: 'text-gray-500' }, 'none');
|
|
23266
23235
|
return h('ul', { className: 'list-disc ml-6' }, ...props.items.map((item, i) => h('li', { key: String(i), className: 'break-all' }, item)));
|
|
23267
23236
|
}
|
|
23237
|
+
/**
|
|
23238
|
+
* Handles section.
|
|
23239
|
+
*/
|
|
23268
23240
|
function Section(props) {
|
|
23269
23241
|
return h('section', { className: 'mt-8' }, h('h2', { className: 'text-xl font-semibold mb-2' }, props.title), props.children);
|
|
23270
23242
|
}
|
|
23243
|
+
/**
|
|
23244
|
+
* Handles server body.
|
|
23245
|
+
*/
|
|
23271
23246
|
function ServerBody({ info }) {
|
|
23272
23247
|
var _a;
|
|
23273
23248
|
return h('div', { className: 'max-w-4xl mx-auto p-6' }, h('h1', { className: 'text-3xl font-bold mb-4' }, 'Promptbook Server'), h('div', { className: 'space-y-2' }, h(KeyVal, { label: 'Book language version:', value: info.bookLanguageVersion }), h(KeyVal, { label: 'Promptbook engine version:', value: info.promptbookEngineVersion }), h(KeyVal, { label: 'Node.js version:', value: info.nodeVersion }), h(KeyVal, { label: 'Server port:', value: String((_a = info.port) !== null && _a !== void 0 ? _a : '') }), h(KeyVal, { label: 'Startup date:', value: info.startupDate }), h(KeyVal, {
|
|
@@ -23281,6 +23256,9 @@
|
|
|
23281
23256
|
className: 'text-blue-600 underline',
|
|
23282
23257
|
}, 'https://www.npmjs.com/package/@promptbook/remote-client')), h('li', null, 'OpenAI compatible client ', h('span', { className: 'text-gray-500' }, '(Not working yet)')), h('li', null, 'REST API')), h('p', { className: 'mt-2' }, 'For more information look at: ', h('a', { href: 'https://github.com/webgptorg/promptbook', className: 'text-blue-600 underline' }, 'https://github.com/webgptorg/promptbook'))));
|
|
23283
23258
|
}
|
|
23259
|
+
/**
|
|
23260
|
+
* Handles Html doc.
|
|
23261
|
+
*/
|
|
23284
23262
|
function HtmlDoc({ info }) {
|
|
23285
23263
|
return h('html', { lang: 'en' }, h('head', null, h('meta', { charSet: 'UTF-8' }), h('meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0' }), h('title', null, 'Promptbook Server'), h('link', {
|
|
23286
23264
|
href: 'https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css',
|
|
@@ -23304,6 +23282,7 @@
|
|
|
23304
23282
|
* This is useful to make all logic on browser side but not expose your API keys or no need to use customer's GPU.
|
|
23305
23283
|
*
|
|
23306
23284
|
* @see https://github.com/webgptorg/promptbook#remote-server
|
|
23285
|
+
*
|
|
23307
23286
|
* @public exported from `@promptbook/remote-server`
|
|
23308
23287
|
*/
|
|
23309
23288
|
function startRemoteServer(options) {
|
|
@@ -23861,22 +23840,19 @@
|
|
|
23861
23840
|
},
|
|
23862
23841
|
};
|
|
23863
23842
|
}
|
|
23864
|
-
|
|
23865
|
-
|
|
23866
|
-
|
|
23867
|
-
|
|
23868
|
-
|
|
23869
|
-
|
|
23870
|
-
|
|
23871
|
-
|
|
23872
|
-
|
|
23873
|
-
|
|
23874
|
-
|
|
23875
|
-
|
|
23876
|
-
|
|
23877
|
-
* TODO: Allow to constrain anonymous mode for specific models / providers
|
|
23878
|
-
* Note: [🟢] Code in this file should never be never released in packages that could be imported into browser environment
|
|
23879
|
-
*/
|
|
23843
|
+
// Note: [🟢] Code for Node server bootstrap [startRemoteServer](src/remote-server/startRemoteServer.ts) should never be published into packages that could be imported into browser environment
|
|
23844
|
+
// TODO: [🕋] Use here `aboutPromptbookInformation`
|
|
23845
|
+
// TODO: [🌡] Add CORS and security - probably via `helmet`
|
|
23846
|
+
// TODO: Split this file into multiple functions - handler for each request
|
|
23847
|
+
// TODO: Maybe use `$exportJson`
|
|
23848
|
+
// TODO: [🧠][🛍] Maybe not `isAnonymous: boolean` BUT `mode: 'ANONYMOUS'|'COLLECTION'`
|
|
23849
|
+
// TODO: [⚖] Expose the collection to be able to connect to same collection via createPipelineCollectionFromUrl
|
|
23850
|
+
// TODO: Handle progress - support streaming
|
|
23851
|
+
// TODO: [🗯] Do not hang up immediately but wait until client closes OR timeout
|
|
23852
|
+
// TODO: [🗯] Timeout on chat to free up resources
|
|
23853
|
+
// TODO: [🃏] Pass here some security token to prevent malitious usage and/or DDoS
|
|
23854
|
+
// TODO: [0] Set unavailable models as undefined in `RemoteLlmExecutionTools` NOT throw error here
|
|
23855
|
+
// TODO: Allow to constrain anonymous mode for specific models / providers
|
|
23880
23856
|
|
|
23881
23857
|
/**
|
|
23882
23858
|
* Keep-alive helpers used for streaming chat responses.
|
|
@@ -23888,12 +23864,10 @@
|
|
|
23888
23864
|
* @private internal streaming helper for Promptbook chat connections
|
|
23889
23865
|
*/
|
|
23890
23866
|
const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
|
|
23891
|
-
|
|
23892
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23893
|
-
*/
|
|
23867
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23894
23868
|
|
|
23895
23869
|
/**
|
|
23896
|
-
*
|
|
23870
|
+
* Number of padding lines to add at the end of the book content
|
|
23897
23871
|
*
|
|
23898
23872
|
* @public exported from `@promptbook/core`
|
|
23899
23873
|
*/
|
|
@@ -23930,9 +23904,7 @@
|
|
|
23930
23904
|
const linesToAdd = PADDING_LINES - trailingEmptyLines;
|
|
23931
23905
|
return (content + '\n'.repeat(linesToAdd));
|
|
23932
23906
|
}
|
|
23933
|
-
|
|
23934
|
-
* TODO: [🧠] Maybe export
|
|
23935
|
-
*/
|
|
23907
|
+
// TODO: [🧠] Maybe export
|
|
23936
23908
|
|
|
23937
23909
|
/**
|
|
23938
23910
|
* Type guard to check if a string is a valid agent source
|
|
@@ -23962,6 +23934,7 @@
|
|
|
23962
23934
|
* Default book
|
|
23963
23935
|
*
|
|
23964
23936
|
* @deprecated Use `$generateBookBoilerplate` instead
|
|
23937
|
+
*
|
|
23965
23938
|
* @public exported from `@promptbook/core`
|
|
23966
23939
|
*/
|
|
23967
23940
|
padBook(validateBook(_spaceTrim.spaceTrim(`
|
|
@@ -23980,6 +23953,7 @@
|
|
|
23980
23953
|
*
|
|
23981
23954
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
23982
23955
|
* @returns {boolean} if the string is a valid pipeline string
|
|
23956
|
+
*
|
|
23983
23957
|
* @public exported from `@promptbook/core`
|
|
23984
23958
|
*/
|
|
23985
23959
|
function isValidPipelineString(pipelineString) {
|
|
@@ -23992,9 +23966,7 @@
|
|
|
23992
23966
|
return false;
|
|
23993
23967
|
}
|
|
23994
23968
|
}
|
|
23995
|
-
|
|
23996
|
-
* TODO: [🧠][🈴] Where is the best location for this file
|
|
23997
|
-
*/
|
|
23969
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
23998
23970
|
|
|
23999
23971
|
/**
|
|
24000
23972
|
* Tag function for notating a pipeline with a book\`...\ notation as template literal
|
|
@@ -24007,6 +23979,7 @@
|
|
|
24007
23979
|
* @param strings The static string parts of the template literal
|
|
24008
23980
|
* @param values The dynamic values embedded within the template literal used as data
|
|
24009
23981
|
* @returns the pipeline string
|
|
23982
|
+
*
|
|
24010
23983
|
* @public exported from `@promptbook/core`
|
|
24011
23984
|
*/
|
|
24012
23985
|
function book(strings, ...values) {
|
|
@@ -24033,10 +24006,8 @@
|
|
|
24033
24006
|
}
|
|
24034
24007
|
return padBook(bookString);
|
|
24035
24008
|
}
|
|
24036
|
-
|
|
24037
|
-
|
|
24038
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24039
|
-
*/
|
|
24009
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
24010
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24040
24011
|
|
|
24041
24012
|
/**
|
|
24042
24013
|
* Tool call name emitted while preparing a GPT assistant for an agent.
|
|
@@ -24081,9 +24052,7 @@
|
|
|
24081
24052
|
{ token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
|
|
24082
24053
|
{ token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
|
|
24083
24054
|
];
|
|
24084
|
-
|
|
24085
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24086
|
-
*/
|
|
24055
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24087
24056
|
|
|
24088
24057
|
/**
|
|
24089
24058
|
* Converts encoded whitespace markers back into real whitespace so the UI can render the message
|
|
@@ -24101,6 +24070,9 @@
|
|
|
24101
24070
|
}, content);
|
|
24102
24071
|
}
|
|
24103
24072
|
|
|
24073
|
+
/**
|
|
24074
|
+
* Constant for raw tool call ID fields.
|
|
24075
|
+
*/
|
|
24104
24076
|
const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
|
|
24105
24077
|
/**
|
|
24106
24078
|
* Builds a deterministic idempotency key for tool calls so the UI can track updates.
|
|
@@ -24131,6 +24103,9 @@
|
|
|
24131
24103
|
}
|
|
24132
24104
|
return `fallback:${toolCall.name}`;
|
|
24133
24105
|
}
|
|
24106
|
+
/**
|
|
24107
|
+
* Gets arguments key.
|
|
24108
|
+
*/
|
|
24134
24109
|
function getArgumentsKey(value) {
|
|
24135
24110
|
if (typeof value === 'string') {
|
|
24136
24111
|
return value;
|
|
@@ -24204,6 +24179,7 @@
|
|
|
24204
24179
|
* @param existingToolCall - Previous snapshot.
|
|
24205
24180
|
* @param incomingToolCall - New snapshot.
|
|
24206
24181
|
* @returns One merged snapshot.
|
|
24182
|
+
*
|
|
24207
24183
|
* @private helper of `mergeToolCalls`
|
|
24208
24184
|
*/
|
|
24209
24185
|
function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
|
|
@@ -24226,6 +24202,7 @@
|
|
|
24226
24202
|
* @param existingToolCall - Previous snapshot.
|
|
24227
24203
|
* @param incomingToolCall - New snapshot.
|
|
24228
24204
|
* @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
|
|
24205
|
+
*
|
|
24229
24206
|
* @private helper of `mergeToolCalls`
|
|
24230
24207
|
*/
|
|
24231
24208
|
function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
|
|
@@ -24239,6 +24216,7 @@
|
|
|
24239
24216
|
*
|
|
24240
24217
|
* @param toolCall - Tool call snapshot to inspect.
|
|
24241
24218
|
* @returns Inferred lifecycle state or `undefined`.
|
|
24219
|
+
*
|
|
24242
24220
|
* @private helper of `mergeToolCalls`
|
|
24243
24221
|
*/
|
|
24244
24222
|
function inferToolCallState(toolCall) {
|
|
@@ -24262,6 +24240,7 @@
|
|
|
24262
24240
|
* @param existingValues - Previous list.
|
|
24263
24241
|
* @param incomingValues - Incoming list.
|
|
24264
24242
|
* @returns Deduplicated merged list or `undefined`.
|
|
24243
|
+
*
|
|
24265
24244
|
* @private helper of `mergeToolCalls`
|
|
24266
24245
|
*/
|
|
24267
24246
|
function mergeUnknownLists(existingValues, incomingValues) {
|
|
@@ -24288,6 +24267,7 @@
|
|
|
24288
24267
|
*
|
|
24289
24268
|
* @param value - Value to serialize.
|
|
24290
24269
|
* @returns String signature.
|
|
24270
|
+
*
|
|
24291
24271
|
* @private helper of `mergeToolCalls`
|
|
24292
24272
|
*/
|
|
24293
24273
|
function serializeValueForMerge(value) {
|
|
@@ -24305,6 +24285,7 @@
|
|
|
24305
24285
|
*
|
|
24306
24286
|
* @param toolCalls - Mutable list to deduplicate in-place.
|
|
24307
24287
|
* @returns The same array after removing redundant preparation entries.
|
|
24288
|
+
*
|
|
24308
24289
|
* @private helper of `mergeToolCalls`
|
|
24309
24290
|
*/
|
|
24310
24291
|
function deduplicatePreparationToolCalls(toolCalls) {
|
|
@@ -24362,6 +24343,7 @@
|
|
|
24362
24343
|
*
|
|
24363
24344
|
* @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
|
|
24364
24345
|
* @returns Normalized hostname or `null` when the value cannot be normalized.
|
|
24346
|
+
*
|
|
24365
24347
|
* @private utility for host/domain matching
|
|
24366
24348
|
*/
|
|
24367
24349
|
function normalizeDomainForMatching(rawDomain) {
|
|
@@ -24384,6 +24366,7 @@
|
|
|
24384
24366
|
*
|
|
24385
24367
|
* @param value - Raw value to inspect.
|
|
24386
24368
|
* @returns True when the value starts with `http://` or `https://`.
|
|
24369
|
+
*
|
|
24387
24370
|
* @private utility for host/domain matching
|
|
24388
24371
|
*/
|
|
24389
24372
|
function hasHttpProtocol(value) {
|
|
@@ -24399,6 +24382,7 @@
|
|
|
24399
24382
|
*
|
|
24400
24383
|
* @param agentSource - Raw agent source.
|
|
24401
24384
|
* @returns Parsed prelude with shared line metadata.
|
|
24385
|
+
*
|
|
24402
24386
|
* @private internal utility of book agent-source parsing
|
|
24403
24387
|
*/
|
|
24404
24388
|
function parseAgentSourcePrelude(agentSource) {
|
|
@@ -24574,6 +24558,7 @@
|
|
|
24574
24558
|
*
|
|
24575
24559
|
* @param text - Text to extract parameters from
|
|
24576
24560
|
* @returns Array of parsed parameters with unified representation
|
|
24561
|
+
*
|
|
24577
24562
|
* @public exported from `@promptbook/core`
|
|
24578
24563
|
*/
|
|
24579
24564
|
function parseParameters(text) {
|
|
@@ -25002,9 +24987,7 @@
|
|
|
25002
24987
|
const trimmed = _spaceTrim.spaceTrim(content);
|
|
25003
24988
|
return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
|
|
25004
24989
|
}
|
|
25005
|
-
|
|
25006
|
-
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
25007
|
-
*/
|
|
24990
|
+
// TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
25008
24991
|
|
|
25009
24992
|
/**
|
|
25010
24993
|
* Gets all tool titles provided by all commitments
|
|
@@ -25030,6 +25013,7 @@
|
|
|
25030
25013
|
* Restricts an Updatable to a (2) BehaviorSubject variant
|
|
25031
25014
|
*
|
|
25032
25015
|
* @see Updatable
|
|
25016
|
+
*
|
|
25033
25017
|
* @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
|
|
25034
25018
|
*/
|
|
25035
25019
|
function asUpdatableSubject(value) {
|
|
@@ -25054,9 +25038,7 @@
|
|
|
25054
25038
|
return new rxjs.BehaviorSubject(value);
|
|
25055
25039
|
}
|
|
25056
25040
|
}
|
|
25057
|
-
|
|
25058
|
-
* TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
|
|
25059
|
-
*/
|
|
25041
|
+
// TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
|
|
25060
25042
|
|
|
25061
25043
|
/**
|
|
25062
25044
|
* Creates an empty/basic agent model requirements object
|
|
@@ -25091,12 +25073,11 @@
|
|
|
25091
25073
|
systemMessage: `You are ${agentName || 'AI Agent'}`,
|
|
25092
25074
|
};
|
|
25093
25075
|
}
|
|
25094
|
-
|
|
25095
|
-
* TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
|
|
25096
|
-
*/
|
|
25076
|
+
// TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
|
|
25097
25077
|
|
|
25098
25078
|
/**
|
|
25099
25079
|
* Gets a commitment definition by its type
|
|
25080
|
+
*
|
|
25100
25081
|
* @param type The commitment type to look up
|
|
25101
25082
|
* @returns The commitment definition or null if not found
|
|
25102
25083
|
*
|
|
@@ -25475,7 +25456,9 @@
|
|
|
25475
25456
|
};
|
|
25476
25457
|
}
|
|
25477
25458
|
/**
|
|
25478
|
-
*
|
|
25459
|
+
* Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
|
|
25460
|
+
*
|
|
25461
|
+
* @private
|
|
25479
25462
|
*/
|
|
25480
25463
|
async function applyPendingInlineKnowledgeSources(requirements, uploader) {
|
|
25481
25464
|
var _a;
|
|
@@ -25496,6 +25479,9 @@
|
|
|
25496
25479
|
_metadata: stripInlineKnowledgeMetadata(requirements._metadata),
|
|
25497
25480
|
};
|
|
25498
25481
|
}
|
|
25482
|
+
/**
|
|
25483
|
+
* Handles upload inline knowledge source with fallback.
|
|
25484
|
+
*/
|
|
25499
25485
|
async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
|
|
25500
25486
|
try {
|
|
25501
25487
|
return await uploader(inlineSource);
|
|
@@ -25508,6 +25494,9 @@
|
|
|
25508
25494
|
return inlineKnowledgeSourceToDataUrl(inlineSource);
|
|
25509
25495
|
}
|
|
25510
25496
|
}
|
|
25497
|
+
/**
|
|
25498
|
+
* Extracts inline knowledge sources.
|
|
25499
|
+
*/
|
|
25511
25500
|
function extractInlineKnowledgeSources(metadata) {
|
|
25512
25501
|
if (!metadata) {
|
|
25513
25502
|
return [];
|
|
@@ -25515,6 +25504,9 @@
|
|
|
25515
25504
|
const value = metadata.inlineKnowledgeSources;
|
|
25516
25505
|
return Array.isArray(value) ? value : [];
|
|
25517
25506
|
}
|
|
25507
|
+
/**
|
|
25508
|
+
* Strips inline knowledge metadata.
|
|
25509
|
+
*/
|
|
25518
25510
|
function stripInlineKnowledgeMetadata(metadata) {
|
|
25519
25511
|
if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
|
|
25520
25512
|
return metadata;
|
|
@@ -25565,6 +25557,7 @@
|
|
|
25565
25557
|
* @param availableModels - Models that could fulfill the agent.
|
|
25566
25558
|
* @param llmTools - Execution tools used when selecting a best model.
|
|
25567
25559
|
* @param options - Optional hooks such as the agent reference resolver.
|
|
25560
|
+
*
|
|
25568
25561
|
* @public exported from `@promptbook/core`
|
|
25569
25562
|
*/
|
|
25570
25563
|
async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
|
|
@@ -25584,6 +25577,7 @@
|
|
|
25584
25577
|
* @param agentSource The agent source to derive persona description from
|
|
25585
25578
|
* @param llmTools LLM tools for preparing persona
|
|
25586
25579
|
* @returns The name of the best selected model
|
|
25580
|
+
*
|
|
25587
25581
|
* @private function of `createAgentModelRequirements`
|
|
25588
25582
|
*/
|
|
25589
25583
|
async function selectBestModelUsingPersona(agentSource, llmTools) {
|
|
@@ -25719,6 +25713,7 @@
|
|
|
25719
25713
|
*
|
|
25720
25714
|
* @param {unknown} rawAttachments - The raw attachments to normalize.
|
|
25721
25715
|
* @returns {Array<ChatAttachment>} The normalized attachments.
|
|
25716
|
+
*
|
|
25722
25717
|
* @public exported from `@promptbook/core`
|
|
25723
25718
|
*/
|
|
25724
25719
|
function normalizeChatAttachments(rawAttachments) {
|
|
@@ -25763,6 +25758,7 @@
|
|
|
25763
25758
|
*
|
|
25764
25759
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
|
|
25765
25760
|
* @returns {string} The formatted context.
|
|
25761
|
+
*
|
|
25766
25762
|
* @public exported from `@promptbook/core`
|
|
25767
25763
|
*/
|
|
25768
25764
|
function formatChatAttachmentContext(attachments) {
|
|
@@ -25783,6 +25779,7 @@
|
|
|
25783
25779
|
* @param {number} maxBytes - Maximum number of bytes to capture.
|
|
25784
25780
|
* @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
|
|
25785
25781
|
* @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
|
|
25782
|
+
*
|
|
25786
25783
|
* @private internal utility for bounded response reads
|
|
25787
25784
|
*/
|
|
25788
25785
|
async function readResponseBytes(response, maxBytes, options = {}) {
|
|
@@ -25879,6 +25876,7 @@
|
|
|
25879
25876
|
* @param {number} maxInlineCharacters - Maximum number of characters to inline.
|
|
25880
25877
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
25881
25878
|
* @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
|
|
25879
|
+
*
|
|
25882
25880
|
* @private function of resolveChatAttachmentContents
|
|
25883
25881
|
*/
|
|
25884
25882
|
async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
|
|
@@ -25970,6 +25968,7 @@
|
|
|
25970
25968
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
|
|
25971
25969
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
25972
25970
|
* @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
|
|
25971
|
+
*
|
|
25973
25972
|
* @public exported from `@promptbook/core`
|
|
25974
25973
|
*/
|
|
25975
25974
|
async function resolveChatAttachmentContents(attachments, options = {}) {
|
|
@@ -26035,6 +26034,7 @@
|
|
|
26035
26034
|
*
|
|
26036
26035
|
* @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
|
|
26037
26036
|
* @returns {string} The formatted context.
|
|
26037
|
+
*
|
|
26038
26038
|
* @public exported from `@promptbook/core`
|
|
26039
26039
|
*/
|
|
26040
26040
|
function formatChatAttachmentContentContext(resolvedContents) {
|
|
@@ -26075,6 +26075,7 @@
|
|
|
26075
26075
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
|
|
26076
26076
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
26077
26077
|
* @returns {Promise<string>} The updated message content.
|
|
26078
|
+
*
|
|
26078
26079
|
* @public exported from `@promptbook/core`
|
|
26079
26080
|
*/
|
|
26080
26081
|
async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
|
|
@@ -26103,9 +26104,7 @@
|
|
|
26103
26104
|
function humanizeAiTextEllipsis(aiText) {
|
|
26104
26105
|
return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
|
|
26105
26106
|
}
|
|
26106
|
-
|
|
26107
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26108
|
-
*/
|
|
26107
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26109
26108
|
|
|
26110
26109
|
/**
|
|
26111
26110
|
* Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
|
|
@@ -26118,9 +26117,7 @@
|
|
|
26118
26117
|
function humanizeAiTextEmdashed(aiText) {
|
|
26119
26118
|
return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
|
|
26120
26119
|
}
|
|
26121
|
-
|
|
26122
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26123
|
-
*/
|
|
26120
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26124
26121
|
|
|
26125
26122
|
/**
|
|
26126
26123
|
* Change smart quotes to regular quotes
|
|
@@ -26133,9 +26130,7 @@
|
|
|
26133
26130
|
function humanizeAiTextQuotes(aiText) {
|
|
26134
26131
|
return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
|
|
26135
26132
|
}
|
|
26136
|
-
|
|
26137
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26138
|
-
*/
|
|
26133
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26139
26134
|
|
|
26140
26135
|
/**
|
|
26141
26136
|
* Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
|
|
@@ -26148,9 +26143,7 @@
|
|
|
26148
26143
|
function humanizeAiTextSources(aiText) {
|
|
26149
26144
|
return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
|
|
26150
26145
|
}
|
|
26151
|
-
|
|
26152
|
-
* Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26153
|
-
*/
|
|
26146
|
+
// Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26154
26147
|
|
|
26155
26148
|
/**
|
|
26156
26149
|
* Change unprintable hard spaces to regular spaces and drop zero-width spaces
|
|
@@ -26163,9 +26156,7 @@
|
|
|
26163
26156
|
function humanizeAiTextWhitespace(aiText) {
|
|
26164
26157
|
return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
|
|
26165
26158
|
}
|
|
26166
|
-
|
|
26167
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26168
|
-
*/
|
|
26159
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
26169
26160
|
|
|
26170
26161
|
/**
|
|
26171
26162
|
* Function `humanizeAiText` will remove traces of AI text generation artifacts
|
|
@@ -26184,11 +26175,11 @@
|
|
|
26184
26175
|
cleanedText = humanizeAiTextWhitespace(cleanedText);
|
|
26185
26176
|
return cleanedText;
|
|
26186
26177
|
}
|
|
26187
|
-
|
|
26188
|
-
* TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
|
|
26189
|
-
*/
|
|
26178
|
+
// TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
|
|
26190
26179
|
|
|
26191
26180
|
/**
|
|
26181
|
+
* Map of promptbook pseudotoken substitution.
|
|
26182
|
+
*
|
|
26192
26183
|
* @private
|
|
26193
26184
|
*/
|
|
26194
26185
|
const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
|
|
@@ -26236,9 +26227,7 @@
|
|
|
26236
26227
|
}
|
|
26237
26228
|
return promptbookifiedTextTokens.join('');
|
|
26238
26229
|
}
|
|
26239
|
-
|
|
26240
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
26241
|
-
*/
|
|
26230
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
26242
26231
|
|
|
26243
26232
|
/**
|
|
26244
26233
|
* Make UncertainNumber
|
|
@@ -26294,6 +26283,7 @@
|
|
|
26294
26283
|
*
|
|
26295
26284
|
* @see https://platform.openai.com/docs/models/
|
|
26296
26285
|
* @see https://openai.com/api/pricing/
|
|
26286
|
+
*
|
|
26297
26287
|
* @public exported from `@promptbook/openai`
|
|
26298
26288
|
*/
|
|
26299
26289
|
const OPENAI_MODELS = exportJson({
|
|
@@ -26970,6 +26960,7 @@
|
|
|
26970
26960
|
* @param rawResponse The raw response from OpenAI API
|
|
26971
26961
|
* @param duration The duration of the execution
|
|
26972
26962
|
* @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
|
|
26963
|
+
*
|
|
26973
26964
|
* @private internal utility of `OpenAiExecutionTools`
|
|
26974
26965
|
*/
|
|
26975
26966
|
function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
|
|
@@ -27012,15 +27003,14 @@
|
|
|
27012
27003
|
},
|
|
27013
27004
|
};
|
|
27014
27005
|
}
|
|
27015
|
-
|
|
27016
|
-
* TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
|
|
27017
|
-
*/
|
|
27006
|
+
// TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
|
|
27018
27007
|
|
|
27019
27008
|
/**
|
|
27020
27009
|
* Parses an OpenAI error message to identify which parameter is unsupported
|
|
27021
27010
|
*
|
|
27022
27011
|
* @param errorMessage The error message from OpenAI API
|
|
27023
27012
|
* @returns The parameter name that is unsupported, or null if not an unsupported parameter error
|
|
27013
|
+
*
|
|
27024
27014
|
* @private utility of LLM Tools
|
|
27025
27015
|
*/
|
|
27026
27016
|
function parseUnsupportedParameterError(errorMessage) {
|
|
@@ -27042,6 +27032,7 @@
|
|
|
27042
27032
|
* @param modelRequirements Original model requirements
|
|
27043
27033
|
* @param unsupportedParameter The parameter to remove
|
|
27044
27034
|
* @returns New model requirements without the unsupported parameter
|
|
27035
|
+
*
|
|
27045
27036
|
* @private utility of LLM Tools
|
|
27046
27037
|
*/
|
|
27047
27038
|
function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
|
|
@@ -27061,8 +27052,10 @@
|
|
|
27061
27052
|
}
|
|
27062
27053
|
/**
|
|
27063
27054
|
* Checks if an error is an "Unsupported value" error from OpenAI
|
|
27055
|
+
*
|
|
27064
27056
|
* @param error The error to check
|
|
27065
27057
|
* @returns true if this is an unsupported parameter error
|
|
27058
|
+
*
|
|
27066
27059
|
* @private utility of LLM Tools
|
|
27067
27060
|
*/
|
|
27068
27061
|
function isUnsupportedParameterError(error) {
|
|
@@ -28168,13 +28161,11 @@
|
|
|
28168
28161
|
return false;
|
|
28169
28162
|
}
|
|
28170
28163
|
}
|
|
28171
|
-
|
|
28172
|
-
|
|
28173
|
-
|
|
28174
|
-
|
|
28175
|
-
|
|
28176
|
-
* TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
|
|
28177
|
-
*/
|
|
28164
|
+
// TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
|
|
28165
|
+
// TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
|
|
28166
|
+
// TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
28167
|
+
// TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
28168
|
+
// TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
|
|
28178
28169
|
|
|
28179
28170
|
/**
|
|
28180
28171
|
* Profile for OpenAI provider
|
|
@@ -28242,9 +28233,21 @@
|
|
|
28242
28233
|
}
|
|
28243
28234
|
}
|
|
28244
28235
|
|
|
28236
|
+
/**
|
|
28237
|
+
* Constant for default knowledge source download timeout ms.
|
|
28238
|
+
*/
|
|
28245
28239
|
const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
|
|
28240
|
+
/**
|
|
28241
|
+
* Constant for default knowledge source upload timeout ms.
|
|
28242
|
+
*/
|
|
28246
28243
|
const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
|
|
28244
|
+
/**
|
|
28245
|
+
* Constant for vector store progress log interval min ms.
|
|
28246
|
+
*/
|
|
28247
28247
|
const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
|
|
28248
|
+
/**
|
|
28249
|
+
* Constant for vector store stall log threshold ms.
|
|
28250
|
+
*/
|
|
28248
28251
|
const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
|
|
28249
28252
|
/**
|
|
28250
28253
|
* Base class for OpenAI execution tools that need hosted vector stores.
|
|
@@ -29011,6 +29014,9 @@
|
|
|
29011
29014
|
}
|
|
29012
29015
|
}
|
|
29013
29016
|
|
|
29017
|
+
/**
|
|
29018
|
+
* Constant for default agent kit model name.
|
|
29019
|
+
*/
|
|
29014
29020
|
const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
|
|
29015
29021
|
/**
|
|
29016
29022
|
* Creates one structured log entry for streamed tool-call updates.
|
|
@@ -29054,6 +29060,9 @@
|
|
|
29054
29060
|
}
|
|
29055
29061
|
return 'COMPLETE';
|
|
29056
29062
|
}
|
|
29063
|
+
/**
|
|
29064
|
+
* Constant for default JSON schema name.
|
|
29065
|
+
*/
|
|
29057
29066
|
const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
|
|
29058
29067
|
/**
|
|
29059
29068
|
* File extensions considered image inputs when MIME type is missing or generic.
|
|
@@ -29209,6 +29218,7 @@
|
|
|
29209
29218
|
*
|
|
29210
29219
|
* @param responseFormat - The OpenAI `response_format` payload from the user request.
|
|
29211
29220
|
* @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
|
|
29221
|
+
*
|
|
29212
29222
|
* @private utility of Open AI
|
|
29213
29223
|
*/
|
|
29214
29224
|
function mapResponseFormatToAgentOutputType(responseFormat) {
|
|
@@ -29967,6 +29977,7 @@
|
|
|
29967
29977
|
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
29968
29978
|
*
|
|
29969
29979
|
* @deprecated Use `OpenAiAgentKitExecutionTools` instead.
|
|
29980
|
+
*
|
|
29970
29981
|
* @public exported from `@promptbook/openai`
|
|
29971
29982
|
*/
|
|
29972
29983
|
class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
|
|
@@ -30658,14 +30669,12 @@
|
|
|
30658
30669
|
* @private const of `OpenAiAssistantExecutionTools`
|
|
30659
30670
|
*/
|
|
30660
30671
|
const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
|
|
30661
|
-
|
|
30662
|
-
|
|
30663
|
-
|
|
30664
|
-
|
|
30665
|
-
|
|
30666
|
-
|
|
30667
|
-
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
30668
|
-
*/
|
|
30672
|
+
// TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
|
|
30673
|
+
// TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
|
|
30674
|
+
// TODO: [🧠][🧙♂️] Maybe there can be some wizard for those who want to use just OpenAI
|
|
30675
|
+
// TODO: Maybe make custom OpenAiError
|
|
30676
|
+
// TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
30677
|
+
// TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
30669
30678
|
|
|
30670
30679
|
/**
|
|
30671
30680
|
* Emits a progress update to signal assistant preparation before long setup work.
|
|
@@ -31142,10 +31151,8 @@
|
|
|
31142
31151
|
* Cache of OpenAI vector stores to avoid creating duplicates
|
|
31143
31152
|
*/
|
|
31144
31153
|
AgentLlmExecutionTools.vectorStoreCache = new Map();
|
|
31145
|
-
|
|
31146
|
-
|
|
31147
|
-
* TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
|
|
31148
|
-
*/
|
|
31154
|
+
// TODO: [🍚] Implement Destroyable pattern to free resources
|
|
31155
|
+
// TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
|
|
31149
31156
|
|
|
31150
31157
|
/**
|
|
31151
31158
|
* Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
|
|
@@ -31155,6 +31162,7 @@
|
|
|
31155
31162
|
*
|
|
31156
31163
|
* @param agentSource - The raw agent book source
|
|
31157
31164
|
* @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
|
|
31165
|
+
*
|
|
31158
31166
|
* @private Internal helper shared between self-learning and related features.
|
|
31159
31167
|
*/
|
|
31160
31168
|
function extractOpenTeacherInstructions(agentSource) {
|
|
@@ -31362,6 +31370,7 @@
|
|
|
31362
31370
|
*
|
|
31363
31371
|
* @param section Raw fragment from self-learning workflow.
|
|
31364
31372
|
* @returns Trimmed fragment, or empty string when nothing remains.
|
|
31373
|
+
*
|
|
31365
31374
|
* @private function of Agent
|
|
31366
31375
|
*/
|
|
31367
31376
|
function normalizeBookSection(section) {
|
|
@@ -31373,6 +31382,7 @@
|
|
|
31373
31382
|
* @param agentSource Current source.
|
|
31374
31383
|
* @param normalizedSection Candidate fragment expected to be normalized first.
|
|
31375
31384
|
* @returns True when appending would duplicate an existing fragment.
|
|
31385
|
+
*
|
|
31376
31386
|
* @private function of Agent
|
|
31377
31387
|
*/
|
|
31378
31388
|
function containsNormalizedBookSection(agentSource, normalizedSection) {
|
|
@@ -31387,6 +31397,7 @@
|
|
|
31387
31397
|
*
|
|
31388
31398
|
* @param responseFormat Prompt response format requirements
|
|
31389
31399
|
* @returns True when JSON schema mode is active
|
|
31400
|
+
*
|
|
31390
31401
|
* @private function of Agent
|
|
31391
31402
|
*/
|
|
31392
31403
|
function isJsonSchemaResponseFormat(responseFormat) {
|
|
@@ -31398,6 +31409,7 @@
|
|
|
31398
31409
|
* @param content Original agent answer content
|
|
31399
31410
|
* @param isJsonMode Whether the interaction requested JSON schema output
|
|
31400
31411
|
* @returns Agent answer, wrapped in a formatted JSON code block when possible
|
|
31412
|
+
*
|
|
31401
31413
|
* @private function of Agent
|
|
31402
31414
|
*/
|
|
31403
31415
|
function formatAgentMessageForJsonMode(content, isJsonMode) {
|
|
@@ -31423,6 +31435,7 @@
|
|
|
31423
31435
|
*
|
|
31424
31436
|
* @param content Text to parse as JSON
|
|
31425
31437
|
* @returns Parsed JSON value or null when parsing fails
|
|
31438
|
+
*
|
|
31426
31439
|
* @private function of Agent
|
|
31427
31440
|
*/
|
|
31428
31441
|
function tryParseJson(content) {
|
|
@@ -31438,6 +31451,7 @@
|
|
|
31438
31451
|
*
|
|
31439
31452
|
* @param options - Normalized sample parts.
|
|
31440
31453
|
* @returns Book-language sample section ready to append into agent source.
|
|
31454
|
+
*
|
|
31441
31455
|
* @private function of Agent
|
|
31442
31456
|
*/
|
|
31443
31457
|
function formatSelfLearningSample(options) {
|
|
@@ -31459,6 +31473,7 @@
|
|
|
31459
31473
|
*
|
|
31460
31474
|
* @param internalMessage Internal trace payload.
|
|
31461
31475
|
* @returns Book-language INTERNAL MESSAGE block.
|
|
31476
|
+
*
|
|
31462
31477
|
* @private function of Agent
|
|
31463
31478
|
*/
|
|
31464
31479
|
function formatInternalLearningMessage(internalMessage) {
|
|
@@ -31472,6 +31487,7 @@
|
|
|
31472
31487
|
*
|
|
31473
31488
|
* @param result Final chat result used in self-learning.
|
|
31474
31489
|
* @returns Internal payloads that capture request/response/tool-call context.
|
|
31490
|
+
*
|
|
31475
31491
|
* @private function of Agent
|
|
31476
31492
|
*/
|
|
31477
31493
|
function buildInternalLearningMessages(result) {
|
|
@@ -31501,6 +31517,7 @@
|
|
|
31501
31517
|
*
|
|
31502
31518
|
* @param toolCall Tool call produced during execution.
|
|
31503
31519
|
* @returns Sanitized and serializable tool-call payload.
|
|
31520
|
+
*
|
|
31504
31521
|
* @private function of Agent
|
|
31505
31522
|
*/
|
|
31506
31523
|
function sanitizeToolCallForLearning(toolCall) {
|
|
@@ -31520,6 +31537,7 @@
|
|
|
31520
31537
|
*
|
|
31521
31538
|
* @param payload Internal payload to serialize.
|
|
31522
31539
|
* @returns Pretty JSON string that can be embedded in BOOK.
|
|
31540
|
+
*
|
|
31523
31541
|
* @private function of Agent
|
|
31524
31542
|
*/
|
|
31525
31543
|
function stringifyInternalLearningPayload(payload) {
|
|
@@ -31569,6 +31587,7 @@
|
|
|
31569
31587
|
* Normalizes teacher commitments into trimmed, display-ready lines.
|
|
31570
31588
|
*
|
|
31571
31589
|
* @param commitments Raw teacher output
|
|
31590
|
+
*
|
|
31572
31591
|
* @private function of Agent
|
|
31573
31592
|
*/
|
|
31574
31593
|
function getTeacherCommitmentLines(commitments) {
|
|
@@ -31581,6 +31600,7 @@
|
|
|
31581
31600
|
* Summarizes teacher commitment lines into user-friendly counts for self-learning.
|
|
31582
31601
|
*
|
|
31583
31602
|
* @param lines Parsed teacher commitment lines
|
|
31603
|
+
*
|
|
31584
31604
|
* @private function of Agent
|
|
31585
31605
|
*/
|
|
31586
31606
|
function summarizeTeacherCommitmentLines(lines) {
|
|
@@ -31613,6 +31633,7 @@
|
|
|
31613
31633
|
* @param commitments Raw teacher commitments
|
|
31614
31634
|
* @param used Whether the teacher was invoked
|
|
31615
31635
|
* @returns Summary of learned commitments
|
|
31636
|
+
*
|
|
31616
31637
|
* @private function of Agent
|
|
31617
31638
|
*/
|
|
31618
31639
|
function buildTeacherSummary(commitments, used) {
|
|
@@ -31849,9 +31870,7 @@
|
|
|
31849
31870
|
return finalResult;
|
|
31850
31871
|
}
|
|
31851
31872
|
}
|
|
31852
|
-
|
|
31853
|
-
* TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
31854
|
-
*/
|
|
31873
|
+
// TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
31855
31874
|
|
|
31856
31875
|
/**
|
|
31857
31876
|
* Parses one failed remote agent response into a structured error.
|
|
@@ -32317,10 +32336,8 @@
|
|
|
32317
32336
|
return agentResult;
|
|
32318
32337
|
}
|
|
32319
32338
|
}
|
|
32320
|
-
|
|
32321
|
-
|
|
32322
|
-
* TODO: !!! Agent on remote server
|
|
32323
|
-
*/
|
|
32339
|
+
// TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
32340
|
+
// TODO: !!! Agent on remote server
|
|
32324
32341
|
|
|
32325
32342
|
var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
|
|
32326
32343
|
__proto__: null,
|