@promptbook/browser 0.112.0-34 → 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 +608 -585
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/types.index.d.ts +45 -45
- 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 +4 -8
- 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 +1 -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/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 +1 -0
- package/esm/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
- package/esm/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +7 -30
- 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/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 -1
- package/esm/src/cli/cli-commands/_boilerplate.d.ts +0 -2
- 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 -2
- package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -2
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -2
- package/esm/src/cli/cli-commands/coder/init.d.ts +0 -2
- package/esm/src/cli/cli-commands/coder/run.d.ts +1 -3
- package/esm/src/cli/cli-commands/coder/run.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/verify.d.ts +0 -2
- package/esm/src/cli/cli-commands/coder.d.ts +0 -2
- 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 -2
- package/esm/src/cli/cli-commands/list-scrapers.d.ts +0 -2
- package/esm/src/cli/cli-commands/login.d.ts +0 -5
- 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 -2
- 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 -2
- 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 -5
- 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 -1
- 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 -2
- 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 -2
- 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 -2
- package/esm/src/executables/apps/locatePandoc.d.ts +0 -2
- 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 -2
- package/esm/src/executables/platforms/locateAppOnLinux.d.ts +0 -2
- package/esm/src/executables/platforms/locateAppOnMacOs.d.ts +0 -2
- package/esm/src/executables/platforms/locateAppOnWindows.d.ts +0 -2
- 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 -3
- package/esm/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
- 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 -1
- package/esm/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- 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 -16
- 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 -1
- 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 -2
- 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 -2
- 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 -2
- 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 -1
- package/esm/src/llm-providers/vercel/playground/playground.d.ts +0 -2
- 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 -1
- package/esm/src/playground/permanent/agent-with-browser-playground.d.ts +0 -1
- package/esm/src/playground/permanent/error-handling-playground.d.ts +0 -1
- package/esm/src/playground/playground.d.ts +0 -2
- 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 -2
- package/esm/src/remote-server/startRemoteServer.d.ts +1 -15
- 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 -4
- package/esm/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
- package/esm/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -1
- 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 -2
- package/esm/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -2
- package/esm/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -2
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- 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 -2
- 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 -2
- package/esm/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -1
- package/esm/src/storage/local-storage/getLocalStorage.d.ts +0 -1
- package/esm/src/storage/local-storage/getSessionStorage.d.ts +0 -1
- 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 -1
- 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 +4 -2
- 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 +4 -2
- package/esm/src/types/Prompt.d.ts +1 -6
- package/esm/src/types/ReservedParameters_private.d.ts +2 -1
- package/esm/src/types/ToolCall.d.ts +0 -2
- package/esm/src/types/Updatable.d.ts +1 -3
- package/esm/src/types/string_agent_hash_private.d.ts +1 -1
- package/esm/src/types/string_agent_name.d.ts +32 -0
- package/esm/src/types/string_agent_name_in_book_private.d.ts +1 -1
- package/esm/src/types/string_agent_name_private.d.ts +2 -1
- package/esm/src/types/string_agent_permanent_id_private.d.ts +2 -1
- package/esm/src/types/string_business_category_name.d.ts +5 -0
- package/esm/src/types/string_business_category_name_private.d.ts +1 -1
- package/esm/src/types/string_char_private.d.ts +1 -1
- package/esm/src/types/string_chat_prompt_private.d.ts +1 -1
- package/esm/src/types/string_completion_prompt_private.d.ts +1 -1
- package/esm/src/types/string_markdown.d.ts +0 -1
- package/esm/src/types/string_mime_type_private.d.ts +1 -0
- package/esm/src/types/string_model_description_private.d.ts +1 -1
- package/esm/src/types/string_model_name.d.ts +7 -0
- package/esm/src/types/string_model_name_private.d.ts +1 -1
- package/esm/src/types/string_name.d.ts +31 -0
- package/esm/src/types/string_name_private.d.ts +1 -1
- package/esm/src/types/string_page.d.ts +15 -0
- package/esm/src/types/string_page_private.d.ts +1 -1
- package/esm/src/types/string_parameter_name.d.ts +11 -210
- package/esm/src/types/string_parameter_value_private.d.ts +1 -1
- package/esm/src/types/string_persona_description.d.ts +14 -0
- package/esm/src/types/string_persona_description_private.d.ts +1 -1
- package/esm/src/types/string_prompt.d.ts +49 -0
- package/esm/src/types/string_prompt_image_private.d.ts +1 -1
- package/esm/src/types/string_prompt_private.d.ts +1 -1
- package/esm/src/types/string_reserved_parameter_name_private.d.ts +1 -1
- package/esm/src/types/string_sha256.d.ts +2 -2
- package/esm/src/types/string_system_message_private.d.ts +1 -1
- package/esm/src/types/string_template_private.d.ts +1 -1
- package/esm/src/types/string_text_prompt_private.d.ts +1 -1
- package/esm/src/types/string_title.d.ts +8 -0
- package/esm/src/types/string_title_private.d.ts +1 -1
- package/esm/src/types/typeAliasEmoji.d.ts +0 -3
- package/esm/src/types/typeAliases.d.ts +0 -6
- 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 -2
- package/esm/src/utils/execCommand/$execCommands.d.ts +0 -1
- 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 -1
- package/esm/src/utils/files/$induceFileDownload.d.ts +0 -1
- package/esm/src/utils/files/ObjectUrl.d.ts +0 -1
- 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 -2
- package/esm/src/wizard/wizard.d.ts +1 -2
- package/package.json +2 -2
- package/umd/index.umd.js +608 -585
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/types.index.d.ts +45 -45
- 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 +4 -8
- 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 +1 -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/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 +1 -0
- package/umd/src/book-components/Chat/Chat/renderMemoryToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderPopupToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderRunBrowserToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderSearchToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderSelfLearningToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderTimeToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderTimeoutToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallClockPanel.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderToolCallProgressPlaceholder.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/renderWalletCredentialToolCallDetails.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/resolveSpeechRecognitionUiDescriptor.d.ts +30 -0
- package/umd/src/book-components/Chat/Chat/resolveToolCallProgressMessage.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/useChatInputAreaDictation.d.ts +7 -30
- 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/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 -1
- package/umd/src/cli/cli-commands/_boilerplate.d.ts +0 -2
- 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 -2
- package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +0 -2
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +0 -2
- package/umd/src/cli/cli-commands/coder/init.d.ts +0 -2
- package/umd/src/cli/cli-commands/coder/run.d.ts +1 -3
- package/umd/src/cli/cli-commands/coder/run.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/verify.d.ts +0 -2
- package/umd/src/cli/cli-commands/coder.d.ts +0 -2
- 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 -2
- package/umd/src/cli/cli-commands/list-scrapers.d.ts +0 -2
- package/umd/src/cli/cli-commands/login.d.ts +0 -5
- 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 -2
- 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 -2
- 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 -5
- 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 -1
- 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 -2
- 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 -2
- 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 -2
- package/umd/src/executables/apps/locatePandoc.d.ts +0 -2
- 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 -2
- package/umd/src/executables/platforms/locateAppOnLinux.d.ts +0 -2
- package/umd/src/executables/platforms/locateAppOnMacOs.d.ts +0 -2
- package/umd/src/executables/platforms/locateAppOnWindows.d.ts +0 -2
- 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 -3
- package/umd/src/execution/utils/$provideExecutionToolsForNode.d.ts +2 -4
- 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 -1
- package/umd/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
- 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 -16
- 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 -1
- 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 -2
- 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 -2
- 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 -2
- 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 -1
- package/umd/src/llm-providers/vercel/playground/playground.d.ts +0 -2
- 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 -1
- package/umd/src/playground/permanent/agent-with-browser-playground.d.ts +0 -1
- package/umd/src/playground/permanent/error-handling-playground.d.ts +0 -1
- package/umd/src/playground/playground.d.ts +0 -2
- 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 -2
- package/umd/src/remote-server/startRemoteServer.d.ts +1 -15
- 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 -4
- package/umd/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +0 -3
- package/umd/src/scrapers/_boilerplate/playground/boilerplate-scraper-playground.d.ts +0 -1
- 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 -2
- package/umd/src/scrapers/_common/register/$provideScrapersForNode.d.ts +1 -2
- package/umd/src/scrapers/_common/register/$provideScriptingForNode.d.ts +0 -2
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- 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 -1
- 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 -2
- 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 -2
- package/umd/src/storage/local-storage/getIndexedDbStorage.d.ts +0 -1
- package/umd/src/storage/local-storage/getLocalStorage.d.ts +0 -1
- package/umd/src/storage/local-storage/getSessionStorage.d.ts +0 -1
- 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 -1
- 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 +4 -2
- 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 +4 -2
- package/umd/src/types/Prompt.d.ts +1 -6
- package/umd/src/types/ReservedParameters_private.d.ts +2 -1
- package/umd/src/types/ToolCall.d.ts +0 -2
- package/umd/src/types/Updatable.d.ts +1 -3
- package/umd/src/types/string_agent_hash_private.d.ts +1 -1
- package/umd/src/types/string_agent_name.d.ts +32 -0
- package/umd/src/types/string_agent_name_in_book_private.d.ts +1 -1
- package/umd/src/types/string_agent_name_private.d.ts +2 -1
- package/umd/src/types/string_agent_permanent_id_private.d.ts +2 -1
- package/umd/src/types/string_business_category_name.d.ts +5 -0
- package/umd/src/types/string_business_category_name_private.d.ts +1 -1
- package/umd/src/types/string_char_private.d.ts +1 -1
- package/umd/src/types/string_chat_prompt_private.d.ts +1 -1
- package/umd/src/types/string_completion_prompt_private.d.ts +1 -1
- package/umd/src/types/string_markdown.d.ts +0 -1
- package/umd/src/types/string_mime_type_private.d.ts +1 -0
- package/umd/src/types/string_model_description_private.d.ts +1 -1
- package/umd/src/types/string_model_name.d.ts +7 -0
- package/umd/src/types/string_model_name_private.d.ts +1 -1
- package/umd/src/types/string_name.d.ts +31 -0
- package/umd/src/types/string_name_private.d.ts +1 -1
- package/umd/src/types/string_page.d.ts +15 -0
- package/umd/src/types/string_page_private.d.ts +1 -1
- package/umd/src/types/string_parameter_name.d.ts +11 -210
- package/umd/src/types/string_parameter_value_private.d.ts +1 -1
- package/umd/src/types/string_persona_description.d.ts +14 -0
- package/umd/src/types/string_persona_description_private.d.ts +1 -1
- package/umd/src/types/string_prompt.d.ts +49 -0
- package/umd/src/types/string_prompt_image_private.d.ts +1 -1
- package/umd/src/types/string_prompt_private.d.ts +1 -1
- package/umd/src/types/string_reserved_parameter_name_private.d.ts +1 -1
- package/umd/src/types/string_sha256.d.ts +2 -2
- package/umd/src/types/string_system_message_private.d.ts +1 -1
- package/umd/src/types/string_template_private.d.ts +1 -1
- package/umd/src/types/string_text_prompt_private.d.ts +1 -1
- package/umd/src/types/string_title.d.ts +8 -0
- package/umd/src/types/string_title_private.d.ts +1 -1
- package/umd/src/types/typeAliasEmoji.d.ts +0 -3
- package/umd/src/types/typeAliases.d.ts +0 -6
- 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 -2
- package/umd/src/utils/execCommand/$execCommands.d.ts +0 -1
- 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 -1
- package/umd/src/utils/files/$induceFileDownload.d.ts +0 -1
- package/umd/src/utils/files/ObjectUrl.d.ts +0 -1
- 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 -2
- package/umd/src/wizard/wizard.d.ts +1 -2
package/esm/index.es.js
CHANGED
|
@@ -29,7 +29,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
29
29
|
* @generated
|
|
30
30
|
* @see https://github.com/webgptorg/promptbook
|
|
31
31
|
*/
|
|
32
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
32
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
|
|
33
33
|
/**
|
|
34
34
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
35
35
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -39,16 +39,20 @@ const PROMPTBOOK_ENGINE_VERSION = '0.112.0-34';
|
|
|
39
39
|
* Trims string from all 4 sides
|
|
40
40
|
*
|
|
41
41
|
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
42
|
-
*
|
|
42
|
+
* Developed by same author @hejny as this package
|
|
43
43
|
*
|
|
44
|
-
* @public exported from `@promptbook/utils`
|
|
45
44
|
* @see https://github.com/hejny/spacetrim#usage
|
|
45
|
+
*
|
|
46
|
+
* @public exported from `@promptbook/utils`
|
|
46
47
|
*/
|
|
47
48
|
const spaceTrim = spaceTrim$1;
|
|
48
49
|
|
|
49
50
|
/**
|
|
50
|
-
*
|
|
51
|
+
* Class implementing take chain.
|
|
52
|
+
*
|
|
51
53
|
* @de
|
|
54
|
+
*
|
|
55
|
+
* @private util of `@promptbook/color`
|
|
52
56
|
*/
|
|
53
57
|
class TakeChain {
|
|
54
58
|
constructor(value) {
|
|
@@ -65,9 +69,9 @@ class TakeChain {
|
|
|
65
69
|
*
|
|
66
70
|
* @param {*} initialValue - The initial value.
|
|
67
71
|
* @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
|
|
72
|
+
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
68
73
|
*
|
|
69
74
|
* @private util of `@promptbook/color`
|
|
70
|
-
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
71
75
|
*/
|
|
72
76
|
function take(initialValue) {
|
|
73
77
|
if (initialValue instanceof TakeChain) {
|
|
@@ -245,9 +249,7 @@ const CSS_COLORS = {
|
|
|
245
249
|
yellow: '#ffff00',
|
|
246
250
|
yellowgreen: '#9acd32',
|
|
247
251
|
};
|
|
248
|
-
|
|
249
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
250
|
-
*/
|
|
252
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
251
253
|
|
|
252
254
|
/**
|
|
253
255
|
* Validates that a channel value is a valid number within the range of 0 to 255.
|
|
@@ -277,7 +279,13 @@ function checkChannelValue(channelName, value) {
|
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
281
|
|
|
282
|
+
/**
|
|
283
|
+
* Constant for short hex lengths.
|
|
284
|
+
*/
|
|
280
285
|
const SHORT_HEX_LENGTHS = new Set([3, 4]);
|
|
286
|
+
/**
|
|
287
|
+
* Constant for long hex lengths.
|
|
288
|
+
*/
|
|
281
289
|
const LONG_HEX_LENGTHS = new Set([6, 8]);
|
|
282
290
|
/**
|
|
283
291
|
* Parses a hex string into RGBA channel values.
|
|
@@ -310,6 +318,9 @@ function parseHexColor(hex) {
|
|
|
310
318
|
}
|
|
311
319
|
return throwInvalidHex();
|
|
312
320
|
}
|
|
321
|
+
/**
|
|
322
|
+
* Parses short hex channel.
|
|
323
|
+
*/
|
|
313
324
|
function parseShortHexChannel(char, onError) {
|
|
314
325
|
if (!char) {
|
|
315
326
|
return onError();
|
|
@@ -320,6 +331,9 @@ function parseShortHexChannel(char, onError) {
|
|
|
320
331
|
}
|
|
321
332
|
return parsed * 16;
|
|
322
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Parses long hex channel.
|
|
336
|
+
*/
|
|
323
337
|
function parseLongHexChannel(hex, start, onError) {
|
|
324
338
|
const segment = hex.substr(start, 2);
|
|
325
339
|
if (segment.length < 2) {
|
|
@@ -332,6 +346,9 @@ function parseLongHexChannel(hex, start, onError) {
|
|
|
332
346
|
return parsed;
|
|
333
347
|
}
|
|
334
348
|
|
|
349
|
+
/**
|
|
350
|
+
* Pattern matching hsl.
|
|
351
|
+
*/
|
|
335
352
|
const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
|
|
336
353
|
/**
|
|
337
354
|
* Parses an HSL string into RGBA channel values.
|
|
@@ -357,6 +374,9 @@ function parseHslColor(hsl) {
|
|
|
357
374
|
alpha: 255,
|
|
358
375
|
};
|
|
359
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Handles convert hsl to Rgb.
|
|
379
|
+
*/
|
|
360
380
|
function convertHslToRgb(h, s, l) {
|
|
361
381
|
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
362
382
|
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
@@ -395,7 +415,13 @@ function convertHslToRgb(h, s, l) {
|
|
|
395
415
|
};
|
|
396
416
|
}
|
|
397
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Pattern matching RGB.
|
|
420
|
+
*/
|
|
398
421
|
const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
422
|
+
/**
|
|
423
|
+
* Pattern matching rgba.
|
|
424
|
+
*/
|
|
399
425
|
const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
400
426
|
/**
|
|
401
427
|
* Parses an RGB string into RGBA channel values.
|
|
@@ -437,6 +463,9 @@ function parseRgbaColor(rgba) {
|
|
|
437
463
|
alpha: parseAlphaValue(match[4]),
|
|
438
464
|
};
|
|
439
465
|
}
|
|
466
|
+
/**
|
|
467
|
+
* Parses channel value.
|
|
468
|
+
*/
|
|
440
469
|
function parseChannelValue(value) {
|
|
441
470
|
if (value.endsWith('%')) {
|
|
442
471
|
const percent = parseFloat(value);
|
|
@@ -444,6 +473,9 @@ function parseChannelValue(value) {
|
|
|
444
473
|
}
|
|
445
474
|
return Math.round(parseFloat(value));
|
|
446
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* Parses alpha value.
|
|
478
|
+
*/
|
|
447
479
|
function parseAlphaValue(value) {
|
|
448
480
|
if (value.endsWith('%')) {
|
|
449
481
|
const percent = parseFloat(value);
|
|
@@ -456,8 +488,17 @@ function parseAlphaValue(value) {
|
|
|
456
488
|
return Math.round(parsed);
|
|
457
489
|
}
|
|
458
490
|
|
|
491
|
+
/**
|
|
492
|
+
* Pattern matching hsl regex.
|
|
493
|
+
*/
|
|
459
494
|
const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
|
|
495
|
+
/**
|
|
496
|
+
* Pattern matching RGB regex.
|
|
497
|
+
*/
|
|
460
498
|
const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
499
|
+
/**
|
|
500
|
+
* Pattern matching rgba regex.
|
|
501
|
+
*/
|
|
461
502
|
const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
462
503
|
/**
|
|
463
504
|
* Color object represents an RGB color with alpha channel
|
|
@@ -823,9 +864,7 @@ function hslToRgb(hue, saturation, lightness) {
|
|
|
823
864
|
}
|
|
824
865
|
return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
|
|
825
866
|
}
|
|
826
|
-
|
|
827
|
-
* TODO: Properly name all used internal variables
|
|
828
|
-
*/
|
|
867
|
+
// TODO: Properly name all used internal variables
|
|
829
868
|
|
|
830
869
|
/**
|
|
831
870
|
* Converts RGB values to HSL values
|
|
@@ -871,9 +910,7 @@ function rgbToHsl(red, green, blue) {
|
|
|
871
910
|
}
|
|
872
911
|
return [hue, saturation, lightness];
|
|
873
912
|
}
|
|
874
|
-
|
|
875
|
-
* TODO: Properly name all used internal variables
|
|
876
|
-
*/
|
|
913
|
+
// TODO: Properly name all used internal variables
|
|
877
914
|
|
|
878
915
|
/**
|
|
879
916
|
* Makes color transformer which lighten the given color
|
|
@@ -891,9 +928,7 @@ function lighten(amount) {
|
|
|
891
928
|
return Color.fromValues(r, g, b, alpha);
|
|
892
929
|
};
|
|
893
930
|
}
|
|
894
|
-
|
|
895
|
-
* TODO: Maybe implement by mix+hsl
|
|
896
|
-
*/
|
|
931
|
+
// TODO: Maybe implement by mix+hsl
|
|
897
932
|
|
|
898
933
|
/**
|
|
899
934
|
* Makes color transformer which saturate the given color
|
|
@@ -911,9 +946,7 @@ function saturate(amount) {
|
|
|
911
946
|
return Color.fromValues(r, g, b, alpha);
|
|
912
947
|
};
|
|
913
948
|
}
|
|
914
|
-
|
|
915
|
-
* TODO: Maybe implement by mix+hsl
|
|
916
|
-
*/
|
|
949
|
+
// TODO: Maybe implement by mix+hsl
|
|
917
950
|
|
|
918
951
|
/**
|
|
919
952
|
* Returns the same value that is passed as argument.
|
|
@@ -926,6 +959,7 @@ function saturate(amount) {
|
|
|
926
959
|
*
|
|
927
960
|
* @param value any values
|
|
928
961
|
* @returns the same values
|
|
962
|
+
*
|
|
929
963
|
* @private within the repository
|
|
930
964
|
*/
|
|
931
965
|
function just(value) {
|
|
@@ -1492,9 +1526,7 @@ class ActionCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1492
1526
|
return this.appendToSystemMessage(requirements, actionSection, '\n\n');
|
|
1493
1527
|
}
|
|
1494
1528
|
}
|
|
1495
|
-
|
|
1496
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1497
|
-
*/
|
|
1529
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1498
1530
|
|
|
1499
1531
|
/**
|
|
1500
1532
|
* Just says that the variable is not used but should be kept
|
|
@@ -1508,6 +1540,7 @@ class ActionCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1508
1540
|
*
|
|
1509
1541
|
* @param value any values
|
|
1510
1542
|
* @returns void
|
|
1543
|
+
*
|
|
1511
1544
|
* @private within the repository
|
|
1512
1545
|
*/
|
|
1513
1546
|
function keepUnused(...valuesToKeep) {
|
|
@@ -1577,9 +1610,7 @@ class ClosedCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1577
1610
|
};
|
|
1578
1611
|
}
|
|
1579
1612
|
}
|
|
1580
|
-
|
|
1581
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1582
|
-
*/
|
|
1613
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1583
1614
|
|
|
1584
1615
|
/**
|
|
1585
1616
|
* COMPONENT commitment definition
|
|
@@ -1638,9 +1669,7 @@ class ComponentCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1638
1669
|
return this.appendToSystemMessage(requirements, componentSection, '\n\n');
|
|
1639
1670
|
}
|
|
1640
1671
|
}
|
|
1641
|
-
|
|
1642
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1643
|
-
*/
|
|
1672
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1644
1673
|
|
|
1645
1674
|
/**
|
|
1646
1675
|
* DELETE commitment definition
|
|
@@ -1762,9 +1791,7 @@ class DeleteCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1762
1791
|
return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
|
|
1763
1792
|
}
|
|
1764
1793
|
}
|
|
1765
|
-
|
|
1766
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1767
|
-
*/
|
|
1794
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1768
1795
|
|
|
1769
1796
|
/**
|
|
1770
1797
|
* DICTIONARY commitment definition
|
|
@@ -1868,9 +1895,7 @@ class DictionaryCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1868
1895
|
};
|
|
1869
1896
|
}
|
|
1870
1897
|
}
|
|
1871
|
-
|
|
1872
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1873
|
-
*/
|
|
1898
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1874
1899
|
|
|
1875
1900
|
/**
|
|
1876
1901
|
* FORMAT commitment definition
|
|
@@ -1949,14 +1974,13 @@ class FormatCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
1949
1974
|
return this.appendToSystemMessage(requirements, formatSection, '\n\n');
|
|
1950
1975
|
}
|
|
1951
1976
|
}
|
|
1952
|
-
|
|
1953
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1954
|
-
*/
|
|
1977
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1955
1978
|
|
|
1956
1979
|
/**
|
|
1957
1980
|
* Orders JSON object by keys
|
|
1958
1981
|
*
|
|
1959
1982
|
* @returns The same type of object as the input re-ordered
|
|
1983
|
+
*
|
|
1960
1984
|
* @public exported from `@promptbook/utils`
|
|
1961
1985
|
*/
|
|
1962
1986
|
function orderJson(options) {
|
|
@@ -1975,6 +1999,7 @@ function orderJson(options) {
|
|
|
1975
1999
|
* Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
|
|
1976
2000
|
*
|
|
1977
2001
|
* @returns The same object as the input, but deeply frozen
|
|
2002
|
+
*
|
|
1978
2003
|
* @public exported from `@promptbook/utils`
|
|
1979
2004
|
*/
|
|
1980
2005
|
function $deepFreeze(objectValue) {
|
|
@@ -1991,9 +2016,7 @@ function $deepFreeze(objectValue) {
|
|
|
1991
2016
|
Object.freeze(objectValue);
|
|
1992
2017
|
return objectValue;
|
|
1993
2018
|
}
|
|
1994
|
-
|
|
1995
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1996
|
-
*/
|
|
2019
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1997
2020
|
|
|
1998
2021
|
/**
|
|
1999
2022
|
* This error type indicates that somewhere in the code non-Error object was thrown and it was wrapped into the `WrappedError`
|
|
@@ -2061,6 +2084,7 @@ function assertsError(whatWasThrown) {
|
|
|
2061
2084
|
* - And much more...
|
|
2062
2085
|
*
|
|
2063
2086
|
* @throws UnexpectedError if the value is not serializable as JSON
|
|
2087
|
+
*
|
|
2064
2088
|
* @public exported from `@promptbook/utils`
|
|
2065
2089
|
*/
|
|
2066
2090
|
function checkSerializableAsJson(options) {
|
|
@@ -2175,11 +2199,9 @@ function checkSerializableAsJson(options) {
|
|
|
2175
2199
|
`));
|
|
2176
2200
|
}
|
|
2177
2201
|
}
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
2182
|
-
*/
|
|
2202
|
+
// TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
|
|
2203
|
+
// TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
2204
|
+
// Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
2183
2205
|
|
|
2184
2206
|
/**
|
|
2185
2207
|
* Creates a deep clone of the given object
|
|
@@ -2189,6 +2211,7 @@ function checkSerializableAsJson(options) {
|
|
|
2189
2211
|
*
|
|
2190
2212
|
* @param objectValue The object to clone.
|
|
2191
2213
|
* @returns A deep, writable clone of the input object.
|
|
2214
|
+
*
|
|
2192
2215
|
* @public exported from `@promptbook/utils`
|
|
2193
2216
|
*/
|
|
2194
2217
|
function deepClone(objectValue) {
|
|
@@ -2205,9 +2228,7 @@ function deepClone(objectValue) {
|
|
|
2205
2228
|
> return Object.assign({}, objectValue);
|
|
2206
2229
|
*/
|
|
2207
2230
|
}
|
|
2208
|
-
|
|
2209
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2210
|
-
*/
|
|
2231
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2211
2232
|
|
|
2212
2233
|
/**
|
|
2213
2234
|
* Utility to export a JSON object from a function
|
|
@@ -2220,6 +2241,7 @@ function deepClone(objectValue) {
|
|
|
2220
2241
|
* Note: This function does not mutates the given object
|
|
2221
2242
|
*
|
|
2222
2243
|
* @returns The same type of object as the input but read-only and re-ordered
|
|
2244
|
+
*
|
|
2223
2245
|
* @public exported from `@promptbook/utils`
|
|
2224
2246
|
*/
|
|
2225
2247
|
function exportJson(options) {
|
|
@@ -2239,9 +2261,7 @@ function exportJson(options) {
|
|
|
2239
2261
|
$deepFreeze(orderedValue);
|
|
2240
2262
|
return orderedValue;
|
|
2241
2263
|
}
|
|
2242
|
-
|
|
2243
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2244
|
-
*/
|
|
2264
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
2245
2265
|
|
|
2246
2266
|
/**
|
|
2247
2267
|
* Order of keys in the pipeline JSON
|
|
@@ -2352,9 +2372,7 @@ const LIMITS = {
|
|
|
2352
2372
|
*/
|
|
2353
2373
|
SHORT_NAME_LENGTH: 6,
|
|
2354
2374
|
};
|
|
2355
|
-
|
|
2356
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2357
|
-
*/
|
|
2375
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2358
2376
|
|
|
2359
2377
|
/**
|
|
2360
2378
|
* Normalizes a given text to camelCase format.
|
|
@@ -2366,6 +2384,7 @@ const LIMITS = {
|
|
|
2366
2384
|
* @returns The camelCase formatted string.
|
|
2367
2385
|
* @example 'helloWorld'
|
|
2368
2386
|
* @example 'iLovePromptbook'
|
|
2387
|
+
*
|
|
2369
2388
|
* @public exported from `@promptbook/utils`
|
|
2370
2389
|
*/
|
|
2371
2390
|
function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
|
|
@@ -2406,14 +2425,13 @@ function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
|
|
|
2406
2425
|
}
|
|
2407
2426
|
return normalizedName;
|
|
2408
2427
|
}
|
|
2409
|
-
|
|
2410
|
-
* TODO: [🌺] Use some intermediate util splitWords
|
|
2411
|
-
*/
|
|
2428
|
+
// TODO: [🌺] Use some intermediate util splitWords
|
|
2412
2429
|
|
|
2413
2430
|
/**
|
|
2414
2431
|
* Tests if given string is valid file path.
|
|
2415
2432
|
*
|
|
2416
2433
|
* Note: This does not check if the file exists only if the path is valid
|
|
2434
|
+
*
|
|
2417
2435
|
* @public exported from `@promptbook/utils`
|
|
2418
2436
|
*/
|
|
2419
2437
|
function isValidFilePath(filename) {
|
|
@@ -2462,9 +2480,7 @@ function isValidFilePath(filename) {
|
|
|
2462
2480
|
}
|
|
2463
2481
|
return false;
|
|
2464
2482
|
}
|
|
2465
|
-
|
|
2466
|
-
* TODO: [🍏] Implement for MacOs
|
|
2467
|
-
*/
|
|
2483
|
+
// TODO: [🍏] Implement for MacOs
|
|
2468
2484
|
|
|
2469
2485
|
/**
|
|
2470
2486
|
* Tests if given string is valid URL.
|
|
@@ -2497,6 +2513,9 @@ function isValidUrl(url) {
|
|
|
2497
2513
|
}
|
|
2498
2514
|
}
|
|
2499
2515
|
|
|
2516
|
+
/**
|
|
2517
|
+
* Collection of default diacritics removal map.
|
|
2518
|
+
*/
|
|
2500
2519
|
const defaultDiacriticsRemovalMap = [
|
|
2501
2520
|
{
|
|
2502
2521
|
base: 'A',
|
|
@@ -2748,6 +2767,7 @@ for (let i = 0; i < defaultDiacriticsRemovalMap.length; i++) {
|
|
|
2748
2767
|
*
|
|
2749
2768
|
* @param input The string containing diacritics to be normalized.
|
|
2750
2769
|
* @returns The string with diacritics removed or normalized.
|
|
2770
|
+
*
|
|
2751
2771
|
* @public exported from `@promptbook/utils`
|
|
2752
2772
|
*/
|
|
2753
2773
|
function removeDiacritics(input) {
|
|
@@ -2756,9 +2776,7 @@ function removeDiacritics(input) {
|
|
|
2756
2776
|
return DIACRITIC_VARIANTS_LETTERS[character] || character;
|
|
2757
2777
|
});
|
|
2758
2778
|
}
|
|
2759
|
-
|
|
2760
|
-
* TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
|
|
2761
|
-
*/
|
|
2779
|
+
// TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
|
|
2762
2780
|
|
|
2763
2781
|
/**
|
|
2764
2782
|
* Converts a given text to kebab-case format.
|
|
@@ -2769,6 +2787,7 @@ function removeDiacritics(input) {
|
|
|
2769
2787
|
* @returns The kebab-case formatted string.
|
|
2770
2788
|
* @example 'hello-world'
|
|
2771
2789
|
* @example 'i-love-promptbook'
|
|
2790
|
+
*
|
|
2772
2791
|
* @public exported from `@promptbook/utils`
|
|
2773
2792
|
*/
|
|
2774
2793
|
function normalizeToKebabCase(text) {
|
|
@@ -2809,9 +2828,7 @@ function normalizeToKebabCase(text) {
|
|
|
2809
2828
|
normalizedName = normalizedName.replace(/-$/, '');
|
|
2810
2829
|
return normalizedName;
|
|
2811
2830
|
}
|
|
2812
|
-
|
|
2813
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2814
|
-
*/
|
|
2831
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
2815
2832
|
|
|
2816
2833
|
/**
|
|
2817
2834
|
* Removes emojis from a string and fix whitespaces
|
|
@@ -2820,6 +2837,7 @@ function normalizeToKebabCase(text) {
|
|
|
2820
2837
|
*
|
|
2821
2838
|
* @param text with emojis
|
|
2822
2839
|
* @returns text without emojis
|
|
2840
|
+
*
|
|
2823
2841
|
* @public exported from `@promptbook/utils`
|
|
2824
2842
|
*/
|
|
2825
2843
|
function removeEmojis(text) {
|
|
@@ -2839,6 +2857,7 @@ function removeEmojis(text) {
|
|
|
2839
2857
|
* @param value The title string to be converted to a name.
|
|
2840
2858
|
* @returns A normalized name derived from the input title.
|
|
2841
2859
|
* @example 'Hello World!' -> 'hello-world'
|
|
2860
|
+
*
|
|
2842
2861
|
* @public exported from `@promptbook/utils`
|
|
2843
2862
|
*/
|
|
2844
2863
|
function titleToName(value) {
|
|
@@ -2938,9 +2957,7 @@ class DatabaseError extends Error {
|
|
|
2938
2957
|
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
2939
2958
|
}
|
|
2940
2959
|
}
|
|
2941
|
-
|
|
2942
|
-
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
2943
|
-
*/
|
|
2960
|
+
// TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
2944
2961
|
|
|
2945
2962
|
/**
|
|
2946
2963
|
* This error type indicates that you try to use a feature that is not available in the current environment
|
|
@@ -2958,10 +2975,11 @@ class EnvironmentMismatchError extends Error {
|
|
|
2958
2975
|
/**
|
|
2959
2976
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
2960
2977
|
*
|
|
2961
|
-
* @public exported from `@promptbook/core`
|
|
2962
2978
|
* Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
|
|
2963
2979
|
* Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
|
|
2964
2980
|
* Note: This is a kindof subtype of PipelineExecutionError
|
|
2981
|
+
*
|
|
2982
|
+
* @public exported from `@promptbook/core`
|
|
2965
2983
|
*/
|
|
2966
2984
|
class ExpectError extends Error {
|
|
2967
2985
|
constructor(message) {
|
|
@@ -3076,9 +3094,7 @@ class ParseError extends Error {
|
|
|
3076
3094
|
Object.setPrototypeOf(this, ParseError.prototype);
|
|
3077
3095
|
}
|
|
3078
3096
|
}
|
|
3079
|
-
|
|
3080
|
-
* TODO: Maybe split `ParseError` and `ApplyError`
|
|
3081
|
-
*/
|
|
3097
|
+
// TODO: Maybe split `ParseError` and `ApplyError`
|
|
3082
3098
|
|
|
3083
3099
|
/**
|
|
3084
3100
|
* Generates random token
|
|
@@ -3086,16 +3102,15 @@ class ParseError extends Error {
|
|
|
3086
3102
|
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
3087
3103
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
3088
3104
|
*
|
|
3089
|
-
* @private internal helper function
|
|
3090
3105
|
* @returns secure random token
|
|
3106
|
+
*
|
|
3107
|
+
* @private internal helper function
|
|
3091
3108
|
*/
|
|
3092
3109
|
function $randomToken(randomness) {
|
|
3093
3110
|
return randomBytes(randomness).toString('hex');
|
|
3094
3111
|
}
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
3098
|
-
*/
|
|
3112
|
+
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
3113
|
+
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
3099
3114
|
|
|
3100
3115
|
/**
|
|
3101
3116
|
* This error indicates errors during the execution of the pipeline
|
|
@@ -3112,9 +3127,7 @@ class PipelineExecutionError extends Error {
|
|
|
3112
3127
|
Object.setPrototypeOf(this, PipelineExecutionError.prototype);
|
|
3113
3128
|
}
|
|
3114
3129
|
}
|
|
3115
|
-
|
|
3116
|
-
* TODO: [🧠][🌂] Add id to all errors
|
|
3117
|
-
*/
|
|
3130
|
+
// TODO: [🧠][🌂] Add id to all errors
|
|
3118
3131
|
|
|
3119
3132
|
/**
|
|
3120
3133
|
* This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
|
|
@@ -3216,9 +3229,7 @@ const ALL_ERRORS = {
|
|
|
3216
3229
|
...PROMPTBOOK_ERRORS,
|
|
3217
3230
|
...COMMON_JAVASCRIPT_ERRORS,
|
|
3218
3231
|
};
|
|
3219
|
-
|
|
3220
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3221
|
-
*/
|
|
3232
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3222
3233
|
|
|
3223
3234
|
/**
|
|
3224
3235
|
* Deserializes the error object
|
|
@@ -3281,8 +3292,9 @@ function serializeError(error) {
|
|
|
3281
3292
|
* @param array - Array to iterate over
|
|
3282
3293
|
* @param options - Options for the function
|
|
3283
3294
|
* @param callbackfunction - Function to call for each item
|
|
3284
|
-
* @public exported from `@promptbook/utils`
|
|
3285
3295
|
* @deprecated [🪂] Use queues instead
|
|
3296
|
+
*
|
|
3297
|
+
* @public exported from `@promptbook/utils`
|
|
3286
3298
|
*/
|
|
3287
3299
|
async function forEachAsync(array, options, callbackfunction) {
|
|
3288
3300
|
const { maxParallelCount = Infinity } = options;
|
|
@@ -3441,8 +3453,8 @@ function numberToString(value) {
|
|
|
3441
3453
|
* This is useful and used in the `templateParameters` function
|
|
3442
3454
|
*
|
|
3443
3455
|
* Note: This function is not just calling `toString` method
|
|
3444
|
-
*
|
|
3445
|
-
*
|
|
3456
|
+
* It's more complex and can handle this conversion specifically for LLM models
|
|
3457
|
+
* See `VALUE_STRINGS`
|
|
3446
3458
|
*
|
|
3447
3459
|
* Note: There are 2 similar functions
|
|
3448
3460
|
* - `valueToString` converts value to string for LLM models as human-readable string
|
|
@@ -3493,12 +3505,13 @@ function valueToString(value) {
|
|
|
3493
3505
|
* Replaces parameters in template with values from parameters object
|
|
3494
3506
|
*
|
|
3495
3507
|
* Note: This function is not places strings into string,
|
|
3496
|
-
*
|
|
3508
|
+
* It's more complex and can handle this operation specifically for LLM models
|
|
3497
3509
|
*
|
|
3498
3510
|
* @param template the template with parameters in {curly} braces
|
|
3499
3511
|
* @param parameters the object with parameters
|
|
3500
3512
|
* @returns the template with replaced parameters
|
|
3501
3513
|
* @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
|
|
3514
|
+
*
|
|
3502
3515
|
* @public exported from `@promptbook/utils`
|
|
3503
3516
|
*/
|
|
3504
3517
|
function templateParameters(template, parameters) {
|
|
@@ -3582,6 +3595,7 @@ const PROMPT_PARAMETER_ESCAPE_WITH_BRACES_PATTERN = /[{}$`]/g;
|
|
|
3582
3595
|
* Normalizes a JSON string so it can be safely rendered without double escaping.
|
|
3583
3596
|
*
|
|
3584
3597
|
* @param value Candidate JSON string.
|
|
3598
|
+
*
|
|
3585
3599
|
* @private function of ParameterEscaping
|
|
3586
3600
|
*/
|
|
3587
3601
|
function normalizeJsonString(value) {
|
|
@@ -3596,6 +3610,7 @@ function normalizeJsonString(value) {
|
|
|
3596
3610
|
* Hides brackets in a string to avoid confusion with template parameters.
|
|
3597
3611
|
*
|
|
3598
3612
|
* @param value Input string with literal brackets.
|
|
3613
|
+
*
|
|
3599
3614
|
* @private function of ParameterEscaping
|
|
3600
3615
|
*/
|
|
3601
3616
|
function hideBrackets(value) {
|
|
@@ -3605,6 +3620,7 @@ function hideBrackets(value) {
|
|
|
3605
3620
|
* Restores hidden brackets.
|
|
3606
3621
|
*
|
|
3607
3622
|
* @param value String with hidden brackets.
|
|
3623
|
+
*
|
|
3608
3624
|
* @private function of ParameterEscaping
|
|
3609
3625
|
*/
|
|
3610
3626
|
function restoreBrackets(value) {
|
|
@@ -3614,6 +3630,7 @@ function restoreBrackets(value) {
|
|
|
3614
3630
|
* Decides whether a parameter can be inlined safely.
|
|
3615
3631
|
*
|
|
3616
3632
|
* @param value Parameter rendered as string.
|
|
3633
|
+
*
|
|
3617
3634
|
* @private function of ParameterEscaping
|
|
3618
3635
|
*/
|
|
3619
3636
|
function shouldInlineParameterValue(value) {
|
|
@@ -3627,6 +3644,7 @@ function shouldInlineParameterValue(value) {
|
|
|
3627
3644
|
*
|
|
3628
3645
|
* @param value Parameter value to escape.
|
|
3629
3646
|
* @param options Escape options for additional characters.
|
|
3647
|
+
*
|
|
3630
3648
|
* @private function of ParameterEscaping
|
|
3631
3649
|
*/
|
|
3632
3650
|
function escapePromptParameterValue(value, options) {
|
|
@@ -3652,6 +3670,7 @@ const ParameterEscaping = {
|
|
|
3652
3670
|
* Builds numeric parameter names (1, 2, ...).
|
|
3653
3671
|
*
|
|
3654
3672
|
* @param index Zero-based parameter index.
|
|
3673
|
+
*
|
|
3655
3674
|
* @private function of ParameterNaming
|
|
3656
3675
|
*/
|
|
3657
3676
|
function buildNumericParameterName(index) {
|
|
@@ -3661,6 +3680,7 @@ function buildNumericParameterName(index) {
|
|
|
3661
3680
|
* Builds alphabetic parameter names (a, b, ..., aa).
|
|
3662
3681
|
*
|
|
3663
3682
|
* @param index Zero-based parameter index.
|
|
3683
|
+
*
|
|
3664
3684
|
* @private function of ParameterNaming
|
|
3665
3685
|
*/
|
|
3666
3686
|
function buildAlphabeticParameterName(index) {
|
|
@@ -3677,6 +3697,7 @@ function buildAlphabeticParameterName(index) {
|
|
|
3677
3697
|
* Converts a positive integer into a Roman numeral string.
|
|
3678
3698
|
*
|
|
3679
3699
|
* @param value Positive integer value.
|
|
3700
|
+
*
|
|
3680
3701
|
* @private function of ParameterNaming
|
|
3681
3702
|
*/
|
|
3682
3703
|
function toRomanNumeral(value) {
|
|
@@ -3709,6 +3730,7 @@ function toRomanNumeral(value) {
|
|
|
3709
3730
|
* Builds Roman numeral parameter names (I, II, ...).
|
|
3710
3731
|
*
|
|
3711
3732
|
* @param index Zero-based parameter index.
|
|
3733
|
+
*
|
|
3712
3734
|
* @private function of ParameterNaming
|
|
3713
3735
|
*/
|
|
3714
3736
|
function buildRomanParameterName(index) {
|
|
@@ -3719,6 +3741,7 @@ function buildRomanParameterName(index) {
|
|
|
3719
3741
|
*
|
|
3720
3742
|
* @param prefix Prefix string.
|
|
3721
3743
|
* @param builder Base builder function.
|
|
3744
|
+
*
|
|
3722
3745
|
* @private function of ParameterNaming
|
|
3723
3746
|
*/
|
|
3724
3747
|
function buildPrefixedParameterName(prefix, builder) {
|
|
@@ -3740,6 +3763,7 @@ const PARAMETER_NAME_STRATEGIES = [
|
|
|
3740
3763
|
* Collects bracketed tokens from parameter values to avoid placeholder collisions.
|
|
3741
3764
|
*
|
|
3742
3765
|
* @param values Parameter values to scan.
|
|
3766
|
+
*
|
|
3743
3767
|
* @private function of ParameterNaming
|
|
3744
3768
|
*/
|
|
3745
3769
|
function collectBracketedParameterTokens(values) {
|
|
@@ -3760,6 +3784,7 @@ function collectBracketedParameterTokens(values) {
|
|
|
3760
3784
|
* Builds placeholder names while avoiding collisions with parameter content.
|
|
3761
3785
|
*
|
|
3762
3786
|
* @param values Parameter values to scan for conflicting tokens.
|
|
3787
|
+
*
|
|
3763
3788
|
* @private function of ParameterNaming
|
|
3764
3789
|
*/
|
|
3765
3790
|
function buildParameterNames(values) {
|
|
@@ -3790,6 +3815,7 @@ const ParameterNaming = {
|
|
|
3790
3815
|
* Formats the placeholder used in the prompt body for a parameter.
|
|
3791
3816
|
*
|
|
3792
3817
|
* @param name Parameter placeholder name.
|
|
3818
|
+
*
|
|
3793
3819
|
* @private function of ParameterSection
|
|
3794
3820
|
*/
|
|
3795
3821
|
function formatParameterPlaceholder(name) {
|
|
@@ -3799,6 +3825,7 @@ function formatParameterPlaceholder(name) {
|
|
|
3799
3825
|
* Formats a single line entry for structured parameters.
|
|
3800
3826
|
*
|
|
3801
3827
|
* @param item Parameter entry data.
|
|
3828
|
+
*
|
|
3802
3829
|
* @private function of ParameterSection
|
|
3803
3830
|
*/
|
|
3804
3831
|
function formatParameterListItem(item) {
|
|
@@ -3810,6 +3837,7 @@ function formatParameterListItem(item) {
|
|
|
3810
3837
|
* Builds the structured parameters section appended to the prompt.
|
|
3811
3838
|
*
|
|
3812
3839
|
* @param items Parameter entries to include.
|
|
3840
|
+
*
|
|
3813
3841
|
* @private function of ParameterSection
|
|
3814
3842
|
*/
|
|
3815
3843
|
function buildParametersSection(items) {
|
|
@@ -3885,6 +3913,7 @@ function isPromptString(value) {
|
|
|
3885
3913
|
* @param strings
|
|
3886
3914
|
* @param values
|
|
3887
3915
|
* @returns prompt content wrapped as a PromptString
|
|
3916
|
+
*
|
|
3888
3917
|
* @public exported from `@promptbook/utils`
|
|
3889
3918
|
*/
|
|
3890
3919
|
function prompt(strings, ...values) {
|
|
@@ -3969,11 +3998,9 @@ function prompt(strings, ...values) {
|
|
|
3969
3998
|
}
|
|
3970
3999
|
return new PromptString(pipelineString);
|
|
3971
4000
|
}
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3976
|
-
*/
|
|
4001
|
+
// TODO: Maybe split into multiple files
|
|
4002
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
4003
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3977
4004
|
|
|
3978
4005
|
/**
|
|
3979
4006
|
* @@@
|
|
@@ -4010,9 +4037,7 @@ function attachClientVersionHeader(headers) {
|
|
|
4010
4037
|
[CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
|
|
4011
4038
|
};
|
|
4012
4039
|
}
|
|
4013
|
-
|
|
4014
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4015
|
-
*/
|
|
4040
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4016
4041
|
|
|
4017
4042
|
/**
|
|
4018
4043
|
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
@@ -4029,9 +4054,7 @@ function $isRunningInBrowser() {
|
|
|
4029
4054
|
return false;
|
|
4030
4055
|
}
|
|
4031
4056
|
}
|
|
4032
|
-
|
|
4033
|
-
* TODO: [🎺]
|
|
4034
|
-
*/
|
|
4057
|
+
// TODO: [🎺]
|
|
4035
4058
|
|
|
4036
4059
|
/**
|
|
4037
4060
|
* Detects if the code is running in a web worker
|
|
@@ -4051,9 +4074,7 @@ function $isRunningInWebWorker() {
|
|
|
4051
4074
|
return false;
|
|
4052
4075
|
}
|
|
4053
4076
|
}
|
|
4054
|
-
|
|
4055
|
-
* TODO: [🎺]
|
|
4056
|
-
*/
|
|
4077
|
+
// TODO: [🎺]
|
|
4057
4078
|
|
|
4058
4079
|
/**
|
|
4059
4080
|
* Number of characters per standard line with 11pt Arial font size.
|
|
@@ -4067,10 +4088,8 @@ const CHARACTERS_PER_STANDARD_LINE = 63;
|
|
|
4067
4088
|
* @public exported from `@promptbook/utils`
|
|
4068
4089
|
*/
|
|
4069
4090
|
const LINES_PER_STANDARD_PAGE = 44;
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4073
|
-
*/
|
|
4091
|
+
// TODO: [🧠] Should be this `constants.ts` or `config.ts`?
|
|
4092
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4074
4093
|
|
|
4075
4094
|
/**
|
|
4076
4095
|
* Counts number of characters in the text
|
|
@@ -4086,10 +4105,8 @@ function countCharacters(text) {
|
|
|
4086
4105
|
text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
|
|
4087
4106
|
return text.length;
|
|
4088
4107
|
}
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4092
|
-
*/
|
|
4108
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4109
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4093
4110
|
|
|
4094
4111
|
/**
|
|
4095
4112
|
* Counts number of lines in the text
|
|
@@ -4107,10 +4124,8 @@ function countLines(text) {
|
|
|
4107
4124
|
const lines = text.split(/\r?\n/);
|
|
4108
4125
|
return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
|
|
4109
4126
|
}
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4113
|
-
*/
|
|
4127
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4128
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4114
4129
|
|
|
4115
4130
|
/**
|
|
4116
4131
|
* Counts number of pages in the text
|
|
@@ -4122,10 +4137,8 @@ function countLines(text) {
|
|
|
4122
4137
|
function countPages(text) {
|
|
4123
4138
|
return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
|
|
4124
4139
|
}
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4128
|
-
*/
|
|
4140
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4141
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4129
4142
|
|
|
4130
4143
|
/**
|
|
4131
4144
|
* Counts number of paragraphs in the text
|
|
@@ -4135,10 +4148,8 @@ function countPages(text) {
|
|
|
4135
4148
|
function countParagraphs(text) {
|
|
4136
4149
|
return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
|
|
4137
4150
|
}
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4141
|
-
*/
|
|
4151
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4152
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4142
4153
|
|
|
4143
4154
|
/**
|
|
4144
4155
|
* Split text into sentences
|
|
@@ -4156,10 +4167,8 @@ function splitIntoSentences(text) {
|
|
|
4156
4167
|
function countSentences(text) {
|
|
4157
4168
|
return splitIntoSentences(text).length;
|
|
4158
4169
|
}
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4162
|
-
*/
|
|
4170
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4171
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4163
4172
|
|
|
4164
4173
|
/**
|
|
4165
4174
|
* Counts number of words in the text
|
|
@@ -4173,11 +4182,9 @@ function countWords(text) {
|
|
|
4173
4182
|
text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
|
|
4174
4183
|
return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
|
|
4175
4184
|
}
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
* TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
4180
|
-
*/
|
|
4185
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4186
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4187
|
+
// TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
4181
4188
|
|
|
4182
4189
|
/**
|
|
4183
4190
|
* Index of all counter functions
|
|
@@ -4192,10 +4199,8 @@ const CountUtils = {
|
|
|
4192
4199
|
LINES: countLines,
|
|
4193
4200
|
PAGES: countPages,
|
|
4194
4201
|
};
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4198
|
-
*/
|
|
4202
|
+
// TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
|
|
4203
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4199
4204
|
|
|
4200
4205
|
/**
|
|
4201
4206
|
* Computes SHA-256 hash of the given object
|
|
@@ -4205,9 +4210,7 @@ const CountUtils = {
|
|
|
4205
4210
|
function computeHash(value) {
|
|
4206
4211
|
return SHA256(hexEncoder.parse(spaceTrim$1(valueToString(value)))).toString( /* hex */);
|
|
4207
4212
|
}
|
|
4208
|
-
|
|
4209
|
-
* TODO: [🥬][🥬] Use this ACRY
|
|
4210
|
-
*/
|
|
4213
|
+
// TODO: [🥬][🥬] Use this ACRY
|
|
4211
4214
|
|
|
4212
4215
|
/**
|
|
4213
4216
|
* Makes first letter of a string uppercase
|
|
@@ -4384,6 +4387,9 @@ const ADJECTIVES$1 = [
|
|
|
4384
4387
|
'prvotní',
|
|
4385
4388
|
'hbitý',
|
|
4386
4389
|
];
|
|
4390
|
+
/**
|
|
4391
|
+
* Collection of nouns.
|
|
4392
|
+
*/
|
|
4387
4393
|
const NOUNS$1 = [
|
|
4388
4394
|
'jablko',
|
|
4389
4395
|
'nebe',
|
|
@@ -4597,6 +4603,9 @@ const NOUNS$1 = [
|
|
|
4597
4603
|
'okno',
|
|
4598
4604
|
'chodba',
|
|
4599
4605
|
];
|
|
4606
|
+
/**
|
|
4607
|
+
* Collection of verbs.
|
|
4608
|
+
*/
|
|
4600
4609
|
const VERBS$1 = [
|
|
4601
4610
|
'skáče',
|
|
4602
4611
|
'tančí',
|
|
@@ -4769,9 +4778,7 @@ const LINGUISTIC_HASH_WORD_LISTS_CS = {
|
|
|
4769
4778
|
noun: NOUNS$1,
|
|
4770
4779
|
verb: VERBS$1,
|
|
4771
4780
|
};
|
|
4772
|
-
|
|
4773
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4774
|
-
*/
|
|
4781
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4775
4782
|
|
|
4776
4783
|
/**
|
|
4777
4784
|
* @@@
|
|
@@ -5027,6 +5034,9 @@ const ADJECTIVES = [
|
|
|
5027
5034
|
'macro',
|
|
5028
5035
|
'mini',
|
|
5029
5036
|
];
|
|
5037
|
+
/**
|
|
5038
|
+
* Collection of nouns.
|
|
5039
|
+
*/
|
|
5030
5040
|
const NOUNS = [
|
|
5031
5041
|
'apple',
|
|
5032
5042
|
'sky',
|
|
@@ -5266,6 +5276,9 @@ const NOUNS = [
|
|
|
5266
5276
|
'roof',
|
|
5267
5277
|
'floor',
|
|
5268
5278
|
];
|
|
5279
|
+
/**
|
|
5280
|
+
* Collection of verbs.
|
|
5281
|
+
*/
|
|
5269
5282
|
const VERBS = [
|
|
5270
5283
|
'jumping',
|
|
5271
5284
|
'dancing',
|
|
@@ -5461,9 +5474,7 @@ const LINGUISTIC_HASH_WORD_LISTS_EN = {
|
|
|
5461
5474
|
noun: NOUNS,
|
|
5462
5475
|
verb: VERBS,
|
|
5463
5476
|
};
|
|
5464
|
-
|
|
5465
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
5466
|
-
*/
|
|
5477
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
5467
5478
|
|
|
5468
5479
|
/**
|
|
5469
5480
|
* Default language used for linguistic hashes.
|
|
@@ -5638,8 +5649,9 @@ function normalizeLinguisticHashWordCount(wordCount) {
|
|
|
5638
5649
|
/**
|
|
5639
5650
|
* Creates a human-readable hash as a short, story-like phrase.
|
|
5640
5651
|
*
|
|
5641
|
-
* @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
|
|
5642
5652
|
* {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
|
|
5653
|
+
*
|
|
5654
|
+
* @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
|
|
5643
5655
|
* @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
|
|
5644
5656
|
*
|
|
5645
5657
|
* @public exported from `@promptbook/utils`
|
|
@@ -5658,6 +5670,7 @@ async function linguisticHash(input, wordCount, language) {
|
|
|
5658
5670
|
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
|
|
5659
5671
|
*
|
|
5660
5672
|
* @returns string_date branded type
|
|
5673
|
+
*
|
|
5661
5674
|
* @public exported from `@promptbook/utils`
|
|
5662
5675
|
*/
|
|
5663
5676
|
function $getCurrentDate() {
|
|
@@ -5673,6 +5686,7 @@ function $getCurrentDate() {
|
|
|
5673
5686
|
* @returns The normalized text in SCREAMING_CASE format.
|
|
5674
5687
|
* @example 'HELLO_WORLD'
|
|
5675
5688
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
5689
|
+
*
|
|
5676
5690
|
* @public exported from `@promptbook/utils`
|
|
5677
5691
|
*/
|
|
5678
5692
|
function normalizeTo_SCREAMING_CASE(text) {
|
|
@@ -5742,6 +5756,7 @@ function normalizeMessageText(text) {
|
|
|
5742
5756
|
* @returns The normalized text in snake_case format.
|
|
5743
5757
|
* @example 'hello_world'
|
|
5744
5758
|
* @example 'i_love_promptbook'
|
|
5759
|
+
*
|
|
5745
5760
|
* @public exported from `@promptbook/utils`
|
|
5746
5761
|
*/
|
|
5747
5762
|
function normalizeTo_snake_case(text) {
|
|
@@ -5770,6 +5785,7 @@ function normalizeWhitespaces(sentence) {
|
|
|
5770
5785
|
*
|
|
5771
5786
|
* @param text optionally quoted text
|
|
5772
5787
|
* @returns text without quotes
|
|
5788
|
+
*
|
|
5773
5789
|
* @public exported from `@promptbook/utils`
|
|
5774
5790
|
*/
|
|
5775
5791
|
function unwrapResult(text, options) {
|
|
@@ -5844,15 +5860,14 @@ function unwrapResult(text, options) {
|
|
|
5844
5860
|
return processedText;
|
|
5845
5861
|
}
|
|
5846
5862
|
}
|
|
5847
|
-
|
|
5848
|
-
* TODO: [🧠] Should this also unwrap the (parenthesis)
|
|
5849
|
-
*/
|
|
5863
|
+
// TODO: [🧠] Should this also unwrap the (parenthesis)
|
|
5850
5864
|
|
|
5851
5865
|
/**
|
|
5852
5866
|
* Parses the task and returns the list of all parameter names
|
|
5853
5867
|
*
|
|
5854
5868
|
* @param template the string template with parameters in {curly} braces
|
|
5855
5869
|
* @returns the list of parameter names
|
|
5870
|
+
*
|
|
5856
5871
|
* @public exported from `@promptbook/utils`
|
|
5857
5872
|
*/
|
|
5858
5873
|
function extractParameterNames(template) {
|
|
@@ -5882,7 +5897,6 @@ function extractParameterNames(template) {
|
|
|
5882
5897
|
* - `Symbol` objects are not serializable
|
|
5883
5898
|
* - And much more...
|
|
5884
5899
|
*
|
|
5885
|
-
*
|
|
5886
5900
|
* @public exported from `@promptbook/utils`
|
|
5887
5901
|
*/
|
|
5888
5902
|
function isSerializableAsJson(value) {
|
|
@@ -5894,14 +5908,12 @@ function isSerializableAsJson(value) {
|
|
|
5894
5908
|
return false;
|
|
5895
5909
|
}
|
|
5896
5910
|
}
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
* TODO: [🧠][💺] Can be done this on type-level?
|
|
5900
|
-
*/
|
|
5911
|
+
// TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
5912
|
+
// TODO: [🧠][💺] Can be done this on type-level?
|
|
5901
5913
|
|
|
5902
5914
|
/**
|
|
5903
5915
|
* Recursively converts JSON strings to JSON objects
|
|
5904
|
-
|
|
5916
|
+
*
|
|
5905
5917
|
* @public exported from `@promptbook/utils`
|
|
5906
5918
|
*/
|
|
5907
5919
|
function jsonStringsToJsons(object) {
|
|
@@ -5925,14 +5937,13 @@ function jsonStringsToJsons(object) {
|
|
|
5925
5937
|
}
|
|
5926
5938
|
return newObject;
|
|
5927
5939
|
}
|
|
5928
|
-
|
|
5929
|
-
* TODO: Type the return type correctly
|
|
5930
|
-
*/
|
|
5940
|
+
// TODO: Type the return type correctly
|
|
5931
5941
|
|
|
5932
5942
|
/**
|
|
5933
5943
|
* Create difference set of two sets.
|
|
5934
5944
|
*
|
|
5935
5945
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5946
|
+
*
|
|
5936
5947
|
* @public exported from `@promptbook/utils`
|
|
5937
5948
|
*/
|
|
5938
5949
|
function difference(a, b, isEqual = (a, b) => a === b) {
|
|
@@ -5944,14 +5955,13 @@ function difference(a, b, isEqual = (a, b) => a === b) {
|
|
|
5944
5955
|
}
|
|
5945
5956
|
return diff;
|
|
5946
5957
|
}
|
|
5947
|
-
|
|
5948
|
-
* TODO: [🧠][💯] Maybe also implement symmetricDifference
|
|
5949
|
-
*/
|
|
5958
|
+
// TODO: [🧠][💯] Maybe also implement symmetricDifference
|
|
5950
5959
|
|
|
5951
5960
|
/**
|
|
5952
5961
|
* Creates a new set with all elements that are present in either set
|
|
5953
5962
|
*
|
|
5954
5963
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5964
|
+
*
|
|
5955
5965
|
* @public exported from `@promptbook/utils`
|
|
5956
5966
|
*/
|
|
5957
5967
|
function union(...sets) {
|
|
@@ -6002,12 +6012,13 @@ function isValidSemanticVersion(version) {
|
|
|
6002
6012
|
* Tests if given string is valid promptbook version
|
|
6003
6013
|
* It looks into list of known promptbook versions.
|
|
6004
6014
|
*
|
|
6005
|
-
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
6006
6015
|
* 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.
|
|
6007
6016
|
* Note: There are two similar functions:
|
|
6008
6017
|
* - `isValidSemanticVersion` which tests any semantic version
|
|
6009
6018
|
* - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
|
|
6010
6019
|
*
|
|
6020
|
+
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
6021
|
+
*
|
|
6011
6022
|
* @public exported from `@promptbook/utils`
|
|
6012
6023
|
*/
|
|
6013
6024
|
function isValidPromptbookVersion(version) {
|
|
@@ -6065,6 +6076,7 @@ function isHostnameOnPrivateNetwork(hostname, options = {}) {
|
|
|
6065
6076
|
* @param {string} url - The URL to check.
|
|
6066
6077
|
* @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
|
|
6067
6078
|
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
6079
|
+
*
|
|
6068
6080
|
* @public exported from `@promptbook/utils`
|
|
6069
6081
|
*/
|
|
6070
6082
|
function isUrlOnPrivateNetwork(url, options = {}) {
|
|
@@ -6103,9 +6115,7 @@ function isValidAgentUrl(url) {
|
|
|
6103
6115
|
*/
|
|
6104
6116
|
return true;
|
|
6105
6117
|
}
|
|
6106
|
-
|
|
6107
|
-
* TODO: [🐠] Maybe more info why the URL is invalid
|
|
6108
|
-
*/
|
|
6118
|
+
// TODO: [🐠] Maybe more info why the URL is invalid
|
|
6109
6119
|
|
|
6110
6120
|
/**
|
|
6111
6121
|
* Tests if given string is valid pipeline URL URL.
|
|
@@ -6136,10 +6146,11 @@ function isValidPipelineUrl(url) {
|
|
|
6136
6146
|
*/
|
|
6137
6147
|
return true;
|
|
6138
6148
|
}
|
|
6149
|
+
// TODO: [🐠] Maybe more info why the URL is invalid
|
|
6150
|
+
|
|
6139
6151
|
/**
|
|
6140
|
-
*
|
|
6152
|
+
* Collection of firstnames.
|
|
6141
6153
|
*/
|
|
6142
|
-
|
|
6143
6154
|
const FIRSTNAMES = [
|
|
6144
6155
|
'Paul',
|
|
6145
6156
|
'George',
|
|
@@ -6176,6 +6187,9 @@ const FIRSTNAMES = [
|
|
|
6176
6187
|
'Anthony',
|
|
6177
6188
|
'Christopher',
|
|
6178
6189
|
];
|
|
6190
|
+
/**
|
|
6191
|
+
* Collection of lastnames with colors.
|
|
6192
|
+
*/
|
|
6179
6193
|
const LASTNAMES_WITH_COLORS = [
|
|
6180
6194
|
{ lastname: 'Green', color: '#008000' },
|
|
6181
6195
|
{ lastname: 'Brown', color: '#A52A2A' },
|
|
@@ -6203,6 +6217,7 @@ function pickDeterministicItem(hash, startIndex, list) {
|
|
|
6203
6217
|
*
|
|
6204
6218
|
* @param seed - Input seed used to derive a stable pseudonym.
|
|
6205
6219
|
* @returns Deterministic English full name with color metadata.
|
|
6220
|
+
*
|
|
6206
6221
|
* @private internal helper for deterministic pseudonym generation
|
|
6207
6222
|
*/
|
|
6208
6223
|
function generateDeterministicEnglishName(seed) {
|
|
@@ -6244,6 +6259,9 @@ const VOID_PSEUDO_AGENT_ALIAS_KEYS = ['void', 'null', 'none', 'nil'];
|
|
|
6244
6259
|
* Legacy aliases that historically behaved like `FROM VOID`.
|
|
6245
6260
|
*/
|
|
6246
6261
|
const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
|
|
6262
|
+
/**
|
|
6263
|
+
* Constant for void alias entries.
|
|
6264
|
+
*/
|
|
6247
6265
|
const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
|
|
6248
6266
|
alias,
|
|
6249
6267
|
'VOID',
|
|
@@ -6292,6 +6310,7 @@ function normalizePseudoReferenceKey(rawReference) {
|
|
|
6292
6310
|
*
|
|
6293
6311
|
* @param rawReference - Raw reference token or payload.
|
|
6294
6312
|
* @returns Pseudo-agent kind or `null` when the reference is not pseudo.
|
|
6313
|
+
*
|
|
6295
6314
|
* @private internal utility of pseudo-agent resolution
|
|
6296
6315
|
*/
|
|
6297
6316
|
function resolvePseudoAgentKindFromReference(rawReference) {
|
|
@@ -6306,6 +6325,7 @@ function resolvePseudoAgentKindFromReference(rawReference) {
|
|
|
6306
6325
|
*
|
|
6307
6326
|
* @param agentUrl - URL to inspect.
|
|
6308
6327
|
* @returns Pseudo-agent kind or `null` when the URL is not pseudo.
|
|
6328
|
+
*
|
|
6309
6329
|
* @private internal utility of pseudo-agent resolution
|
|
6310
6330
|
*/
|
|
6311
6331
|
function resolvePseudoAgentKindFromUrl(agentUrl) {
|
|
@@ -6326,6 +6346,7 @@ function resolvePseudoAgentKindFromUrl(agentUrl) {
|
|
|
6326
6346
|
*
|
|
6327
6347
|
* @param teamCommitmentContent - TEAM commitment content after reference resolution.
|
|
6328
6348
|
* @returns Deterministic English full name representing pseudo-user in that TEAM context.
|
|
6349
|
+
*
|
|
6329
6350
|
* @private internal utility of TEAM commitment rendering
|
|
6330
6351
|
*/
|
|
6331
6352
|
function createPseudoUserTeammateLabel(teamCommitmentContent) {
|
|
@@ -6341,6 +6362,7 @@ function createPseudoUserTeammateLabel(teamCommitmentContent) {
|
|
|
6341
6362
|
*
|
|
6342
6363
|
* @param rawReference - Raw reference content.
|
|
6343
6364
|
* @returns True when the reference maps to void.
|
|
6365
|
+
*
|
|
6344
6366
|
* @private internal utility of pseudo-agent resolution
|
|
6345
6367
|
*/
|
|
6346
6368
|
function isVoidPseudoAgentReference(rawReference) {
|
|
@@ -6354,9 +6376,7 @@ function isVoidPseudoAgentReference(rawReference) {
|
|
|
6354
6376
|
const normalizedReference = normalizePseudoReferenceKey(rawReference);
|
|
6355
6377
|
return LEGACY_VOID_ALIASES.has(normalizedReference);
|
|
6356
6378
|
}
|
|
6357
|
-
|
|
6358
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6359
|
-
*/
|
|
6379
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6360
6380
|
|
|
6361
6381
|
/**
|
|
6362
6382
|
* FROM commitment definition
|
|
@@ -6435,9 +6455,7 @@ class FromCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
6435
6455
|
};
|
|
6436
6456
|
}
|
|
6437
6457
|
}
|
|
6438
|
-
|
|
6439
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6440
|
-
*/
|
|
6458
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6441
6459
|
|
|
6442
6460
|
/**
|
|
6443
6461
|
* GOAL commitment definition
|
|
@@ -6535,9 +6553,7 @@ class GoalCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
6535
6553
|
return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
|
|
6536
6554
|
}
|
|
6537
6555
|
}
|
|
6538
|
-
|
|
6539
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6540
|
-
*/
|
|
6556
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6541
6557
|
|
|
6542
6558
|
/**
|
|
6543
6559
|
* IMPORT commitment definition
|
|
@@ -6616,19 +6632,26 @@ class ImportCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
6616
6632
|
`));
|
|
6617
6633
|
}
|
|
6618
6634
|
}
|
|
6635
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6636
|
+
|
|
6619
6637
|
/**
|
|
6620
|
-
*
|
|
6638
|
+
* Matches URL-like candidates inside arbitrary text.
|
|
6639
|
+
*
|
|
6640
|
+
* @private
|
|
6621
6641
|
*/
|
|
6622
|
-
|
|
6623
|
-
/** @private Matches URL-like candidates inside arbitrary text. */
|
|
6624
6642
|
const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
|
|
6625
|
-
/**
|
|
6643
|
+
/**
|
|
6644
|
+
* Trims punctuation that commonly trails URLs in prose.
|
|
6645
|
+
*
|
|
6646
|
+
* @private
|
|
6647
|
+
*/
|
|
6626
6648
|
const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
|
|
6627
6649
|
/**
|
|
6628
6650
|
* Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
|
|
6629
6651
|
*
|
|
6630
6652
|
* @param text - Input text that may contain one or more URLs.
|
|
6631
6653
|
* @returns Unique URLs in their first-seen order.
|
|
6654
|
+
*
|
|
6632
6655
|
* @private utility of KNOWLEDGE parsing
|
|
6633
6656
|
*/
|
|
6634
6657
|
function extractUrlsFromText(text) {
|
|
@@ -6658,7 +6681,9 @@ function extractUrlsFromText(text) {
|
|
|
6658
6681
|
return urls;
|
|
6659
6682
|
}
|
|
6660
6683
|
/**
|
|
6661
|
-
*
|
|
6684
|
+
* Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
|
|
6685
|
+
*
|
|
6686
|
+
* @private
|
|
6662
6687
|
*/
|
|
6663
6688
|
function normalizeUrlCandidate(candidate) {
|
|
6664
6689
|
let normalized = candidate.trim();
|
|
@@ -6678,7 +6703,9 @@ function normalizeUrlCandidate(candidate) {
|
|
|
6678
6703
|
return normalized;
|
|
6679
6704
|
}
|
|
6680
6705
|
/**
|
|
6681
|
-
*
|
|
6706
|
+
* Removes trailing closing wrappers when they are unmatched in the candidate.
|
|
6707
|
+
*
|
|
6708
|
+
* @private
|
|
6682
6709
|
*/
|
|
6683
6710
|
function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
|
|
6684
6711
|
let normalized = candidate;
|
|
@@ -6693,7 +6720,9 @@ function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
|
|
|
6693
6720
|
return normalized;
|
|
6694
6721
|
}
|
|
6695
6722
|
/**
|
|
6696
|
-
*
|
|
6723
|
+
* Counts character occurrences in a string.
|
|
6724
|
+
*
|
|
6725
|
+
* @private
|
|
6697
6726
|
*/
|
|
6698
6727
|
function countOccurrences(value, searchedChar) {
|
|
6699
6728
|
let count = 0;
|
|
@@ -6705,14 +6734,28 @@ function countOccurrences(value, searchedChar) {
|
|
|
6705
6734
|
return count;
|
|
6706
6735
|
}
|
|
6707
6736
|
|
|
6708
|
-
/**
|
|
6737
|
+
/**
|
|
6738
|
+
* The default base name for inline knowledge files when the content lacks identifying text.
|
|
6739
|
+
*
|
|
6740
|
+
* @private
|
|
6741
|
+
*/
|
|
6709
6742
|
const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
|
|
6710
|
-
/**
|
|
6743
|
+
/**
|
|
6744
|
+
* The default file extension used for inline knowledge uploads.
|
|
6745
|
+
*
|
|
6746
|
+
* @private
|
|
6747
|
+
*/
|
|
6711
6748
|
const INLINE_KNOWLEDGE_EXTENSION = '.txt';
|
|
6712
|
-
/**
|
|
6749
|
+
/**
|
|
6750
|
+
* Prefix that identifies base64 data URLs.
|
|
6751
|
+
*
|
|
6752
|
+
* @private
|
|
6753
|
+
*/
|
|
6713
6754
|
const DATA_URL_PREFIX = 'data:';
|
|
6714
6755
|
/**
|
|
6715
|
-
*
|
|
6756
|
+
* Retrieves the first meaningful line from the inline content.
|
|
6757
|
+
*
|
|
6758
|
+
* @private
|
|
6716
6759
|
*/
|
|
6717
6760
|
function getFirstNonEmptyLine(content) {
|
|
6718
6761
|
const lines = content.split(/\r?\n/);
|
|
@@ -6725,7 +6768,9 @@ function getFirstNonEmptyLine(content) {
|
|
|
6725
6768
|
return null;
|
|
6726
6769
|
}
|
|
6727
6770
|
/**
|
|
6728
|
-
*
|
|
6771
|
+
* Determines the base file name by normalizing the first non-empty line.
|
|
6772
|
+
*
|
|
6773
|
+
* @private
|
|
6729
6774
|
*/
|
|
6730
6775
|
function deriveBaseFilename(content) {
|
|
6731
6776
|
const firstLine = getFirstNonEmptyLine(content);
|
|
@@ -6736,7 +6781,9 @@ function deriveBaseFilename(content) {
|
|
|
6736
6781
|
return normalized || INLINE_KNOWLEDGE_BASE_NAME;
|
|
6737
6782
|
}
|
|
6738
6783
|
/**
|
|
6739
|
-
*
|
|
6784
|
+
* Converts inline knowledge into the internal metadata form used for uploads.
|
|
6785
|
+
*
|
|
6786
|
+
* @private
|
|
6740
6787
|
*/
|
|
6741
6788
|
function createInlineKnowledgeSourceFile(content) {
|
|
6742
6789
|
const trimmedContent = content.trim();
|
|
@@ -6759,7 +6806,9 @@ function isDataUrlKnowledgeSource(source) {
|
|
|
6759
6806
|
return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
|
|
6760
6807
|
}
|
|
6761
6808
|
/**
|
|
6762
|
-
*
|
|
6809
|
+
* Converts a stored inline knowledge file into a data URL for backwards compatibility.
|
|
6810
|
+
*
|
|
6811
|
+
* @private
|
|
6763
6812
|
*/
|
|
6764
6813
|
function inlineKnowledgeSourceToDataUrl(source) {
|
|
6765
6814
|
const base64 = source.buffer.toString('base64');
|
|
@@ -6819,9 +6868,7 @@ function parseDataUrlKnowledgeSource(source) {
|
|
|
6819
6868
|
return null;
|
|
6820
6869
|
}
|
|
6821
6870
|
}
|
|
6822
|
-
|
|
6823
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6824
|
-
*/
|
|
6871
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6825
6872
|
|
|
6826
6873
|
/**
|
|
6827
6874
|
* KNOWLEDGE commitment definition
|
|
@@ -7025,9 +7072,7 @@ class LanguageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
7025
7072
|
return this.appendToSystemMessage(requirements, languageSection, '\n\n');
|
|
7026
7073
|
}
|
|
7027
7074
|
}
|
|
7028
|
-
|
|
7029
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
7030
|
-
*/
|
|
7075
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
7031
7076
|
|
|
7032
7077
|
/**
|
|
7033
7078
|
* @@@
|
|
@@ -7293,6 +7338,7 @@ function serializeToolRuntimeContext(context) {
|
|
|
7293
7338
|
*
|
|
7294
7339
|
* @param listener - Listener notified about tool progress.
|
|
7295
7340
|
* @returns Hidden token used to route progress updates.
|
|
7341
|
+
*
|
|
7296
7342
|
* @private internal runtime wiring for commitment tools
|
|
7297
7343
|
*/
|
|
7298
7344
|
function registerToolCallProgressListener(listener) {
|
|
@@ -7305,14 +7351,13 @@ function registerToolCallProgressListener(listener) {
|
|
|
7305
7351
|
* Unregisters one in-memory progress listener.
|
|
7306
7352
|
*
|
|
7307
7353
|
* @param token - Token previously created by `registerToolCallProgressListener`.
|
|
7354
|
+
*
|
|
7308
7355
|
* @private internal runtime wiring for commitment tools
|
|
7309
7356
|
*/
|
|
7310
7357
|
function unregisterToolCallProgressListener(token) {
|
|
7311
7358
|
toolCallProgressListeners.delete(token);
|
|
7312
7359
|
}
|
|
7313
|
-
|
|
7314
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
7315
|
-
*/
|
|
7360
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
7316
7361
|
|
|
7317
7362
|
/**
|
|
7318
7363
|
* Resolves runtime context from hidden tool arguments.
|
|
@@ -7673,9 +7718,7 @@ class MemoryCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
7673
7718
|
return createMemoryToolFunctions();
|
|
7674
7719
|
}
|
|
7675
7720
|
}
|
|
7676
|
-
|
|
7677
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
7678
|
-
*/
|
|
7721
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
7679
7722
|
|
|
7680
7723
|
/**
|
|
7681
7724
|
* AGENT MESSAGE commitment definition
|
|
@@ -8005,9 +8048,7 @@ class MessageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8005
8048
|
return this.appendToSystemMessage(requirements, messageSection, '\n\n');
|
|
8006
8049
|
}
|
|
8007
8050
|
}
|
|
8008
|
-
|
|
8009
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8010
|
-
*/
|
|
8051
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8011
8052
|
|
|
8012
8053
|
/**
|
|
8013
8054
|
* USER MESSAGE commitment definition
|
|
@@ -8138,9 +8179,7 @@ class MessageSuffixCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8138
8179
|
return requirements;
|
|
8139
8180
|
}
|
|
8140
8181
|
}
|
|
8141
|
-
|
|
8142
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8143
|
-
*/
|
|
8182
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8144
8183
|
|
|
8145
8184
|
/**
|
|
8146
8185
|
* META commitment definition
|
|
@@ -8287,9 +8326,7 @@ class MetaCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8287
8326
|
return knownTypes.includes(metaType.toUpperCase());
|
|
8288
8327
|
}
|
|
8289
8328
|
}
|
|
8290
|
-
|
|
8291
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8292
|
-
*/
|
|
8329
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8293
8330
|
|
|
8294
8331
|
/**
|
|
8295
8332
|
* META COLOR commitment definition
|
|
@@ -8385,9 +8422,7 @@ class MetaColorCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8385
8422
|
return trimmedContent || null;
|
|
8386
8423
|
}
|
|
8387
8424
|
}
|
|
8388
|
-
|
|
8389
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8390
|
-
*/
|
|
8425
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8391
8426
|
|
|
8392
8427
|
/**
|
|
8393
8428
|
* META DOMAIN commitment definition
|
|
@@ -8452,9 +8487,7 @@ class MetaDomainCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8452
8487
|
return trimmedContent || null;
|
|
8453
8488
|
}
|
|
8454
8489
|
}
|
|
8455
|
-
|
|
8456
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8457
|
-
*/
|
|
8490
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8458
8491
|
|
|
8459
8492
|
/**
|
|
8460
8493
|
* META DISCLAIMER commitment definition
|
|
@@ -8522,9 +8555,7 @@ class MetaDisclaimerCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8522
8555
|
return requirements;
|
|
8523
8556
|
}
|
|
8524
8557
|
}
|
|
8525
|
-
|
|
8526
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8527
|
-
*/
|
|
8558
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8528
8559
|
|
|
8529
8560
|
/**
|
|
8530
8561
|
* META FONT commitment definition
|
|
@@ -8607,9 +8638,7 @@ class MetaFontCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8607
8638
|
return trimmedContent || null;
|
|
8608
8639
|
}
|
|
8609
8640
|
}
|
|
8610
|
-
|
|
8611
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8612
|
-
*/
|
|
8641
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8613
8642
|
|
|
8614
8643
|
/**
|
|
8615
8644
|
* META IMAGE commitment definition
|
|
@@ -8694,9 +8723,7 @@ class MetaImageCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8694
8723
|
return trimmedContent || null;
|
|
8695
8724
|
}
|
|
8696
8725
|
}
|
|
8697
|
-
|
|
8698
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8699
|
-
*/
|
|
8726
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8700
8727
|
|
|
8701
8728
|
/**
|
|
8702
8729
|
* META INPUT PLACEHOLDER commitment definition.
|
|
@@ -8759,9 +8786,7 @@ class MetaInputPlaceholderCommitmentDefinition extends BaseCommitmentDefinition
|
|
|
8759
8786
|
return trimmedContent || null;
|
|
8760
8787
|
}
|
|
8761
8788
|
}
|
|
8762
|
-
|
|
8763
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8764
|
-
*/
|
|
8789
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8765
8790
|
|
|
8766
8791
|
/**
|
|
8767
8792
|
* META LINK commitment definition
|
|
@@ -8868,9 +8893,7 @@ class MetaLinkCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8868
8893
|
}
|
|
8869
8894
|
}
|
|
8870
8895
|
}
|
|
8871
|
-
|
|
8872
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8873
|
-
*/
|
|
8896
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8874
8897
|
|
|
8875
8898
|
/**
|
|
8876
8899
|
* META VOICE commitment definition
|
|
@@ -8939,9 +8962,7 @@ class MetaVoiceCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
8939
8962
|
return trimmedContent || null;
|
|
8940
8963
|
}
|
|
8941
8964
|
}
|
|
8942
|
-
|
|
8943
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8944
|
-
*/
|
|
8965
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8945
8966
|
|
|
8946
8967
|
/**
|
|
8947
8968
|
* MODEL commitment definition
|
|
@@ -9179,9 +9200,7 @@ class ModelCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9179
9200
|
return result;
|
|
9180
9201
|
}
|
|
9181
9202
|
}
|
|
9182
|
-
|
|
9183
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9184
|
-
*/
|
|
9203
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9185
9204
|
|
|
9186
9205
|
/**
|
|
9187
9206
|
* NOTE commitment definition
|
|
@@ -9343,9 +9362,7 @@ class OpenCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9343
9362
|
};
|
|
9344
9363
|
}
|
|
9345
9364
|
}
|
|
9346
|
-
|
|
9347
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9348
|
-
*/
|
|
9365
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9349
9366
|
|
|
9350
9367
|
/**
|
|
9351
9368
|
* PERSONA commitment definition
|
|
@@ -9484,9 +9501,7 @@ class PersonaCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9484
9501
|
};
|
|
9485
9502
|
}
|
|
9486
9503
|
}
|
|
9487
|
-
|
|
9488
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9489
|
-
*/
|
|
9504
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9490
9505
|
|
|
9491
9506
|
/**
|
|
9492
9507
|
* RULE commitment definition
|
|
@@ -9567,15 +9582,14 @@ class RuleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9567
9582
|
return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
|
|
9568
9583
|
}
|
|
9569
9584
|
}
|
|
9570
|
-
|
|
9571
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9572
|
-
*/
|
|
9585
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9573
9586
|
|
|
9574
9587
|
/**
|
|
9575
9588
|
* Creates the canonical system-message body for one writing-sample commitment.
|
|
9576
9589
|
*
|
|
9577
9590
|
* @param content - Explicit 1:1 sample text.
|
|
9578
9591
|
* @returns Writing-sample guidance ready for one system-message section.
|
|
9592
|
+
*
|
|
9579
9593
|
* @private internal utility of writing commitments
|
|
9580
9594
|
*/
|
|
9581
9595
|
function createWritingSampleSection(content) {
|
|
@@ -9593,6 +9607,7 @@ function createWritingSampleSection(content) {
|
|
|
9593
9607
|
*
|
|
9594
9608
|
* @param content - Writing-only instructions.
|
|
9595
9609
|
* @returns Writing-rules guidance ready for one system-message section.
|
|
9610
|
+
*
|
|
9596
9611
|
* @private internal utility of writing commitments
|
|
9597
9612
|
*/
|
|
9598
9613
|
function createWritingRulesSection(content) {
|
|
@@ -9605,9 +9620,7 @@ function createWritingRulesSection(content) {
|
|
|
9605
9620
|
${content}
|
|
9606
9621
|
`);
|
|
9607
9622
|
}
|
|
9608
|
-
|
|
9609
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9610
|
-
*/
|
|
9623
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9611
9624
|
|
|
9612
9625
|
/**
|
|
9613
9626
|
* Legacy `SAMPLE` / `EXAMPLE` commitment definition.
|
|
@@ -9686,9 +9699,7 @@ class SampleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9686
9699
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
|
|
9687
9700
|
}
|
|
9688
9701
|
}
|
|
9689
|
-
|
|
9690
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9691
|
-
*/
|
|
9702
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9692
9703
|
|
|
9693
9704
|
/**
|
|
9694
9705
|
* SCENARIO commitment definition
|
|
@@ -9810,9 +9821,7 @@ class ScenarioCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
9810
9821
|
return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
|
|
9811
9822
|
}
|
|
9812
9823
|
}
|
|
9813
|
-
|
|
9814
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9815
|
-
*/
|
|
9824
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9816
9825
|
|
|
9817
9826
|
/**
|
|
9818
9827
|
* STYLE commitment definition
|
|
@@ -9909,6 +9918,7 @@ const TEAM_TOOL_FALLBACK_NAME = 'teammate';
|
|
|
9909
9918
|
*
|
|
9910
9919
|
* @param teammateLabel - Human-readable teammate label.
|
|
9911
9920
|
* @returns Normalized teammate identifier for TEAM tool names.
|
|
9921
|
+
*
|
|
9912
9922
|
* @private internal helper of TEAM tool-name generation
|
|
9913
9923
|
*/
|
|
9914
9924
|
function normalizeTeammateToolNamePart(teammateLabel) {
|
|
@@ -9924,6 +9934,7 @@ function normalizeTeammateToolNamePart(teammateLabel) {
|
|
|
9924
9934
|
* @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
|
|
9925
9935
|
* @param teammateLabel - Human-readable teammate label used as the basis for the name.
|
|
9926
9936
|
* @returns TEAM tool name derived from the label.
|
|
9937
|
+
*
|
|
9927
9938
|
* @private internal utility of TEAM commitments and chat UI mapping
|
|
9928
9939
|
*/
|
|
9929
9940
|
function createTeamToolName(_teammateUrl, teammateLabel) {
|
|
@@ -9931,9 +9942,21 @@ function createTeamToolName(_teammateUrl, teammateLabel) {
|
|
|
9931
9942
|
return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
|
|
9932
9943
|
}
|
|
9933
9944
|
|
|
9945
|
+
/**
|
|
9946
|
+
* Pattern matching agent URLs inside TEAM commitment content.
|
|
9947
|
+
*/
|
|
9934
9948
|
const urlRegex = /https?:\/\/[^\s]+/gi;
|
|
9949
|
+
/**
|
|
9950
|
+
* Pattern matching punctuation that often trails teammate URLs in prose.
|
|
9951
|
+
*/
|
|
9935
9952
|
const trailingPunctuationRegex = /[),.;!?]+$/;
|
|
9953
|
+
/**
|
|
9954
|
+
* Clause separators used while splitting TEAM instruction context.
|
|
9955
|
+
*/
|
|
9936
9956
|
const clauseSeparators = ['.', '?', '!', ';', ','];
|
|
9957
|
+
/**
|
|
9958
|
+
* Conjunction separators used while splitting TEAM instruction context.
|
|
9959
|
+
*/
|
|
9937
9960
|
const conjunctionSeparators = [' and ', ' or '];
|
|
9938
9961
|
/**
|
|
9939
9962
|
* Parses TEAM commitment content into teammates with instructions.
|
|
@@ -9981,6 +10004,9 @@ function parseTeamCommitmentContent(content, options = {}) {
|
|
|
9981
10004
|
}
|
|
9982
10005
|
return teammates;
|
|
9983
10006
|
}
|
|
10007
|
+
/**
|
|
10008
|
+
* Extracts the instruction fragment associated with one teammate URL.
|
|
10009
|
+
*/
|
|
9984
10010
|
function extractInstructionContext(line, matches, matchIndex) {
|
|
9985
10011
|
var _a;
|
|
9986
10012
|
const match = matches[matchIndex];
|
|
@@ -10006,6 +10032,9 @@ function extractInstructionContext(line, matches, matchIndex) {
|
|
|
10006
10032
|
}
|
|
10007
10033
|
return `${prefix} ${suffix}`.trim();
|
|
10008
10034
|
}
|
|
10035
|
+
/**
|
|
10036
|
+
* Trims content after the last detected clause delimiter.
|
|
10037
|
+
*/
|
|
10009
10038
|
function trimAfterLastDelimiter(text) {
|
|
10010
10039
|
const match = findLastDelimiter(text);
|
|
10011
10040
|
if (!match) {
|
|
@@ -10013,6 +10042,9 @@ function trimAfterLastDelimiter(text) {
|
|
|
10013
10042
|
}
|
|
10014
10043
|
return text.slice(match.index + match.length);
|
|
10015
10044
|
}
|
|
10045
|
+
/**
|
|
10046
|
+
* Trims content before the last detected clause delimiter.
|
|
10047
|
+
*/
|
|
10016
10048
|
function trimBeforeLastDelimiter(text) {
|
|
10017
10049
|
const cleaned = text.replace(/^[,;:]\s*/g, '');
|
|
10018
10050
|
const match = findLastDelimiter(cleaned);
|
|
@@ -10021,6 +10053,9 @@ function trimBeforeLastDelimiter(text) {
|
|
|
10021
10053
|
}
|
|
10022
10054
|
return cleaned.slice(0, match.index);
|
|
10023
10055
|
}
|
|
10056
|
+
/**
|
|
10057
|
+
* Finds the last clause or conjunction delimiter in a string.
|
|
10058
|
+
*/
|
|
10024
10059
|
function findLastDelimiter(text) {
|
|
10025
10060
|
let bestIndex = -1;
|
|
10026
10061
|
let bestLength = 0;
|
|
@@ -10044,6 +10079,9 @@ function findLastDelimiter(text) {
|
|
|
10044
10079
|
}
|
|
10045
10080
|
return { index: bestIndex, length: bestLength };
|
|
10046
10081
|
}
|
|
10082
|
+
/**
|
|
10083
|
+
* Normalizes teammate instruction text after URL extraction.
|
|
10084
|
+
*/
|
|
10047
10085
|
function normalizeInstructionText(text) {
|
|
10048
10086
|
if (!text) {
|
|
10049
10087
|
return '';
|
|
@@ -10057,6 +10095,9 @@ function normalizeInstructionText(text) {
|
|
|
10057
10095
|
normalized = normalizeWhitespaces(normalized).trim();
|
|
10058
10096
|
return normalized;
|
|
10059
10097
|
}
|
|
10098
|
+
/**
|
|
10099
|
+
* Creates a readable teammate label from an agent URL.
|
|
10100
|
+
*/
|
|
10060
10101
|
function createTeammateLabel(url) {
|
|
10061
10102
|
try {
|
|
10062
10103
|
const parsed = new URL(url);
|
|
@@ -10076,12 +10117,19 @@ function createTeammateLabel(url) {
|
|
|
10076
10117
|
return url;
|
|
10077
10118
|
}
|
|
10078
10119
|
}
|
|
10120
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10121
|
+
|
|
10079
10122
|
/**
|
|
10080
|
-
*
|
|
10123
|
+
* Map of team tool functions.
|
|
10081
10124
|
*/
|
|
10082
|
-
|
|
10083
10125
|
const teamToolFunctions = {};
|
|
10126
|
+
/**
|
|
10127
|
+
* Map of team tool titles.
|
|
10128
|
+
*/
|
|
10084
10129
|
const teamToolTitles = {};
|
|
10130
|
+
/**
|
|
10131
|
+
* Constant for remote agents by Url.
|
|
10132
|
+
*/
|
|
10085
10133
|
const remoteAgentsByUrl = new Map();
|
|
10086
10134
|
/**
|
|
10087
10135
|
* TEAM commitment definition
|
|
@@ -10445,9 +10493,7 @@ function createTeamToolFunction(entry) {
|
|
|
10445
10493
|
return JSON.stringify(result);
|
|
10446
10494
|
};
|
|
10447
10495
|
}
|
|
10448
|
-
|
|
10449
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10450
|
-
*/
|
|
10496
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10451
10497
|
|
|
10452
10498
|
/**
|
|
10453
10499
|
* TEMPLATE commitment definition
|
|
@@ -10568,9 +10614,7 @@ class TemplateCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
10568
10614
|
};
|
|
10569
10615
|
}
|
|
10570
10616
|
}
|
|
10571
|
-
|
|
10572
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10573
|
-
*/
|
|
10617
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10574
10618
|
|
|
10575
10619
|
/**
|
|
10576
10620
|
* USE commitment definition
|
|
@@ -10682,9 +10726,7 @@ class UseCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
10682
10726
|
return knownTypes.includes(useType.toUpperCase());
|
|
10683
10727
|
}
|
|
10684
10728
|
}
|
|
10685
|
-
|
|
10686
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10687
|
-
*/
|
|
10729
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10688
10730
|
|
|
10689
10731
|
/**
|
|
10690
10732
|
* All `USE` commitment types currently participating in final system-message aggregation.
|
|
@@ -10707,6 +10749,7 @@ const AGGREGATED_USE_COMMITMENT_PLACEHOLDER_PREFIX = '# AGGREGATED USE COMMITMEN
|
|
|
10707
10749
|
*
|
|
10708
10750
|
* @param type - Commitment type to check.
|
|
10709
10751
|
* @returns `true` when the commitment participates in `USE` system-message aggregation.
|
|
10752
|
+
*
|
|
10710
10753
|
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
10711
10754
|
*/
|
|
10712
10755
|
function isAggregatedUseCommitmentType(type) {
|
|
@@ -10717,6 +10760,7 @@ function isAggregatedUseCommitmentType(type) {
|
|
|
10717
10760
|
*
|
|
10718
10761
|
* @param type - Aggregated `USE` commitment type.
|
|
10719
10762
|
* @returns Single-line placeholder comment stored in the interim system message.
|
|
10763
|
+
*
|
|
10720
10764
|
* @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
|
|
10721
10765
|
*/
|
|
10722
10766
|
function getAggregatedUseCommitmentPlaceholder(type) {
|
|
@@ -10727,6 +10771,7 @@ function getAggregatedUseCommitmentPlaceholder(type) {
|
|
|
10727
10771
|
*
|
|
10728
10772
|
* @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
|
|
10729
10773
|
* @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
|
|
10774
|
+
*
|
|
10730
10775
|
* @private internal utility of `createAggregatedUseCommitmentSystemMessage`
|
|
10731
10776
|
*/
|
|
10732
10777
|
function combineAdditionalInstructions(additionalInstructions) {
|
|
@@ -10738,6 +10783,7 @@ function combineAdditionalInstructions(additionalInstructions) {
|
|
|
10738
10783
|
* @param type - Aggregated `USE` commitment type.
|
|
10739
10784
|
* @param additionalInstructions - Distinct additional instructions in source order.
|
|
10740
10785
|
* @returns Final system-message block for the commitment type.
|
|
10786
|
+
*
|
|
10741
10787
|
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
10742
10788
|
*/
|
|
10743
10789
|
function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
|
|
@@ -10776,6 +10822,7 @@ function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions
|
|
|
10776
10822
|
* @param requirements - Current model requirements.
|
|
10777
10823
|
* @param type - Aggregated `USE` commitment type being applied.
|
|
10778
10824
|
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
10825
|
+
*
|
|
10779
10826
|
* @private internal utility of `USE` commitments
|
|
10780
10827
|
*/
|
|
10781
10828
|
function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
|
|
@@ -10799,6 +10846,7 @@ function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
|
|
|
10799
10846
|
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
10800
10847
|
* @param commitments - Filtered commitments in their original source order.
|
|
10801
10848
|
* @returns Requirements with aggregated `USE` system-message sections.
|
|
10849
|
+
*
|
|
10802
10850
|
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
10803
10851
|
*/
|
|
10804
10852
|
function aggregateUseCommitmentSystemMessages(requirements, commitments) {
|
|
@@ -11091,9 +11139,7 @@ class UseBrowserCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
11091
11139
|
};
|
|
11092
11140
|
}
|
|
11093
11141
|
}
|
|
11094
|
-
|
|
11095
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11096
|
-
*/
|
|
11142
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11097
11143
|
|
|
11098
11144
|
/**
|
|
11099
11145
|
* Base Google Calendar API URL.
|
|
@@ -11364,9 +11410,7 @@ function removeTokenFromLine(line, token) {
|
|
|
11364
11410
|
const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
|
|
11365
11411
|
return filteredTokens.join(' ').trim();
|
|
11366
11412
|
}
|
|
11367
|
-
|
|
11368
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11369
|
-
*/
|
|
11413
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11370
11414
|
|
|
11371
11415
|
/**
|
|
11372
11416
|
* Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
|
|
@@ -12317,9 +12361,7 @@ function addConfiguredCalendarIfMissing(configuredCalendars, calendarReference)
|
|
|
12317
12361
|
...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
|
|
12318
12362
|
});
|
|
12319
12363
|
}
|
|
12320
|
-
|
|
12321
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12322
|
-
*/
|
|
12364
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12323
12365
|
|
|
12324
12366
|
/**
|
|
12325
12367
|
* Lightweight email token matcher used for `USE EMAIL` first-line parsing.
|
|
@@ -12585,9 +12627,7 @@ function addUseEmailTools(existingTools) {
|
|
|
12585
12627
|
},
|
|
12586
12628
|
];
|
|
12587
12629
|
}
|
|
12588
|
-
|
|
12589
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12590
|
-
*/
|
|
12630
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12591
12631
|
|
|
12592
12632
|
/**
|
|
12593
12633
|
* USE IMAGE GENERATOR commitment definition
|
|
@@ -12678,9 +12718,7 @@ class UseImageGeneratorCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12678
12718
|
`));
|
|
12679
12719
|
}
|
|
12680
12720
|
}
|
|
12681
|
-
|
|
12682
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12683
|
-
*/
|
|
12721
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12684
12722
|
|
|
12685
12723
|
/**
|
|
12686
12724
|
* USE MCP commitment definition
|
|
@@ -12755,9 +12793,7 @@ class UseMcpCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12755
12793
|
};
|
|
12756
12794
|
}
|
|
12757
12795
|
}
|
|
12758
|
-
|
|
12759
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12760
|
-
*/
|
|
12796
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12761
12797
|
|
|
12762
12798
|
/**
|
|
12763
12799
|
* USE POPUP commitment definition
|
|
@@ -12893,9 +12929,7 @@ class UsePopupCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12893
12929
|
};
|
|
12894
12930
|
}
|
|
12895
12931
|
}
|
|
12896
|
-
|
|
12897
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12898
|
-
*/
|
|
12932
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12899
12933
|
|
|
12900
12934
|
/**
|
|
12901
12935
|
* Tool name used by the USE PRIVACY commitment.
|
|
@@ -13067,9 +13101,7 @@ class UsePrivacyCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
13067
13101
|
};
|
|
13068
13102
|
}
|
|
13069
13103
|
}
|
|
13070
|
-
|
|
13071
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13072
|
-
*/
|
|
13104
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13073
13105
|
|
|
13074
13106
|
/* eslint-disable no-magic-numbers */
|
|
13075
13107
|
/**
|
|
@@ -13876,9 +13908,7 @@ function createGitHubRepositoryReference(owner, repository, defaultBranch) {
|
|
|
13876
13908
|
defaultBranch,
|
|
13877
13909
|
};
|
|
13878
13910
|
}
|
|
13879
|
-
|
|
13880
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13881
|
-
*/
|
|
13911
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13882
13912
|
|
|
13883
13913
|
/**
|
|
13884
13914
|
* Wallet metadata used by USE PROJECT when resolving GitHub credentials.
|
|
@@ -14737,9 +14767,7 @@ function addConfiguredProjectIfMissing(configuredProjects, repositoryReference)
|
|
|
14737
14767
|
defaultBranch: repositoryReference.defaultBranch,
|
|
14738
14768
|
});
|
|
14739
14769
|
}
|
|
14740
|
-
|
|
14741
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14742
|
-
*/
|
|
14770
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14743
14771
|
|
|
14744
14772
|
/**
|
|
14745
14773
|
* A search engine implementation that uses the SerpApi to fetch Google search results.
|
|
@@ -14950,9 +14978,7 @@ class UseSearchEngineCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
14950
14978
|
};
|
|
14951
14979
|
}
|
|
14952
14980
|
}
|
|
14953
|
-
|
|
14954
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14955
|
-
*/
|
|
14981
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14956
14982
|
|
|
14957
14983
|
/**
|
|
14958
14984
|
* Maximum allowed source length for create-agent payloads.
|
|
@@ -15149,9 +15175,7 @@ class UseSpawnCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
15149
15175
|
};
|
|
15150
15176
|
}
|
|
15151
15177
|
}
|
|
15152
|
-
|
|
15153
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15154
|
-
*/
|
|
15178
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15155
15179
|
|
|
15156
15180
|
/**
|
|
15157
15181
|
* Creates system-message instructions for `USE TIMEOUT`.
|
|
@@ -15216,9 +15240,7 @@ function parseToolExecutionEnvelope(rawValue) {
|
|
|
15216
15240
|
return null;
|
|
15217
15241
|
}
|
|
15218
15242
|
}
|
|
15219
|
-
|
|
15220
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15221
|
-
*/
|
|
15243
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15222
15244
|
|
|
15223
15245
|
/**
|
|
15224
15246
|
* Builds a disabled timeout-tool payload.
|
|
@@ -15950,11 +15972,9 @@ class UseTimeoutCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
15950
15972
|
*/
|
|
15951
15973
|
getToolFunctions() {
|
|
15952
15974
|
return createTimeoutToolFunctions();
|
|
15953
|
-
}
|
|
15954
|
-
}
|
|
15955
|
-
|
|
15956
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15957
|
-
*/
|
|
15975
|
+
}
|
|
15976
|
+
}
|
|
15977
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15958
15978
|
|
|
15959
15979
|
/**
|
|
15960
15980
|
* USE TIME commitment definition
|
|
@@ -16101,9 +16121,7 @@ class UseTimeCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
16101
16121
|
};
|
|
16102
16122
|
}
|
|
16103
16123
|
}
|
|
16104
|
-
|
|
16105
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16106
|
-
*/
|
|
16124
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16107
16125
|
|
|
16108
16126
|
/**
|
|
16109
16127
|
* Tool name used by the USE USER LOCATION commitment.
|
|
@@ -16316,9 +16334,7 @@ class UseUserLocationCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
16316
16334
|
};
|
|
16317
16335
|
}
|
|
16318
16336
|
}
|
|
16319
|
-
|
|
16320
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16321
|
-
*/
|
|
16337
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16322
16338
|
|
|
16323
16339
|
/**
|
|
16324
16340
|
* `WRITING RULES` commitment definition.
|
|
@@ -16394,9 +16410,7 @@ class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
16394
16410
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
|
|
16395
16411
|
}
|
|
16396
16412
|
}
|
|
16397
|
-
|
|
16398
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16399
|
-
*/
|
|
16413
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16400
16414
|
|
|
16401
16415
|
/**
|
|
16402
16416
|
* `WRITING SAMPLE` commitment definition.
|
|
@@ -16466,9 +16480,7 @@ class WritingSampleCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
16466
16480
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
|
|
16467
16481
|
}
|
|
16468
16482
|
}
|
|
16469
|
-
|
|
16470
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16471
|
-
*/
|
|
16483
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16472
16484
|
|
|
16473
16485
|
/**
|
|
16474
16486
|
* Placeholder commitment definition for commitments that are not yet implemented
|
|
@@ -16630,13 +16642,12 @@ const COMMITMENT_REGISTRY = [
|
|
|
16630
16642
|
new NotYetImplementedCommitmentDefinition('CONTEXT'),
|
|
16631
16643
|
// <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
|
|
16632
16644
|
];
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16636
|
-
*/
|
|
16645
|
+
// TODO: [🧠] Maybe create through standardized $register
|
|
16646
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16637
16647
|
|
|
16638
16648
|
/**
|
|
16639
16649
|
* Gets all available commitment definitions
|
|
16650
|
+
*
|
|
16640
16651
|
* @returns Array of all commitment definitions
|
|
16641
16652
|
*
|
|
16642
16653
|
* @public exported from `@promptbook/core`
|
|
@@ -16649,6 +16660,7 @@ function getAllCommitmentDefinitions() {
|
|
|
16649
16660
|
* Collects tool functions from all commitment definitions.
|
|
16650
16661
|
*
|
|
16651
16662
|
* @returns Map of tool function implementations.
|
|
16663
|
+
*
|
|
16652
16664
|
* @private internal helper for commitment tool registry
|
|
16653
16665
|
*/
|
|
16654
16666
|
function collectCommitmentToolFunctions() {
|
|
@@ -16670,6 +16682,7 @@ function collectCommitmentToolFunctions() {
|
|
|
16670
16682
|
*
|
|
16671
16683
|
* @param getFunctions - Provider of current tool functions.
|
|
16672
16684
|
* @returns Proxy exposing tool functions as properties.
|
|
16685
|
+
*
|
|
16673
16686
|
* @private internal helper for commitment tool registry
|
|
16674
16687
|
*/
|
|
16675
16688
|
function createToolFunctionsProxy(getFunctions) {
|
|
@@ -16707,10 +16720,11 @@ function createToolFunctionsProxy(getFunctions) {
|
|
|
16707
16720
|
},
|
|
16708
16721
|
});
|
|
16709
16722
|
}
|
|
16723
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16724
|
+
|
|
16710
16725
|
/**
|
|
16711
|
-
*
|
|
16726
|
+
* Constant for commitment tool functions proxy.
|
|
16712
16727
|
*/
|
|
16713
|
-
|
|
16714
16728
|
const commitmentToolFunctionsProxy = createToolFunctionsProxy(collectCommitmentToolFunctions);
|
|
16715
16729
|
/**
|
|
16716
16730
|
* Gets all function implementations provided by all commitments
|
|
@@ -16727,7 +16741,7 @@ function getAllCommitmentsToolFunctionsForBrowser() {
|
|
|
16727
16741
|
* Wrapper around `window.prompt` synchronous function that interacts with the user via browser prompt
|
|
16728
16742
|
*
|
|
16729
16743
|
* Warning: It is used for testing and mocking
|
|
16730
|
-
*
|
|
16744
|
+
* **NOT intended to use in the production** due to its synchronous nature.
|
|
16731
16745
|
*
|
|
16732
16746
|
* @public exported from `@promptbook/browser`
|
|
16733
16747
|
*/
|
|
@@ -16756,7 +16770,7 @@ class SimplePromptInterfaceTools {
|
|
|
16756
16770
|
return answer;
|
|
16757
16771
|
}
|
|
16758
16772
|
}
|
|
16759
|
-
|
|
16773
|
+
// Note: [🔵] Code for browser dialog helper [SimplePromptInterfaceTools](src/dialogs/simple-prompt/SimplePromptInterfaceTools.ts) should never be published outside of `@promptbook/browser`
|
|
16760
16774
|
|
|
16761
16775
|
/**
|
|
16762
16776
|
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
@@ -16764,7 +16778,7 @@ class SimplePromptInterfaceTools {
|
|
|
16764
16778
|
*
|
|
16765
16779
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
16766
16780
|
*
|
|
16767
|
-
*
|
|
16781
|
+
* @private internal function of `$Register`
|
|
16768
16782
|
*/
|
|
16769
16783
|
function $getGlobalScope() {
|
|
16770
16784
|
return Function('return this')();
|
|
@@ -16823,13 +16837,13 @@ class $Register {
|
|
|
16823
16837
|
* Central point for registering and accessing different types of content scrapers.
|
|
16824
16838
|
*
|
|
16825
16839
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
16840
|
+
*
|
|
16826
16841
|
* @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
|
|
16842
|
+
*
|
|
16827
16843
|
* @public exported from `@promptbook/core`
|
|
16828
16844
|
*/
|
|
16829
16845
|
const $scrapersRegister = new $Register('scraper_constructors');
|
|
16830
|
-
|
|
16831
|
-
* TODO: [®] DRY Register logic
|
|
16832
|
-
*/
|
|
16846
|
+
// TODO: [®] DRY Register logic
|
|
16833
16847
|
|
|
16834
16848
|
/**
|
|
16835
16849
|
* Provides a collection of scrapers optimized for browser environments.
|
|
@@ -16955,12 +16969,13 @@ class BrowserSpeechRecognition {
|
|
|
16955
16969
|
}
|
|
16956
16970
|
}
|
|
16957
16971
|
}
|
|
16958
|
-
|
|
16959
|
-
|
|
16972
|
+
// Note: [🔵] Code for browser speech-recognition adapter [BrowserSpeechRecognition](src/speech-recognition/BrowserSpeechRecognition.ts) should never be published outside of `@promptbook/browser`
|
|
16973
|
+
// TODO: !!!! Search ACRY for `window` and put -> [🔵]
|
|
16960
16974
|
|
|
16961
16975
|
/**
|
|
16962
16976
|
* Creates a PromptbookStorage backed by IndexedDB.
|
|
16963
16977
|
* Uses a single object store named 'promptbook'.
|
|
16978
|
+
*
|
|
16964
16979
|
* @private for `getIndexedDbStorage`
|
|
16965
16980
|
*/
|
|
16966
16981
|
function makePromptbookStorageFromIndexedDb(options) {
|
|
@@ -17033,7 +17048,7 @@ function getIndexedDbStorage(options) {
|
|
|
17033
17048
|
indexedDbStorageCache.set(cacheKey, storage);
|
|
17034
17049
|
return storage;
|
|
17035
17050
|
}
|
|
17036
|
-
|
|
17051
|
+
// Note: [🔵] Code for browser storage helper [getIndexedDbStorage](src/storage/local-storage/getIndexedDbStorage.ts) should never be published outside of `@promptbook/browser`
|
|
17037
17052
|
|
|
17038
17053
|
/**
|
|
17039
17054
|
* Stringify the PipelineJson with proper formatting
|
|
@@ -17061,12 +17076,10 @@ function stringifyPipelineJson(pipeline) {
|
|
|
17061
17076
|
pipelineJsonStringified += '\n';
|
|
17062
17077
|
return pipelineJsonStringified;
|
|
17063
17078
|
}
|
|
17064
|
-
|
|
17065
|
-
|
|
17066
|
-
|
|
17067
|
-
|
|
17068
|
-
* TODO: [🍙] Make some standard order of json properties
|
|
17069
|
-
*/
|
|
17079
|
+
// TODO: [🐝] Not Working properly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
17080
|
+
// TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
17081
|
+
// TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
17082
|
+
// TODO: [🍙] Make some standard order of json properties
|
|
17070
17083
|
|
|
17071
17084
|
/**
|
|
17072
17085
|
* Creates a Promptbook storage interface from a web storage object.
|
|
@@ -17097,10 +17110,8 @@ function makePromptbookStorageFromWebStorage(webStorage) {
|
|
|
17097
17110
|
},
|
|
17098
17111
|
};
|
|
17099
17112
|
}
|
|
17100
|
-
|
|
17101
|
-
|
|
17102
|
-
* TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
|
|
17103
|
-
*/
|
|
17113
|
+
// TODO: [🧠] Should this be named `makePromptbookStorageFromWebStorage` vs `createPromptbookStorageFromWebStorage`
|
|
17114
|
+
// TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
|
|
17104
17115
|
|
|
17105
17116
|
/**
|
|
17106
17117
|
* Cache storage
|
|
@@ -17123,7 +17134,7 @@ function getLocalStorage() {
|
|
|
17123
17134
|
promptbookLocalStorage = makePromptbookStorageFromWebStorage(localStorage);
|
|
17124
17135
|
return promptbookLocalStorage;
|
|
17125
17136
|
}
|
|
17126
|
-
|
|
17137
|
+
// Note: [🔵] Code for browser storage helper [getLocalStorage](src/storage/local-storage/getLocalStorage.ts) should never be published outside of `@promptbook/browser`
|
|
17127
17138
|
|
|
17128
17139
|
/**
|
|
17129
17140
|
* Cache storage
|
|
@@ -17146,7 +17157,7 @@ function getSessionStorage() {
|
|
|
17146
17157
|
promptbookSessionStorage = makePromptbookStorageFromWebStorage(sessionStorage);
|
|
17147
17158
|
return promptbookSessionStorage;
|
|
17148
17159
|
}
|
|
17149
|
-
|
|
17160
|
+
// Note: [🔵] Code for browser storage helper [getSessionStorage](src/storage/local-storage/getSessionStorage.ts) should never be published outside of `@promptbook/browser`
|
|
17150
17161
|
|
|
17151
17162
|
/**
|
|
17152
17163
|
* Normalizes a domain-like string into a comparable hostname form.
|
|
@@ -17156,6 +17167,7 @@ function getSessionStorage() {
|
|
|
17156
17167
|
*
|
|
17157
17168
|
* @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
|
|
17158
17169
|
* @returns Normalized hostname or `null` when the value cannot be normalized.
|
|
17170
|
+
*
|
|
17159
17171
|
* @private utility for host/domain matching
|
|
17160
17172
|
*/
|
|
17161
17173
|
function normalizeDomainForMatching(rawDomain) {
|
|
@@ -17178,6 +17190,7 @@ function normalizeDomainForMatching(rawDomain) {
|
|
|
17178
17190
|
*
|
|
17179
17191
|
* @param value - Raw value to inspect.
|
|
17180
17192
|
* @returns True when the value starts with `http://` or `https://`.
|
|
17193
|
+
*
|
|
17181
17194
|
* @private utility for host/domain matching
|
|
17182
17195
|
*/
|
|
17183
17196
|
function hasHttpProtocol(value) {
|
|
@@ -17223,6 +17236,7 @@ function createDefaultAgentName(agentSource) {
|
|
|
17223
17236
|
*
|
|
17224
17237
|
* @param agentSource - Raw agent source.
|
|
17225
17238
|
* @returns Parsed prelude with shared line metadata.
|
|
17239
|
+
*
|
|
17226
17240
|
* @private internal utility of book agent-source parsing
|
|
17227
17241
|
*/
|
|
17228
17242
|
function parseAgentSourcePrelude(agentSource) {
|
|
@@ -17398,6 +17412,7 @@ function parseAgentSourceWithCommitments(agentSource) {
|
|
|
17398
17412
|
*
|
|
17399
17413
|
* @param text - Text to extract parameters from
|
|
17400
17414
|
* @returns Array of parsed parameters with unified representation
|
|
17415
|
+
*
|
|
17401
17416
|
* @public exported from `@promptbook/core`
|
|
17402
17417
|
*/
|
|
17403
17418
|
function parseParameters(text) {
|
|
@@ -17826,9 +17841,7 @@ function normalizeMetaDomain(content) {
|
|
|
17826
17841
|
const trimmed = spaceTrim$1(content);
|
|
17827
17842
|
return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
|
|
17828
17843
|
}
|
|
17829
|
-
|
|
17830
|
-
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
17831
|
-
*/
|
|
17844
|
+
// TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
17832
17845
|
|
|
17833
17846
|
/**
|
|
17834
17847
|
* Converts Blob, File or MediaSource to url using URL.createObjectURL
|
|
@@ -17901,7 +17914,7 @@ class ObjectUrl extends Registration {
|
|
|
17901
17914
|
return new URL(this.src);
|
|
17902
17915
|
}
|
|
17903
17916
|
}
|
|
17904
|
-
|
|
17917
|
+
// Note: [🔵] Code for browser file helper [ObjectUrl](src/utils/files/ObjectUrl.ts) should never be published outside of `@promptbook/browser`
|
|
17905
17918
|
|
|
17906
17919
|
/**
|
|
17907
17920
|
* Download a File in a browser
|
|
@@ -17921,7 +17934,7 @@ async function $induceFileDownload(fileOrBlobOrUrl) {
|
|
|
17921
17934
|
link.click();
|
|
17922
17935
|
await objectUrl.destroy();
|
|
17923
17936
|
}
|
|
17924
|
-
|
|
17937
|
+
// Note: [🔵] Code for browser file helper [$induceFileDownload](src/utils/files/$induceFileDownload.ts) should never be published outside of `@promptbook/browser`
|
|
17925
17938
|
|
|
17926
17939
|
/**
|
|
17927
17940
|
* Download a Book in a browser
|
|
@@ -17940,7 +17953,7 @@ async function $induceBookDownload(book) {
|
|
|
17940
17953
|
});
|
|
17941
17954
|
return /* not await */ $induceFileDownload(bookFile);
|
|
17942
17955
|
}
|
|
17943
|
-
|
|
17956
|
+
// Note: [🔵] Code for browser file helper [$induceBookDownload](src/utils/files/$induceBookDownload.ts) should never be published outside of `@promptbook/browser`
|
|
17944
17957
|
|
|
17945
17958
|
/**
|
|
17946
17959
|
* Keep-alive helpers used for streaming chat responses.
|
|
@@ -17952,12 +17965,10 @@ async function $induceBookDownload(book) {
|
|
|
17952
17965
|
* @private internal streaming helper for Promptbook chat connections
|
|
17953
17966
|
*/
|
|
17954
17967
|
const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
|
|
17955
|
-
|
|
17956
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17957
|
-
*/
|
|
17968
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17958
17969
|
|
|
17959
17970
|
/**
|
|
17960
|
-
*
|
|
17971
|
+
* Number of padding lines to add at the end of the book content
|
|
17961
17972
|
*
|
|
17962
17973
|
* @public exported from `@promptbook/core`
|
|
17963
17974
|
*/
|
|
@@ -17994,9 +18005,7 @@ function padBook(content) {
|
|
|
17994
18005
|
const linesToAdd = PADDING_LINES - trailingEmptyLines;
|
|
17995
18006
|
return (content + '\n'.repeat(linesToAdd));
|
|
17996
18007
|
}
|
|
17997
|
-
|
|
17998
|
-
* TODO: [🧠] Maybe export
|
|
17999
|
-
*/
|
|
18008
|
+
// TODO: [🧠] Maybe export
|
|
18000
18009
|
|
|
18001
18010
|
/**
|
|
18002
18011
|
* Type guard to check if a string is a valid agent source
|
|
@@ -18026,6 +18035,7 @@ function validateBook(source) {
|
|
|
18026
18035
|
* Default book
|
|
18027
18036
|
*
|
|
18028
18037
|
* @deprecated Use `$generateBookBoilerplate` instead
|
|
18038
|
+
*
|
|
18029
18039
|
* @public exported from `@promptbook/core`
|
|
18030
18040
|
*/
|
|
18031
18041
|
padBook(validateBook(spaceTrim$1(`
|
|
@@ -18047,6 +18057,7 @@ padBook(validateBook(spaceTrim$1(`
|
|
|
18047
18057
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
18048
18058
|
* @returns {PipelineString} the same string as input, but validated as valid
|
|
18049
18059
|
* @throws {ParseError} if the string is not a valid pipeline string
|
|
18060
|
+
*
|
|
18050
18061
|
* @public exported from `@promptbook/core`
|
|
18051
18062
|
*/
|
|
18052
18063
|
function validatePipelineString(pipelineString) {
|
|
@@ -18065,9 +18076,7 @@ function validatePipelineString(pipelineString) {
|
|
|
18065
18076
|
// <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
|
|
18066
18077
|
return pipelineString;
|
|
18067
18078
|
}
|
|
18068
|
-
|
|
18069
|
-
* TODO: [🧠][🈴] Where is the best location for this file
|
|
18070
|
-
*/
|
|
18079
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
18071
18080
|
|
|
18072
18081
|
/**
|
|
18073
18082
|
* Function `isValidPipelineString` will validate the if the string is a valid pipeline string
|
|
@@ -18075,6 +18084,7 @@ function validatePipelineString(pipelineString) {
|
|
|
18075
18084
|
*
|
|
18076
18085
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
18077
18086
|
* @returns {boolean} if the string is a valid pipeline string
|
|
18087
|
+
*
|
|
18078
18088
|
* @public exported from `@promptbook/core`
|
|
18079
18089
|
*/
|
|
18080
18090
|
function isValidPipelineString(pipelineString) {
|
|
@@ -18087,9 +18097,7 @@ function isValidPipelineString(pipelineString) {
|
|
|
18087
18097
|
return false;
|
|
18088
18098
|
}
|
|
18089
18099
|
}
|
|
18090
|
-
|
|
18091
|
-
* TODO: [🧠][🈴] Where is the best location for this file
|
|
18092
|
-
*/
|
|
18100
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
18093
18101
|
|
|
18094
18102
|
/**
|
|
18095
18103
|
* Tag function for notating a pipeline with a book\`...\ notation as template literal
|
|
@@ -18102,6 +18110,7 @@ function isValidPipelineString(pipelineString) {
|
|
|
18102
18110
|
* @param strings The static string parts of the template literal
|
|
18103
18111
|
* @param values The dynamic values embedded within the template literal used as data
|
|
18104
18112
|
* @returns the pipeline string
|
|
18113
|
+
*
|
|
18105
18114
|
* @public exported from `@promptbook/core`
|
|
18106
18115
|
*/
|
|
18107
18116
|
function book(strings, ...values) {
|
|
@@ -18128,10 +18137,8 @@ function book(strings, ...values) {
|
|
|
18128
18137
|
}
|
|
18129
18138
|
return padBook(bookString);
|
|
18130
18139
|
}
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18134
|
-
*/
|
|
18140
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
18141
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18135
18142
|
|
|
18136
18143
|
/**
|
|
18137
18144
|
* Tool call name emitted while preparing a GPT assistant for an agent.
|
|
@@ -18176,9 +18183,7 @@ const CHAT_STREAM_WHITESPACE_DECODERS = [
|
|
|
18176
18183
|
{ token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
|
|
18177
18184
|
{ token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
|
|
18178
18185
|
];
|
|
18179
|
-
|
|
18180
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18181
|
-
*/
|
|
18186
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18182
18187
|
|
|
18183
18188
|
/**
|
|
18184
18189
|
* Converts encoded whitespace markers back into real whitespace so the UI can render the message
|
|
@@ -18196,6 +18201,9 @@ function decodeChatStreamWhitespaceFromTransport(content) {
|
|
|
18196
18201
|
}, content);
|
|
18197
18202
|
}
|
|
18198
18203
|
|
|
18204
|
+
/**
|
|
18205
|
+
* Constant for raw tool call ID fields.
|
|
18206
|
+
*/
|
|
18199
18207
|
const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
|
|
18200
18208
|
/**
|
|
18201
18209
|
* Builds a deterministic idempotency key for tool calls so the UI can track updates.
|
|
@@ -18226,6 +18234,9 @@ function resolveToolCallIdempotencyKey(toolCall) {
|
|
|
18226
18234
|
}
|
|
18227
18235
|
return `fallback:${toolCall.name}`;
|
|
18228
18236
|
}
|
|
18237
|
+
/**
|
|
18238
|
+
* Gets arguments key.
|
|
18239
|
+
*/
|
|
18229
18240
|
function getArgumentsKey(value) {
|
|
18230
18241
|
if (typeof value === 'string') {
|
|
18231
18242
|
return value;
|
|
@@ -18299,6 +18310,7 @@ function mergeToolCalls(existingToolCalls, incomingToolCalls) {
|
|
|
18299
18310
|
* @param existingToolCall - Previous snapshot.
|
|
18300
18311
|
* @param incomingToolCall - New snapshot.
|
|
18301
18312
|
* @returns One merged snapshot.
|
|
18313
|
+
*
|
|
18302
18314
|
* @private helper of `mergeToolCalls`
|
|
18303
18315
|
*/
|
|
18304
18316
|
function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
|
|
@@ -18321,6 +18333,7 @@ function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
|
|
|
18321
18333
|
* @param existingToolCall - Previous snapshot.
|
|
18322
18334
|
* @param incomingToolCall - New snapshot.
|
|
18323
18335
|
* @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
|
|
18336
|
+
*
|
|
18324
18337
|
* @private helper of `mergeToolCalls`
|
|
18325
18338
|
*/
|
|
18326
18339
|
function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
|
|
@@ -18334,6 +18347,7 @@ function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
|
|
|
18334
18347
|
*
|
|
18335
18348
|
* @param toolCall - Tool call snapshot to inspect.
|
|
18336
18349
|
* @returns Inferred lifecycle state or `undefined`.
|
|
18350
|
+
*
|
|
18337
18351
|
* @private helper of `mergeToolCalls`
|
|
18338
18352
|
*/
|
|
18339
18353
|
function inferToolCallState(toolCall) {
|
|
@@ -18357,6 +18371,7 @@ function inferToolCallState(toolCall) {
|
|
|
18357
18371
|
* @param existingValues - Previous list.
|
|
18358
18372
|
* @param incomingValues - Incoming list.
|
|
18359
18373
|
* @returns Deduplicated merged list or `undefined`.
|
|
18374
|
+
*
|
|
18360
18375
|
* @private helper of `mergeToolCalls`
|
|
18361
18376
|
*/
|
|
18362
18377
|
function mergeUnknownLists(existingValues, incomingValues) {
|
|
@@ -18383,6 +18398,7 @@ function mergeUnknownLists(existingValues, incomingValues) {
|
|
|
18383
18398
|
*
|
|
18384
18399
|
* @param value - Value to serialize.
|
|
18385
18400
|
* @returns String signature.
|
|
18401
|
+
*
|
|
18386
18402
|
* @private helper of `mergeToolCalls`
|
|
18387
18403
|
*/
|
|
18388
18404
|
function serializeValueForMerge(value) {
|
|
@@ -18400,6 +18416,7 @@ function serializeValueForMerge(value) {
|
|
|
18400
18416
|
*
|
|
18401
18417
|
* @param toolCalls - Mutable list to deduplicate in-place.
|
|
18402
18418
|
* @returns The same array after removing redundant preparation entries.
|
|
18419
|
+
*
|
|
18403
18420
|
* @private helper of `mergeToolCalls`
|
|
18404
18421
|
*/
|
|
18405
18422
|
function deduplicatePreparationToolCalls(toolCalls) {
|
|
@@ -18443,6 +18460,7 @@ function getAllCommitmentsToolTitles() {
|
|
|
18443
18460
|
* Restricts an Updatable to a (2) BehaviorSubject variant
|
|
18444
18461
|
*
|
|
18445
18462
|
* @see Updatable
|
|
18463
|
+
*
|
|
18446
18464
|
* @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
|
|
18447
18465
|
*/
|
|
18448
18466
|
function asUpdatableSubject(value) {
|
|
@@ -18467,9 +18485,7 @@ function asUpdatableSubject(value) {
|
|
|
18467
18485
|
return new BehaviorSubject(value);
|
|
18468
18486
|
}
|
|
18469
18487
|
}
|
|
18470
|
-
|
|
18471
|
-
* TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
|
|
18472
|
-
*/
|
|
18488
|
+
// TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
|
|
18473
18489
|
|
|
18474
18490
|
/**
|
|
18475
18491
|
* Takes an item or an array of items and returns an array of items
|
|
@@ -18502,6 +18518,7 @@ const MULTIPLE_PROVIDER_PROFILE = {
|
|
|
18502
18518
|
* Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
|
|
18503
18519
|
*
|
|
18504
18520
|
* Note: Internal utility of `joinLlmExecutionTools` but exposed type
|
|
18521
|
+
*
|
|
18505
18522
|
* @public exported from `@promptbook/core`
|
|
18506
18523
|
*/
|
|
18507
18524
|
class MultipleLlmExecutionTools {
|
|
@@ -18664,16 +18681,16 @@ class MultipleLlmExecutionTools {
|
|
|
18664
18681
|
* `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
|
|
18665
18682
|
*
|
|
18666
18683
|
* 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
|
|
18667
|
-
*
|
|
18684
|
+
* If the first provider doesn't support the requested model or fails, it tries the next one.
|
|
18668
18685
|
* 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
|
|
18669
18686
|
* 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
|
|
18670
18687
|
*
|
|
18688
|
+
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
18689
|
+
*
|
|
18671
18690
|
* @param title - A descriptive title for this collection of joined tools
|
|
18672
18691
|
* @param llmExecutionTools - An array of execution tools to be joined
|
|
18673
18692
|
* @returns A single unified execution tool wrapper
|
|
18674
18693
|
*
|
|
18675
|
-
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
18676
|
-
*
|
|
18677
18694
|
* @public exported from `@promptbook/core`
|
|
18678
18695
|
*/
|
|
18679
18696
|
function joinLlmExecutionTools(title, ...llmExecutionTools) {
|
|
@@ -18710,10 +18727,8 @@ function joinLlmExecutionTools(title, ...llmExecutionTools) {
|
|
|
18710
18727
|
}
|
|
18711
18728
|
return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
|
|
18712
18729
|
}
|
|
18713
|
-
|
|
18714
|
-
|
|
18715
|
-
* TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
18716
|
-
*/
|
|
18730
|
+
// TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
18731
|
+
// TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
18717
18732
|
|
|
18718
18733
|
/**
|
|
18719
18734
|
* Just returns the given `LlmExecutionTools` or joins multiple into one
|
|
@@ -18727,10 +18742,8 @@ function getSingleLlmExecutionTools(oneOrMoreLlmExecutionTools) {
|
|
|
18727
18742
|
: joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
|
|
18728
18743
|
return llmTools;
|
|
18729
18744
|
}
|
|
18730
|
-
|
|
18731
|
-
|
|
18732
|
-
* TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
18733
|
-
*/
|
|
18745
|
+
// TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
18746
|
+
// TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
18734
18747
|
|
|
18735
18748
|
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"}];
|
|
18736
18749
|
|
|
@@ -18739,8 +18752,9 @@ var PipelineCollection = [{title:"Prepare Knowledge from Markdown",pipelineUrl:"
|
|
|
18739
18752
|
*
|
|
18740
18753
|
* @param content raw html code
|
|
18741
18754
|
* @returns formatted html code
|
|
18742
|
-
* @private withing the package because of HUGE size of prettier dependency
|
|
18743
18755
|
* @deprecated Prettier removed from Promptbook due to package size
|
|
18756
|
+
*
|
|
18757
|
+
* @private withing the package because of HUGE size of prettier dependency
|
|
18744
18758
|
*/
|
|
18745
18759
|
function prettifyMarkdown(content) {
|
|
18746
18760
|
return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
|
|
@@ -18752,6 +18766,7 @@ function prettifyMarkdown(content) {
|
|
|
18752
18766
|
* @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
|
|
18753
18767
|
* @param pipelineJson Promptbook in JSON format (.bookc)
|
|
18754
18768
|
* @returns Promptbook in string format (.book.md)
|
|
18769
|
+
*
|
|
18755
18770
|
* @public exported from `@promptbook/core`
|
|
18756
18771
|
*/
|
|
18757
18772
|
function pipelineJsonToString(pipelineJson) {
|
|
@@ -18868,6 +18883,8 @@ function pipelineJsonToString(pipelineJson) {
|
|
|
18868
18883
|
return validatePipelineString(pipelineString);
|
|
18869
18884
|
}
|
|
18870
18885
|
/**
|
|
18886
|
+
* Handles task parameter Json to string.
|
|
18887
|
+
*
|
|
18871
18888
|
* @private internal utility of `pipelineJsonToString`
|
|
18872
18889
|
*/
|
|
18873
18890
|
function taskParameterJsonToString(taskParameterJson) {
|
|
@@ -18878,13 +18895,11 @@ function taskParameterJsonToString(taskParameterJson) {
|
|
|
18878
18895
|
}
|
|
18879
18896
|
return parameterString;
|
|
18880
18897
|
}
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
* TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
18887
|
-
*/
|
|
18898
|
+
// TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
|
|
18899
|
+
// TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
|
|
18900
|
+
// TODO: [🏛] Maybe make some markdown builder
|
|
18901
|
+
// TODO: [🏛] Escape all
|
|
18902
|
+
// TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
18888
18903
|
|
|
18889
18904
|
/**
|
|
18890
18905
|
* Validates PipelineJson if it is logically valid
|
|
@@ -18901,6 +18916,7 @@ function taskParameterJsonToString(taskParameterJson) {
|
|
|
18901
18916
|
* @param pipeline valid or invalid PipelineJson
|
|
18902
18917
|
* @returns the same pipeline if it is logically valid
|
|
18903
18918
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
18919
|
+
*
|
|
18904
18920
|
* @public exported from `@promptbook/core`
|
|
18905
18921
|
*/
|
|
18906
18922
|
function validatePipeline(pipeline) {
|
|
@@ -18925,6 +18941,8 @@ function validatePipeline(pipeline) {
|
|
|
18925
18941
|
return pipeline;
|
|
18926
18942
|
}
|
|
18927
18943
|
/**
|
|
18944
|
+
* Validates pipeline inner function.
|
|
18945
|
+
*
|
|
18928
18946
|
* @private internal function for `validatePipeline`
|
|
18929
18947
|
*/
|
|
18930
18948
|
function validatePipeline_InnerFunction(pipeline) {
|
|
@@ -19169,20 +19187,19 @@ function validatePipeline_InnerFunction(pipeline) {
|
|
|
19169
19187
|
* > * - ...
|
|
19170
19188
|
* > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
|
|
19171
19189
|
*/
|
|
19172
|
-
|
|
19173
|
-
|
|
19174
|
-
|
|
19175
|
-
|
|
19176
|
-
|
|
19177
|
-
|
|
19178
|
-
|
|
19179
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
19180
|
-
*/
|
|
19190
|
+
// TODO: [🧳][main] !!4 Validate that all examples match expectations
|
|
19191
|
+
// TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
|
|
19192
|
+
// TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
|
|
19193
|
+
// TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
|
|
19194
|
+
// TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
|
|
19195
|
+
// TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
|
|
19196
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
19181
19197
|
|
|
19182
19198
|
/**
|
|
19183
19199
|
* Unprepare just strips the preparation data of the pipeline
|
|
19184
19200
|
*
|
|
19185
19201
|
* @deprecated In future version this function will be removed or deprecated
|
|
19202
|
+
*
|
|
19186
19203
|
* @public exported from `@promptbook/core`
|
|
19187
19204
|
*/
|
|
19188
19205
|
function unpreparePipeline(pipeline) {
|
|
@@ -19211,18 +19228,17 @@ function unpreparePipeline(pipeline) {
|
|
|
19211
19228
|
},
|
|
19212
19229
|
});
|
|
19213
19230
|
}
|
|
19214
|
-
|
|
19215
|
-
|
|
19216
|
-
|
|
19217
|
-
* TODO: [🍙] Make some standard order of json properties
|
|
19218
|
-
*/
|
|
19231
|
+
// TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
|
|
19232
|
+
// TODO: Write tests for `preparePipeline`
|
|
19233
|
+
// TODO: [🍙] Make some standard order of json properties
|
|
19219
19234
|
|
|
19220
19235
|
/**
|
|
19221
19236
|
* Library of pipelines that groups together pipelines for an application.
|
|
19222
19237
|
* This implementation is a very thin wrapper around the Array / Map of pipelines.
|
|
19223
19238
|
*
|
|
19224
|
-
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
19225
19239
|
* @see https://github.com/webgptorg/pipeline#pipeline-collection
|
|
19240
|
+
*
|
|
19241
|
+
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
19226
19242
|
*/
|
|
19227
19243
|
class SimplePipelineCollection {
|
|
19228
19244
|
/**
|
|
@@ -19326,6 +19342,7 @@ class SimplePipelineCollection {
|
|
|
19326
19342
|
*
|
|
19327
19343
|
* @param promptbookSources
|
|
19328
19344
|
* @returns PipelineCollection
|
|
19345
|
+
*
|
|
19329
19346
|
* @public exported from `@promptbook/core`
|
|
19330
19347
|
*/
|
|
19331
19348
|
function createPipelineCollectionFromJson(...promptbooks) {
|
|
@@ -19379,6 +19396,7 @@ function isPipelinePrepared(pipeline) {
|
|
|
19379
19396
|
*
|
|
19380
19397
|
* @param executionResult - The partial result of the Promptbook execution
|
|
19381
19398
|
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
19399
|
+
*
|
|
19382
19400
|
* @private internal helper function of `asPromise` method of `ExecutionTask`
|
|
19383
19401
|
*/
|
|
19384
19402
|
function assertsTaskSuccessful(executionResult) {
|
|
@@ -19409,9 +19427,7 @@ function assertsTaskSuccessful(executionResult) {
|
|
|
19409
19427
|
`));
|
|
19410
19428
|
}
|
|
19411
19429
|
}
|
|
19412
|
-
|
|
19413
|
-
* TODO: [🧠] Can this return type be better typed than void
|
|
19414
|
-
*/
|
|
19430
|
+
// TODO: [🧠] Can this return type be better typed than void
|
|
19415
19431
|
|
|
19416
19432
|
/**
|
|
19417
19433
|
* Helper to create a new task
|
|
@@ -19602,10 +19618,8 @@ function createTask(options) {
|
|
|
19602
19618
|
},
|
|
19603
19619
|
};
|
|
19604
19620
|
}
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
* TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
|
|
19608
|
-
*/
|
|
19621
|
+
// TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
|
|
19622
|
+
// TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
|
|
19609
19623
|
|
|
19610
19624
|
/**
|
|
19611
19625
|
* Represents the uncertain value
|
|
@@ -19673,9 +19687,7 @@ const UNCERTAIN_USAGE = $deepFreeze({
|
|
|
19673
19687
|
pagesCount: UNCERTAIN_ZERO_VALUE,
|
|
19674
19688
|
},
|
|
19675
19689
|
});
|
|
19676
|
-
|
|
19677
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19678
|
-
*/
|
|
19690
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19679
19691
|
|
|
19680
19692
|
/**
|
|
19681
19693
|
* Function `addUsage` will add multiple usages into one
|
|
@@ -19740,6 +19752,7 @@ function addUsage(...usageItems) {
|
|
|
19740
19752
|
*
|
|
19741
19753
|
* @param llmTools - The LLM tools to be intercepted and tracked
|
|
19742
19754
|
* @returns Full proxy of the tools with added usage tracking capabilities
|
|
19755
|
+
*
|
|
19743
19756
|
* @public exported from `@promptbook/core`
|
|
19744
19757
|
*/
|
|
19745
19758
|
function countUsage(llmTools) {
|
|
@@ -19837,13 +19850,13 @@ function countUsage(llmTools) {
|
|
|
19837
19850
|
* Global registry for storing metadata about all available scrapers and converters.
|
|
19838
19851
|
*
|
|
19839
19852
|
* Note: `$` is used to indicate that this interacts with the global scope.
|
|
19853
|
+
*
|
|
19840
19854
|
* @singleton Only one instance of each register is created per build, but there can be more in different contexts (e.g., tests).
|
|
19855
|
+
*
|
|
19841
19856
|
* @public exported from `@promptbook/core`
|
|
19842
19857
|
*/
|
|
19843
19858
|
const $scrapersMetadataRegister = new $Register('scrapers_metadata');
|
|
19844
|
-
|
|
19845
|
-
* TODO: [®] DRY Register logic
|
|
19846
|
-
*/
|
|
19859
|
+
// TODO: [®] DRY Register logic
|
|
19847
19860
|
|
|
19848
19861
|
/**
|
|
19849
19862
|
* Creates a message with all registered scrapers
|
|
@@ -19928,9 +19941,7 @@ function $registeredScrapersMessage(availableScrapers) {
|
|
|
19928
19941
|
|
|
19929
19942
|
`);
|
|
19930
19943
|
}
|
|
19931
|
-
|
|
19932
|
-
* TODO: [®] DRY Register logic
|
|
19933
|
-
*/
|
|
19944
|
+
// TODO: [®] DRY Register logic
|
|
19934
19945
|
|
|
19935
19946
|
/**
|
|
19936
19947
|
* Creates unique name for the source
|
|
@@ -19949,9 +19960,7 @@ function knowledgeSourceContentToName(knowledgeSourceContent) {
|
|
|
19949
19960
|
// <- TODO: Use MAX_FILENAME_LENGTH
|
|
19950
19961
|
return name;
|
|
19951
19962
|
}
|
|
19952
|
-
|
|
19953
|
-
* TODO: [🐱🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
|
|
19954
|
-
*/
|
|
19963
|
+
// TODO: [🐱🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
|
|
19955
19964
|
|
|
19956
19965
|
/**
|
|
19957
19966
|
* Converts a name to a properly formatted subfolder path for cache storage.
|
|
@@ -19982,11 +19991,9 @@ async function isFileExisting(filename, fs) {
|
|
|
19982
19991
|
.catch(() => false);
|
|
19983
19992
|
return isFile;
|
|
19984
19993
|
}
|
|
19985
|
-
|
|
19986
|
-
|
|
19987
|
-
|
|
19988
|
-
* TODO: [🖇] What about symlinks?
|
|
19989
|
-
*/
|
|
19994
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
19995
|
+
// TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
19996
|
+
// TODO: [🖇] What about symlinks?
|
|
19990
19997
|
|
|
19991
19998
|
/**
|
|
19992
19999
|
* Convert mime type to file extension
|
|
@@ -20026,9 +20033,7 @@ const promptbookFetch = async (urlOrRequest, init) => {
|
|
|
20026
20033
|
`));
|
|
20027
20034
|
}
|
|
20028
20035
|
};
|
|
20029
|
-
|
|
20030
|
-
* TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
|
|
20031
|
-
*/
|
|
20036
|
+
// TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
|
|
20032
20037
|
|
|
20033
20038
|
/**
|
|
20034
20039
|
* Factory function that creates a handler for processing knowledge sources.
|
|
@@ -20248,6 +20253,7 @@ async function makeKnowledgeSourceHandler(knowledgeSource, tools, options) {
|
|
|
20248
20253
|
* Prepares the knowledge pieces
|
|
20249
20254
|
*
|
|
20250
20255
|
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
20256
|
+
*
|
|
20251
20257
|
* @public exported from `@promptbook/core`
|
|
20252
20258
|
*/
|
|
20253
20259
|
async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
@@ -20389,25 +20395,24 @@ async function prepareTasks(pipeline, tools, options) {
|
|
|
20389
20395
|
});
|
|
20390
20396
|
return { tasksPrepared };
|
|
20391
20397
|
}
|
|
20392
|
-
|
|
20393
|
-
|
|
20394
|
-
|
|
20395
|
-
|
|
20396
|
-
|
|
20397
|
-
|
|
20398
|
-
|
|
20399
|
-
|
|
20400
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
20401
|
-
*/
|
|
20398
|
+
// TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
|
|
20399
|
+
// TODO: [🧠] Add context to each task (if missing)
|
|
20400
|
+
// TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
|
|
20401
|
+
// TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
|
|
20402
|
+
// TODO: Write tests for `preparePipeline`
|
|
20403
|
+
// TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
20404
|
+
// TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
20405
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
20402
20406
|
|
|
20403
20407
|
/**
|
|
20404
20408
|
* Prepare pipeline locally
|
|
20405
20409
|
*
|
|
20406
|
-
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
20407
|
-
*
|
|
20408
20410
|
* Note: This function does not validate logic of the pipeline
|
|
20409
20411
|
* Note: This function acts as part of compilation process
|
|
20410
20412
|
* Note: When the pipeline is already prepared, it returns the same pipeline
|
|
20413
|
+
*
|
|
20414
|
+
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
20415
|
+
*
|
|
20411
20416
|
* @public exported from `@promptbook/core`
|
|
20412
20417
|
*/
|
|
20413
20418
|
async function preparePipeline(pipeline, tools, options) {
|
|
@@ -20551,6 +20556,7 @@ async function preparePipeline(pipeline, tools, options) {
|
|
|
20551
20556
|
* @param script from which to extract the variables
|
|
20552
20557
|
* @returns the list of variable names
|
|
20553
20558
|
* @throws {ParseError} if the script is invalid
|
|
20559
|
+
*
|
|
20554
20560
|
* @public exported from `@promptbook/javascript`
|
|
20555
20561
|
*/
|
|
20556
20562
|
function extractVariablesFromJavascript(script) {
|
|
@@ -20616,9 +20622,7 @@ function extractVariablesFromJavascript(script) {
|
|
|
20616
20622
|
}
|
|
20617
20623
|
return variables;
|
|
20618
20624
|
}
|
|
20619
|
-
|
|
20620
|
-
* TODO: [🔣] Support for multiple languages - python, java,...
|
|
20621
|
-
*/
|
|
20625
|
+
// TODO: [🔣] Support for multiple languages - python, java,...
|
|
20622
20626
|
|
|
20623
20627
|
/**
|
|
20624
20628
|
* Parses the task and returns the set of all used parameters
|
|
@@ -20626,6 +20630,7 @@ function extractVariablesFromJavascript(script) {
|
|
|
20626
20630
|
* @param task the task with used parameters
|
|
20627
20631
|
* @returns the set of parameter names
|
|
20628
20632
|
* @throws {ParseError} if the script is invalid
|
|
20633
|
+
*
|
|
20629
20634
|
* @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
|
|
20630
20635
|
*/
|
|
20631
20636
|
function extractParameterNamesFromTask(task) {
|
|
@@ -20666,9 +20671,7 @@ function extractParameterNamesFromTask(task) {
|
|
|
20666
20671
|
}
|
|
20667
20672
|
return parameterNames;
|
|
20668
20673
|
}
|
|
20669
|
-
|
|
20670
|
-
* TODO: [🔣] If script require contentLanguage
|
|
20671
|
-
*/
|
|
20674
|
+
// TODO: [🔣] If script require contentLanguage
|
|
20672
20675
|
|
|
20673
20676
|
/**
|
|
20674
20677
|
* Contains configuration options for parsing and generating CSV files, such as delimiters and quoting rules.
|
|
@@ -20701,8 +20704,9 @@ function csvParse(value /* <- TODO: string_csv */, settings, schema /* <- TODO:
|
|
|
20701
20704
|
/**
|
|
20702
20705
|
* Definition for CSV spreadsheet
|
|
20703
20706
|
*
|
|
20707
|
+
* TODO: [🏢] Export from package `@promptbook/csv`
|
|
20708
|
+
*
|
|
20704
20709
|
* @public exported from `@promptbook/core`
|
|
20705
|
-
* <- TODO: [🏢] Export from package `@promptbook/csv`
|
|
20706
20710
|
*/
|
|
20707
20711
|
const CsvFormatParser = {
|
|
20708
20712
|
formatName: 'CSV',
|
|
@@ -20792,13 +20796,11 @@ const CsvFormatParser = {
|
|
|
20792
20796
|
},
|
|
20793
20797
|
],
|
|
20794
20798
|
};
|
|
20795
|
-
|
|
20796
|
-
|
|
20797
|
-
|
|
20798
|
-
|
|
20799
|
-
|
|
20800
|
-
* TODO: [🏢] Allow to expect something inside CSV objects and other formats
|
|
20801
|
-
*/
|
|
20799
|
+
// TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
|
|
20800
|
+
// TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
|
|
20801
|
+
// TODO: [🍓] In `CsvFormatParser` implement `heal
|
|
20802
|
+
// TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
|
|
20803
|
+
// TODO: [🏢] Allow to expect something inside CSV objects and other formats
|
|
20802
20804
|
|
|
20803
20805
|
/**
|
|
20804
20806
|
* Definition for JSON format
|
|
@@ -20819,17 +20821,15 @@ const JsonFormatParser = {
|
|
|
20819
20821
|
},
|
|
20820
20822
|
subvalueParsers: [],
|
|
20821
20823
|
};
|
|
20822
|
-
|
|
20823
|
-
|
|
20824
|
-
|
|
20825
|
-
|
|
20826
|
-
|
|
20827
|
-
|
|
20828
|
-
|
|
20829
|
-
|
|
20830
|
-
|
|
20831
|
-
* TODO: [🏢] Allow to expect something inside JSON objects and other formats
|
|
20832
|
-
*/
|
|
20824
|
+
// TODO: [🧠] Maybe proper instance of object
|
|
20825
|
+
// TODO: [0] Make string_serialized_json
|
|
20826
|
+
// TODO: [1] Make type for JSON Settings and Schema
|
|
20827
|
+
// TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
|
|
20828
|
+
// TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
|
|
20829
|
+
// TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
|
|
20830
|
+
// TODO: [🍓] In `JsonFormatParser` implement `heal
|
|
20831
|
+
// TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
|
|
20832
|
+
// TODO: [🏢] Allow to expect something inside JSON objects and other formats
|
|
20833
20833
|
|
|
20834
20834
|
/**
|
|
20835
20835
|
* Definition for any text - this will be always valid
|
|
@@ -20867,15 +20867,13 @@ const TextFormatParser = {
|
|
|
20867
20867
|
// <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
20868
20868
|
],
|
|
20869
20869
|
};
|
|
20870
|
-
|
|
20871
|
-
|
|
20872
|
-
|
|
20873
|
-
|
|
20874
|
-
|
|
20875
|
-
|
|
20876
|
-
|
|
20877
|
-
* TODO: [🏢] Allow to expect something inside each item of list and other formats
|
|
20878
|
-
*/
|
|
20870
|
+
// TODO: [1] Make type for XML Text and Schema
|
|
20871
|
+
// TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
20872
|
+
// TODO: [🍓] In `TextFormatParser` implement simple `isValid`
|
|
20873
|
+
// TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
|
|
20874
|
+
// TODO: [🍓] In `TextFormatParser` implement `heal
|
|
20875
|
+
// TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
|
|
20876
|
+
// TODO: [🏢] Allow to expect something inside each item of list and other formats
|
|
20879
20877
|
|
|
20880
20878
|
/**
|
|
20881
20879
|
* Definition for XML format
|
|
@@ -20896,17 +20894,15 @@ const XmlFormatParser = {
|
|
|
20896
20894
|
},
|
|
20897
20895
|
subvalueParsers: [],
|
|
20898
20896
|
};
|
|
20899
|
-
|
|
20900
|
-
|
|
20901
|
-
|
|
20902
|
-
|
|
20903
|
-
|
|
20904
|
-
|
|
20905
|
-
|
|
20906
|
-
|
|
20907
|
-
|
|
20908
|
-
* TODO: [🏢] Allow to expect something inside XML and other formats
|
|
20909
|
-
*/
|
|
20897
|
+
// TODO: [🧠] Maybe proper instance of object
|
|
20898
|
+
// TODO: [0] Make string_serialized_xml
|
|
20899
|
+
// TODO: [1] Make type for XML Settings and Schema
|
|
20900
|
+
// TODO: [🧠] What to use for validating XMLs - XSD,...
|
|
20901
|
+
// TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
|
|
20902
|
+
// TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
|
|
20903
|
+
// TODO: [🍓] In `XmlFormatParser` implement `heal
|
|
20904
|
+
// TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
|
|
20905
|
+
// TODO: [🏢] Allow to expect something inside XML and other formats
|
|
20910
20906
|
|
|
20911
20907
|
/**
|
|
20912
20908
|
* Definitions for all formats supported by Promptbook
|
|
@@ -20914,9 +20910,7 @@ const XmlFormatParser = {
|
|
|
20914
20910
|
* @private internal index of `...` <- TODO [🏢]
|
|
20915
20911
|
*/
|
|
20916
20912
|
const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
|
|
20917
|
-
|
|
20918
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20919
|
-
*/
|
|
20913
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20920
20914
|
|
|
20921
20915
|
/**
|
|
20922
20916
|
* Maps available parameters to expected parameters for a pipeline task.
|
|
@@ -20926,6 +20920,7 @@ const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser,
|
|
|
20926
20920
|
* 2) Then, if there are unmatched expected and available parameters, map them by order.
|
|
20927
20921
|
*
|
|
20928
20922
|
* @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
|
|
20923
|
+
*
|
|
20929
20924
|
* @private within the repository used in `createPipelineExecutor`
|
|
20930
20925
|
*/
|
|
20931
20926
|
function mapAvailableToExpectedParameters(options) {
|
|
@@ -20996,6 +20991,7 @@ function mapAvailableToExpectedParameters(options) {
|
|
|
20996
20991
|
* @param markdown any valid markdown
|
|
20997
20992
|
* @returns code blocks with language and content
|
|
20998
20993
|
* @throws {ParseError} if block is not closed properly
|
|
20994
|
+
*
|
|
20999
20995
|
* @public exported from `@promptbook/markdown-utils`
|
|
21000
20996
|
*/
|
|
21001
20997
|
function extractAllBlocksFromMarkdown(markdown) {
|
|
@@ -21046,9 +21042,7 @@ function extractAllBlocksFromMarkdown(markdown) {
|
|
|
21046
21042
|
}
|
|
21047
21043
|
return codeBlocks;
|
|
21048
21044
|
}
|
|
21049
|
-
|
|
21050
|
-
* TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
21051
|
-
*/
|
|
21045
|
+
// TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
21052
21046
|
|
|
21053
21047
|
/**
|
|
21054
21048
|
* Extracts extracts exactly one valid JSON code block
|
|
@@ -21064,8 +21058,9 @@ function extractAllBlocksFromMarkdown(markdown) {
|
|
|
21064
21058
|
* - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
|
|
21065
21059
|
* - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
|
|
21066
21060
|
*
|
|
21067
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
21068
21061
|
* @throws {ParseError} if there is no valid JSON block in the markdown
|
|
21062
|
+
*
|
|
21063
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
21069
21064
|
*/
|
|
21070
21065
|
function extractJsonBlock(markdown) {
|
|
21071
21066
|
if (isValidJsonString(markdown)) {
|
|
@@ -21081,10 +21076,8 @@ function extractJsonBlock(markdown) {
|
|
|
21081
21076
|
}
|
|
21082
21077
|
return jsonBlocks[0].content;
|
|
21083
21078
|
}
|
|
21084
|
-
|
|
21085
|
-
|
|
21086
|
-
* TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
|
|
21087
|
-
*/
|
|
21079
|
+
// TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
|
|
21080
|
+
// TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
|
|
21088
21081
|
|
|
21089
21082
|
/**
|
|
21090
21083
|
* Function checkExpectations will check if the expectations on given value are met
|
|
@@ -21095,6 +21088,7 @@ function extractJsonBlock(markdown) {
|
|
|
21095
21088
|
*
|
|
21096
21089
|
* @throws {ExpectError} if the expectations are not met
|
|
21097
21090
|
* @returns {void} Nothing
|
|
21091
|
+
*
|
|
21098
21092
|
* @private internal function of `createPipelineExecutor`
|
|
21099
21093
|
*/
|
|
21100
21094
|
function checkExpectations(expectations, value) {
|
|
@@ -21108,11 +21102,9 @@ function checkExpectations(expectations, value) {
|
|
|
21108
21102
|
}
|
|
21109
21103
|
}
|
|
21110
21104
|
}
|
|
21111
|
-
|
|
21112
|
-
|
|
21113
|
-
|
|
21114
|
-
* Note: [💝] and [🤠] are interconnected together
|
|
21115
|
-
*/
|
|
21105
|
+
// TODO: [💝] Unite object for expecting amount and format
|
|
21106
|
+
// TODO: [🧠][🤠] This should be part of `TextFormatParser`
|
|
21107
|
+
// Note: [💝] and [🤠] are interconnected together
|
|
21116
21108
|
|
|
21117
21109
|
/**
|
|
21118
21110
|
* Validates a prompt result against expectations and format requirements.
|
|
@@ -21123,6 +21115,7 @@ function checkExpectations(expectations, value) {
|
|
|
21123
21115
|
*
|
|
21124
21116
|
* @param options - The validation options including result string, expectations, and format
|
|
21125
21117
|
* @returns Validation result with processed string and validity status
|
|
21118
|
+
*
|
|
21126
21119
|
* @private internal function of `createPipelineExecutor` and `cacheLlmTools`
|
|
21127
21120
|
*/
|
|
21128
21121
|
function validatePromptResult(options) {
|
|
@@ -21185,6 +21178,7 @@ function validatePromptResult(options) {
|
|
|
21185
21178
|
*
|
|
21186
21179
|
* @param options - The options for execution, including task, parameters, pipeline, and configuration.
|
|
21187
21180
|
* @returns The result string of the executed task.
|
|
21181
|
+
*
|
|
21188
21182
|
* @private internal utility of `createPipelineExecutor`
|
|
21189
21183
|
*/
|
|
21190
21184
|
async function executeAttempts(options) {
|
|
@@ -21508,9 +21502,7 @@ async function executeAttempts(options) {
|
|
|
21508
21502
|
}
|
|
21509
21503
|
return $ongoingTaskResult.$resultString;
|
|
21510
21504
|
}
|
|
21511
|
-
|
|
21512
|
-
* TODO: Break into smaller functions
|
|
21513
|
-
*/
|
|
21505
|
+
// TODO: Break into smaller functions
|
|
21514
21506
|
|
|
21515
21507
|
/**
|
|
21516
21508
|
* Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
|
|
@@ -21653,6 +21645,7 @@ async function executeFormatSubvalues(options) {
|
|
|
21653
21645
|
*
|
|
21654
21646
|
* @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
|
|
21655
21647
|
* @returns The context as a string, formatted as markdown and parameter value.
|
|
21648
|
+
*
|
|
21656
21649
|
* @private internal utility of `createPipelineExecutor`
|
|
21657
21650
|
*/
|
|
21658
21651
|
async function getContextForTask(task) {
|
|
@@ -21690,7 +21683,6 @@ function computeCosineSimilarity(embeddingVector1, embeddingVector2) {
|
|
|
21690
21683
|
}
|
|
21691
21684
|
|
|
21692
21685
|
/**
|
|
21693
|
-
*
|
|
21694
21686
|
* @param knowledgePieces
|
|
21695
21687
|
* @returns
|
|
21696
21688
|
*
|
|
@@ -21771,10 +21763,8 @@ async function getKnowledgeForTask(options) {
|
|
|
21771
21763
|
return knowledgePiecesToString(preparedPipeline.knowledgePieces);
|
|
21772
21764
|
}
|
|
21773
21765
|
}
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
* TODO: [♨] Examples of values
|
|
21777
|
-
*/
|
|
21766
|
+
// TODO: [♨] Implement Better - use keyword search
|
|
21767
|
+
// TODO: [♨] Examples of values
|
|
21778
21768
|
|
|
21779
21769
|
/**
|
|
21780
21770
|
* Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
|
|
@@ -21927,9 +21917,7 @@ async function executeTask(options) {
|
|
|
21927
21917
|
resultString,
|
|
21928
21918
|
});
|
|
21929
21919
|
}
|
|
21930
|
-
|
|
21931
|
-
* TODO: [🤹♂️]
|
|
21932
|
-
*/
|
|
21920
|
+
// TODO: [🤹♂️]
|
|
21933
21921
|
|
|
21934
21922
|
/**
|
|
21935
21923
|
* Filters and returns only the output parameters from the provided pipeline execution options.
|
|
@@ -22259,6 +22247,7 @@ async function executePipeline(options) {
|
|
|
22259
22247
|
*
|
|
22260
22248
|
* @returns The executor function
|
|
22261
22249
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
22250
|
+
*
|
|
22262
22251
|
* @public exported from `@promptbook/core`
|
|
22263
22252
|
*/
|
|
22264
22253
|
function createPipelineExecutor(options) {
|
|
@@ -22412,6 +22401,7 @@ function createPipelineExecutor(options) {
|
|
|
22412
22401
|
* Prepares the persona for the pipeline
|
|
22413
22402
|
*
|
|
22414
22403
|
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
22404
|
+
*
|
|
22415
22405
|
* @public exported from `@promptbook/core`
|
|
22416
22406
|
*/
|
|
22417
22407
|
async function preparePersona(personaDescription, tools, options) {
|
|
@@ -22468,13 +22458,11 @@ async function preparePersona(personaDescription, tools, options) {
|
|
|
22468
22458
|
modelsRequirements,
|
|
22469
22459
|
};
|
|
22470
22460
|
}
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
|
|
22475
|
-
|
|
22476
|
-
* TODO: [🏢] Check validity of `temperature` in pipeline
|
|
22477
|
-
*/
|
|
22461
|
+
// TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
|
|
22462
|
+
// TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
|
|
22463
|
+
// TODO: [🏢] Check validity of `modelName` in pipeline
|
|
22464
|
+
// TODO: [🏢] Check validity of `systemMessage` in pipeline
|
|
22465
|
+
// TODO: [🏢] Check validity of `temperature` in pipeline
|
|
22478
22466
|
|
|
22479
22467
|
/**
|
|
22480
22468
|
* Creates an empty/basic agent model requirements object
|
|
@@ -22509,12 +22497,11 @@ function createBasicAgentModelRequirements(agentName) {
|
|
|
22509
22497
|
systemMessage: `You are ${agentName || 'AI Agent'}`,
|
|
22510
22498
|
};
|
|
22511
22499
|
}
|
|
22512
|
-
|
|
22513
|
-
* TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
|
|
22514
|
-
*/
|
|
22500
|
+
// TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
|
|
22515
22501
|
|
|
22516
22502
|
/**
|
|
22517
22503
|
* Gets a commitment definition by its type
|
|
22504
|
+
*
|
|
22518
22505
|
* @param type The commitment type to look up
|
|
22519
22506
|
* @returns The commitment definition or null if not found
|
|
22520
22507
|
*
|
|
@@ -22893,7 +22880,9 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
|
|
|
22893
22880
|
};
|
|
22894
22881
|
}
|
|
22895
22882
|
/**
|
|
22896
|
-
*
|
|
22883
|
+
* Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
|
|
22884
|
+
*
|
|
22885
|
+
* @private
|
|
22897
22886
|
*/
|
|
22898
22887
|
async function applyPendingInlineKnowledgeSources(requirements, uploader) {
|
|
22899
22888
|
var _a;
|
|
@@ -22914,6 +22903,9 @@ async function applyPendingInlineKnowledgeSources(requirements, uploader) {
|
|
|
22914
22903
|
_metadata: stripInlineKnowledgeMetadata(requirements._metadata),
|
|
22915
22904
|
};
|
|
22916
22905
|
}
|
|
22906
|
+
/**
|
|
22907
|
+
* Handles upload inline knowledge source with fallback.
|
|
22908
|
+
*/
|
|
22917
22909
|
async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
|
|
22918
22910
|
try {
|
|
22919
22911
|
return await uploader(inlineSource);
|
|
@@ -22926,6 +22918,9 @@ async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
|
|
|
22926
22918
|
return inlineKnowledgeSourceToDataUrl(inlineSource);
|
|
22927
22919
|
}
|
|
22928
22920
|
}
|
|
22921
|
+
/**
|
|
22922
|
+
* Extracts inline knowledge sources.
|
|
22923
|
+
*/
|
|
22929
22924
|
function extractInlineKnowledgeSources(metadata) {
|
|
22930
22925
|
if (!metadata) {
|
|
22931
22926
|
return [];
|
|
@@ -22933,6 +22928,9 @@ function extractInlineKnowledgeSources(metadata) {
|
|
|
22933
22928
|
const value = metadata.inlineKnowledgeSources;
|
|
22934
22929
|
return Array.isArray(value) ? value : [];
|
|
22935
22930
|
}
|
|
22931
|
+
/**
|
|
22932
|
+
* Strips inline knowledge metadata.
|
|
22933
|
+
*/
|
|
22936
22934
|
function stripInlineKnowledgeMetadata(metadata) {
|
|
22937
22935
|
if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
|
|
22938
22936
|
return metadata;
|
|
@@ -22983,6 +22981,7 @@ function isBinaryMimeType(mimeType) {
|
|
|
22983
22981
|
* @param availableModels - Models that could fulfill the agent.
|
|
22984
22982
|
* @param llmTools - Execution tools used when selecting a best model.
|
|
22985
22983
|
* @param options - Optional hooks such as the agent reference resolver.
|
|
22984
|
+
*
|
|
22986
22985
|
* @public exported from `@promptbook/core`
|
|
22987
22986
|
*/
|
|
22988
22987
|
async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
|
|
@@ -23002,6 +23001,7 @@ async function createAgentModelRequirements(agentSource, modelName, availableMod
|
|
|
23002
23001
|
* @param agentSource The agent source to derive persona description from
|
|
23003
23002
|
* @param llmTools LLM tools for preparing persona
|
|
23004
23003
|
* @returns The name of the best selected model
|
|
23004
|
+
*
|
|
23005
23005
|
* @private function of `createAgentModelRequirements`
|
|
23006
23006
|
*/
|
|
23007
23007
|
async function selectBestModelUsingPersona(agentSource, llmTools) {
|
|
@@ -23137,6 +23137,7 @@ function normalizeChatAttachment(rawAttachment) {
|
|
|
23137
23137
|
*
|
|
23138
23138
|
* @param {unknown} rawAttachments - The raw attachments to normalize.
|
|
23139
23139
|
* @returns {Array<ChatAttachment>} The normalized attachments.
|
|
23140
|
+
*
|
|
23140
23141
|
* @public exported from `@promptbook/core`
|
|
23141
23142
|
*/
|
|
23142
23143
|
function normalizeChatAttachments(rawAttachments) {
|
|
@@ -23181,6 +23182,7 @@ function formatChatAttachmentLine(attachment) {
|
|
|
23181
23182
|
*
|
|
23182
23183
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
|
|
23183
23184
|
* @returns {string} The formatted context.
|
|
23185
|
+
*
|
|
23184
23186
|
* @public exported from `@promptbook/core`
|
|
23185
23187
|
*/
|
|
23186
23188
|
function formatChatAttachmentContext(attachments) {
|
|
@@ -23201,6 +23203,7 @@ function formatChatAttachmentContext(attachments) {
|
|
|
23201
23203
|
* @param {number} maxBytes - Maximum number of bytes to capture.
|
|
23202
23204
|
* @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
|
|
23203
23205
|
* @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
|
|
23206
|
+
*
|
|
23204
23207
|
* @private internal utility for bounded response reads
|
|
23205
23208
|
*/
|
|
23206
23209
|
async function readResponseBytes(response, maxBytes, options = {}) {
|
|
@@ -23297,6 +23300,7 @@ function createAttachmentContentFailure(attachment, reason, options = {}) {
|
|
|
23297
23300
|
* @param {number} maxInlineCharacters - Maximum number of characters to inline.
|
|
23298
23301
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
23299
23302
|
* @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
|
|
23303
|
+
*
|
|
23300
23304
|
* @private function of resolveChatAttachmentContents
|
|
23301
23305
|
*/
|
|
23302
23306
|
async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
|
|
@@ -23388,6 +23392,7 @@ const CHAT_ATTACHMENT_MAX_INLINE_CHARACTERS_TOTAL = 24000;
|
|
|
23388
23392
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
|
|
23389
23393
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
23390
23394
|
* @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
|
|
23395
|
+
*
|
|
23391
23396
|
* @public exported from `@promptbook/core`
|
|
23392
23397
|
*/
|
|
23393
23398
|
async function resolveChatAttachmentContents(attachments, options = {}) {
|
|
@@ -23453,6 +23458,7 @@ function formatResolvedChatAttachmentContent(contentResolution) {
|
|
|
23453
23458
|
*
|
|
23454
23459
|
* @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
|
|
23455
23460
|
* @returns {string} The formatted context.
|
|
23461
|
+
*
|
|
23456
23462
|
* @public exported from `@promptbook/core`
|
|
23457
23463
|
*/
|
|
23458
23464
|
function formatChatAttachmentContentContext(resolvedContents) {
|
|
@@ -23493,6 +23499,7 @@ function appendChatContextSections(messageContent, contextSections) {
|
|
|
23493
23499
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
|
|
23494
23500
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
23495
23501
|
* @returns {Promise<string>} The updated message content.
|
|
23502
|
+
*
|
|
23496
23503
|
* @public exported from `@promptbook/core`
|
|
23497
23504
|
*/
|
|
23498
23505
|
async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
|
|
@@ -23521,9 +23528,7 @@ async function appendChatAttachmentContextWithContent(messageContent, attachment
|
|
|
23521
23528
|
function humanizeAiTextEllipsis(aiText) {
|
|
23522
23529
|
return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
|
|
23523
23530
|
}
|
|
23524
|
-
|
|
23525
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23526
|
-
*/
|
|
23531
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23527
23532
|
|
|
23528
23533
|
/**
|
|
23529
23534
|
* Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
|
|
@@ -23536,9 +23541,7 @@ function humanizeAiTextEllipsis(aiText) {
|
|
|
23536
23541
|
function humanizeAiTextEmdashed(aiText) {
|
|
23537
23542
|
return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
|
|
23538
23543
|
}
|
|
23539
|
-
|
|
23540
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23541
|
-
*/
|
|
23544
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23542
23545
|
|
|
23543
23546
|
/**
|
|
23544
23547
|
* Change smart quotes to regular quotes
|
|
@@ -23551,9 +23554,7 @@ function humanizeAiTextEmdashed(aiText) {
|
|
|
23551
23554
|
function humanizeAiTextQuotes(aiText) {
|
|
23552
23555
|
return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
|
|
23553
23556
|
}
|
|
23554
|
-
|
|
23555
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23556
|
-
*/
|
|
23557
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23557
23558
|
|
|
23558
23559
|
/**
|
|
23559
23560
|
* Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
|
|
@@ -23566,9 +23567,7 @@ function humanizeAiTextQuotes(aiText) {
|
|
|
23566
23567
|
function humanizeAiTextSources(aiText) {
|
|
23567
23568
|
return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
|
|
23568
23569
|
}
|
|
23569
|
-
|
|
23570
|
-
* Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23571
|
-
*/
|
|
23570
|
+
// Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23572
23571
|
|
|
23573
23572
|
/**
|
|
23574
23573
|
* Change unprintable hard spaces to regular spaces and drop zero-width spaces
|
|
@@ -23581,9 +23580,7 @@ function humanizeAiTextSources(aiText) {
|
|
|
23581
23580
|
function humanizeAiTextWhitespace(aiText) {
|
|
23582
23581
|
return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
|
|
23583
23582
|
}
|
|
23584
|
-
|
|
23585
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23586
|
-
*/
|
|
23583
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
23587
23584
|
|
|
23588
23585
|
/**
|
|
23589
23586
|
* Function `humanizeAiText` will remove traces of AI text generation artifacts
|
|
@@ -23602,11 +23599,11 @@ function humanizeAiText(aiText) {
|
|
|
23602
23599
|
cleanedText = humanizeAiTextWhitespace(cleanedText);
|
|
23603
23600
|
return cleanedText;
|
|
23604
23601
|
}
|
|
23605
|
-
|
|
23606
|
-
* TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
|
|
23607
|
-
*/
|
|
23602
|
+
// TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
|
|
23608
23603
|
|
|
23609
23604
|
/**
|
|
23605
|
+
* Map of promptbook pseudotoken substitution.
|
|
23606
|
+
*
|
|
23610
23607
|
* @private
|
|
23611
23608
|
*/
|
|
23612
23609
|
const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
|
|
@@ -23654,9 +23651,7 @@ function promptbookifyAiText(text) {
|
|
|
23654
23651
|
}
|
|
23655
23652
|
return promptbookifiedTextTokens.join('');
|
|
23656
23653
|
}
|
|
23657
|
-
|
|
23658
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
23659
|
-
*/
|
|
23654
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
23660
23655
|
|
|
23661
23656
|
/**
|
|
23662
23657
|
* Make UncertainNumber
|
|
@@ -23712,6 +23707,7 @@ function pricing(value) {
|
|
|
23712
23707
|
*
|
|
23713
23708
|
* @see https://platform.openai.com/docs/models/
|
|
23714
23709
|
* @see https://openai.com/api/pricing/
|
|
23710
|
+
*
|
|
23715
23711
|
* @public exported from `@promptbook/openai`
|
|
23716
23712
|
*/
|
|
23717
23713
|
const OPENAI_MODELS = exportJson({
|
|
@@ -24388,6 +24384,7 @@ const OPENAI_MODELS = exportJson({
|
|
|
24388
24384
|
* @param rawResponse The raw response from OpenAI API
|
|
24389
24385
|
* @param duration The duration of the execution
|
|
24390
24386
|
* @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
|
|
24387
|
+
*
|
|
24391
24388
|
* @private internal utility of `OpenAiExecutionTools`
|
|
24392
24389
|
*/
|
|
24393
24390
|
function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
|
|
@@ -24430,15 +24427,14 @@ resultContent, rawResponse, duration = ZERO_VALUE) {
|
|
|
24430
24427
|
},
|
|
24431
24428
|
};
|
|
24432
24429
|
}
|
|
24433
|
-
|
|
24434
|
-
* TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
|
|
24435
|
-
*/
|
|
24430
|
+
// TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
|
|
24436
24431
|
|
|
24437
24432
|
/**
|
|
24438
24433
|
* Parses an OpenAI error message to identify which parameter is unsupported
|
|
24439
24434
|
*
|
|
24440
24435
|
* @param errorMessage The error message from OpenAI API
|
|
24441
24436
|
* @returns The parameter name that is unsupported, or null if not an unsupported parameter error
|
|
24437
|
+
*
|
|
24442
24438
|
* @private utility of LLM Tools
|
|
24443
24439
|
*/
|
|
24444
24440
|
function parseUnsupportedParameterError(errorMessage) {
|
|
@@ -24460,6 +24456,7 @@ function parseUnsupportedParameterError(errorMessage) {
|
|
|
24460
24456
|
* @param modelRequirements Original model requirements
|
|
24461
24457
|
* @param unsupportedParameter The parameter to remove
|
|
24462
24458
|
* @returns New model requirements without the unsupported parameter
|
|
24459
|
+
*
|
|
24463
24460
|
* @private utility of LLM Tools
|
|
24464
24461
|
*/
|
|
24465
24462
|
function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
|
|
@@ -24479,8 +24476,10 @@ function removeUnsupportedModelRequirement(modelRequirements, unsupportedParamet
|
|
|
24479
24476
|
}
|
|
24480
24477
|
/**
|
|
24481
24478
|
* Checks if an error is an "Unsupported value" error from OpenAI
|
|
24479
|
+
*
|
|
24482
24480
|
* @param error The error to check
|
|
24483
24481
|
* @returns true if this is an unsupported parameter error
|
|
24482
|
+
*
|
|
24484
24483
|
* @private utility of LLM Tools
|
|
24485
24484
|
*/
|
|
24486
24485
|
function isUnsupportedParameterError(error) {
|
|
@@ -25586,13 +25585,11 @@ class OpenAiCompatibleExecutionTools {
|
|
|
25586
25585
|
return false;
|
|
25587
25586
|
}
|
|
25588
25587
|
}
|
|
25589
|
-
|
|
25590
|
-
|
|
25591
|
-
|
|
25592
|
-
|
|
25593
|
-
|
|
25594
|
-
* TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
|
|
25595
|
-
*/
|
|
25588
|
+
// TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
|
|
25589
|
+
// TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
|
|
25590
|
+
// TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
25591
|
+
// TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
25592
|
+
// TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
|
|
25596
25593
|
|
|
25597
25594
|
/**
|
|
25598
25595
|
* Profile for OpenAI provider
|
|
@@ -25660,9 +25657,21 @@ class OpenAiExecutionTools extends OpenAiCompatibleExecutionTools {
|
|
|
25660
25657
|
}
|
|
25661
25658
|
}
|
|
25662
25659
|
|
|
25660
|
+
/**
|
|
25661
|
+
* Constant for default knowledge source download timeout ms.
|
|
25662
|
+
*/
|
|
25663
25663
|
const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
|
|
25664
|
+
/**
|
|
25665
|
+
* Constant for default knowledge source upload timeout ms.
|
|
25666
|
+
*/
|
|
25664
25667
|
const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
|
|
25668
|
+
/**
|
|
25669
|
+
* Constant for vector store progress log interval min ms.
|
|
25670
|
+
*/
|
|
25665
25671
|
const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
|
|
25672
|
+
/**
|
|
25673
|
+
* Constant for vector store stall log threshold ms.
|
|
25674
|
+
*/
|
|
25666
25675
|
const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
|
|
25667
25676
|
/**
|
|
25668
25677
|
* Base class for OpenAI execution tools that need hosted vector stores.
|
|
@@ -26429,6 +26438,9 @@ class OpenAiVectorStoreHandler extends OpenAiExecutionTools {
|
|
|
26429
26438
|
}
|
|
26430
26439
|
}
|
|
26431
26440
|
|
|
26441
|
+
/**
|
|
26442
|
+
* Constant for default agent kit model name.
|
|
26443
|
+
*/
|
|
26432
26444
|
const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
|
|
26433
26445
|
/**
|
|
26434
26446
|
* Creates one structured log entry for streamed tool-call updates.
|
|
@@ -26472,6 +26484,9 @@ function resolveFinalToolCallState$1(options) {
|
|
|
26472
26484
|
}
|
|
26473
26485
|
return 'COMPLETE';
|
|
26474
26486
|
}
|
|
26487
|
+
/**
|
|
26488
|
+
* Constant for default JSON schema name.
|
|
26489
|
+
*/
|
|
26475
26490
|
const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
|
|
26476
26491
|
/**
|
|
26477
26492
|
* File extensions considered image inputs when MIME type is missing or generic.
|
|
@@ -26627,6 +26642,7 @@ function buildJsonSchemaDefinition(jsonSchema) {
|
|
|
26627
26642
|
*
|
|
26628
26643
|
* @param responseFormat - The OpenAI `response_format` payload from the user request.
|
|
26629
26644
|
* @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
|
|
26645
|
+
*
|
|
26630
26646
|
* @private utility of Open AI
|
|
26631
26647
|
*/
|
|
26632
26648
|
function mapResponseFormatToAgentOutputType(responseFormat) {
|
|
@@ -27385,6 +27401,7 @@ function resolveFinalToolCallState(options) {
|
|
|
27385
27401
|
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
27386
27402
|
*
|
|
27387
27403
|
* @deprecated Use `OpenAiAgentKitExecutionTools` instead.
|
|
27404
|
+
*
|
|
27388
27405
|
* @public exported from `@promptbook/openai`
|
|
27389
27406
|
*/
|
|
27390
27407
|
class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
|
|
@@ -28076,14 +28093,12 @@ class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
|
|
|
28076
28093
|
* @private const of `OpenAiAssistantExecutionTools`
|
|
28077
28094
|
*/
|
|
28078
28095
|
const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
|
|
28079
|
-
|
|
28080
|
-
|
|
28081
|
-
|
|
28082
|
-
|
|
28083
|
-
|
|
28084
|
-
|
|
28085
|
-
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
28086
|
-
*/
|
|
28096
|
+
// TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
|
|
28097
|
+
// TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
|
|
28098
|
+
// TODO: [🧠][🧙♂️] Maybe there can be some wizard for those who want to use just OpenAI
|
|
28099
|
+
// TODO: Maybe make custom OpenAiError
|
|
28100
|
+
// TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
28101
|
+
// TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
28087
28102
|
|
|
28088
28103
|
/**
|
|
28089
28104
|
* Emits a progress update to signal assistant preparation before long setup work.
|
|
@@ -28560,10 +28575,8 @@ AgentLlmExecutionTools.assistantCache = new Map();
|
|
|
28560
28575
|
* Cache of OpenAI vector stores to avoid creating duplicates
|
|
28561
28576
|
*/
|
|
28562
28577
|
AgentLlmExecutionTools.vectorStoreCache = new Map();
|
|
28563
|
-
|
|
28564
|
-
|
|
28565
|
-
* TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
|
|
28566
|
-
*/
|
|
28578
|
+
// TODO: [🍚] Implement Destroyable pattern to free resources
|
|
28579
|
+
// TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
|
|
28567
28580
|
|
|
28568
28581
|
/**
|
|
28569
28582
|
* Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
|
|
@@ -28573,6 +28586,7 @@ AgentLlmExecutionTools.vectorStoreCache = new Map();
|
|
|
28573
28586
|
*
|
|
28574
28587
|
* @param agentSource - The raw agent book source
|
|
28575
28588
|
* @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
|
|
28589
|
+
*
|
|
28576
28590
|
* @private Internal helper shared between self-learning and related features.
|
|
28577
28591
|
*/
|
|
28578
28592
|
function extractOpenTeacherInstructions(agentSource) {
|
|
@@ -28780,6 +28794,7 @@ class SelfLearningManager {
|
|
|
28780
28794
|
*
|
|
28781
28795
|
* @param section Raw fragment from self-learning workflow.
|
|
28782
28796
|
* @returns Trimmed fragment, or empty string when nothing remains.
|
|
28797
|
+
*
|
|
28783
28798
|
* @private function of Agent
|
|
28784
28799
|
*/
|
|
28785
28800
|
function normalizeBookSection(section) {
|
|
@@ -28791,6 +28806,7 @@ function normalizeBookSection(section) {
|
|
|
28791
28806
|
* @param agentSource Current source.
|
|
28792
28807
|
* @param normalizedSection Candidate fragment expected to be normalized first.
|
|
28793
28808
|
* @returns True when appending would duplicate an existing fragment.
|
|
28809
|
+
*
|
|
28794
28810
|
* @private function of Agent
|
|
28795
28811
|
*/
|
|
28796
28812
|
function containsNormalizedBookSection(agentSource, normalizedSection) {
|
|
@@ -28805,6 +28821,7 @@ function containsNormalizedBookSection(agentSource, normalizedSection) {
|
|
|
28805
28821
|
*
|
|
28806
28822
|
* @param responseFormat Prompt response format requirements
|
|
28807
28823
|
* @returns True when JSON schema mode is active
|
|
28824
|
+
*
|
|
28808
28825
|
* @private function of Agent
|
|
28809
28826
|
*/
|
|
28810
28827
|
function isJsonSchemaResponseFormat(responseFormat) {
|
|
@@ -28816,6 +28833,7 @@ function isJsonSchemaResponseFormat(responseFormat) {
|
|
|
28816
28833
|
* @param content Original agent answer content
|
|
28817
28834
|
* @param isJsonMode Whether the interaction requested JSON schema output
|
|
28818
28835
|
* @returns Agent answer, wrapped in a formatted JSON code block when possible
|
|
28836
|
+
*
|
|
28819
28837
|
* @private function of Agent
|
|
28820
28838
|
*/
|
|
28821
28839
|
function formatAgentMessageForJsonMode(content, isJsonMode) {
|
|
@@ -28841,6 +28859,7 @@ function formatAgentMessageForJsonMode(content, isJsonMode) {
|
|
|
28841
28859
|
*
|
|
28842
28860
|
* @param content Text to parse as JSON
|
|
28843
28861
|
* @returns Parsed JSON value or null when parsing fails
|
|
28862
|
+
*
|
|
28844
28863
|
* @private function of Agent
|
|
28845
28864
|
*/
|
|
28846
28865
|
function tryParseJson(content) {
|
|
@@ -28856,6 +28875,7 @@ function tryParseJson(content) {
|
|
|
28856
28875
|
*
|
|
28857
28876
|
* @param options - Normalized sample parts.
|
|
28858
28877
|
* @returns Book-language sample section ready to append into agent source.
|
|
28878
|
+
*
|
|
28859
28879
|
* @private function of Agent
|
|
28860
28880
|
*/
|
|
28861
28881
|
function formatSelfLearningSample(options) {
|
|
@@ -28877,6 +28897,7 @@ function formatSelfLearningSample(options) {
|
|
|
28877
28897
|
*
|
|
28878
28898
|
* @param internalMessage Internal trace payload.
|
|
28879
28899
|
* @returns Book-language INTERNAL MESSAGE block.
|
|
28900
|
+
*
|
|
28880
28901
|
* @private function of Agent
|
|
28881
28902
|
*/
|
|
28882
28903
|
function formatInternalLearningMessage(internalMessage) {
|
|
@@ -28890,6 +28911,7 @@ function formatInternalLearningMessage(internalMessage) {
|
|
|
28890
28911
|
*
|
|
28891
28912
|
* @param result Final chat result used in self-learning.
|
|
28892
28913
|
* @returns Internal payloads that capture request/response/tool-call context.
|
|
28914
|
+
*
|
|
28893
28915
|
* @private function of Agent
|
|
28894
28916
|
*/
|
|
28895
28917
|
function buildInternalLearningMessages(result) {
|
|
@@ -28919,6 +28941,7 @@ function buildInternalLearningMessages(result) {
|
|
|
28919
28941
|
*
|
|
28920
28942
|
* @param toolCall Tool call produced during execution.
|
|
28921
28943
|
* @returns Sanitized and serializable tool-call payload.
|
|
28944
|
+
*
|
|
28922
28945
|
* @private function of Agent
|
|
28923
28946
|
*/
|
|
28924
28947
|
function sanitizeToolCallForLearning(toolCall) {
|
|
@@ -28938,6 +28961,7 @@ function sanitizeToolCallForLearning(toolCall) {
|
|
|
28938
28961
|
*
|
|
28939
28962
|
* @param payload Internal payload to serialize.
|
|
28940
28963
|
* @returns Pretty JSON string that can be embedded in BOOK.
|
|
28964
|
+
*
|
|
28941
28965
|
* @private function of Agent
|
|
28942
28966
|
*/
|
|
28943
28967
|
function stringifyInternalLearningPayload(payload) {
|
|
@@ -28987,6 +29011,7 @@ function createEmptySelfLearningCommitmentCounts() {
|
|
|
28987
29011
|
* Normalizes teacher commitments into trimmed, display-ready lines.
|
|
28988
29012
|
*
|
|
28989
29013
|
* @param commitments Raw teacher output
|
|
29014
|
+
*
|
|
28990
29015
|
* @private function of Agent
|
|
28991
29016
|
*/
|
|
28992
29017
|
function getTeacherCommitmentLines(commitments) {
|
|
@@ -28999,6 +29024,7 @@ function getTeacherCommitmentLines(commitments) {
|
|
|
28999
29024
|
* Summarizes teacher commitment lines into user-friendly counts for self-learning.
|
|
29000
29025
|
*
|
|
29001
29026
|
* @param lines Parsed teacher commitment lines
|
|
29027
|
+
*
|
|
29002
29028
|
* @private function of Agent
|
|
29003
29029
|
*/
|
|
29004
29030
|
function summarizeTeacherCommitmentLines(lines) {
|
|
@@ -29031,6 +29057,7 @@ function summarizeTeacherCommitmentLines(lines) {
|
|
|
29031
29057
|
* @param commitments Raw teacher commitments
|
|
29032
29058
|
* @param used Whether the teacher was invoked
|
|
29033
29059
|
* @returns Summary of learned commitments
|
|
29060
|
+
*
|
|
29034
29061
|
* @private function of Agent
|
|
29035
29062
|
*/
|
|
29036
29063
|
function buildTeacherSummary(commitments, used) {
|
|
@@ -29267,9 +29294,7 @@ class Agent extends AgentLlmExecutionTools {
|
|
|
29267
29294
|
return finalResult;
|
|
29268
29295
|
}
|
|
29269
29296
|
}
|
|
29270
|
-
|
|
29271
|
-
* TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
29272
|
-
*/
|
|
29297
|
+
// TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
29273
29298
|
|
|
29274
29299
|
/**
|
|
29275
29300
|
* Parses one failed remote agent response into a structured error.
|
|
@@ -29735,10 +29760,8 @@ class RemoteAgent extends Agent {
|
|
|
29735
29760
|
return agentResult;
|
|
29736
29761
|
}
|
|
29737
29762
|
}
|
|
29738
|
-
|
|
29739
|
-
|
|
29740
|
-
* TODO: !!! Agent on remote server
|
|
29741
|
-
*/
|
|
29763
|
+
// TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
29764
|
+
// TODO: !!! Agent on remote server
|
|
29742
29765
|
|
|
29743
29766
|
var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
|
|
29744
29767
|
__proto__: null,
|