@promptbook/node 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 +776 -764
- 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 +776 -764
- 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/umd/index.umd.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
* @generated
|
|
49
49
|
* @see https://github.com/webgptorg/promptbook
|
|
50
50
|
*/
|
|
51
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-
|
|
51
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.112.0-35';
|
|
52
52
|
/**
|
|
53
53
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
54
54
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -58,16 +58,20 @@
|
|
|
58
58
|
* Trims string from all 4 sides
|
|
59
59
|
*
|
|
60
60
|
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
61
|
-
*
|
|
61
|
+
* Developed by same author @hejny as this package
|
|
62
62
|
*
|
|
63
|
-
* @public exported from `@promptbook/utils`
|
|
64
63
|
* @see https://github.com/hejny/spacetrim#usage
|
|
64
|
+
*
|
|
65
|
+
* @public exported from `@promptbook/utils`
|
|
65
66
|
*/
|
|
66
67
|
const spaceTrim = _spaceTrim.spaceTrim;
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
|
-
*
|
|
70
|
+
* Class implementing take chain.
|
|
71
|
+
*
|
|
70
72
|
* @de
|
|
73
|
+
*
|
|
74
|
+
* @private util of `@promptbook/color`
|
|
71
75
|
*/
|
|
72
76
|
class TakeChain {
|
|
73
77
|
constructor(value) {
|
|
@@ -84,9 +88,9 @@
|
|
|
84
88
|
*
|
|
85
89
|
* @param {*} initialValue - The initial value.
|
|
86
90
|
* @returns {Proxy<WithTake<TValue>>} - A proxy object with a `take` method.
|
|
91
|
+
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
87
92
|
*
|
|
88
93
|
* @private util of `@promptbook/color`
|
|
89
|
-
* @deprecated [🤡] Use some better functional library instead of `TakeChain`
|
|
90
94
|
*/
|
|
91
95
|
function take(initialValue) {
|
|
92
96
|
if (initialValue instanceof TakeChain) {
|
|
@@ -264,9 +268,7 @@
|
|
|
264
268
|
yellow: '#ffff00',
|
|
265
269
|
yellowgreen: '#9acd32',
|
|
266
270
|
};
|
|
267
|
-
|
|
268
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
269
|
-
*/
|
|
271
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
270
272
|
|
|
271
273
|
/**
|
|
272
274
|
* Validates that a channel value is a valid number within the range of 0 to 255.
|
|
@@ -296,7 +298,13 @@
|
|
|
296
298
|
}
|
|
297
299
|
}
|
|
298
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Constant for short hex lengths.
|
|
303
|
+
*/
|
|
299
304
|
const SHORT_HEX_LENGTHS = new Set([3, 4]);
|
|
305
|
+
/**
|
|
306
|
+
* Constant for long hex lengths.
|
|
307
|
+
*/
|
|
300
308
|
const LONG_HEX_LENGTHS = new Set([6, 8]);
|
|
301
309
|
/**
|
|
302
310
|
* Parses a hex string into RGBA channel values.
|
|
@@ -329,6 +337,9 @@
|
|
|
329
337
|
}
|
|
330
338
|
return throwInvalidHex();
|
|
331
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* Parses short hex channel.
|
|
342
|
+
*/
|
|
332
343
|
function parseShortHexChannel(char, onError) {
|
|
333
344
|
if (!char) {
|
|
334
345
|
return onError();
|
|
@@ -339,6 +350,9 @@
|
|
|
339
350
|
}
|
|
340
351
|
return parsed * 16;
|
|
341
352
|
}
|
|
353
|
+
/**
|
|
354
|
+
* Parses long hex channel.
|
|
355
|
+
*/
|
|
342
356
|
function parseLongHexChannel(hex, start, onError) {
|
|
343
357
|
const segment = hex.substr(start, 2);
|
|
344
358
|
if (segment.length < 2) {
|
|
@@ -351,6 +365,9 @@
|
|
|
351
365
|
return parsed;
|
|
352
366
|
}
|
|
353
367
|
|
|
368
|
+
/**
|
|
369
|
+
* Pattern matching hsl.
|
|
370
|
+
*/
|
|
354
371
|
const HSL_REGEX = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
|
|
355
372
|
/**
|
|
356
373
|
* Parses an HSL string into RGBA channel values.
|
|
@@ -376,6 +393,9 @@
|
|
|
376
393
|
alpha: 255,
|
|
377
394
|
};
|
|
378
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* Handles convert hsl to Rgb.
|
|
398
|
+
*/
|
|
379
399
|
function convertHslToRgb(h, s, l) {
|
|
380
400
|
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
381
401
|
const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
|
|
@@ -414,7 +434,13 @@
|
|
|
414
434
|
};
|
|
415
435
|
}
|
|
416
436
|
|
|
437
|
+
/**
|
|
438
|
+
* Pattern matching RGB.
|
|
439
|
+
*/
|
|
417
440
|
const RGB_REGEX = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
441
|
+
/**
|
|
442
|
+
* Pattern matching rgba.
|
|
443
|
+
*/
|
|
418
444
|
const RGBA_REGEX = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
419
445
|
/**
|
|
420
446
|
* Parses an RGB string into RGBA channel values.
|
|
@@ -456,6 +482,9 @@
|
|
|
456
482
|
alpha: parseAlphaValue(match[4]),
|
|
457
483
|
};
|
|
458
484
|
}
|
|
485
|
+
/**
|
|
486
|
+
* Parses channel value.
|
|
487
|
+
*/
|
|
459
488
|
function parseChannelValue(value) {
|
|
460
489
|
if (value.endsWith('%')) {
|
|
461
490
|
const percent = parseFloat(value);
|
|
@@ -463,6 +492,9 @@
|
|
|
463
492
|
}
|
|
464
493
|
return Math.round(parseFloat(value));
|
|
465
494
|
}
|
|
495
|
+
/**
|
|
496
|
+
* Parses alpha value.
|
|
497
|
+
*/
|
|
466
498
|
function parseAlphaValue(value) {
|
|
467
499
|
if (value.endsWith('%')) {
|
|
468
500
|
const percent = parseFloat(value);
|
|
@@ -475,8 +507,17 @@
|
|
|
475
507
|
return Math.round(parsed);
|
|
476
508
|
}
|
|
477
509
|
|
|
510
|
+
/**
|
|
511
|
+
* Pattern matching hsl regex.
|
|
512
|
+
*/
|
|
478
513
|
const HSL_REGEX_PATTERN = /^hsl\(\s*([0-9.]+)\s*,\s*([0-9.]+)%\s*,\s*([0-9.]+)%\s*\)$/;
|
|
514
|
+
/**
|
|
515
|
+
* Pattern matching RGB regex.
|
|
516
|
+
*/
|
|
479
517
|
const RGB_REGEX_PATTERN = /^rgb\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
518
|
+
/**
|
|
519
|
+
* Pattern matching rgba regex.
|
|
520
|
+
*/
|
|
480
521
|
const RGBA_REGEX_PATTERN = /^rgba\(\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*,\s*([0-9.%-]+)\s*\)$/;
|
|
481
522
|
/**
|
|
482
523
|
* Color object represents an RGB color with alpha channel
|
|
@@ -842,9 +883,7 @@
|
|
|
842
883
|
}
|
|
843
884
|
return [Math.round(red * 255), Math.round(green * 255), Math.round(blue * 255)];
|
|
844
885
|
}
|
|
845
|
-
|
|
846
|
-
* TODO: Properly name all used internal variables
|
|
847
|
-
*/
|
|
886
|
+
// TODO: Properly name all used internal variables
|
|
848
887
|
|
|
849
888
|
/**
|
|
850
889
|
* Converts RGB values to HSL values
|
|
@@ -890,9 +929,7 @@
|
|
|
890
929
|
}
|
|
891
930
|
return [hue, saturation, lightness];
|
|
892
931
|
}
|
|
893
|
-
|
|
894
|
-
* TODO: Properly name all used internal variables
|
|
895
|
-
*/
|
|
932
|
+
// TODO: Properly name all used internal variables
|
|
896
933
|
|
|
897
934
|
/**
|
|
898
935
|
* Makes color transformer which lighten the given color
|
|
@@ -910,9 +947,7 @@
|
|
|
910
947
|
return Color.fromValues(r, g, b, alpha);
|
|
911
948
|
};
|
|
912
949
|
}
|
|
913
|
-
|
|
914
|
-
* TODO: Maybe implement by mix+hsl
|
|
915
|
-
*/
|
|
950
|
+
// TODO: Maybe implement by mix+hsl
|
|
916
951
|
|
|
917
952
|
/**
|
|
918
953
|
* Makes color transformer which saturate the given color
|
|
@@ -930,9 +965,7 @@
|
|
|
930
965
|
return Color.fromValues(r, g, b, alpha);
|
|
931
966
|
};
|
|
932
967
|
}
|
|
933
|
-
|
|
934
|
-
* TODO: Maybe implement by mix+hsl
|
|
935
|
-
*/
|
|
968
|
+
// TODO: Maybe implement by mix+hsl
|
|
936
969
|
|
|
937
970
|
/**
|
|
938
971
|
* Returns the same value that is passed as argument.
|
|
@@ -945,6 +978,7 @@
|
|
|
945
978
|
*
|
|
946
979
|
* @param value any values
|
|
947
980
|
* @returns the same values
|
|
981
|
+
*
|
|
948
982
|
* @private within the repository
|
|
949
983
|
*/
|
|
950
984
|
function just(value) {
|
|
@@ -1326,6 +1360,7 @@
|
|
|
1326
1360
|
* Orders JSON object by keys
|
|
1327
1361
|
*
|
|
1328
1362
|
* @returns The same type of object as the input re-ordered
|
|
1363
|
+
*
|
|
1329
1364
|
* @public exported from `@promptbook/utils`
|
|
1330
1365
|
*/
|
|
1331
1366
|
function orderJson(options) {
|
|
@@ -1344,6 +1379,7 @@
|
|
|
1344
1379
|
* Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
|
|
1345
1380
|
*
|
|
1346
1381
|
* @returns The same object as the input, but deeply frozen
|
|
1382
|
+
*
|
|
1347
1383
|
* @public exported from `@promptbook/utils`
|
|
1348
1384
|
*/
|
|
1349
1385
|
function $deepFreeze(objectValue) {
|
|
@@ -1360,9 +1396,7 @@
|
|
|
1360
1396
|
Object.freeze(objectValue);
|
|
1361
1397
|
return objectValue;
|
|
1362
1398
|
}
|
|
1363
|
-
|
|
1364
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1365
|
-
*/
|
|
1399
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1366
1400
|
|
|
1367
1401
|
/**
|
|
1368
1402
|
* This error type indicates that somewhere in the code non-Error object was thrown and it was wrapped into the `WrappedError`
|
|
@@ -1430,6 +1464,7 @@
|
|
|
1430
1464
|
* - And much more...
|
|
1431
1465
|
*
|
|
1432
1466
|
* @throws UnexpectedError if the value is not serializable as JSON
|
|
1467
|
+
*
|
|
1433
1468
|
* @public exported from `@promptbook/utils`
|
|
1434
1469
|
*/
|
|
1435
1470
|
function checkSerializableAsJson(options) {
|
|
@@ -1544,11 +1579,9 @@
|
|
|
1544
1579
|
`));
|
|
1545
1580
|
}
|
|
1546
1581
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
1551
|
-
*/
|
|
1582
|
+
// TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
|
|
1583
|
+
// TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
1584
|
+
// Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
1552
1585
|
|
|
1553
1586
|
/**
|
|
1554
1587
|
* Creates a deep clone of the given object
|
|
@@ -1558,6 +1591,7 @@
|
|
|
1558
1591
|
*
|
|
1559
1592
|
* @param objectValue The object to clone.
|
|
1560
1593
|
* @returns A deep, writable clone of the input object.
|
|
1594
|
+
*
|
|
1561
1595
|
* @public exported from `@promptbook/utils`
|
|
1562
1596
|
*/
|
|
1563
1597
|
function deepClone(objectValue) {
|
|
@@ -1574,9 +1608,7 @@
|
|
|
1574
1608
|
> return Object.assign({}, objectValue);
|
|
1575
1609
|
*/
|
|
1576
1610
|
}
|
|
1577
|
-
|
|
1578
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1579
|
-
*/
|
|
1611
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1580
1612
|
|
|
1581
1613
|
/**
|
|
1582
1614
|
* Utility to export a JSON object from a function
|
|
@@ -1589,6 +1621,7 @@
|
|
|
1589
1621
|
* Note: This function does not mutates the given object
|
|
1590
1622
|
*
|
|
1591
1623
|
* @returns The same type of object as the input but read-only and re-ordered
|
|
1624
|
+
*
|
|
1592
1625
|
* @public exported from `@promptbook/utils`
|
|
1593
1626
|
*/
|
|
1594
1627
|
function exportJson(options) {
|
|
@@ -1608,9 +1641,7 @@
|
|
|
1608
1641
|
$deepFreeze(orderedValue);
|
|
1609
1642
|
return orderedValue;
|
|
1610
1643
|
}
|
|
1611
|
-
|
|
1612
|
-
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1613
|
-
*/
|
|
1644
|
+
// TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
1614
1645
|
|
|
1615
1646
|
/**
|
|
1616
1647
|
* Order of keys in the pipeline JSON
|
|
@@ -1721,9 +1752,7 @@
|
|
|
1721
1752
|
*/
|
|
1722
1753
|
SHORT_NAME_LENGTH: 6,
|
|
1723
1754
|
};
|
|
1724
|
-
|
|
1725
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1726
|
-
*/
|
|
1755
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
1727
1756
|
|
|
1728
1757
|
/**
|
|
1729
1758
|
* This error indicates that the promptbook in a markdown format cannot be parsed into a valid promptbook object
|
|
@@ -1737,9 +1766,7 @@
|
|
|
1737
1766
|
Object.setPrototypeOf(this, ParseError.prototype);
|
|
1738
1767
|
}
|
|
1739
1768
|
}
|
|
1740
|
-
|
|
1741
|
-
* TODO: Maybe split `ParseError` and `ApplyError`
|
|
1742
|
-
*/
|
|
1769
|
+
// TODO: Maybe split `ParseError` and `ApplyError`
|
|
1743
1770
|
|
|
1744
1771
|
/**
|
|
1745
1772
|
* This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
|
|
@@ -1777,12 +1804,13 @@
|
|
|
1777
1804
|
* Tests if given string is valid promptbook version
|
|
1778
1805
|
* It looks into list of known promptbook versions.
|
|
1779
1806
|
*
|
|
1780
|
-
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
1781
1807
|
* 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.
|
|
1782
1808
|
* Note: There are two similar functions:
|
|
1783
1809
|
* - `isValidSemanticVersion` which tests any semantic version
|
|
1784
1810
|
* - `isValidPromptbookVersion` *(this one)* which tests just Promptbook versions
|
|
1785
1811
|
*
|
|
1812
|
+
* @see https://www.npmjs.com/package/promptbook?activeTab=versions
|
|
1813
|
+
*
|
|
1786
1814
|
* @public exported from `@promptbook/utils`
|
|
1787
1815
|
*/
|
|
1788
1816
|
function isValidPromptbookVersion(version) {
|
|
@@ -1856,9 +1884,7 @@
|
|
|
1856
1884
|
*/
|
|
1857
1885
|
return true;
|
|
1858
1886
|
}
|
|
1859
|
-
|
|
1860
|
-
* TODO: [🐠] Maybe more info why the URL is invalid
|
|
1861
|
-
*/
|
|
1887
|
+
// TODO: [🐠] Maybe more info why the URL is invalid
|
|
1862
1888
|
|
|
1863
1889
|
/**
|
|
1864
1890
|
* Validates PipelineJson if it is logically valid
|
|
@@ -1875,6 +1901,7 @@
|
|
|
1875
1901
|
* @param pipeline valid or invalid PipelineJson
|
|
1876
1902
|
* @returns the same pipeline if it is logically valid
|
|
1877
1903
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
1904
|
+
*
|
|
1878
1905
|
* @public exported from `@promptbook/core`
|
|
1879
1906
|
*/
|
|
1880
1907
|
function validatePipeline(pipeline) {
|
|
@@ -1899,6 +1926,8 @@
|
|
|
1899
1926
|
return pipeline;
|
|
1900
1927
|
}
|
|
1901
1928
|
/**
|
|
1929
|
+
* Validates pipeline inner function.
|
|
1930
|
+
*
|
|
1902
1931
|
* @private internal function for `validatePipeline`
|
|
1903
1932
|
*/
|
|
1904
1933
|
function validatePipeline_InnerFunction(pipeline) {
|
|
@@ -2143,15 +2172,13 @@
|
|
|
2143
2172
|
* > * - ...
|
|
2144
2173
|
* > ex port function validatePipeline(promptbook: really_unknown): asserts promptbook is PipelineJson {
|
|
2145
2174
|
*/
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
2154
|
-
*/
|
|
2175
|
+
// TODO: [🧳][main] !!4 Validate that all examples match expectations
|
|
2176
|
+
// TODO: [🧳][🐝][main] !!4 Validate that knowledge is valid (non-void)
|
|
2177
|
+
// TODO: [🧳][main] !!4 Validate that persona can be used only with CHAT variant
|
|
2178
|
+
// TODO: [🧳][main] !!4 Validate that parameter with reserved name not used RESERVED_PARAMETER_NAMES
|
|
2179
|
+
// TODO: [🧳][main] !!4 Validate that reserved parameter is not used as joker
|
|
2180
|
+
// TODO: [🧠] Validation not only logic itself but imports around - files and websites and rerefenced pipelines exists
|
|
2181
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
2155
2182
|
|
|
2156
2183
|
/**
|
|
2157
2184
|
* Loads the books from the archive file with `.bookc` extension
|
|
@@ -2178,7 +2205,7 @@
|
|
|
2178
2205
|
}
|
|
2179
2206
|
return collectionJson;
|
|
2180
2207
|
}
|
|
2181
|
-
|
|
2208
|
+
// Note: [🟢] Code for Node archive helper [loadArchive](src/conversion/archive/loadArchive.ts) should never be published into packages that could be imported into browser environment
|
|
2182
2209
|
|
|
2183
2210
|
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"}];
|
|
2184
2211
|
|
|
@@ -2201,6 +2228,7 @@
|
|
|
2201
2228
|
* Tests if given string is valid file path.
|
|
2202
2229
|
*
|
|
2203
2230
|
* Note: This does not check if the file exists only if the path is valid
|
|
2231
|
+
*
|
|
2204
2232
|
* @public exported from `@promptbook/utils`
|
|
2205
2233
|
*/
|
|
2206
2234
|
function isValidFilePath(filename) {
|
|
@@ -2249,9 +2277,7 @@
|
|
|
2249
2277
|
}
|
|
2250
2278
|
return false;
|
|
2251
2279
|
}
|
|
2252
|
-
|
|
2253
|
-
* TODO: [🍏] Implement for MacOs
|
|
2254
|
-
*/
|
|
2280
|
+
// TODO: [🍏] Implement for MacOs
|
|
2255
2281
|
|
|
2256
2282
|
/**
|
|
2257
2283
|
* Function isValidJsonString will tell you if the string is valid JSON or not
|
|
@@ -2284,6 +2310,7 @@
|
|
|
2284
2310
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
2285
2311
|
* @returns {PipelineString} the same string as input, but validated as valid
|
|
2286
2312
|
* @throws {ParseError} if the string is not a valid pipeline string
|
|
2313
|
+
*
|
|
2287
2314
|
* @public exported from `@promptbook/core`
|
|
2288
2315
|
*/
|
|
2289
2316
|
function validatePipelineString(pipelineString) {
|
|
@@ -2302,17 +2329,16 @@
|
|
|
2302
2329
|
// <- TODO: Implement the validation + add tests when the pipeline logic considered as invalid
|
|
2303
2330
|
return pipelineString;
|
|
2304
2331
|
}
|
|
2305
|
-
|
|
2306
|
-
* TODO: [🧠][🈴] Where is the best location for this file
|
|
2307
|
-
*/
|
|
2332
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
2308
2333
|
|
|
2309
2334
|
/**
|
|
2310
2335
|
* Prettify the html code
|
|
2311
2336
|
*
|
|
2312
2337
|
* @param content raw html code
|
|
2313
2338
|
* @returns formatted html code
|
|
2314
|
-
* @private withing the package because of HUGE size of prettier dependency
|
|
2315
2339
|
* @deprecated Prettier removed from Promptbook due to package size
|
|
2340
|
+
*
|
|
2341
|
+
* @private withing the package because of HUGE size of prettier dependency
|
|
2316
2342
|
*/
|
|
2317
2343
|
function prettifyMarkdown(content) {
|
|
2318
2344
|
return (content + `\n\n<!-- Note: Prettier removed from Promptbook -->`);
|
|
@@ -2335,6 +2361,7 @@
|
|
|
2335
2361
|
* @deprecated TODO: [🥍][🧠] Backup original files in `PipelineJson` same as in Promptbook.studio
|
|
2336
2362
|
* @param pipelineJson Promptbook in JSON format (.bookc)
|
|
2337
2363
|
* @returns Promptbook in string format (.book.md)
|
|
2364
|
+
*
|
|
2338
2365
|
* @public exported from `@promptbook/core`
|
|
2339
2366
|
*/
|
|
2340
2367
|
function pipelineJsonToString(pipelineJson) {
|
|
@@ -2451,6 +2478,8 @@
|
|
|
2451
2478
|
return validatePipelineString(pipelineString);
|
|
2452
2479
|
}
|
|
2453
2480
|
/**
|
|
2481
|
+
* Handles task parameter Json to string.
|
|
2482
|
+
*
|
|
2454
2483
|
* @private internal utility of `pipelineJsonToString`
|
|
2455
2484
|
*/
|
|
2456
2485
|
function taskParameterJsonToString(taskParameterJson) {
|
|
@@ -2461,13 +2490,11 @@
|
|
|
2461
2490
|
}
|
|
2462
2491
|
return parameterString;
|
|
2463
2492
|
}
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
* TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
2470
|
-
*/
|
|
2493
|
+
// TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
|
|
2494
|
+
// TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
|
|
2495
|
+
// TODO: [🏛] Maybe make some markdown builder
|
|
2496
|
+
// TODO: [🏛] Escape all
|
|
2497
|
+
// TODO: [🧠] Should be in generated .book.md file GENERATOR_WARNING
|
|
2471
2498
|
|
|
2472
2499
|
/**
|
|
2473
2500
|
* This error indicates that promptbook not found in the collection
|
|
@@ -2500,6 +2527,7 @@
|
|
|
2500
2527
|
*
|
|
2501
2528
|
* @param template the string template with parameters in {curly} braces
|
|
2502
2529
|
* @returns the list of parameter names
|
|
2530
|
+
*
|
|
2503
2531
|
* @public exported from `@promptbook/utils`
|
|
2504
2532
|
*/
|
|
2505
2533
|
function extractParameterNames(template) {
|
|
@@ -2516,6 +2544,7 @@
|
|
|
2516
2544
|
* Unprepare just strips the preparation data of the pipeline
|
|
2517
2545
|
*
|
|
2518
2546
|
* @deprecated In future version this function will be removed or deprecated
|
|
2547
|
+
*
|
|
2519
2548
|
* @public exported from `@promptbook/core`
|
|
2520
2549
|
*/
|
|
2521
2550
|
function unpreparePipeline(pipeline) {
|
|
@@ -2544,18 +2573,17 @@
|
|
|
2544
2573
|
},
|
|
2545
2574
|
});
|
|
2546
2575
|
}
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
* TODO: [🍙] Make some standard order of json properties
|
|
2551
|
-
*/
|
|
2576
|
+
// TODO: [🧿] Maybe do same process with same granularity and subfinctions as `preparePipeline`
|
|
2577
|
+
// TODO: Write tests for `preparePipeline`
|
|
2578
|
+
// TODO: [🍙] Make some standard order of json properties
|
|
2552
2579
|
|
|
2553
2580
|
/**
|
|
2554
2581
|
* Library of pipelines that groups together pipelines for an application.
|
|
2555
2582
|
* This implementation is a very thin wrapper around the Array / Map of pipelines.
|
|
2556
2583
|
*
|
|
2557
|
-
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
2558
2584
|
* @see https://github.com/webgptorg/pipeline#pipeline-collection
|
|
2585
|
+
*
|
|
2586
|
+
* @private internal function of `createPipelineCollectionFromJson`, use `createPipelineCollectionFromJson` instead
|
|
2559
2587
|
*/
|
|
2560
2588
|
class SimplePipelineCollection {
|
|
2561
2589
|
/**
|
|
@@ -2659,6 +2687,7 @@
|
|
|
2659
2687
|
*
|
|
2660
2688
|
* @param promptbookSources
|
|
2661
2689
|
* @returns PipelineCollection
|
|
2690
|
+
*
|
|
2662
2691
|
* @public exported from `@promptbook/core`
|
|
2663
2692
|
*/
|
|
2664
2693
|
function createPipelineCollectionFromJson(...promptbooks) {
|
|
@@ -2804,9 +2833,7 @@
|
|
|
2804
2833
|
Object.setPrototypeOf(this, DatabaseError.prototype);
|
|
2805
2834
|
}
|
|
2806
2835
|
}
|
|
2807
|
-
|
|
2808
|
-
* TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
2809
|
-
*/
|
|
2836
|
+
// TODO: [🐱🚀] Explain that NotFoundError ([🐱🚀] and other specific errors) has priority over DatabaseError in some contexts
|
|
2810
2837
|
|
|
2811
2838
|
/**
|
|
2812
2839
|
* This error type indicates that you try to use a feature that is not available in the current environment
|
|
@@ -2824,10 +2851,11 @@
|
|
|
2824
2851
|
/**
|
|
2825
2852
|
* This error occurs when some expectation is not met in the execution of the pipeline
|
|
2826
2853
|
*
|
|
2827
|
-
* @public exported from `@promptbook/core`
|
|
2828
2854
|
* Note: Do not throw this error, its reserved for `checkExpectations` and `createPipelineExecutor` and public ONLY to be serializable through remote server
|
|
2829
2855
|
* Note: Always thrown in `checkExpectations` and catched in `createPipelineExecutor` and rethrown as `PipelineExecutionError`
|
|
2830
2856
|
* Note: This is a kindof subtype of PipelineExecutionError
|
|
2857
|
+
*
|
|
2858
|
+
* @public exported from `@promptbook/core`
|
|
2831
2859
|
*/
|
|
2832
2860
|
class ExpectError extends Error {
|
|
2833
2861
|
constructor(message) {
|
|
@@ -2905,16 +2933,15 @@
|
|
|
2905
2933
|
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
2906
2934
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
2907
2935
|
*
|
|
2908
|
-
* @private internal helper function
|
|
2909
2936
|
* @returns secure random token
|
|
2937
|
+
*
|
|
2938
|
+
* @private internal helper function
|
|
2910
2939
|
*/
|
|
2911
2940
|
function $randomToken(randomness) {
|
|
2912
2941
|
return crypto.randomBytes(randomness).toString('hex');
|
|
2913
2942
|
}
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
2917
|
-
*/
|
|
2943
|
+
// TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
2944
|
+
// TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
2918
2945
|
|
|
2919
2946
|
/**
|
|
2920
2947
|
* This error indicates errors during the execution of the pipeline
|
|
@@ -2931,9 +2958,7 @@
|
|
|
2931
2958
|
Object.setPrototypeOf(this, PipelineExecutionError.prototype);
|
|
2932
2959
|
}
|
|
2933
2960
|
}
|
|
2934
|
-
|
|
2935
|
-
* TODO: [🧠][🌂] Add id to all errors
|
|
2936
|
-
*/
|
|
2961
|
+
// TODO: [🧠][🌂] Add id to all errors
|
|
2937
2962
|
|
|
2938
2963
|
/**
|
|
2939
2964
|
* Error thrown when a fetch request fails
|
|
@@ -3009,9 +3034,7 @@
|
|
|
3009
3034
|
...PROMPTBOOK_ERRORS,
|
|
3010
3035
|
...COMMON_JAVASCRIPT_ERRORS,
|
|
3011
3036
|
};
|
|
3012
|
-
|
|
3013
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3014
|
-
*/
|
|
3037
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3015
3038
|
|
|
3016
3039
|
/**
|
|
3017
3040
|
* Serializes an error into a [🚉] JSON-serializable object
|
|
@@ -3044,7 +3067,7 @@
|
|
|
3044
3067
|
|
|
3045
3068
|
/**
|
|
3046
3069
|
* Recursively converts JSON strings to JSON objects
|
|
3047
|
-
|
|
3070
|
+
*
|
|
3048
3071
|
* @public exported from `@promptbook/utils`
|
|
3049
3072
|
*/
|
|
3050
3073
|
function jsonStringsToJsons(object) {
|
|
@@ -3068,9 +3091,7 @@
|
|
|
3068
3091
|
}
|
|
3069
3092
|
return newObject;
|
|
3070
3093
|
}
|
|
3071
|
-
|
|
3072
|
-
* TODO: Type the return type correctly
|
|
3073
|
-
*/
|
|
3094
|
+
// TODO: Type the return type correctly
|
|
3074
3095
|
|
|
3075
3096
|
/**
|
|
3076
3097
|
* Deserializes the error object
|
|
@@ -3105,6 +3126,7 @@
|
|
|
3105
3126
|
*
|
|
3106
3127
|
* @param executionResult - The partial result of the Promptbook execution
|
|
3107
3128
|
* @throws {PipelineExecutionError} If the execution is not successful or if multiple errors occurred
|
|
3129
|
+
*
|
|
3108
3130
|
* @private internal helper function of `asPromise` method of `ExecutionTask`
|
|
3109
3131
|
*/
|
|
3110
3132
|
function assertsTaskSuccessful(executionResult) {
|
|
@@ -3135,9 +3157,7 @@
|
|
|
3135
3157
|
`));
|
|
3136
3158
|
}
|
|
3137
3159
|
}
|
|
3138
|
-
|
|
3139
|
-
* TODO: [🧠] Can this return type be better typed than void
|
|
3140
|
-
*/
|
|
3160
|
+
// TODO: [🧠] Can this return type be better typed than void
|
|
3141
3161
|
|
|
3142
3162
|
/**
|
|
3143
3163
|
* Helper to create a new task
|
|
@@ -3328,10 +3348,8 @@
|
|
|
3328
3348
|
},
|
|
3329
3349
|
};
|
|
3330
3350
|
}
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
* TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
|
|
3334
|
-
*/
|
|
3351
|
+
// TODO: Maybe allow to terminate the task and add getter `isFinished` or `status`
|
|
3352
|
+
// TODO: [🐚] Split into more files and make `PrepareTask` & `RemoteTask` + split the function
|
|
3335
3353
|
|
|
3336
3354
|
/**
|
|
3337
3355
|
* Represents the uncertain value
|
|
@@ -3399,9 +3417,7 @@
|
|
|
3399
3417
|
pagesCount: UNCERTAIN_ZERO_VALUE,
|
|
3400
3418
|
},
|
|
3401
3419
|
});
|
|
3402
|
-
|
|
3403
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3404
|
-
*/
|
|
3420
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3405
3421
|
|
|
3406
3422
|
/**
|
|
3407
3423
|
* Format either small or big number
|
|
@@ -3436,8 +3452,8 @@
|
|
|
3436
3452
|
* This is useful and used in the `templateParameters` function
|
|
3437
3453
|
*
|
|
3438
3454
|
* Note: This function is not just calling `toString` method
|
|
3439
|
-
*
|
|
3440
|
-
*
|
|
3455
|
+
* It's more complex and can handle this conversion specifically for LLM models
|
|
3456
|
+
* See `VALUE_STRINGS`
|
|
3441
3457
|
*
|
|
3442
3458
|
* Note: There are 2 similar functions
|
|
3443
3459
|
* - `valueToString` converts value to string for LLM models as human-readable string
|
|
@@ -3544,6 +3560,7 @@
|
|
|
3544
3560
|
* @param script from which to extract the variables
|
|
3545
3561
|
* @returns the list of variable names
|
|
3546
3562
|
* @throws {ParseError} if the script is invalid
|
|
3563
|
+
*
|
|
3547
3564
|
* @public exported from `@promptbook/javascript`
|
|
3548
3565
|
*/
|
|
3549
3566
|
function extractVariablesFromJavascript(script) {
|
|
@@ -3609,9 +3626,7 @@
|
|
|
3609
3626
|
}
|
|
3610
3627
|
return variables;
|
|
3611
3628
|
}
|
|
3612
|
-
|
|
3613
|
-
* TODO: [🔣] Support for multiple languages - python, java,...
|
|
3614
|
-
*/
|
|
3629
|
+
// TODO: [🔣] Support for multiple languages - python, java,...
|
|
3615
3630
|
|
|
3616
3631
|
/**
|
|
3617
3632
|
* Parses the task and returns the set of all used parameters
|
|
@@ -3619,6 +3634,7 @@
|
|
|
3619
3634
|
* @param task the task with used parameters
|
|
3620
3635
|
* @returns the set of parameter names
|
|
3621
3636
|
* @throws {ParseError} if the script is invalid
|
|
3637
|
+
*
|
|
3622
3638
|
* @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
|
|
3623
3639
|
*/
|
|
3624
3640
|
function extractParameterNamesFromTask(task) {
|
|
@@ -3659,14 +3675,13 @@
|
|
|
3659
3675
|
}
|
|
3660
3676
|
return parameterNames;
|
|
3661
3677
|
}
|
|
3662
|
-
|
|
3663
|
-
* TODO: [🔣] If script require contentLanguage
|
|
3664
|
-
*/
|
|
3678
|
+
// TODO: [🔣] If script require contentLanguage
|
|
3665
3679
|
|
|
3666
3680
|
/**
|
|
3667
3681
|
* Create difference set of two sets.
|
|
3668
3682
|
*
|
|
3669
3683
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
3684
|
+
*
|
|
3670
3685
|
* @public exported from `@promptbook/utils`
|
|
3671
3686
|
*/
|
|
3672
3687
|
function difference(a, b, isEqual = (a, b) => a === b) {
|
|
@@ -3678,14 +3693,13 @@
|
|
|
3678
3693
|
}
|
|
3679
3694
|
return diff;
|
|
3680
3695
|
}
|
|
3681
|
-
|
|
3682
|
-
* TODO: [🧠][💯] Maybe also implement symmetricDifference
|
|
3683
|
-
*/
|
|
3696
|
+
// TODO: [🧠][💯] Maybe also implement symmetricDifference
|
|
3684
3697
|
|
|
3685
3698
|
/**
|
|
3686
3699
|
* Creates a new set with all elements that are present in either set
|
|
3687
3700
|
*
|
|
3688
3701
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
3702
|
+
*
|
|
3689
3703
|
* @public exported from `@promptbook/utils`
|
|
3690
3704
|
*/
|
|
3691
3705
|
function union(...sets) {
|
|
@@ -3751,8 +3765,9 @@
|
|
|
3751
3765
|
/**
|
|
3752
3766
|
* Definition for CSV spreadsheet
|
|
3753
3767
|
*
|
|
3768
|
+
* TODO: [🏢] Export from package `@promptbook/csv`
|
|
3769
|
+
*
|
|
3754
3770
|
* @public exported from `@promptbook/core`
|
|
3755
|
-
* <- TODO: [🏢] Export from package `@promptbook/csv`
|
|
3756
3771
|
*/
|
|
3757
3772
|
const CsvFormatParser = {
|
|
3758
3773
|
formatName: 'CSV',
|
|
@@ -3842,13 +3857,11 @@
|
|
|
3842
3857
|
},
|
|
3843
3858
|
],
|
|
3844
3859
|
};
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
* TODO: [🏢] Allow to expect something inside CSV objects and other formats
|
|
3851
|
-
*/
|
|
3860
|
+
// TODO: [🍓] In `CsvFormatParser` implement simple `isValid`
|
|
3861
|
+
// TODO: [🍓] In `CsvFormatParser` implement partial `canBeValid`
|
|
3862
|
+
// TODO: [🍓] In `CsvFormatParser` implement `heal
|
|
3863
|
+
// TODO: [🍓] In `CsvFormatParser` implement `subvalueParsers`
|
|
3864
|
+
// TODO: [🏢] Allow to expect something inside CSV objects and other formats
|
|
3852
3865
|
|
|
3853
3866
|
/**
|
|
3854
3867
|
* Definition for JSON format
|
|
@@ -3869,17 +3882,15 @@
|
|
|
3869
3882
|
},
|
|
3870
3883
|
subvalueParsers: [],
|
|
3871
3884
|
};
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
* TODO: [🏢] Allow to expect something inside JSON objects and other formats
|
|
3882
|
-
*/
|
|
3885
|
+
// TODO: [🧠] Maybe proper instance of object
|
|
3886
|
+
// TODO: [0] Make string_serialized_json
|
|
3887
|
+
// TODO: [1] Make type for JSON Settings and Schema
|
|
3888
|
+
// TODO: [🧠] What to use for validating JSONs - JSON Schema, ZoD, typescript types/interfaces,...?
|
|
3889
|
+
// TODO: [🍓] In `JsonFormatParser` implement simple `isValid`
|
|
3890
|
+
// TODO: [🍓] In `JsonFormatParser` implement partial `canBeValid`
|
|
3891
|
+
// TODO: [🍓] In `JsonFormatParser` implement `heal
|
|
3892
|
+
// TODO: [🍓] In `JsonFormatParser` implement `subvalueParsers`
|
|
3893
|
+
// TODO: [🏢] Allow to expect something inside JSON objects and other formats
|
|
3883
3894
|
|
|
3884
3895
|
/**
|
|
3885
3896
|
* Definition for any text - this will be always valid
|
|
@@ -3917,15 +3928,13 @@
|
|
|
3917
3928
|
// <- TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
3918
3929
|
],
|
|
3919
3930
|
};
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
* TODO: [🏢] Allow to expect something inside each item of list and other formats
|
|
3928
|
-
*/
|
|
3931
|
+
// TODO: [1] Make type for XML Text and Schema
|
|
3932
|
+
// TODO: [🧠][🤠] Here should be all words, characters, lines, paragraphs, pages available as subvalues
|
|
3933
|
+
// TODO: [🍓] In `TextFormatParser` implement simple `isValid`
|
|
3934
|
+
// TODO: [🍓] In `TextFormatParser` implement partial `canBeValid`
|
|
3935
|
+
// TODO: [🍓] In `TextFormatParser` implement `heal
|
|
3936
|
+
// TODO: [🍓] In `TextFormatParser` implement `subvalueParsers`
|
|
3937
|
+
// TODO: [🏢] Allow to expect something inside each item of list and other formats
|
|
3929
3938
|
|
|
3930
3939
|
/**
|
|
3931
3940
|
* Function to check if a string is valid XML
|
|
@@ -3970,17 +3979,15 @@
|
|
|
3970
3979
|
},
|
|
3971
3980
|
subvalueParsers: [],
|
|
3972
3981
|
};
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
* TODO: [🏢] Allow to expect something inside XML and other formats
|
|
3983
|
-
*/
|
|
3982
|
+
// TODO: [🧠] Maybe proper instance of object
|
|
3983
|
+
// TODO: [0] Make string_serialized_xml
|
|
3984
|
+
// TODO: [1] Make type for XML Settings and Schema
|
|
3985
|
+
// TODO: [🧠] What to use for validating XMLs - XSD,...
|
|
3986
|
+
// TODO: [🍓] In `XmlFormatParser` implement simple `isValid`
|
|
3987
|
+
// TODO: [🍓] In `XmlFormatParser` implement partial `canBeValid`
|
|
3988
|
+
// TODO: [🍓] In `XmlFormatParser` implement `heal
|
|
3989
|
+
// TODO: [🍓] In `XmlFormatParser` implement `subvalueParsers`
|
|
3990
|
+
// TODO: [🏢] Allow to expect something inside XML and other formats
|
|
3984
3991
|
|
|
3985
3992
|
/**
|
|
3986
3993
|
* Definitions for all formats supported by Promptbook
|
|
@@ -3988,9 +3995,7 @@
|
|
|
3988
3995
|
* @private internal index of `...` <- TODO [🏢]
|
|
3989
3996
|
*/
|
|
3990
3997
|
const FORMAT_DEFINITIONS = [JsonFormatParser, XmlFormatParser, TextFormatParser, CsvFormatParser];
|
|
3991
|
-
|
|
3992
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3993
|
-
*/
|
|
3998
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
3994
3999
|
|
|
3995
4000
|
/**
|
|
3996
4001
|
* Maps available parameters to expected parameters for a pipeline task.
|
|
@@ -4000,6 +4005,7 @@
|
|
|
4000
4005
|
* 2) Then, if there are unmatched expected and available parameters, map them by order.
|
|
4001
4006
|
*
|
|
4002
4007
|
* @throws {PipelineExecutionError} If the number of unmatched expected and available parameters does not match, or mapping is ambiguous.
|
|
4008
|
+
*
|
|
4003
4009
|
* @private within the repository used in `createPipelineExecutor`
|
|
4004
4010
|
*/
|
|
4005
4011
|
function mapAvailableToExpectedParameters(options) {
|
|
@@ -4089,6 +4095,7 @@
|
|
|
4089
4095
|
* Multiple LLM Execution Tools is a proxy server that uses multiple execution tools internally and exposes the executor interface externally.
|
|
4090
4096
|
*
|
|
4091
4097
|
* Note: Internal utility of `joinLlmExecutionTools` but exposed type
|
|
4098
|
+
*
|
|
4092
4099
|
* @public exported from `@promptbook/core`
|
|
4093
4100
|
*/
|
|
4094
4101
|
class MultipleLlmExecutionTools {
|
|
@@ -4251,16 +4258,16 @@
|
|
|
4251
4258
|
* `MultipleLlmExecutionTools` object. It provides failover and aggregation logic:
|
|
4252
4259
|
*
|
|
4253
4260
|
* 1. **Failover**: When a model call is made, it tries providers in the order they were provided.
|
|
4254
|
-
*
|
|
4261
|
+
* If the first provider doesn't support the requested model or fails, it tries the next one.
|
|
4255
4262
|
* 2. **Aggregation**: `listModels` returns a combined list of all models available from all providers.
|
|
4256
4263
|
* 3. **Empty case**: If no tools are provided, it logs a warning (as Promptbook requires LLMs to function).
|
|
4257
4264
|
*
|
|
4265
|
+
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
4266
|
+
*
|
|
4258
4267
|
* @param title - A descriptive title for this collection of joined tools
|
|
4259
4268
|
* @param llmExecutionTools - An array of execution tools to be joined
|
|
4260
4269
|
* @returns A single unified execution tool wrapper
|
|
4261
4270
|
*
|
|
4262
|
-
* Tip: You don't have to use this function directly, just pass an array of LlmExecutionTools to the `ExecutionTools`.
|
|
4263
|
-
*
|
|
4264
4271
|
* @public exported from `@promptbook/core`
|
|
4265
4272
|
*/
|
|
4266
4273
|
function joinLlmExecutionTools(title, ...llmExecutionTools) {
|
|
@@ -4297,10 +4304,8 @@
|
|
|
4297
4304
|
}
|
|
4298
4305
|
return new MultipleLlmExecutionTools(title || 'Multiple LLM Providers joined by `joinLlmExecutionTools`', ...llmExecutionTools);
|
|
4299
4306
|
}
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
* TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4303
|
-
*/
|
|
4307
|
+
// TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4308
|
+
// TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4304
4309
|
|
|
4305
4310
|
/**
|
|
4306
4311
|
* Just returns the given `LlmExecutionTools` or joins multiple into one
|
|
@@ -4314,10 +4319,8 @@
|
|
|
4314
4319
|
: joinLlmExecutionTools('Multiple LLM Providers joined by `getSingleLlmExecutionTools`', ..._llms);
|
|
4315
4320
|
return llmTools;
|
|
4316
4321
|
}
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
* TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4320
|
-
*/
|
|
4322
|
+
// TODO: [🙆] `getSingleLlmExecutionTools` vs `joinLlmExecutionTools` - explain difference or pick one
|
|
4323
|
+
// TODO: [👷♂️] Write a comprehensive manual about how to construct and use LLM execution tools in Promptbook
|
|
4321
4324
|
|
|
4322
4325
|
/**
|
|
4323
4326
|
* Just says that the variable is not used but should be kept
|
|
@@ -4331,6 +4334,7 @@
|
|
|
4331
4334
|
*
|
|
4332
4335
|
* @param value any values
|
|
4333
4336
|
* @returns void
|
|
4337
|
+
*
|
|
4334
4338
|
* @private within the repository
|
|
4335
4339
|
*/
|
|
4336
4340
|
function keepUnused(...valuesToKeep) {
|
|
@@ -4340,12 +4344,13 @@
|
|
|
4340
4344
|
* Replaces parameters in template with values from parameters object
|
|
4341
4345
|
*
|
|
4342
4346
|
* Note: This function is not places strings into string,
|
|
4343
|
-
*
|
|
4347
|
+
* It's more complex and can handle this operation specifically for LLM models
|
|
4344
4348
|
*
|
|
4345
4349
|
* @param template the template with parameters in {curly} braces
|
|
4346
4350
|
* @param parameters the object with parameters
|
|
4347
4351
|
* @returns the template with replaced parameters
|
|
4348
4352
|
* @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
|
|
4353
|
+
*
|
|
4349
4354
|
* @public exported from `@promptbook/utils`
|
|
4350
4355
|
*/
|
|
4351
4356
|
function templateParameters(template, parameters) {
|
|
@@ -4419,6 +4424,7 @@
|
|
|
4419
4424
|
* @param markdown any valid markdown
|
|
4420
4425
|
* @returns code blocks with language and content
|
|
4421
4426
|
* @throws {ParseError} if block is not closed properly
|
|
4427
|
+
*
|
|
4422
4428
|
* @public exported from `@promptbook/markdown-utils`
|
|
4423
4429
|
*/
|
|
4424
4430
|
function extractAllBlocksFromMarkdown(markdown) {
|
|
@@ -4469,9 +4475,7 @@
|
|
|
4469
4475
|
}
|
|
4470
4476
|
return codeBlocks;
|
|
4471
4477
|
}
|
|
4472
|
-
|
|
4473
|
-
* TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
4474
|
-
*/
|
|
4478
|
+
// TODO: Maybe name for `blockNotation` instead of '```' and '>'
|
|
4475
4479
|
|
|
4476
4480
|
/**
|
|
4477
4481
|
* Extracts extracts exactly one valid JSON code block
|
|
@@ -4487,8 +4491,9 @@
|
|
|
4487
4491
|
* - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
|
|
4488
4492
|
* - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
|
|
4489
4493
|
*
|
|
4490
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
4491
4494
|
* @throws {ParseError} if there is no valid JSON block in the markdown
|
|
4495
|
+
*
|
|
4496
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
4492
4497
|
*/
|
|
4493
4498
|
function extractJsonBlock(markdown) {
|
|
4494
4499
|
if (isValidJsonString(markdown)) {
|
|
@@ -4504,10 +4509,8 @@
|
|
|
4504
4509
|
}
|
|
4505
4510
|
return jsonBlocks[0].content;
|
|
4506
4511
|
}
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
* TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
|
|
4510
|
-
*/
|
|
4512
|
+
// TODO: Add some auto-healing logic + extract YAML, JSON5, TOML, etc.
|
|
4513
|
+
// TODO: [🏢] Make this logic part of `JsonFormatParser` or `isValidJsonString`
|
|
4511
4514
|
|
|
4512
4515
|
/**
|
|
4513
4516
|
* Counts number of characters in the text
|
|
@@ -4523,10 +4526,8 @@
|
|
|
4523
4526
|
text = text.replace(/\p{Extended_Pictographic}(\u{200D}\p{Extended_Pictographic})*/gu, '-');
|
|
4524
4527
|
return text.length;
|
|
4525
4528
|
}
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4529
|
-
*/
|
|
4529
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4530
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4530
4531
|
|
|
4531
4532
|
/**
|
|
4532
4533
|
* Number of characters per standard line with 11pt Arial font size.
|
|
@@ -4540,10 +4541,8 @@
|
|
|
4540
4541
|
* @public exported from `@promptbook/utils`
|
|
4541
4542
|
*/
|
|
4542
4543
|
const LINES_PER_STANDARD_PAGE = 44;
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4546
|
-
*/
|
|
4544
|
+
// TODO: [🧠] Should be this `constants.ts` or `config.ts`?
|
|
4545
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4547
4546
|
|
|
4548
4547
|
/**
|
|
4549
4548
|
* Counts number of lines in the text
|
|
@@ -4561,10 +4560,8 @@
|
|
|
4561
4560
|
const lines = text.split(/\r?\n/);
|
|
4562
4561
|
return lines.reduce((count, line) => count + Math.max(Math.ceil(line.length / CHARACTERS_PER_STANDARD_LINE), 1), 0);
|
|
4563
4562
|
}
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4567
|
-
*/
|
|
4563
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4564
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4568
4565
|
|
|
4569
4566
|
/**
|
|
4570
4567
|
* Counts number of pages in the text
|
|
@@ -4576,10 +4573,8 @@
|
|
|
4576
4573
|
function countPages(text) {
|
|
4577
4574
|
return Math.ceil(countLines(text) / LINES_PER_STANDARD_PAGE);
|
|
4578
4575
|
}
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4582
|
-
*/
|
|
4576
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4577
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4583
4578
|
|
|
4584
4579
|
/**
|
|
4585
4580
|
* Counts number of paragraphs in the text
|
|
@@ -4589,10 +4584,8 @@
|
|
|
4589
4584
|
function countParagraphs(text) {
|
|
4590
4585
|
return text.split(/\n\s*\n/).filter((paragraph) => paragraph.trim() !== '').length;
|
|
4591
4586
|
}
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4595
|
-
*/
|
|
4587
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4588
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4596
4589
|
|
|
4597
4590
|
/**
|
|
4598
4591
|
* Split text into sentences
|
|
@@ -4610,11 +4603,12 @@
|
|
|
4610
4603
|
function countSentences(text) {
|
|
4611
4604
|
return splitIntoSentences(text).length;
|
|
4612
4605
|
}
|
|
4606
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4607
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4608
|
+
|
|
4613
4609
|
/**
|
|
4614
|
-
*
|
|
4615
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4610
|
+
* Collection of default diacritics removal map.
|
|
4616
4611
|
*/
|
|
4617
|
-
|
|
4618
4612
|
const defaultDiacriticsRemovalMap = [
|
|
4619
4613
|
{
|
|
4620
4614
|
base: 'A',
|
|
@@ -4866,6 +4860,7 @@
|
|
|
4866
4860
|
*
|
|
4867
4861
|
* @param input The string containing diacritics to be normalized.
|
|
4868
4862
|
* @returns The string with diacritics removed or normalized.
|
|
4863
|
+
*
|
|
4869
4864
|
* @public exported from `@promptbook/utils`
|
|
4870
4865
|
*/
|
|
4871
4866
|
function removeDiacritics(input) {
|
|
@@ -4874,9 +4869,7 @@
|
|
|
4874
4869
|
return DIACRITIC_VARIANTS_LETTERS[character] || character;
|
|
4875
4870
|
});
|
|
4876
4871
|
}
|
|
4877
|
-
|
|
4878
|
-
* TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
|
|
4879
|
-
*/
|
|
4872
|
+
// TODO: [Ж] Variant for cyrillic (and in general non-latin) letters
|
|
4880
4873
|
|
|
4881
4874
|
/**
|
|
4882
4875
|
* Counts number of words in the text
|
|
@@ -4890,11 +4883,9 @@
|
|
|
4890
4883
|
text = text.replace(/([a-z])([A-Z])/g, '$1 $2');
|
|
4891
4884
|
return text.split(/[^a-zа-я0-9]+/i).filter((word) => word.length > 0).length;
|
|
4892
4885
|
}
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
* TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
4897
|
-
*/
|
|
4886
|
+
// TODO: [🥴] Implement counting in formats - like JSON, CSV, XML,...
|
|
4887
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
4888
|
+
// TODO: [✌️] `countWords` should be just `splitWords(...).length`, and all other counters should use this pattern as well
|
|
4898
4889
|
|
|
4899
4890
|
/**
|
|
4900
4891
|
* Index of all counter functions
|
|
@@ -4909,10 +4900,8 @@
|
|
|
4909
4900
|
LINES: countLines,
|
|
4910
4901
|
PAGES: countPages,
|
|
4911
4902
|
};
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4915
|
-
*/
|
|
4903
|
+
// TODO: [🧠][🤠] This should be probably as part of `TextFormatParser`
|
|
4904
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4916
4905
|
|
|
4917
4906
|
/**
|
|
4918
4907
|
* Function checkExpectations will check if the expectations on given value are met
|
|
@@ -4923,6 +4912,7 @@
|
|
|
4923
4912
|
*
|
|
4924
4913
|
* @throws {ExpectError} if the expectations are not met
|
|
4925
4914
|
* @returns {void} Nothing
|
|
4915
|
+
*
|
|
4926
4916
|
* @private internal function of `createPipelineExecutor`
|
|
4927
4917
|
*/
|
|
4928
4918
|
function checkExpectations(expectations, value) {
|
|
@@ -4936,11 +4926,9 @@
|
|
|
4936
4926
|
}
|
|
4937
4927
|
}
|
|
4938
4928
|
}
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
* Note: [💝] and [🤠] are interconnected together
|
|
4943
|
-
*/
|
|
4929
|
+
// TODO: [💝] Unite object for expecting amount and format
|
|
4930
|
+
// TODO: [🧠][🤠] This should be part of `TextFormatParser`
|
|
4931
|
+
// Note: [💝] and [🤠] are interconnected together
|
|
4944
4932
|
|
|
4945
4933
|
/**
|
|
4946
4934
|
* Validates a prompt result against expectations and format requirements.
|
|
@@ -4951,6 +4939,7 @@
|
|
|
4951
4939
|
*
|
|
4952
4940
|
* @param options - The validation options including result string, expectations, and format
|
|
4953
4941
|
* @returns Validation result with processed string and validity status
|
|
4942
|
+
*
|
|
4954
4943
|
* @private internal function of `createPipelineExecutor` and `cacheLlmTools`
|
|
4955
4944
|
*/
|
|
4956
4945
|
function validatePromptResult(options) {
|
|
@@ -5013,6 +5002,7 @@
|
|
|
5013
5002
|
*
|
|
5014
5003
|
* @param options - The options for execution, including task, parameters, pipeline, and configuration.
|
|
5015
5004
|
* @returns The result string of the executed task.
|
|
5005
|
+
*
|
|
5016
5006
|
* @private internal utility of `createPipelineExecutor`
|
|
5017
5007
|
*/
|
|
5018
5008
|
async function executeAttempts(options) {
|
|
@@ -5336,9 +5326,7 @@
|
|
|
5336
5326
|
}
|
|
5337
5327
|
return $ongoingTaskResult.$resultString;
|
|
5338
5328
|
}
|
|
5339
|
-
|
|
5340
|
-
* TODO: Break into smaller functions
|
|
5341
|
-
*/
|
|
5329
|
+
// TODO: Break into smaller functions
|
|
5342
5330
|
|
|
5343
5331
|
/**
|
|
5344
5332
|
* Executes a pipeline task that requires mapping or iterating over subvalues of a parameter (such as rows in a CSV).
|
|
@@ -5481,6 +5469,7 @@
|
|
|
5481
5469
|
*
|
|
5482
5470
|
* @param task - The task for which the context is being generated. This should be a deeply immutable TaskJson object.
|
|
5483
5471
|
* @returns The context as a string, formatted as markdown and parameter value.
|
|
5472
|
+
*
|
|
5484
5473
|
* @private internal utility of `createPipelineExecutor`
|
|
5485
5474
|
*/
|
|
5486
5475
|
async function getContextForTask(task) {
|
|
@@ -5518,7 +5507,6 @@
|
|
|
5518
5507
|
}
|
|
5519
5508
|
|
|
5520
5509
|
/**
|
|
5521
|
-
*
|
|
5522
5510
|
* @param knowledgePieces
|
|
5523
5511
|
* @returns
|
|
5524
5512
|
*
|
|
@@ -5599,10 +5587,8 @@
|
|
|
5599
5587
|
return knowledgePiecesToString(preparedPipeline.knowledgePieces);
|
|
5600
5588
|
}
|
|
5601
5589
|
}
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
* TODO: [♨] Examples of values
|
|
5605
|
-
*/
|
|
5590
|
+
// TODO: [♨] Implement Better - use keyword search
|
|
5591
|
+
// TODO: [♨] Examples of values
|
|
5606
5592
|
|
|
5607
5593
|
/**
|
|
5608
5594
|
* Retrieves all reserved parameters for a given pipeline task, including context, knowledge, examples, and metadata.
|
|
@@ -5755,9 +5741,7 @@
|
|
|
5755
5741
|
resultString,
|
|
5756
5742
|
});
|
|
5757
5743
|
}
|
|
5758
|
-
|
|
5759
|
-
* TODO: [🤹♂️]
|
|
5760
|
-
*/
|
|
5744
|
+
// TODO: [🤹♂️]
|
|
5761
5745
|
|
|
5762
5746
|
/**
|
|
5763
5747
|
* Filters and returns only the output parameters from the provided pipeline execution options.
|
|
@@ -6087,6 +6071,7 @@
|
|
|
6087
6071
|
*
|
|
6088
6072
|
* @returns The executor function
|
|
6089
6073
|
* @throws {PipelineLogicError} on logical error in the pipeline
|
|
6074
|
+
*
|
|
6090
6075
|
* @public exported from `@promptbook/core`
|
|
6091
6076
|
*/
|
|
6092
6077
|
function createPipelineExecutor(options) {
|
|
@@ -6242,8 +6227,9 @@
|
|
|
6242
6227
|
* @param array - Array to iterate over
|
|
6243
6228
|
* @param options - Options for the function
|
|
6244
6229
|
* @param callbackfunction - Function to call for each item
|
|
6245
|
-
* @public exported from `@promptbook/utils`
|
|
6246
6230
|
* @deprecated [🪂] Use queues instead
|
|
6231
|
+
*
|
|
6232
|
+
* @public exported from `@promptbook/utils`
|
|
6247
6233
|
*/
|
|
6248
6234
|
async function forEachAsync(array, options, callbackfunction) {
|
|
6249
6235
|
const { maxParallelCount = Infinity } = options;
|
|
@@ -6274,6 +6260,7 @@
|
|
|
6274
6260
|
*
|
|
6275
6261
|
* @param llmTools - The LLM tools to be intercepted and tracked
|
|
6276
6262
|
* @returns Full proxy of the tools with added usage tracking capabilities
|
|
6263
|
+
*
|
|
6277
6264
|
* @public exported from `@promptbook/core`
|
|
6278
6265
|
*/
|
|
6279
6266
|
function countUsage(llmTools) {
|
|
@@ -6371,6 +6358,7 @@
|
|
|
6371
6358
|
* Prepares the persona for the pipeline
|
|
6372
6359
|
*
|
|
6373
6360
|
* @see https://github.com/webgptorg/promptbook/discussions/22
|
|
6361
|
+
*
|
|
6374
6362
|
* @public exported from `@promptbook/core`
|
|
6375
6363
|
*/
|
|
6376
6364
|
async function preparePersona(personaDescription, tools, options) {
|
|
@@ -6427,13 +6415,11 @@
|
|
|
6427
6415
|
modelsRequirements,
|
|
6428
6416
|
};
|
|
6429
6417
|
}
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
* TODO: [🏢] Check validity of `temperature` in pipeline
|
|
6436
|
-
*/
|
|
6418
|
+
// TODO: [😩] DRY `preparePersona` and `selectBestModelFromAvailable`
|
|
6419
|
+
// TODO: [🔃][main] If the persona was prepared with different version or different set of models, prepare it once again
|
|
6420
|
+
// TODO: [🏢] Check validity of `modelName` in pipeline
|
|
6421
|
+
// TODO: [🏢] Check validity of `systemMessage` in pipeline
|
|
6422
|
+
// TODO: [🏢] Check validity of `temperature` in pipeline
|
|
6437
6423
|
|
|
6438
6424
|
/**
|
|
6439
6425
|
* Safely retrieves the global scope object (window in browser, global in Node.js)
|
|
@@ -6441,7 +6427,7 @@
|
|
|
6441
6427
|
*
|
|
6442
6428
|
* Note: `$` is used to indicate that this function is not a pure function - it access global scope
|
|
6443
6429
|
*
|
|
6444
|
-
*
|
|
6430
|
+
* @private internal function of `$Register`
|
|
6445
6431
|
*/
|
|
6446
6432
|
function $getGlobalScope() {
|
|
6447
6433
|
return Function('return this')();
|
|
@@ -6456,6 +6442,7 @@
|
|
|
6456
6442
|
* @returns The normalized text in SCREAMING_CASE format.
|
|
6457
6443
|
* @example 'HELLO_WORLD'
|
|
6458
6444
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
6445
|
+
*
|
|
6459
6446
|
* @public exported from `@promptbook/utils`
|
|
6460
6447
|
*/
|
|
6461
6448
|
function normalizeTo_SCREAMING_CASE(text) {
|
|
@@ -6513,6 +6500,7 @@
|
|
|
6513
6500
|
* @returns The normalized text in snake_case format.
|
|
6514
6501
|
* @example 'hello_world'
|
|
6515
6502
|
* @example 'i_love_promptbook'
|
|
6503
|
+
*
|
|
6516
6504
|
* @public exported from `@promptbook/utils`
|
|
6517
6505
|
*/
|
|
6518
6506
|
function normalizeTo_snake_case(text) {
|
|
@@ -6571,26 +6559,26 @@
|
|
|
6571
6559
|
* Global registry for storing metadata about all available scrapers and converters.
|
|
6572
6560
|
*
|
|
6573
6561
|
* Note: `$` is used to indicate that this interacts with the global scope.
|
|
6562
|
+
*
|
|
6574
6563
|
* @singleton Only one instance of each register is created per build, but there can be more in different contexts (e.g., tests).
|
|
6564
|
+
*
|
|
6575
6565
|
* @public exported from `@promptbook/core`
|
|
6576
6566
|
*/
|
|
6577
6567
|
const $scrapersMetadataRegister = new $Register('scrapers_metadata');
|
|
6578
|
-
|
|
6579
|
-
* TODO: [®] DRY Register logic
|
|
6580
|
-
*/
|
|
6568
|
+
// TODO: [®] DRY Register logic
|
|
6581
6569
|
|
|
6582
6570
|
/**
|
|
6583
6571
|
* Registry for all available scrapers in the system.
|
|
6584
6572
|
* Central point for registering and accessing different types of content scrapers.
|
|
6585
6573
|
*
|
|
6586
6574
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
6575
|
+
*
|
|
6587
6576
|
* @singleton Only one instance of each register is created per build, but there can be more than one in different build modules
|
|
6577
|
+
*
|
|
6588
6578
|
* @public exported from `@promptbook/core`
|
|
6589
6579
|
*/
|
|
6590
6580
|
const $scrapersRegister = new $Register('scraper_constructors');
|
|
6591
|
-
|
|
6592
|
-
* TODO: [®] DRY Register logic
|
|
6593
|
-
*/
|
|
6581
|
+
// TODO: [®] DRY Register logic
|
|
6594
6582
|
|
|
6595
6583
|
/**
|
|
6596
6584
|
* Creates a message with all registered scrapers
|
|
@@ -6675,9 +6663,7 @@
|
|
|
6675
6663
|
|
|
6676
6664
|
`);
|
|
6677
6665
|
}
|
|
6678
|
-
|
|
6679
|
-
* TODO: [®] DRY Register logic
|
|
6680
|
-
*/
|
|
6666
|
+
// TODO: [®] DRY Register logic
|
|
6681
6667
|
|
|
6682
6668
|
/**
|
|
6683
6669
|
* Converts a given text to kebab-case format.
|
|
@@ -6688,6 +6674,7 @@
|
|
|
6688
6674
|
* @returns The kebab-case formatted string.
|
|
6689
6675
|
* @example 'hello-world'
|
|
6690
6676
|
* @example 'i-love-promptbook'
|
|
6677
|
+
*
|
|
6691
6678
|
* @public exported from `@promptbook/utils`
|
|
6692
6679
|
*/
|
|
6693
6680
|
function normalizeToKebabCase(text) {
|
|
@@ -6728,9 +6715,7 @@
|
|
|
6728
6715
|
normalizedName = normalizedName.replace(/-$/, '');
|
|
6729
6716
|
return normalizedName;
|
|
6730
6717
|
}
|
|
6731
|
-
|
|
6732
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6733
|
-
*/
|
|
6718
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
6734
6719
|
|
|
6735
6720
|
/**
|
|
6736
6721
|
* Creates unique name for the source
|
|
@@ -6749,9 +6734,7 @@
|
|
|
6749
6734
|
// <- TODO: Use MAX_FILENAME_LENGTH
|
|
6750
6735
|
return name;
|
|
6751
6736
|
}
|
|
6752
|
-
|
|
6753
|
-
* TODO: [🐱🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
|
|
6754
|
-
*/
|
|
6737
|
+
// TODO: [🐱🐉][🧠] Make some smart crop NOT source-i-m-pavol-a-develop-... BUT source-i-m-pavol-a-developer-...
|
|
6755
6738
|
|
|
6756
6739
|
/**
|
|
6757
6740
|
* Converts a name to a properly formatted subfolder path for cache storage.
|
|
@@ -6801,11 +6784,9 @@
|
|
|
6801
6784
|
.catch(() => false);
|
|
6802
6785
|
return isFile;
|
|
6803
6786
|
}
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
* TODO: [🖇] What about symlinks?
|
|
6808
|
-
*/
|
|
6787
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
6788
|
+
// TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
6789
|
+
// TODO: [🖇] What about symlinks?
|
|
6809
6790
|
|
|
6810
6791
|
/**
|
|
6811
6792
|
* Convert mime type to file extension
|
|
@@ -6825,6 +6806,7 @@
|
|
|
6825
6806
|
*
|
|
6826
6807
|
* @param text with emojis
|
|
6827
6808
|
* @returns text without emojis
|
|
6809
|
+
*
|
|
6828
6810
|
* @public exported from `@promptbook/utils`
|
|
6829
6811
|
*/
|
|
6830
6812
|
function removeEmojis(text) {
|
|
@@ -6844,6 +6826,7 @@
|
|
|
6844
6826
|
* @param value The title string to be converted to a name.
|
|
6845
6827
|
* @returns A normalized name derived from the input title.
|
|
6846
6828
|
* @example 'Hello World!' -> 'hello-world'
|
|
6829
|
+
*
|
|
6847
6830
|
* @public exported from `@promptbook/utils`
|
|
6848
6831
|
*/
|
|
6849
6832
|
function titleToName(value) {
|
|
@@ -6889,9 +6872,7 @@
|
|
|
6889
6872
|
`));
|
|
6890
6873
|
}
|
|
6891
6874
|
};
|
|
6892
|
-
|
|
6893
|
-
* TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
|
|
6894
|
-
*/
|
|
6875
|
+
// TODO: [🧠] Maybe rename because it is not used only for scrapers but also in `$getCompiledBook`
|
|
6895
6876
|
|
|
6896
6877
|
/**
|
|
6897
6878
|
* Factory function that creates a handler for processing knowledge sources.
|
|
@@ -7111,6 +7092,7 @@
|
|
|
7111
7092
|
* Prepares the knowledge pieces
|
|
7112
7093
|
*
|
|
7113
7094
|
* @see https://github.com/webgptorg/promptbook/discussions/41
|
|
7095
|
+
*
|
|
7114
7096
|
* @public exported from `@promptbook/core`
|
|
7115
7097
|
*/
|
|
7116
7098
|
async function prepareKnowledgePieces(knowledgeSources, tools, options) {
|
|
@@ -7252,25 +7234,24 @@
|
|
|
7252
7234
|
});
|
|
7253
7235
|
return { tasksPrepared };
|
|
7254
7236
|
}
|
|
7255
|
-
|
|
7256
|
-
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
7264
|
-
*/
|
|
7237
|
+
// TODO: [😂] Adding knowledge should be convert to async high-level abstractions, similar thing with expectations to sync high-level abstractions
|
|
7238
|
+
// TODO: [🧠] Add context to each task (if missing)
|
|
7239
|
+
// TODO: [🧠] What is better name `prepareTask` or `prepareTaskAndParameters`
|
|
7240
|
+
// TODO: [♨][main] !!3 Prepare index the examples and maybe tasks
|
|
7241
|
+
// TODO: Write tests for `preparePipeline`
|
|
7242
|
+
// TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
7243
|
+
// TODO: [🧊] In future one preparation can take data from previous preparation and save tokens and time
|
|
7244
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
7265
7245
|
|
|
7266
7246
|
/**
|
|
7267
7247
|
* Prepare pipeline locally
|
|
7268
7248
|
*
|
|
7269
|
-
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
7270
|
-
*
|
|
7271
7249
|
* Note: This function does not validate logic of the pipeline
|
|
7272
7250
|
* Note: This function acts as part of compilation process
|
|
7273
7251
|
* Note: When the pipeline is already prepared, it returns the same pipeline
|
|
7252
|
+
*
|
|
7253
|
+
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
7254
|
+
*
|
|
7274
7255
|
* @public exported from `@promptbook/core`
|
|
7275
7256
|
*/
|
|
7276
7257
|
async function preparePipeline(pipeline, tools, options) {
|
|
@@ -7449,6 +7430,7 @@
|
|
|
7449
7430
|
* Parses the knowledge command
|
|
7450
7431
|
*
|
|
7451
7432
|
* @see `documentationUrl` for more details
|
|
7433
|
+
*
|
|
7452
7434
|
* @public exported from `@promptbook/editable`
|
|
7453
7435
|
*/
|
|
7454
7436
|
const knowledgeCommandParser = {
|
|
@@ -7535,14 +7517,13 @@
|
|
|
7535
7517
|
throw new NotYetImplementedError(`[🛋] Not implemented yet`); // <- TODO: [🛋] Implement
|
|
7536
7518
|
},
|
|
7537
7519
|
};
|
|
7538
|
-
|
|
7539
|
-
* Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
|
|
7540
|
-
*/
|
|
7520
|
+
// Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
|
|
7541
7521
|
|
|
7542
7522
|
/**
|
|
7543
7523
|
* Parses the section command
|
|
7544
7524
|
*
|
|
7545
7525
|
* @see `documentationUrl` for more details
|
|
7526
|
+
*
|
|
7546
7527
|
* @public exported from `@promptbook/editable`
|
|
7547
7528
|
*/
|
|
7548
7529
|
const sectionCommandParser = {
|
|
@@ -7734,6 +7715,7 @@
|
|
|
7734
7715
|
* Note: @@ This command is used as boilerplate for new commands - it should NOT be used in any `.book` file
|
|
7735
7716
|
*
|
|
7736
7717
|
* @see `documentationUrl` for more details
|
|
7718
|
+
*
|
|
7737
7719
|
* @private within the commands folder
|
|
7738
7720
|
*/
|
|
7739
7721
|
const boilerplateCommandParser = {
|
|
@@ -7825,6 +7807,7 @@
|
|
|
7825
7807
|
* Parses the BOOK_VERSION command
|
|
7826
7808
|
*
|
|
7827
7809
|
* @see `documentationUrl` for more details
|
|
7810
|
+
*
|
|
7828
7811
|
* @public exported from `@promptbook/editable`
|
|
7829
7812
|
*/
|
|
7830
7813
|
const bookVersionCommandParser = {
|
|
@@ -7901,12 +7884,11 @@
|
|
|
7901
7884
|
* Units of text measurement
|
|
7902
7885
|
*
|
|
7903
7886
|
* @see https://github.com/webgptorg/promptbook/discussions/30
|
|
7887
|
+
*
|
|
7904
7888
|
* @public exported from `@promptbook/core`
|
|
7905
7889
|
*/
|
|
7906
7890
|
const EXPECTATION_UNITS = ['CHARACTERS', 'WORDS', 'SENTENCES', 'LINES', 'PARAGRAPHS', 'PAGES'];
|
|
7907
|
-
|
|
7908
|
-
* TODO: [💝] Unite object for expecting amount and format - remove format
|
|
7909
|
-
*/
|
|
7891
|
+
// TODO: [💝] Unite object for expecting amount and format - remove format
|
|
7910
7892
|
|
|
7911
7893
|
/**
|
|
7912
7894
|
* Function parseNumber will parse number from string
|
|
@@ -7975,17 +7957,16 @@
|
|
|
7975
7957
|
}
|
|
7976
7958
|
return num;
|
|
7977
7959
|
}
|
|
7978
|
-
|
|
7979
|
-
|
|
7980
|
-
* TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
|
|
7981
|
-
*/
|
|
7960
|
+
// TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
|
|
7961
|
+
// TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
|
|
7982
7962
|
|
|
7983
7963
|
/**
|
|
7984
|
-
|
|
7985
|
-
|
|
7964
|
+
* import { WrappedError } from '../../errors/WrappedError';
|
|
7965
|
+
* import { assertsError } from '../../errors/assertsError';
|
|
7986
7966
|
* Parses the expect command
|
|
7987
7967
|
*
|
|
7988
7968
|
* @see `documentationUrl` for more details
|
|
7969
|
+
*
|
|
7989
7970
|
* @public exported from `@promptbook/editable`
|
|
7990
7971
|
*/
|
|
7991
7972
|
const expectCommandParser = {
|
|
@@ -8132,6 +8113,7 @@
|
|
|
8132
8113
|
* @returns The camelCase formatted string.
|
|
8133
8114
|
* @example 'helloWorld'
|
|
8134
8115
|
* @example 'iLovePromptbook'
|
|
8116
|
+
*
|
|
8135
8117
|
* @public exported from `@promptbook/utils`
|
|
8136
8118
|
*/
|
|
8137
8119
|
function normalizeTo_camelCase(text, _isFirstLetterCapital = false) {
|
|
@@ -8172,9 +8154,7 @@
|
|
|
8172
8154
|
}
|
|
8173
8155
|
return normalizedName;
|
|
8174
8156
|
}
|
|
8175
|
-
|
|
8176
|
-
* TODO: [🌺] Use some intermediate util splitWords
|
|
8177
|
-
*/
|
|
8157
|
+
// TODO: [🌺] Use some intermediate util splitWords
|
|
8178
8158
|
|
|
8179
8159
|
/**
|
|
8180
8160
|
* Removes quotes from a string
|
|
@@ -8188,6 +8168,7 @@
|
|
|
8188
8168
|
*
|
|
8189
8169
|
* @param text optionally quoted text
|
|
8190
8170
|
* @returns text without quotes
|
|
8171
|
+
*
|
|
8191
8172
|
* @public exported from `@promptbook/utils`
|
|
8192
8173
|
*/
|
|
8193
8174
|
function removeQuotes(text) {
|
|
@@ -8209,6 +8190,7 @@
|
|
|
8209
8190
|
* @param parameterName The parameter name to validate and normalize.
|
|
8210
8191
|
* @returns The validated and normalized parameter name.
|
|
8211
8192
|
* @throws {ParseError} If the parameter name is empty, reserved, or contains invalid characters.
|
|
8193
|
+
*
|
|
8212
8194
|
* @private within the repository
|
|
8213
8195
|
*/
|
|
8214
8196
|
function validateParameterName(parameterName) {
|
|
@@ -8279,6 +8261,7 @@
|
|
|
8279
8261
|
* Parses the foreach command
|
|
8280
8262
|
*
|
|
8281
8263
|
* @see `documentationUrl` for more details
|
|
8264
|
+
*
|
|
8282
8265
|
* @public exported from `@promptbook/editable`
|
|
8283
8266
|
*/
|
|
8284
8267
|
const foreachCommandParser = {
|
|
@@ -8437,14 +8420,13 @@
|
|
|
8437
8420
|
throw new NotYetImplementedError(`[🛋] Not implemented yet`); // <- TODO: [🛋] Implement
|
|
8438
8421
|
},
|
|
8439
8422
|
};
|
|
8440
|
-
|
|
8441
|
-
* TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
|
|
8442
|
-
*/
|
|
8423
|
+
// TODO: [🍭] Make .book.md file with examples of the FOREACH with wrong parsing and logic
|
|
8443
8424
|
|
|
8444
8425
|
/**
|
|
8445
8426
|
* Parses the format command
|
|
8446
8427
|
*
|
|
8447
8428
|
* @see `documentationUrl` for more details
|
|
8429
|
+
*
|
|
8448
8430
|
* @public exported from `@promptbook/editable`
|
|
8449
8431
|
*/
|
|
8450
8432
|
const formatCommandParser = {
|
|
@@ -8629,9 +8611,7 @@
|
|
|
8629
8611
|
inputParameters: [],
|
|
8630
8612
|
outputParameters: [],
|
|
8631
8613
|
};
|
|
8632
|
-
|
|
8633
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8634
|
-
*/
|
|
8614
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8635
8615
|
|
|
8636
8616
|
/**
|
|
8637
8617
|
* A generic pipeline
|
|
@@ -8783,9 +8763,7 @@
|
|
|
8783
8763
|
CompletionFormfactorDefinition,
|
|
8784
8764
|
// <- [🛬] When making new formfactor, copy the _boilerplate and link it here
|
|
8785
8765
|
];
|
|
8786
|
-
|
|
8787
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8788
|
-
*/
|
|
8766
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
8789
8767
|
|
|
8790
8768
|
/**
|
|
8791
8769
|
* Parses the formfactor command
|
|
@@ -8793,6 +8771,7 @@
|
|
|
8793
8771
|
* Note: This command is used as a formfactor for new commands and defines the app type format - it should NOT be used in any `.book` file
|
|
8794
8772
|
*
|
|
8795
8773
|
* @see `documentationUrl` for more details
|
|
8774
|
+
*
|
|
8796
8775
|
* @public exported from `@promptbook/editable`
|
|
8797
8776
|
*/
|
|
8798
8777
|
const formfactorCommandParser = {
|
|
@@ -8888,6 +8867,7 @@
|
|
|
8888
8867
|
* Parses the joker command
|
|
8889
8868
|
*
|
|
8890
8869
|
* @see `documentationUrl` for more details
|
|
8870
|
+
*
|
|
8891
8871
|
* @public exported from `@promptbook/editable`
|
|
8892
8872
|
*/
|
|
8893
8873
|
const jokerCommandParser = {
|
|
@@ -8955,7 +8935,10 @@
|
|
|
8955
8935
|
};
|
|
8956
8936
|
|
|
8957
8937
|
/**
|
|
8938
|
+
* Constant for model variants.
|
|
8939
|
+
*
|
|
8958
8940
|
* @see {@link ModelVariant}
|
|
8941
|
+
*
|
|
8959
8942
|
* @public exported from `@promptbook/core`
|
|
8960
8943
|
*/
|
|
8961
8944
|
const MODEL_VARIANTS = [
|
|
@@ -8970,6 +8953,7 @@
|
|
|
8970
8953
|
*
|
|
8971
8954
|
* @see `documentationUrl` for more details
|
|
8972
8955
|
* @deprecated Option to manually set the model requirements is not recommended to use, use `PERSONA` instead
|
|
8956
|
+
*
|
|
8973
8957
|
* @public exported from `@promptbook/editable`
|
|
8974
8958
|
*/
|
|
8975
8959
|
const modelCommandParser = {
|
|
@@ -9150,6 +9134,7 @@
|
|
|
9150
9134
|
* Parses the parameter command
|
|
9151
9135
|
*
|
|
9152
9136
|
* @see `documentationUrl` for more details
|
|
9137
|
+
*
|
|
9153
9138
|
* @public exported from `@promptbook/editable`
|
|
9154
9139
|
*/
|
|
9155
9140
|
const parameterCommandParser = {
|
|
@@ -9260,6 +9245,7 @@
|
|
|
9260
9245
|
* Parses the persona command
|
|
9261
9246
|
*
|
|
9262
9247
|
* @see `documentationUrl` for more details
|
|
9248
|
+
*
|
|
9263
9249
|
* @public exported from `@promptbook/editable`
|
|
9264
9250
|
*/
|
|
9265
9251
|
const personaCommandParser = {
|
|
@@ -9392,6 +9378,7 @@
|
|
|
9392
9378
|
*
|
|
9393
9379
|
* @param javascriptName The value to check for JavaScript identifier validity.
|
|
9394
9380
|
* @returns `true` if the value is a valid JavaScript name, false otherwise.
|
|
9381
|
+
*
|
|
9395
9382
|
* @public exported from `@promptbook/utils`
|
|
9396
9383
|
*/
|
|
9397
9384
|
function isValidJavascriptName(javascriptName) {
|
|
@@ -9405,6 +9392,7 @@
|
|
|
9405
9392
|
* Parses the postprocess command
|
|
9406
9393
|
*
|
|
9407
9394
|
* @see `documentationUrl` for more details
|
|
9395
|
+
*
|
|
9408
9396
|
* @public exported from `@promptbook/editable`
|
|
9409
9397
|
*/
|
|
9410
9398
|
const postprocessCommandParser = {
|
|
@@ -9483,6 +9471,7 @@
|
|
|
9483
9471
|
* Parses the url command
|
|
9484
9472
|
*
|
|
9485
9473
|
* @see `documentationUrl` for more details
|
|
9474
|
+
*
|
|
9486
9475
|
* @public exported from `@promptbook/editable`
|
|
9487
9476
|
*/
|
|
9488
9477
|
const urlCommandParser = {
|
|
@@ -9584,6 +9573,7 @@
|
|
|
9584
9573
|
* Parses the action command
|
|
9585
9574
|
*
|
|
9586
9575
|
* @see `documentationUrl` for more details
|
|
9576
|
+
*
|
|
9587
9577
|
* @public exported from `@promptbook/editable`
|
|
9588
9578
|
*/
|
|
9589
9579
|
const actionCommandParser = {
|
|
@@ -9641,14 +9631,13 @@
|
|
|
9641
9631
|
throw new NotYetImplementedError('[🛠] Actions are not implemented yet');
|
|
9642
9632
|
},
|
|
9643
9633
|
};
|
|
9644
|
-
|
|
9645
|
-
* Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
|
|
9646
|
-
*/
|
|
9634
|
+
// Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
|
|
9647
9635
|
|
|
9648
9636
|
/**
|
|
9649
9637
|
* Parses the instrument command
|
|
9650
9638
|
*
|
|
9651
9639
|
* @see `documentationUrl` for more details
|
|
9640
|
+
*
|
|
9652
9641
|
* @public exported from `@promptbook/editable`
|
|
9653
9642
|
*/
|
|
9654
9643
|
const instrumentCommandParser = {
|
|
@@ -9706,9 +9695,7 @@
|
|
|
9706
9695
|
throw new NotYetImplementedError('[🛠] Instruments are not implemented yet');
|
|
9707
9696
|
},
|
|
9708
9697
|
};
|
|
9709
|
-
|
|
9710
|
-
* Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
|
|
9711
|
-
*/
|
|
9698
|
+
// Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
|
|
9712
9699
|
|
|
9713
9700
|
/**
|
|
9714
9701
|
* All available command parsers
|
|
@@ -9734,9 +9721,7 @@
|
|
|
9734
9721
|
boilerplateCommandParser, // <- TODO: Only in development, remove in production
|
|
9735
9722
|
// <- Note: [♓️][💩] This is the order of the commands in the pipeline, BUT its not used in parsing and before usage maybe it should be done better
|
|
9736
9723
|
];
|
|
9737
|
-
|
|
9738
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9739
|
-
*/
|
|
9724
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9740
9725
|
|
|
9741
9726
|
/**
|
|
9742
9727
|
* Gets the parser for the command
|
|
@@ -9766,6 +9751,7 @@
|
|
|
9766
9751
|
*
|
|
9767
9752
|
* @param {string} str - The string to remove Markdown tags from.
|
|
9768
9753
|
* @returns {string} The input string with all Markdown tags removed.
|
|
9754
|
+
*
|
|
9769
9755
|
* @public exported from `@promptbook/markdown-utils`
|
|
9770
9756
|
*/
|
|
9771
9757
|
function removeMarkdownFormatting(str) {
|
|
@@ -10151,9 +10137,7 @@
|
|
|
10151
10137
|
});
|
|
10152
10138
|
},
|
|
10153
10139
|
};
|
|
10154
|
-
|
|
10155
|
-
* TODO: [🧠][📛] Should this be here?
|
|
10156
|
-
*/
|
|
10140
|
+
// TODO: [🧠][📛] Should this be here?
|
|
10157
10141
|
|
|
10158
10142
|
/**
|
|
10159
10143
|
* All high-level abstractions
|
|
@@ -10165,10 +10149,8 @@
|
|
|
10165
10149
|
QuickChatbotHla,
|
|
10166
10150
|
// <- Note: [♓️][💩] This is the order of the application of high-level abstractions application on pipeline JSON
|
|
10167
10151
|
];
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10171
|
-
*/
|
|
10152
|
+
// TODO: Test that all sync high-level abstractions are before async high-level abstractions
|
|
10153
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
10172
10154
|
|
|
10173
10155
|
/**
|
|
10174
10156
|
* Supported script languages
|
|
@@ -10179,7 +10161,7 @@
|
|
|
10179
10161
|
// <- TODO: [🏥] DRY
|
|
10180
10162
|
|
|
10181
10163
|
/**
|
|
10182
|
-
*
|
|
10164
|
+
* Number of padding lines to add at the end of the book content
|
|
10183
10165
|
*
|
|
10184
10166
|
* @public exported from `@promptbook/core`
|
|
10185
10167
|
*/
|
|
@@ -10216,15 +10198,14 @@
|
|
|
10216
10198
|
const linesToAdd = PADDING_LINES - trailingEmptyLines;
|
|
10217
10199
|
return (content + '\n'.repeat(linesToAdd));
|
|
10218
10200
|
}
|
|
10219
|
-
|
|
10220
|
-
* TODO: [🧠] Maybe export
|
|
10221
|
-
*/
|
|
10201
|
+
// TODO: [🧠] Maybe export
|
|
10222
10202
|
|
|
10223
10203
|
/**
|
|
10224
10204
|
* Removes Markdown (or HTML) comments
|
|
10225
10205
|
*
|
|
10226
10206
|
* @param {string} content - The string to remove comments from.
|
|
10227
10207
|
* @returns {string} The input string with all comments removed.
|
|
10208
|
+
*
|
|
10228
10209
|
* @public exported from `@promptbook/markdown-utils`
|
|
10229
10210
|
*/
|
|
10230
10211
|
function removeMarkdownComments(content) {
|
|
@@ -10302,9 +10283,7 @@
|
|
|
10302
10283
|
// <- TODO: Maybe use book` notation
|
|
10303
10284
|
return padBook(pipelineString);
|
|
10304
10285
|
}
|
|
10305
|
-
|
|
10306
|
-
* TODO: Unit test
|
|
10307
|
-
*/
|
|
10286
|
+
// TODO: Unit test
|
|
10308
10287
|
|
|
10309
10288
|
/**
|
|
10310
10289
|
* Utility function to extract all list items from markdown
|
|
@@ -10316,6 +10295,7 @@
|
|
|
10316
10295
|
*
|
|
10317
10296
|
* @param markdown any valid markdown
|
|
10318
10297
|
* @returns An array of strings, each representing an individual list item found in the markdown
|
|
10298
|
+
*
|
|
10319
10299
|
* @public exported from `@promptbook/markdown-utils`
|
|
10320
10300
|
*/
|
|
10321
10301
|
function extractAllListItemsFromMarkdown(markdown) {
|
|
@@ -10348,8 +10328,9 @@
|
|
|
10348
10328
|
*
|
|
10349
10329
|
* @param markdown any valid markdown
|
|
10350
10330
|
* @returns code block with language and content
|
|
10351
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
10352
10331
|
* @throws {ParseError} if there is not exactly one code block in the markdown
|
|
10332
|
+
*
|
|
10333
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
10353
10334
|
*/
|
|
10354
10335
|
function extractOneBlockFromMarkdown(markdown) {
|
|
10355
10336
|
const codeBlocks = extractAllBlocksFromMarkdown(markdown);
|
|
@@ -10362,9 +10343,7 @@
|
|
|
10362
10343
|
}
|
|
10363
10344
|
return codeBlocks[0];
|
|
10364
10345
|
}
|
|
10365
|
-
|
|
10366
|
-
* TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
|
|
10367
|
-
*/
|
|
10346
|
+
// TODO: [🍓][🌻] Decide of this is internal utility, external util OR validator/postprocessor
|
|
10368
10347
|
|
|
10369
10348
|
/**
|
|
10370
10349
|
* Parses markdown section to title its level and content
|
|
@@ -10506,6 +10485,7 @@
|
|
|
10506
10485
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
10507
10486
|
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
10508
10487
|
* @throws {ParseError} if the promptbook string is not valid
|
|
10488
|
+
*
|
|
10509
10489
|
* @public exported from `@promptbook/core`
|
|
10510
10490
|
*/
|
|
10511
10491
|
function parsePipeline(pipelineString) {
|
|
@@ -10926,31 +10906,29 @@
|
|
|
10926
10906
|
},
|
|
10927
10907
|
});
|
|
10928
10908
|
}
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
* TODO: [🍙] Make some standard order of json properties
|
|
10939
|
-
*/
|
|
10909
|
+
// TODO: [🧠] Maybe more things here can be refactored as high-level abstractions
|
|
10910
|
+
// TODO: [main] !!4 Warn if used only sync version
|
|
10911
|
+
// TODO: [🚞] Report here line/column of error
|
|
10912
|
+
// TODO: Use spaceTrim more effectively
|
|
10913
|
+
// TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
10914
|
+
// TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
|
|
10915
|
+
// TODO: [♈] Probably move expectations from tasks to parameters
|
|
10916
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
10917
|
+
// TODO: [🍙] Make some standard order of json properties
|
|
10940
10918
|
|
|
10941
10919
|
/**
|
|
10942
10920
|
* Compile pipeline from string (markdown) format to JSON format
|
|
10943
10921
|
*
|
|
10944
|
-
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
10945
|
-
*
|
|
10946
10922
|
* Note: This function does not validate logic of the pipeline only the parsing
|
|
10947
10923
|
* Note: This function acts as compilation process
|
|
10948
10924
|
*
|
|
10925
|
+
* @see https://github.com/webgptorg/promptbook/discussions/196
|
|
10949
10926
|
* @param pipelineString {Promptbook} in string markdown format (.book.md)
|
|
10950
10927
|
* @param tools - Tools for the preparation and scraping - if not provided together with `llm`, the preparation will be skipped
|
|
10951
10928
|
* @param options - Options and tools for the compilation
|
|
10952
10929
|
* @returns {Promptbook} compiled in JSON format (.bookc)
|
|
10953
10930
|
* @throws {ParseError} if the promptbook string is not valid
|
|
10931
|
+
*
|
|
10954
10932
|
* @public exported from `@promptbook/core`
|
|
10955
10933
|
*/
|
|
10956
10934
|
async function compilePipeline(pipelineString, tools, options) {
|
|
@@ -10963,11 +10941,9 @@
|
|
|
10963
10941
|
// Note: No need to use `$exportJson` because `parsePipeline` and `preparePipeline` already do that
|
|
10964
10942
|
return pipelineJson;
|
|
10965
10943
|
}
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
* TODO: [🧠] Should be in generated JSON file GENERATOR_WARNING
|
|
10970
|
-
*/
|
|
10944
|
+
// TODO: [🏏] Leverage the batch API and build queues @see https://platform.openai.com/docs/guides/batch
|
|
10945
|
+
// TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
10946
|
+
// TODO: [🧠] Should be in generated JSON file GENERATOR_WARNING
|
|
10971
10947
|
|
|
10972
10948
|
/**
|
|
10973
10949
|
* Unsafe characters that prevent an inline parameter.
|
|
@@ -10991,6 +10967,7 @@
|
|
|
10991
10967
|
* Normalizes a JSON string so it can be safely rendered without double escaping.
|
|
10992
10968
|
*
|
|
10993
10969
|
* @param value Candidate JSON string.
|
|
10970
|
+
*
|
|
10994
10971
|
* @private function of ParameterEscaping
|
|
10995
10972
|
*/
|
|
10996
10973
|
function normalizeJsonString(value) {
|
|
@@ -11005,6 +10982,7 @@
|
|
|
11005
10982
|
* Hides brackets in a string to avoid confusion with template parameters.
|
|
11006
10983
|
*
|
|
11007
10984
|
* @param value Input string with literal brackets.
|
|
10985
|
+
*
|
|
11008
10986
|
* @private function of ParameterEscaping
|
|
11009
10987
|
*/
|
|
11010
10988
|
function hideBrackets(value) {
|
|
@@ -11014,6 +10992,7 @@
|
|
|
11014
10992
|
* Restores hidden brackets.
|
|
11015
10993
|
*
|
|
11016
10994
|
* @param value String with hidden brackets.
|
|
10995
|
+
*
|
|
11017
10996
|
* @private function of ParameterEscaping
|
|
11018
10997
|
*/
|
|
11019
10998
|
function restoreBrackets(value) {
|
|
@@ -11023,6 +11002,7 @@
|
|
|
11023
11002
|
* Decides whether a parameter can be inlined safely.
|
|
11024
11003
|
*
|
|
11025
11004
|
* @param value Parameter rendered as string.
|
|
11005
|
+
*
|
|
11026
11006
|
* @private function of ParameterEscaping
|
|
11027
11007
|
*/
|
|
11028
11008
|
function shouldInlineParameterValue(value) {
|
|
@@ -11036,6 +11016,7 @@
|
|
|
11036
11016
|
*
|
|
11037
11017
|
* @param value Parameter value to escape.
|
|
11038
11018
|
* @param options Escape options for additional characters.
|
|
11019
|
+
*
|
|
11039
11020
|
* @private function of ParameterEscaping
|
|
11040
11021
|
*/
|
|
11041
11022
|
function escapePromptParameterValue(value, options) {
|
|
@@ -11061,6 +11042,7 @@
|
|
|
11061
11042
|
* Builds numeric parameter names (1, 2, ...).
|
|
11062
11043
|
*
|
|
11063
11044
|
* @param index Zero-based parameter index.
|
|
11045
|
+
*
|
|
11064
11046
|
* @private function of ParameterNaming
|
|
11065
11047
|
*/
|
|
11066
11048
|
function buildNumericParameterName(index) {
|
|
@@ -11070,6 +11052,7 @@
|
|
|
11070
11052
|
* Builds alphabetic parameter names (a, b, ..., aa).
|
|
11071
11053
|
*
|
|
11072
11054
|
* @param index Zero-based parameter index.
|
|
11055
|
+
*
|
|
11073
11056
|
* @private function of ParameterNaming
|
|
11074
11057
|
*/
|
|
11075
11058
|
function buildAlphabeticParameterName(index) {
|
|
@@ -11086,6 +11069,7 @@
|
|
|
11086
11069
|
* Converts a positive integer into a Roman numeral string.
|
|
11087
11070
|
*
|
|
11088
11071
|
* @param value Positive integer value.
|
|
11072
|
+
*
|
|
11089
11073
|
* @private function of ParameterNaming
|
|
11090
11074
|
*/
|
|
11091
11075
|
function toRomanNumeral(value) {
|
|
@@ -11118,6 +11102,7 @@
|
|
|
11118
11102
|
* Builds Roman numeral parameter names (I, II, ...).
|
|
11119
11103
|
*
|
|
11120
11104
|
* @param index Zero-based parameter index.
|
|
11105
|
+
*
|
|
11121
11106
|
* @private function of ParameterNaming
|
|
11122
11107
|
*/
|
|
11123
11108
|
function buildRomanParameterName(index) {
|
|
@@ -11128,6 +11113,7 @@
|
|
|
11128
11113
|
*
|
|
11129
11114
|
* @param prefix Prefix string.
|
|
11130
11115
|
* @param builder Base builder function.
|
|
11116
|
+
*
|
|
11131
11117
|
* @private function of ParameterNaming
|
|
11132
11118
|
*/
|
|
11133
11119
|
function buildPrefixedParameterName(prefix, builder) {
|
|
@@ -11149,6 +11135,7 @@
|
|
|
11149
11135
|
* Collects bracketed tokens from parameter values to avoid placeholder collisions.
|
|
11150
11136
|
*
|
|
11151
11137
|
* @param values Parameter values to scan.
|
|
11138
|
+
*
|
|
11152
11139
|
* @private function of ParameterNaming
|
|
11153
11140
|
*/
|
|
11154
11141
|
function collectBracketedParameterTokens(values) {
|
|
@@ -11169,6 +11156,7 @@
|
|
|
11169
11156
|
* Builds placeholder names while avoiding collisions with parameter content.
|
|
11170
11157
|
*
|
|
11171
11158
|
* @param values Parameter values to scan for conflicting tokens.
|
|
11159
|
+
*
|
|
11172
11160
|
* @private function of ParameterNaming
|
|
11173
11161
|
*/
|
|
11174
11162
|
function buildParameterNames(values) {
|
|
@@ -11199,6 +11187,7 @@
|
|
|
11199
11187
|
* Formats the placeholder used in the prompt body for a parameter.
|
|
11200
11188
|
*
|
|
11201
11189
|
* @param name Parameter placeholder name.
|
|
11190
|
+
*
|
|
11202
11191
|
* @private function of ParameterSection
|
|
11203
11192
|
*/
|
|
11204
11193
|
function formatParameterPlaceholder(name) {
|
|
@@ -11208,6 +11197,7 @@
|
|
|
11208
11197
|
* Formats a single line entry for structured parameters.
|
|
11209
11198
|
*
|
|
11210
11199
|
* @param item Parameter entry data.
|
|
11200
|
+
*
|
|
11211
11201
|
* @private function of ParameterSection
|
|
11212
11202
|
*/
|
|
11213
11203
|
function formatParameterListItem(item) {
|
|
@@ -11219,6 +11209,7 @@
|
|
|
11219
11209
|
* Builds the structured parameters section appended to the prompt.
|
|
11220
11210
|
*
|
|
11221
11211
|
* @param items Parameter entries to include.
|
|
11212
|
+
*
|
|
11222
11213
|
* @private function of ParameterSection
|
|
11223
11214
|
*/
|
|
11224
11215
|
function buildParametersSection(items) {
|
|
@@ -11294,6 +11285,7 @@
|
|
|
11294
11285
|
* @param strings
|
|
11295
11286
|
* @param values
|
|
11296
11287
|
* @returns prompt content wrapped as a PromptString
|
|
11288
|
+
*
|
|
11297
11289
|
* @public exported from `@promptbook/utils`
|
|
11298
11290
|
*/
|
|
11299
11291
|
function prompt(strings, ...values) {
|
|
@@ -11378,11 +11370,9 @@
|
|
|
11378
11370
|
}
|
|
11379
11371
|
return new PromptString(pipelineString);
|
|
11380
11372
|
}
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11385
|
-
*/
|
|
11373
|
+
// TODO: Maybe split into multiple files
|
|
11374
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
11375
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11386
11376
|
|
|
11387
11377
|
/**
|
|
11388
11378
|
* @@@
|
|
@@ -11419,9 +11409,7 @@
|
|
|
11419
11409
|
[CLIENT_VERSION_HEADER]: CLIENT_LATEST_VERSION,
|
|
11420
11410
|
};
|
|
11421
11411
|
}
|
|
11422
|
-
|
|
11423
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11424
|
-
*/
|
|
11412
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
11425
11413
|
|
|
11426
11414
|
/**
|
|
11427
11415
|
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
@@ -11438,9 +11426,7 @@
|
|
|
11438
11426
|
return false;
|
|
11439
11427
|
}
|
|
11440
11428
|
}
|
|
11441
|
-
|
|
11442
|
-
* TODO: [🎺]
|
|
11443
|
-
*/
|
|
11429
|
+
// TODO: [🎺]
|
|
11444
11430
|
|
|
11445
11431
|
/**
|
|
11446
11432
|
* Detects if the code is running in a Node.js environment
|
|
@@ -11457,9 +11443,7 @@
|
|
|
11457
11443
|
return false;
|
|
11458
11444
|
}
|
|
11459
11445
|
}
|
|
11460
|
-
|
|
11461
|
-
* TODO: [🎺]
|
|
11462
|
-
*/
|
|
11446
|
+
// TODO: [🎺]
|
|
11463
11447
|
|
|
11464
11448
|
/**
|
|
11465
11449
|
* Detects if the code is running in a web worker
|
|
@@ -11479,9 +11463,7 @@
|
|
|
11479
11463
|
return false;
|
|
11480
11464
|
}
|
|
11481
11465
|
}
|
|
11482
|
-
|
|
11483
|
-
* TODO: [🎺]
|
|
11484
|
-
*/
|
|
11466
|
+
// TODO: [🎺]
|
|
11485
11467
|
|
|
11486
11468
|
/**
|
|
11487
11469
|
* Computes SHA-256 hash of the given object
|
|
@@ -11491,9 +11473,7 @@
|
|
|
11491
11473
|
function computeHash(value) {
|
|
11492
11474
|
return cryptoJs.SHA256(hexEncoder__default["default"].parse(_spaceTrim.spaceTrim(valueToString(value)))).toString( /* hex */);
|
|
11493
11475
|
}
|
|
11494
|
-
|
|
11495
|
-
* TODO: [🥬][🥬] Use this ACRY
|
|
11496
|
-
*/
|
|
11476
|
+
// TODO: [🥬][🥬] Use this ACRY
|
|
11497
11477
|
|
|
11498
11478
|
// spell-checker: disable
|
|
11499
11479
|
/**
|
|
@@ -11659,6 +11639,9 @@
|
|
|
11659
11639
|
'prvotní',
|
|
11660
11640
|
'hbitý',
|
|
11661
11641
|
];
|
|
11642
|
+
/**
|
|
11643
|
+
* Collection of nouns.
|
|
11644
|
+
*/
|
|
11662
11645
|
const NOUNS$1 = [
|
|
11663
11646
|
'jablko',
|
|
11664
11647
|
'nebe',
|
|
@@ -11872,6 +11855,9 @@
|
|
|
11872
11855
|
'okno',
|
|
11873
11856
|
'chodba',
|
|
11874
11857
|
];
|
|
11858
|
+
/**
|
|
11859
|
+
* Collection of verbs.
|
|
11860
|
+
*/
|
|
11875
11861
|
const VERBS$1 = [
|
|
11876
11862
|
'skáče',
|
|
11877
11863
|
'tančí',
|
|
@@ -12044,9 +12030,7 @@
|
|
|
12044
12030
|
noun: NOUNS$1,
|
|
12045
12031
|
verb: VERBS$1,
|
|
12046
12032
|
};
|
|
12047
|
-
|
|
12048
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12049
|
-
*/
|
|
12033
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12050
12034
|
|
|
12051
12035
|
/**
|
|
12052
12036
|
* @@@
|
|
@@ -12302,6 +12286,9 @@
|
|
|
12302
12286
|
'macro',
|
|
12303
12287
|
'mini',
|
|
12304
12288
|
];
|
|
12289
|
+
/**
|
|
12290
|
+
* Collection of nouns.
|
|
12291
|
+
*/
|
|
12305
12292
|
const NOUNS = [
|
|
12306
12293
|
'apple',
|
|
12307
12294
|
'sky',
|
|
@@ -12541,6 +12528,9 @@
|
|
|
12541
12528
|
'roof',
|
|
12542
12529
|
'floor',
|
|
12543
12530
|
];
|
|
12531
|
+
/**
|
|
12532
|
+
* Collection of verbs.
|
|
12533
|
+
*/
|
|
12544
12534
|
const VERBS = [
|
|
12545
12535
|
'jumping',
|
|
12546
12536
|
'dancing',
|
|
@@ -12736,9 +12726,7 @@
|
|
|
12736
12726
|
noun: NOUNS,
|
|
12737
12727
|
verb: VERBS,
|
|
12738
12728
|
};
|
|
12739
|
-
|
|
12740
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12741
|
-
*/
|
|
12729
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
12742
12730
|
|
|
12743
12731
|
/**
|
|
12744
12732
|
* Default language used for linguistic hashes.
|
|
@@ -12913,8 +12901,9 @@
|
|
|
12913
12901
|
/**
|
|
12914
12902
|
* Creates a human-readable hash as a short, story-like phrase.
|
|
12915
12903
|
*
|
|
12916
|
-
* @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
|
|
12917
12904
|
* {@link MIN_LINGUISTIC_HASH_WORD_COUNT}..{@link MAX_LINGUISTIC_HASH_WORD_COUNT})
|
|
12905
|
+
*
|
|
12906
|
+
* @param wordCount how many words to include (defaults to {@link DEFAULT_LINGUISTIC_HASH_WORD_COUNT}, clamped to
|
|
12918
12907
|
* @param language optional language code (defaults to {@link DEFAULT_LINGUISTIC_HASH_LANGUAGE})
|
|
12919
12908
|
*
|
|
12920
12909
|
* @public exported from `@promptbook/utils`
|
|
@@ -12933,6 +12922,7 @@
|
|
|
12933
12922
|
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic because it depends on the current time
|
|
12934
12923
|
*
|
|
12935
12924
|
* @returns string_date branded type
|
|
12925
|
+
*
|
|
12936
12926
|
* @public exported from `@promptbook/utils`
|
|
12937
12927
|
*/
|
|
12938
12928
|
function $getCurrentDate() {
|
|
@@ -12955,6 +12945,7 @@
|
|
|
12955
12945
|
*
|
|
12956
12946
|
* @param {string} input
|
|
12957
12947
|
* @returns {Set} of keywords without diacritics in lowercase
|
|
12948
|
+
*
|
|
12958
12949
|
* @public exported from `@promptbook/utils`
|
|
12959
12950
|
*/
|
|
12960
12951
|
function parseKeywordsFromString(input) {
|
|
@@ -12971,6 +12962,7 @@
|
|
|
12971
12962
|
* @param name The string to be converted to a URI-compatible format.
|
|
12972
12963
|
* @returns A URI-compatible string derived from the input name.
|
|
12973
12964
|
* @example 'Hello World' -> 'hello-world'
|
|
12965
|
+
*
|
|
12974
12966
|
* @public exported from `@promptbook/utils`
|
|
12975
12967
|
*/
|
|
12976
12968
|
function nameToUriPart(name) {
|
|
@@ -12989,6 +12981,7 @@
|
|
|
12989
12981
|
* @param name The name to be converted into URI parts.
|
|
12990
12982
|
* @returns An array of URI-compatible parts derived from the name.
|
|
12991
12983
|
* @example 'Example Name' -> ['example', 'name']
|
|
12984
|
+
*
|
|
12992
12985
|
* @public exported from `@promptbook/utils`
|
|
12993
12986
|
*/
|
|
12994
12987
|
function nameToUriParts(name) {
|
|
@@ -13018,6 +13011,7 @@
|
|
|
13018
13011
|
* @returns
|
|
13019
13012
|
* @example 'HelloWorld'
|
|
13020
13013
|
* @example 'ILovePromptbook'
|
|
13014
|
+
*
|
|
13021
13015
|
* @public exported from `@promptbook/utils`
|
|
13022
13016
|
*/
|
|
13023
13017
|
function normalizeTo_PascalCase(text) {
|
|
@@ -13046,6 +13040,7 @@
|
|
|
13046
13040
|
*
|
|
13047
13041
|
* @param text optionally quoted text
|
|
13048
13042
|
* @returns text without quotes
|
|
13043
|
+
*
|
|
13049
13044
|
* @public exported from `@promptbook/utils`
|
|
13050
13045
|
*/
|
|
13051
13046
|
function unwrapResult(text, options) {
|
|
@@ -13120,9 +13115,7 @@
|
|
|
13120
13115
|
return processedText;
|
|
13121
13116
|
}
|
|
13122
13117
|
}
|
|
13123
|
-
|
|
13124
|
-
* TODO: [🧠] Should this also unwrap the (parenthesis)
|
|
13125
|
-
*/
|
|
13118
|
+
// TODO: [🧠] Should this also unwrap the (parenthesis)
|
|
13126
13119
|
|
|
13127
13120
|
// <- TODO: Auto convert to type `import { ... } from 'type-fest';`
|
|
13128
13121
|
/**
|
|
@@ -13141,7 +13134,6 @@
|
|
|
13141
13134
|
* - `Symbol` objects are not serializable
|
|
13142
13135
|
* - And much more...
|
|
13143
13136
|
*
|
|
13144
|
-
*
|
|
13145
13137
|
* @public exported from `@promptbook/utils`
|
|
13146
13138
|
*/
|
|
13147
13139
|
function isSerializableAsJson(value) {
|
|
@@ -13153,15 +13145,14 @@
|
|
|
13153
13145
|
return false;
|
|
13154
13146
|
}
|
|
13155
13147
|
}
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
* TODO: [🧠][💺] Can be done this on type-level?
|
|
13159
|
-
*/
|
|
13148
|
+
// TODO: [🧠][main] !!3 In-memory cache of same values to prevent multiple checks
|
|
13149
|
+
// TODO: [🧠][💺] Can be done this on type-level?
|
|
13160
13150
|
|
|
13161
13151
|
/**
|
|
13162
13152
|
* Determines if the given path is a root path.
|
|
13163
13153
|
*
|
|
13164
13154
|
* Note: This does not check if the file exists only if the path is valid
|
|
13155
|
+
*
|
|
13165
13156
|
* @public exported from `@promptbook/utils`
|
|
13166
13157
|
*/
|
|
13167
13158
|
function isRootPath(value) {
|
|
@@ -13173,9 +13164,7 @@
|
|
|
13173
13164
|
}
|
|
13174
13165
|
return false;
|
|
13175
13166
|
}
|
|
13176
|
-
|
|
13177
|
-
* TODO: [🍏] Make for MacOS paths
|
|
13178
|
-
*/
|
|
13167
|
+
// TODO: [🍏] Make for MacOS paths
|
|
13179
13168
|
|
|
13180
13169
|
/**
|
|
13181
13170
|
* Checks if an URL is reserved for private networks or localhost.
|
|
@@ -13221,6 +13210,7 @@
|
|
|
13221
13210
|
* @param {string} url - The URL to check.
|
|
13222
13211
|
* @param {IsUrlOnPrivateNetworkOptions} options - Options for the check.
|
|
13223
13212
|
* @returns {boolean} Returns true if the IP address is reserved for private networks or localhost, otherwise false.
|
|
13213
|
+
*
|
|
13224
13214
|
* @public exported from `@promptbook/utils`
|
|
13225
13215
|
*/
|
|
13226
13216
|
function isUrlOnPrivateNetwork(url, options = {}) {
|
|
@@ -13259,9 +13249,7 @@
|
|
|
13259
13249
|
*/
|
|
13260
13250
|
return true;
|
|
13261
13251
|
}
|
|
13262
|
-
|
|
13263
|
-
* TODO: [🐠] Maybe more info why the URL is invalid
|
|
13264
|
-
*/
|
|
13252
|
+
// TODO: [🐠] Maybe more info why the URL is invalid
|
|
13265
13253
|
|
|
13266
13254
|
/**
|
|
13267
13255
|
* Provides filesystem access (for example for Node.js-based scrapers)
|
|
@@ -13284,8 +13272,8 @@
|
|
|
13284
13272
|
watch: promises.watch,
|
|
13285
13273
|
};
|
|
13286
13274
|
}
|
|
13287
|
-
|
|
13288
|
-
|
|
13275
|
+
// Note: [🟢] Code for Node scraper registration helper [$provideFilesystemForNode](src/scrapers/_common/register/$provideFilesystemForNode.ts) should never be published into packages that could be imported into browser environment
|
|
13276
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
13289
13277
|
|
|
13290
13278
|
/**
|
|
13291
13279
|
* Retrieves an intermediate source for a scraper based on the knowledge source.
|
|
@@ -13349,13 +13337,11 @@
|
|
|
13349
13337
|
};
|
|
13350
13338
|
return fileHandler;
|
|
13351
13339
|
}
|
|
13352
|
-
|
|
13353
|
-
|
|
13354
|
-
|
|
13355
|
-
|
|
13356
|
-
|
|
13357
|
-
* TODO: [🐱🐉][🧠] Make some smart crop
|
|
13358
|
-
*/
|
|
13340
|
+
// Note: [🟢] Code for Node scraper helper [getScraperIntermediateSource](src/scrapers/_common/utils/getScraperIntermediateSource.ts) should never be published into packages that could be imported into browser environment
|
|
13341
|
+
// Note: Not using `FileCacheStorage` for two reasons:
|
|
13342
|
+
// 1. Need to store more than serialized JSONs.
|
|
13343
|
+
// 2. Need to switch between a `rootDirname` and `cacheDirname` <- TODO: [😡]
|
|
13344
|
+
// TODO: [🐱🐉][🧠] Make some smart crop
|
|
13359
13345
|
|
|
13360
13346
|
/**
|
|
13361
13347
|
* Metadata of the scraper
|
|
@@ -13382,14 +13368,13 @@
|
|
|
13382
13368
|
* @public exported from `@promptbook/cli`
|
|
13383
13369
|
*/
|
|
13384
13370
|
$scrapersMetadataRegister.register(markdownScraperMetadata);
|
|
13385
|
-
|
|
13386
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13387
|
-
*/
|
|
13371
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13388
13372
|
|
|
13389
13373
|
/**
|
|
13390
13374
|
* Scraper for markdown files
|
|
13391
13375
|
*
|
|
13392
13376
|
* @see `documentationUrl` for more details
|
|
13377
|
+
*
|
|
13393
13378
|
* @public exported from `@promptbook/markdown-utils`
|
|
13394
13379
|
*/
|
|
13395
13380
|
class MarkdownScraper {
|
|
@@ -13522,10 +13507,8 @@
|
|
|
13522
13507
|
return knowledge;
|
|
13523
13508
|
}
|
|
13524
13509
|
}
|
|
13525
|
-
|
|
13526
|
-
|
|
13527
|
-
* Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
13528
|
-
*/
|
|
13510
|
+
// TODO: [🪂] Do it in parallel 11:11
|
|
13511
|
+
// Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
13529
13512
|
|
|
13530
13513
|
/**
|
|
13531
13514
|
* Metadata of the scraper
|
|
@@ -13552,9 +13535,7 @@
|
|
|
13552
13535
|
* @public exported from `@promptbook/cli`
|
|
13553
13536
|
*/
|
|
13554
13537
|
$scrapersMetadataRegister.register(websiteScraperMetadata);
|
|
13555
|
-
|
|
13556
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13557
|
-
*/
|
|
13538
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
13558
13539
|
|
|
13559
13540
|
/**
|
|
13560
13541
|
* Create a new showdown converter instance
|
|
@@ -13583,6 +13564,7 @@
|
|
|
13583
13564
|
* Scraper for websites
|
|
13584
13565
|
*
|
|
13585
13566
|
* @see `documentationUrl` for more details
|
|
13567
|
+
*
|
|
13586
13568
|
* @public exported from `@promptbook/website-crawler`
|
|
13587
13569
|
*/
|
|
13588
13570
|
class WebsiteScraper {
|
|
@@ -13686,12 +13668,10 @@
|
|
|
13686
13668
|
return knowledge;
|
|
13687
13669
|
}
|
|
13688
13670
|
}
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13693
|
-
* Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
13694
|
-
*/
|
|
13671
|
+
// Note: [🟢] Code for Node scraper implementation [WebsiteScraper](src/scrapers/website/WebsiteScraper.ts) should never be published into packages that could be imported into browser environment
|
|
13672
|
+
// TODO: [👣] Scraped website in .md can act as cache item - there is no need to run conversion each time
|
|
13673
|
+
// TODO: [🪂] Do it in parallel 11:11
|
|
13674
|
+
// Note: No need to aggregate usage here, it is done by intercepting the llmTools
|
|
13695
13675
|
|
|
13696
13676
|
/**
|
|
13697
13677
|
* Fetches and scrapes content from a URL (SERVER-SIDE ONLY)
|
|
@@ -13702,14 +13682,14 @@
|
|
|
13702
13682
|
* 3. Uses the appropriate scraper to convert to markdown
|
|
13703
13683
|
* 4. Returns the scraped markdown content
|
|
13704
13684
|
*
|
|
13685
|
+
* WARNING: This function should NOT be used directly in browser environments.
|
|
13686
|
+
* For browser environments, use fetchUrlContentViaBrowser which proxies through
|
|
13687
|
+
* the Agents Server API endpoint at /api/scrape
|
|
13688
|
+
*
|
|
13705
13689
|
* @param url The URL to fetch and scrape
|
|
13706
13690
|
* @returns Markdown content from the URL
|
|
13707
13691
|
*
|
|
13708
13692
|
* @private internal utility for USE BROWSER commitment
|
|
13709
|
-
*
|
|
13710
|
-
* WARNING: This function should NOT be used directly in browser environments.
|
|
13711
|
-
* For browser environments, use fetchUrlContentViaBrowser which proxies through
|
|
13712
|
-
* the Agents Server API endpoint at /api/scrape
|
|
13713
13693
|
*/
|
|
13714
13694
|
async function fetchUrlContent(url) {
|
|
13715
13695
|
try {
|
|
@@ -13813,7 +13793,7 @@
|
|
|
13813
13793
|
`);
|
|
13814
13794
|
}
|
|
13815
13795
|
}
|
|
13816
|
-
|
|
13796
|
+
// Note: [🟢] Code for Node browser-fetch helper [fetchUrlContent](src/commitments/USE_BROWSER/fetchUrlContent.ts) should never be published into packages that could be imported into browser environment
|
|
13817
13797
|
|
|
13818
13798
|
/**
|
|
13819
13799
|
* Cached implementation of `run_browser` when it can be resolved.
|
|
@@ -13831,6 +13811,7 @@
|
|
|
13831
13811
|
* Attempts to load the server-side `run_browser` tool lazily.
|
|
13832
13812
|
*
|
|
13833
13813
|
* @returns Loaded `run_browser` implementation
|
|
13814
|
+
*
|
|
13834
13815
|
* @private internal utility for USE BROWSER commitment
|
|
13835
13816
|
*/
|
|
13836
13817
|
function loadRunBrowserToolForNode() {
|
|
@@ -14200,9 +14181,7 @@
|
|
|
14200
14181
|
return this.appendToSystemMessage(requirements, actionSection, '\n\n');
|
|
14201
14182
|
}
|
|
14202
14183
|
}
|
|
14203
|
-
|
|
14204
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14205
|
-
*/
|
|
14184
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14206
14185
|
|
|
14207
14186
|
/**
|
|
14208
14187
|
* CLOSED commitment definition
|
|
@@ -14268,9 +14247,7 @@
|
|
|
14268
14247
|
};
|
|
14269
14248
|
}
|
|
14270
14249
|
}
|
|
14271
|
-
|
|
14272
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14273
|
-
*/
|
|
14250
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14274
14251
|
|
|
14275
14252
|
/**
|
|
14276
14253
|
* COMPONENT commitment definition
|
|
@@ -14329,9 +14306,7 @@
|
|
|
14329
14306
|
return this.appendToSystemMessage(requirements, componentSection, '\n\n');
|
|
14330
14307
|
}
|
|
14331
14308
|
}
|
|
14332
|
-
|
|
14333
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14334
|
-
*/
|
|
14309
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14335
14310
|
|
|
14336
14311
|
/**
|
|
14337
14312
|
* DELETE commitment definition
|
|
@@ -14453,9 +14428,7 @@
|
|
|
14453
14428
|
return this.appendToSystemMessage(requirements, deleteSection, '\n\n');
|
|
14454
14429
|
}
|
|
14455
14430
|
}
|
|
14456
|
-
|
|
14457
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14458
|
-
*/
|
|
14431
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14459
14432
|
|
|
14460
14433
|
/**
|
|
14461
14434
|
* DICTIONARY commitment definition
|
|
@@ -14559,9 +14532,7 @@
|
|
|
14559
14532
|
};
|
|
14560
14533
|
}
|
|
14561
14534
|
}
|
|
14562
|
-
|
|
14563
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14564
|
-
*/
|
|
14535
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14565
14536
|
|
|
14566
14537
|
/**
|
|
14567
14538
|
* FORMAT commitment definition
|
|
@@ -14640,10 +14611,11 @@
|
|
|
14640
14611
|
return this.appendToSystemMessage(requirements, formatSection, '\n\n');
|
|
14641
14612
|
}
|
|
14642
14613
|
}
|
|
14614
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14615
|
+
|
|
14643
14616
|
/**
|
|
14644
|
-
*
|
|
14617
|
+
* Collection of firstnames.
|
|
14645
14618
|
*/
|
|
14646
|
-
|
|
14647
14619
|
const FIRSTNAMES = [
|
|
14648
14620
|
'Paul',
|
|
14649
14621
|
'George',
|
|
@@ -14680,6 +14652,9 @@
|
|
|
14680
14652
|
'Anthony',
|
|
14681
14653
|
'Christopher',
|
|
14682
14654
|
];
|
|
14655
|
+
/**
|
|
14656
|
+
* Collection of lastnames with colors.
|
|
14657
|
+
*/
|
|
14683
14658
|
const LASTNAMES_WITH_COLORS = [
|
|
14684
14659
|
{ lastname: 'Green', color: '#008000' },
|
|
14685
14660
|
{ lastname: 'Brown', color: '#A52A2A' },
|
|
@@ -14707,6 +14682,7 @@
|
|
|
14707
14682
|
*
|
|
14708
14683
|
* @param seed - Input seed used to derive a stable pseudonym.
|
|
14709
14684
|
* @returns Deterministic English full name with color metadata.
|
|
14685
|
+
*
|
|
14710
14686
|
* @private internal helper for deterministic pseudonym generation
|
|
14711
14687
|
*/
|
|
14712
14688
|
function generateDeterministicEnglishName(seed) {
|
|
@@ -14748,6 +14724,9 @@
|
|
|
14748
14724
|
* Legacy aliases that historically behaved like `FROM VOID`.
|
|
14749
14725
|
*/
|
|
14750
14726
|
const LEGACY_VOID_ALIASES = new Set(VOID_PSEUDO_AGENT_ALIAS_KEYS);
|
|
14727
|
+
/**
|
|
14728
|
+
* Constant for void alias entries.
|
|
14729
|
+
*/
|
|
14751
14730
|
const VOID_ALIAS_ENTRIES = VOID_PSEUDO_AGENT_ALIAS_KEYS.map((alias) => [
|
|
14752
14731
|
alias,
|
|
14753
14732
|
'VOID',
|
|
@@ -14796,6 +14775,7 @@
|
|
|
14796
14775
|
*
|
|
14797
14776
|
* @param rawReference - Raw reference token or payload.
|
|
14798
14777
|
* @returns Pseudo-agent kind or `null` when the reference is not pseudo.
|
|
14778
|
+
*
|
|
14799
14779
|
* @private internal utility of pseudo-agent resolution
|
|
14800
14780
|
*/
|
|
14801
14781
|
function resolvePseudoAgentKindFromReference(rawReference) {
|
|
@@ -14810,6 +14790,7 @@
|
|
|
14810
14790
|
*
|
|
14811
14791
|
* @param agentUrl - URL to inspect.
|
|
14812
14792
|
* @returns Pseudo-agent kind or `null` when the URL is not pseudo.
|
|
14793
|
+
*
|
|
14813
14794
|
* @private internal utility of pseudo-agent resolution
|
|
14814
14795
|
*/
|
|
14815
14796
|
function resolvePseudoAgentKindFromUrl(agentUrl) {
|
|
@@ -14830,6 +14811,7 @@
|
|
|
14830
14811
|
*
|
|
14831
14812
|
* @param teamCommitmentContent - TEAM commitment content after reference resolution.
|
|
14832
14813
|
* @returns Deterministic English full name representing pseudo-user in that TEAM context.
|
|
14814
|
+
*
|
|
14833
14815
|
* @private internal utility of TEAM commitment rendering
|
|
14834
14816
|
*/
|
|
14835
14817
|
function createPseudoUserTeammateLabel(teamCommitmentContent) {
|
|
@@ -14845,6 +14827,7 @@
|
|
|
14845
14827
|
*
|
|
14846
14828
|
* @param rawReference - Raw reference content.
|
|
14847
14829
|
* @returns True when the reference maps to void.
|
|
14830
|
+
*
|
|
14848
14831
|
* @private internal utility of pseudo-agent resolution
|
|
14849
14832
|
*/
|
|
14850
14833
|
function isVoidPseudoAgentReference(rawReference) {
|
|
@@ -14858,9 +14841,7 @@
|
|
|
14858
14841
|
const normalizedReference = normalizePseudoReferenceKey(rawReference);
|
|
14859
14842
|
return LEGACY_VOID_ALIASES.has(normalizedReference);
|
|
14860
14843
|
}
|
|
14861
|
-
|
|
14862
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14863
|
-
*/
|
|
14844
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14864
14845
|
|
|
14865
14846
|
/**
|
|
14866
14847
|
* FROM commitment definition
|
|
@@ -14939,9 +14920,7 @@
|
|
|
14939
14920
|
};
|
|
14940
14921
|
}
|
|
14941
14922
|
}
|
|
14942
|
-
|
|
14943
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14944
|
-
*/
|
|
14923
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
14945
14924
|
|
|
14946
14925
|
/**
|
|
14947
14926
|
* GOAL commitment definition
|
|
@@ -15039,9 +15018,7 @@
|
|
|
15039
15018
|
return this.appendToPromptSuffix(requirementsWithGoal, goalSection);
|
|
15040
15019
|
}
|
|
15041
15020
|
}
|
|
15042
|
-
|
|
15043
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15044
|
-
*/
|
|
15021
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15045
15022
|
|
|
15046
15023
|
/**
|
|
15047
15024
|
* IMPORT commitment definition
|
|
@@ -15120,19 +15097,26 @@
|
|
|
15120
15097
|
`));
|
|
15121
15098
|
}
|
|
15122
15099
|
}
|
|
15100
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15101
|
+
|
|
15123
15102
|
/**
|
|
15124
|
-
*
|
|
15103
|
+
* Matches URL-like candidates inside arbitrary text.
|
|
15104
|
+
*
|
|
15105
|
+
* @private
|
|
15125
15106
|
*/
|
|
15126
|
-
|
|
15127
|
-
/** @private Matches URL-like candidates inside arbitrary text. */
|
|
15128
15107
|
const URL_CANDIDATE_PATTERN = /https?:\/\/[^\s<>"'`]+/g;
|
|
15129
|
-
/**
|
|
15108
|
+
/**
|
|
15109
|
+
* Trims punctuation that commonly trails URLs in prose.
|
|
15110
|
+
*
|
|
15111
|
+
* @private
|
|
15112
|
+
*/
|
|
15130
15113
|
const TRAILING_PUNCTUATION_PATTERN = /[.,!?;:'"`]+$/;
|
|
15131
15114
|
/**
|
|
15132
15115
|
* Extracts all valid URLs from arbitrary text while removing common trailing punctuation.
|
|
15133
15116
|
*
|
|
15134
15117
|
* @param text - Input text that may contain one or more URLs.
|
|
15135
15118
|
* @returns Unique URLs in their first-seen order.
|
|
15119
|
+
*
|
|
15136
15120
|
* @private utility of KNOWLEDGE parsing
|
|
15137
15121
|
*/
|
|
15138
15122
|
function extractUrlsFromText(text) {
|
|
@@ -15162,7 +15146,9 @@
|
|
|
15162
15146
|
return urls;
|
|
15163
15147
|
}
|
|
15164
15148
|
/**
|
|
15165
|
-
*
|
|
15149
|
+
* Normalizes one extracted URL candidate by stripping trailing punctuation and unmatched closing wrappers.
|
|
15150
|
+
*
|
|
15151
|
+
* @private
|
|
15166
15152
|
*/
|
|
15167
15153
|
function normalizeUrlCandidate(candidate) {
|
|
15168
15154
|
let normalized = candidate.trim();
|
|
@@ -15182,7 +15168,9 @@
|
|
|
15182
15168
|
return normalized;
|
|
15183
15169
|
}
|
|
15184
15170
|
/**
|
|
15185
|
-
*
|
|
15171
|
+
* Removes trailing closing wrappers when they are unmatched in the candidate.
|
|
15172
|
+
*
|
|
15173
|
+
* @private
|
|
15186
15174
|
*/
|
|
15187
15175
|
function stripTrailingUnmatchedClosing(candidate, openingChar, closingChar) {
|
|
15188
15176
|
let normalized = candidate;
|
|
@@ -15197,7 +15185,9 @@
|
|
|
15197
15185
|
return normalized;
|
|
15198
15186
|
}
|
|
15199
15187
|
/**
|
|
15200
|
-
*
|
|
15188
|
+
* Counts character occurrences in a string.
|
|
15189
|
+
*
|
|
15190
|
+
* @private
|
|
15201
15191
|
*/
|
|
15202
15192
|
function countOccurrences(value, searchedChar) {
|
|
15203
15193
|
let count = 0;
|
|
@@ -15209,14 +15199,28 @@
|
|
|
15209
15199
|
return count;
|
|
15210
15200
|
}
|
|
15211
15201
|
|
|
15212
|
-
/**
|
|
15202
|
+
/**
|
|
15203
|
+
* The default base name for inline knowledge files when the content lacks identifying text.
|
|
15204
|
+
*
|
|
15205
|
+
* @private
|
|
15206
|
+
*/
|
|
15213
15207
|
const INLINE_KNOWLEDGE_BASE_NAME = 'inline-knowledge';
|
|
15214
|
-
/**
|
|
15208
|
+
/**
|
|
15209
|
+
* The default file extension used for inline knowledge uploads.
|
|
15210
|
+
*
|
|
15211
|
+
* @private
|
|
15212
|
+
*/
|
|
15215
15213
|
const INLINE_KNOWLEDGE_EXTENSION = '.txt';
|
|
15216
|
-
/**
|
|
15214
|
+
/**
|
|
15215
|
+
* Prefix that identifies base64 data URLs.
|
|
15216
|
+
*
|
|
15217
|
+
* @private
|
|
15218
|
+
*/
|
|
15217
15219
|
const DATA_URL_PREFIX = 'data:';
|
|
15218
15220
|
/**
|
|
15219
|
-
*
|
|
15221
|
+
* Retrieves the first meaningful line from the inline content.
|
|
15222
|
+
*
|
|
15223
|
+
* @private
|
|
15220
15224
|
*/
|
|
15221
15225
|
function getFirstNonEmptyLine(content) {
|
|
15222
15226
|
const lines = content.split(/\r?\n/);
|
|
@@ -15229,7 +15233,9 @@
|
|
|
15229
15233
|
return null;
|
|
15230
15234
|
}
|
|
15231
15235
|
/**
|
|
15232
|
-
*
|
|
15236
|
+
* Determines the base file name by normalizing the first non-empty line.
|
|
15237
|
+
*
|
|
15238
|
+
* @private
|
|
15233
15239
|
*/
|
|
15234
15240
|
function deriveBaseFilename(content) {
|
|
15235
15241
|
const firstLine = getFirstNonEmptyLine(content);
|
|
@@ -15240,7 +15246,9 @@
|
|
|
15240
15246
|
return normalized || INLINE_KNOWLEDGE_BASE_NAME;
|
|
15241
15247
|
}
|
|
15242
15248
|
/**
|
|
15243
|
-
*
|
|
15249
|
+
* Converts inline knowledge into the internal metadata form used for uploads.
|
|
15250
|
+
*
|
|
15251
|
+
* @private
|
|
15244
15252
|
*/
|
|
15245
15253
|
function createInlineKnowledgeSourceFile(content) {
|
|
15246
15254
|
const trimmedContent = content.trim();
|
|
@@ -15263,7 +15271,9 @@
|
|
|
15263
15271
|
return typeof source === 'string' && source.startsWith(DATA_URL_PREFIX);
|
|
15264
15272
|
}
|
|
15265
15273
|
/**
|
|
15266
|
-
*
|
|
15274
|
+
* Converts a stored inline knowledge file into a data URL for backwards compatibility.
|
|
15275
|
+
*
|
|
15276
|
+
* @private
|
|
15267
15277
|
*/
|
|
15268
15278
|
function inlineKnowledgeSourceToDataUrl(source) {
|
|
15269
15279
|
const base64 = source.buffer.toString('base64');
|
|
@@ -15323,9 +15333,7 @@
|
|
|
15323
15333
|
return null;
|
|
15324
15334
|
}
|
|
15325
15335
|
}
|
|
15326
|
-
|
|
15327
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15328
|
-
*/
|
|
15336
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15329
15337
|
|
|
15330
15338
|
/**
|
|
15331
15339
|
* KNOWLEDGE commitment definition
|
|
@@ -15529,9 +15537,7 @@
|
|
|
15529
15537
|
return this.appendToSystemMessage(requirements, languageSection, '\n\n');
|
|
15530
15538
|
}
|
|
15531
15539
|
}
|
|
15532
|
-
|
|
15533
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15534
|
-
*/
|
|
15540
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15535
15541
|
|
|
15536
15542
|
/**
|
|
15537
15543
|
* @@@
|
|
@@ -15797,6 +15803,7 @@
|
|
|
15797
15803
|
*
|
|
15798
15804
|
* @param listener - Listener notified about tool progress.
|
|
15799
15805
|
* @returns Hidden token used to route progress updates.
|
|
15806
|
+
*
|
|
15800
15807
|
* @private internal runtime wiring for commitment tools
|
|
15801
15808
|
*/
|
|
15802
15809
|
function registerToolCallProgressListener(listener) {
|
|
@@ -15809,14 +15816,13 @@
|
|
|
15809
15816
|
* Unregisters one in-memory progress listener.
|
|
15810
15817
|
*
|
|
15811
15818
|
* @param token - Token previously created by `registerToolCallProgressListener`.
|
|
15819
|
+
*
|
|
15812
15820
|
* @private internal runtime wiring for commitment tools
|
|
15813
15821
|
*/
|
|
15814
15822
|
function unregisterToolCallProgressListener(token) {
|
|
15815
15823
|
toolCallProgressListeners.delete(token);
|
|
15816
15824
|
}
|
|
15817
|
-
|
|
15818
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15819
|
-
*/
|
|
15825
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
15820
15826
|
|
|
15821
15827
|
/**
|
|
15822
15828
|
* Resolves runtime context from hidden tool arguments.
|
|
@@ -16177,9 +16183,7 @@
|
|
|
16177
16183
|
return createMemoryToolFunctions();
|
|
16178
16184
|
}
|
|
16179
16185
|
}
|
|
16180
|
-
|
|
16181
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16182
|
-
*/
|
|
16186
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16183
16187
|
|
|
16184
16188
|
/**
|
|
16185
16189
|
* AGENT MESSAGE commitment definition
|
|
@@ -16509,9 +16513,7 @@
|
|
|
16509
16513
|
return this.appendToSystemMessage(requirements, messageSection, '\n\n');
|
|
16510
16514
|
}
|
|
16511
16515
|
}
|
|
16512
|
-
|
|
16513
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16514
|
-
*/
|
|
16516
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16515
16517
|
|
|
16516
16518
|
/**
|
|
16517
16519
|
* USER MESSAGE commitment definition
|
|
@@ -16642,9 +16644,7 @@
|
|
|
16642
16644
|
return requirements;
|
|
16643
16645
|
}
|
|
16644
16646
|
}
|
|
16645
|
-
|
|
16646
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16647
|
-
*/
|
|
16647
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16648
16648
|
|
|
16649
16649
|
/**
|
|
16650
16650
|
* META commitment definition
|
|
@@ -16791,9 +16791,7 @@
|
|
|
16791
16791
|
return knownTypes.includes(metaType.toUpperCase());
|
|
16792
16792
|
}
|
|
16793
16793
|
}
|
|
16794
|
-
|
|
16795
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16796
|
-
*/
|
|
16794
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16797
16795
|
|
|
16798
16796
|
/**
|
|
16799
16797
|
* META COLOR commitment definition
|
|
@@ -16889,9 +16887,7 @@
|
|
|
16889
16887
|
return trimmedContent || null;
|
|
16890
16888
|
}
|
|
16891
16889
|
}
|
|
16892
|
-
|
|
16893
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16894
|
-
*/
|
|
16890
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16895
16891
|
|
|
16896
16892
|
/**
|
|
16897
16893
|
* META DOMAIN commitment definition
|
|
@@ -16956,9 +16952,7 @@
|
|
|
16956
16952
|
return trimmedContent || null;
|
|
16957
16953
|
}
|
|
16958
16954
|
}
|
|
16959
|
-
|
|
16960
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16961
|
-
*/
|
|
16955
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
16962
16956
|
|
|
16963
16957
|
/**
|
|
16964
16958
|
* META DISCLAIMER commitment definition
|
|
@@ -17026,9 +17020,7 @@
|
|
|
17026
17020
|
return requirements;
|
|
17027
17021
|
}
|
|
17028
17022
|
}
|
|
17029
|
-
|
|
17030
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17031
|
-
*/
|
|
17023
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17032
17024
|
|
|
17033
17025
|
/**
|
|
17034
17026
|
* META FONT commitment definition
|
|
@@ -17111,9 +17103,7 @@
|
|
|
17111
17103
|
return trimmedContent || null;
|
|
17112
17104
|
}
|
|
17113
17105
|
}
|
|
17114
|
-
|
|
17115
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17116
|
-
*/
|
|
17106
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17117
17107
|
|
|
17118
17108
|
/**
|
|
17119
17109
|
* META IMAGE commitment definition
|
|
@@ -17198,9 +17188,7 @@
|
|
|
17198
17188
|
return trimmedContent || null;
|
|
17199
17189
|
}
|
|
17200
17190
|
}
|
|
17201
|
-
|
|
17202
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17203
|
-
*/
|
|
17191
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17204
17192
|
|
|
17205
17193
|
/**
|
|
17206
17194
|
* META INPUT PLACEHOLDER commitment definition.
|
|
@@ -17263,9 +17251,7 @@
|
|
|
17263
17251
|
return trimmedContent || null;
|
|
17264
17252
|
}
|
|
17265
17253
|
}
|
|
17266
|
-
|
|
17267
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17268
|
-
*/
|
|
17254
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17269
17255
|
|
|
17270
17256
|
/**
|
|
17271
17257
|
* META LINK commitment definition
|
|
@@ -17372,9 +17358,7 @@
|
|
|
17372
17358
|
}
|
|
17373
17359
|
}
|
|
17374
17360
|
}
|
|
17375
|
-
|
|
17376
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17377
|
-
*/
|
|
17361
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17378
17362
|
|
|
17379
17363
|
/**
|
|
17380
17364
|
* META VOICE commitment definition
|
|
@@ -17443,9 +17427,7 @@
|
|
|
17443
17427
|
return trimmedContent || null;
|
|
17444
17428
|
}
|
|
17445
17429
|
}
|
|
17446
|
-
|
|
17447
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17448
|
-
*/
|
|
17430
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17449
17431
|
|
|
17450
17432
|
/**
|
|
17451
17433
|
* MODEL commitment definition
|
|
@@ -17683,9 +17665,7 @@
|
|
|
17683
17665
|
return result;
|
|
17684
17666
|
}
|
|
17685
17667
|
}
|
|
17686
|
-
|
|
17687
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17688
|
-
*/
|
|
17668
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17689
17669
|
|
|
17690
17670
|
/**
|
|
17691
17671
|
* NOTE commitment definition
|
|
@@ -17847,9 +17827,7 @@
|
|
|
17847
17827
|
};
|
|
17848
17828
|
}
|
|
17849
17829
|
}
|
|
17850
|
-
|
|
17851
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17852
|
-
*/
|
|
17830
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17853
17831
|
|
|
17854
17832
|
/**
|
|
17855
17833
|
* PERSONA commitment definition
|
|
@@ -17988,9 +17966,7 @@
|
|
|
17988
17966
|
};
|
|
17989
17967
|
}
|
|
17990
17968
|
}
|
|
17991
|
-
|
|
17992
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17993
|
-
*/
|
|
17969
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
17994
17970
|
|
|
17995
17971
|
/**
|
|
17996
17972
|
* RULE commitment definition
|
|
@@ -18071,15 +18047,14 @@
|
|
|
18071
18047
|
return this.appendToPromptSuffix(requirementsWithRule, ruleSection);
|
|
18072
18048
|
}
|
|
18073
18049
|
}
|
|
18074
|
-
|
|
18075
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18076
|
-
*/
|
|
18050
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18077
18051
|
|
|
18078
18052
|
/**
|
|
18079
18053
|
* Creates the canonical system-message body for one writing-sample commitment.
|
|
18080
18054
|
*
|
|
18081
18055
|
* @param content - Explicit 1:1 sample text.
|
|
18082
18056
|
* @returns Writing-sample guidance ready for one system-message section.
|
|
18057
|
+
*
|
|
18083
18058
|
* @private internal utility of writing commitments
|
|
18084
18059
|
*/
|
|
18085
18060
|
function createWritingSampleSection(content) {
|
|
@@ -18097,6 +18072,7 @@
|
|
|
18097
18072
|
*
|
|
18098
18073
|
* @param content - Writing-only instructions.
|
|
18099
18074
|
* @returns Writing-rules guidance ready for one system-message section.
|
|
18075
|
+
*
|
|
18100
18076
|
* @private internal utility of writing commitments
|
|
18101
18077
|
*/
|
|
18102
18078
|
function createWritingRulesSection(content) {
|
|
@@ -18109,9 +18085,7 @@
|
|
|
18109
18085
|
${content}
|
|
18110
18086
|
`);
|
|
18111
18087
|
}
|
|
18112
|
-
|
|
18113
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18114
|
-
*/
|
|
18088
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18115
18089
|
|
|
18116
18090
|
/**
|
|
18117
18091
|
* Legacy `SAMPLE` / `EXAMPLE` commitment definition.
|
|
@@ -18190,9 +18164,7 @@
|
|
|
18190
18164
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
|
|
18191
18165
|
}
|
|
18192
18166
|
}
|
|
18193
|
-
|
|
18194
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18195
|
-
*/
|
|
18167
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18196
18168
|
|
|
18197
18169
|
/**
|
|
18198
18170
|
* SCENARIO commitment definition
|
|
@@ -18314,9 +18286,7 @@
|
|
|
18314
18286
|
return this.appendToSystemMessage(requirements, scenarioSection, '\n\n');
|
|
18315
18287
|
}
|
|
18316
18288
|
}
|
|
18317
|
-
|
|
18318
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18319
|
-
*/
|
|
18289
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18320
18290
|
|
|
18321
18291
|
/**
|
|
18322
18292
|
* STYLE commitment definition
|
|
@@ -18413,6 +18383,7 @@
|
|
|
18413
18383
|
*
|
|
18414
18384
|
* @param teammateLabel - Human-readable teammate label.
|
|
18415
18385
|
* @returns Normalized teammate identifier for TEAM tool names.
|
|
18386
|
+
*
|
|
18416
18387
|
* @private internal helper of TEAM tool-name generation
|
|
18417
18388
|
*/
|
|
18418
18389
|
function normalizeTeammateToolNamePart(teammateLabel) {
|
|
@@ -18428,6 +18399,7 @@
|
|
|
18428
18399
|
* @param _teammateUrl - Canonical teammate URL (kept for API compatibility, not used).
|
|
18429
18400
|
* @param teammateLabel - Human-readable teammate label used as the basis for the name.
|
|
18430
18401
|
* @returns TEAM tool name derived from the label.
|
|
18402
|
+
*
|
|
18431
18403
|
* @private internal utility of TEAM commitments and chat UI mapping
|
|
18432
18404
|
*/
|
|
18433
18405
|
function createTeamToolName(_teammateUrl, teammateLabel) {
|
|
@@ -18435,9 +18407,21 @@
|
|
|
18435
18407
|
return `${TEAM_TOOL_PREFIX}${normalizedLabel}`;
|
|
18436
18408
|
}
|
|
18437
18409
|
|
|
18410
|
+
/**
|
|
18411
|
+
* Pattern matching agent URLs inside TEAM commitment content.
|
|
18412
|
+
*/
|
|
18438
18413
|
const urlRegex = /https?:\/\/[^\s]+/gi;
|
|
18414
|
+
/**
|
|
18415
|
+
* Pattern matching punctuation that often trails teammate URLs in prose.
|
|
18416
|
+
*/
|
|
18439
18417
|
const trailingPunctuationRegex = /[),.;!?]+$/;
|
|
18418
|
+
/**
|
|
18419
|
+
* Clause separators used while splitting TEAM instruction context.
|
|
18420
|
+
*/
|
|
18440
18421
|
const clauseSeparators = ['.', '?', '!', ';', ','];
|
|
18422
|
+
/**
|
|
18423
|
+
* Conjunction separators used while splitting TEAM instruction context.
|
|
18424
|
+
*/
|
|
18441
18425
|
const conjunctionSeparators = [' and ', ' or '];
|
|
18442
18426
|
/**
|
|
18443
18427
|
* Parses TEAM commitment content into teammates with instructions.
|
|
@@ -18485,6 +18469,9 @@
|
|
|
18485
18469
|
}
|
|
18486
18470
|
return teammates;
|
|
18487
18471
|
}
|
|
18472
|
+
/**
|
|
18473
|
+
* Extracts the instruction fragment associated with one teammate URL.
|
|
18474
|
+
*/
|
|
18488
18475
|
function extractInstructionContext(line, matches, matchIndex) {
|
|
18489
18476
|
var _a;
|
|
18490
18477
|
const match = matches[matchIndex];
|
|
@@ -18510,6 +18497,9 @@
|
|
|
18510
18497
|
}
|
|
18511
18498
|
return `${prefix} ${suffix}`.trim();
|
|
18512
18499
|
}
|
|
18500
|
+
/**
|
|
18501
|
+
* Trims content after the last detected clause delimiter.
|
|
18502
|
+
*/
|
|
18513
18503
|
function trimAfterLastDelimiter(text) {
|
|
18514
18504
|
const match = findLastDelimiter(text);
|
|
18515
18505
|
if (!match) {
|
|
@@ -18517,6 +18507,9 @@
|
|
|
18517
18507
|
}
|
|
18518
18508
|
return text.slice(match.index + match.length);
|
|
18519
18509
|
}
|
|
18510
|
+
/**
|
|
18511
|
+
* Trims content before the last detected clause delimiter.
|
|
18512
|
+
*/
|
|
18520
18513
|
function trimBeforeLastDelimiter(text) {
|
|
18521
18514
|
const cleaned = text.replace(/^[,;:]\s*/g, '');
|
|
18522
18515
|
const match = findLastDelimiter(cleaned);
|
|
@@ -18525,6 +18518,9 @@
|
|
|
18525
18518
|
}
|
|
18526
18519
|
return cleaned.slice(0, match.index);
|
|
18527
18520
|
}
|
|
18521
|
+
/**
|
|
18522
|
+
* Finds the last clause or conjunction delimiter in a string.
|
|
18523
|
+
*/
|
|
18528
18524
|
function findLastDelimiter(text) {
|
|
18529
18525
|
let bestIndex = -1;
|
|
18530
18526
|
let bestLength = 0;
|
|
@@ -18548,6 +18544,9 @@
|
|
|
18548
18544
|
}
|
|
18549
18545
|
return { index: bestIndex, length: bestLength };
|
|
18550
18546
|
}
|
|
18547
|
+
/**
|
|
18548
|
+
* Normalizes teammate instruction text after URL extraction.
|
|
18549
|
+
*/
|
|
18551
18550
|
function normalizeInstructionText(text) {
|
|
18552
18551
|
if (!text) {
|
|
18553
18552
|
return '';
|
|
@@ -18561,6 +18560,9 @@
|
|
|
18561
18560
|
normalized = normalizeWhitespaces(normalized).trim();
|
|
18562
18561
|
return normalized;
|
|
18563
18562
|
}
|
|
18563
|
+
/**
|
|
18564
|
+
* Creates a readable teammate label from an agent URL.
|
|
18565
|
+
*/
|
|
18564
18566
|
function createTeammateLabel(url) {
|
|
18565
18567
|
try {
|
|
18566
18568
|
const parsed = new URL(url);
|
|
@@ -18580,12 +18582,19 @@
|
|
|
18580
18582
|
return url;
|
|
18581
18583
|
}
|
|
18582
18584
|
}
|
|
18585
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18586
|
+
|
|
18583
18587
|
/**
|
|
18584
|
-
*
|
|
18588
|
+
* Map of team tool functions.
|
|
18585
18589
|
*/
|
|
18586
|
-
|
|
18587
18590
|
const teamToolFunctions = {};
|
|
18591
|
+
/**
|
|
18592
|
+
* Map of team tool titles.
|
|
18593
|
+
*/
|
|
18588
18594
|
const teamToolTitles = {};
|
|
18595
|
+
/**
|
|
18596
|
+
* Constant for remote agents by Url.
|
|
18597
|
+
*/
|
|
18589
18598
|
const remoteAgentsByUrl = new Map();
|
|
18590
18599
|
/**
|
|
18591
18600
|
* TEAM commitment definition
|
|
@@ -18949,9 +18958,7 @@
|
|
|
18949
18958
|
return JSON.stringify(result);
|
|
18950
18959
|
};
|
|
18951
18960
|
}
|
|
18952
|
-
|
|
18953
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18954
|
-
*/
|
|
18961
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
18955
18962
|
|
|
18956
18963
|
/**
|
|
18957
18964
|
* TEMPLATE commitment definition
|
|
@@ -19072,9 +19079,7 @@
|
|
|
19072
19079
|
};
|
|
19073
19080
|
}
|
|
19074
19081
|
}
|
|
19075
|
-
|
|
19076
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19077
|
-
*/
|
|
19082
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19078
19083
|
|
|
19079
19084
|
/**
|
|
19080
19085
|
* USE commitment definition
|
|
@@ -19186,9 +19191,7 @@
|
|
|
19186
19191
|
return knownTypes.includes(useType.toUpperCase());
|
|
19187
19192
|
}
|
|
19188
19193
|
}
|
|
19189
|
-
|
|
19190
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19191
|
-
*/
|
|
19194
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19192
19195
|
|
|
19193
19196
|
/**
|
|
19194
19197
|
* All `USE` commitment types currently participating in final system-message aggregation.
|
|
@@ -19211,6 +19214,7 @@
|
|
|
19211
19214
|
*
|
|
19212
19215
|
* @param type - Commitment type to check.
|
|
19213
19216
|
* @returns `true` when the commitment participates in `USE` system-message aggregation.
|
|
19217
|
+
*
|
|
19214
19218
|
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
19215
19219
|
*/
|
|
19216
19220
|
function isAggregatedUseCommitmentType(type) {
|
|
@@ -19221,6 +19225,7 @@
|
|
|
19221
19225
|
*
|
|
19222
19226
|
* @param type - Aggregated `USE` commitment type.
|
|
19223
19227
|
* @returns Single-line placeholder comment stored in the interim system message.
|
|
19228
|
+
*
|
|
19224
19229
|
* @private internal utility of `appendAggregatedUseCommitmentPlaceholder`
|
|
19225
19230
|
*/
|
|
19226
19231
|
function getAggregatedUseCommitmentPlaceholder(type) {
|
|
@@ -19231,6 +19236,7 @@
|
|
|
19231
19236
|
*
|
|
19232
19237
|
* @param additionalInstructions - Deduplicated instruction blocks collected from the agent source.
|
|
19233
19238
|
* @returns Combined instruction text ready for `formatOptionalInstructionBlock`.
|
|
19239
|
+
*
|
|
19234
19240
|
* @private internal utility of `createAggregatedUseCommitmentSystemMessage`
|
|
19235
19241
|
*/
|
|
19236
19242
|
function combineAdditionalInstructions(additionalInstructions) {
|
|
@@ -19242,6 +19248,7 @@
|
|
|
19242
19248
|
* @param type - Aggregated `USE` commitment type.
|
|
19243
19249
|
* @param additionalInstructions - Distinct additional instructions in source order.
|
|
19244
19250
|
* @returns Final system-message block for the commitment type.
|
|
19251
|
+
*
|
|
19245
19252
|
* @private internal utility of `aggregateUseCommitmentSystemMessages`
|
|
19246
19253
|
*/
|
|
19247
19254
|
function createAggregatedUseCommitmentSystemMessage(type, additionalInstructions) {
|
|
@@ -19280,6 +19287,7 @@
|
|
|
19280
19287
|
* @param requirements - Current model requirements.
|
|
19281
19288
|
* @param type - Aggregated `USE` commitment type being applied.
|
|
19282
19289
|
* @returns Requirements with the placeholder inserted when it was not already present.
|
|
19290
|
+
*
|
|
19283
19291
|
* @private internal utility of `USE` commitments
|
|
19284
19292
|
*/
|
|
19285
19293
|
function appendAggregatedUseCommitmentPlaceholder(requirements, type) {
|
|
@@ -19303,6 +19311,7 @@
|
|
|
19303
19311
|
* @param requirements - Model requirements produced by commitment-by-commitment application.
|
|
19304
19312
|
* @param commitments - Filtered commitments in their original source order.
|
|
19305
19313
|
* @returns Requirements with aggregated `USE` system-message sections.
|
|
19314
|
+
*
|
|
19306
19315
|
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
19307
19316
|
*/
|
|
19308
19317
|
function aggregateUseCommitmentSystemMessages(requirements, commitments) {
|
|
@@ -19595,9 +19604,7 @@
|
|
|
19595
19604
|
};
|
|
19596
19605
|
}
|
|
19597
19606
|
}
|
|
19598
|
-
|
|
19599
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19600
|
-
*/
|
|
19607
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19601
19608
|
|
|
19602
19609
|
/**
|
|
19603
19610
|
* Base Google Calendar API URL.
|
|
@@ -19868,9 +19875,7 @@
|
|
|
19868
19875
|
const filteredTokens = tokens.filter((lineToken) => lineToken.replace(/[),.;:!?]+$/g, '') !== token);
|
|
19869
19876
|
return filteredTokens.join(' ').trim();
|
|
19870
19877
|
}
|
|
19871
|
-
|
|
19872
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19873
|
-
*/
|
|
19878
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
19874
19879
|
|
|
19875
19880
|
/**
|
|
19876
19881
|
* Wallet metadata used by USE CALENDAR when resolving Google Calendar credentials.
|
|
@@ -20821,9 +20826,7 @@
|
|
|
20821
20826
|
...(calendarReference.tokenRef ? { tokenRef: calendarReference.tokenRef } : {}),
|
|
20822
20827
|
});
|
|
20823
20828
|
}
|
|
20824
|
-
|
|
20825
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20826
|
-
*/
|
|
20829
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
20827
20830
|
|
|
20828
20831
|
/**
|
|
20829
20832
|
* Lightweight email token matcher used for `USE EMAIL` first-line parsing.
|
|
@@ -21089,9 +21092,7 @@
|
|
|
21089
21092
|
},
|
|
21090
21093
|
];
|
|
21091
21094
|
}
|
|
21092
|
-
|
|
21093
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21094
|
-
*/
|
|
21095
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21095
21096
|
|
|
21096
21097
|
/**
|
|
21097
21098
|
* USE IMAGE GENERATOR commitment definition
|
|
@@ -21182,9 +21183,7 @@
|
|
|
21182
21183
|
`));
|
|
21183
21184
|
}
|
|
21184
21185
|
}
|
|
21185
|
-
|
|
21186
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21187
|
-
*/
|
|
21186
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21188
21187
|
|
|
21189
21188
|
/**
|
|
21190
21189
|
* USE MCP commitment definition
|
|
@@ -21259,9 +21258,7 @@
|
|
|
21259
21258
|
};
|
|
21260
21259
|
}
|
|
21261
21260
|
}
|
|
21262
|
-
|
|
21263
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21264
|
-
*/
|
|
21261
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21265
21262
|
|
|
21266
21263
|
/**
|
|
21267
21264
|
* USE POPUP commitment definition
|
|
@@ -21397,9 +21394,7 @@
|
|
|
21397
21394
|
};
|
|
21398
21395
|
}
|
|
21399
21396
|
}
|
|
21400
|
-
|
|
21401
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21402
|
-
*/
|
|
21397
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21403
21398
|
|
|
21404
21399
|
/**
|
|
21405
21400
|
* Tool name used by the USE PRIVACY commitment.
|
|
@@ -21571,9 +21566,7 @@
|
|
|
21571
21566
|
};
|
|
21572
21567
|
}
|
|
21573
21568
|
}
|
|
21574
|
-
|
|
21575
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21576
|
-
*/
|
|
21569
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21577
21570
|
|
|
21578
21571
|
/* eslint-disable no-magic-numbers */
|
|
21579
21572
|
/**
|
|
@@ -22361,9 +22354,7 @@
|
|
|
22361
22354
|
defaultBranch,
|
|
22362
22355
|
};
|
|
22363
22356
|
}
|
|
22364
|
-
|
|
22365
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22366
|
-
*/
|
|
22357
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
22367
22358
|
|
|
22368
22359
|
/**
|
|
22369
22360
|
* Wallet metadata used by USE PROJECT when resolving GitHub credentials.
|
|
@@ -23222,9 +23213,7 @@
|
|
|
23222
23213
|
defaultBranch: repositoryReference.defaultBranch,
|
|
23223
23214
|
});
|
|
23224
23215
|
}
|
|
23225
|
-
|
|
23226
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23227
|
-
*/
|
|
23216
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23228
23217
|
|
|
23229
23218
|
/**
|
|
23230
23219
|
* A search engine implementation that uses the SerpApi to fetch Google search results.
|
|
@@ -23435,9 +23424,7 @@
|
|
|
23435
23424
|
};
|
|
23436
23425
|
}
|
|
23437
23426
|
}
|
|
23438
|
-
|
|
23439
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23440
|
-
*/
|
|
23427
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23441
23428
|
|
|
23442
23429
|
/**
|
|
23443
23430
|
* Maximum allowed source length for create-agent payloads.
|
|
@@ -23634,9 +23621,7 @@
|
|
|
23634
23621
|
};
|
|
23635
23622
|
}
|
|
23636
23623
|
}
|
|
23637
|
-
|
|
23638
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23639
|
-
*/
|
|
23624
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23640
23625
|
|
|
23641
23626
|
/**
|
|
23642
23627
|
* Creates system-message instructions for `USE TIMEOUT`.
|
|
@@ -23701,9 +23686,7 @@
|
|
|
23701
23686
|
return null;
|
|
23702
23687
|
}
|
|
23703
23688
|
}
|
|
23704
|
-
|
|
23705
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23706
|
-
*/
|
|
23689
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
23707
23690
|
|
|
23708
23691
|
/**
|
|
23709
23692
|
* Builds a disabled timeout-tool payload.
|
|
@@ -24437,9 +24420,7 @@
|
|
|
24437
24420
|
return createTimeoutToolFunctions();
|
|
24438
24421
|
}
|
|
24439
24422
|
}
|
|
24440
|
-
|
|
24441
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24442
|
-
*/
|
|
24423
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24443
24424
|
|
|
24444
24425
|
/**
|
|
24445
24426
|
* USE TIME commitment definition
|
|
@@ -24586,9 +24567,7 @@
|
|
|
24586
24567
|
};
|
|
24587
24568
|
}
|
|
24588
24569
|
}
|
|
24589
|
-
|
|
24590
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24591
|
-
*/
|
|
24570
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24592
24571
|
|
|
24593
24572
|
/**
|
|
24594
24573
|
* Tool name used by the USE USER LOCATION commitment.
|
|
@@ -24801,9 +24780,7 @@
|
|
|
24801
24780
|
};
|
|
24802
24781
|
}
|
|
24803
24782
|
}
|
|
24804
|
-
|
|
24805
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24806
|
-
*/
|
|
24783
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24807
24784
|
|
|
24808
24785
|
/**
|
|
24809
24786
|
* `WRITING RULES` commitment definition.
|
|
@@ -24879,9 +24856,7 @@
|
|
|
24879
24856
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing rules', createWritingRulesSection(trimmedContent)), '\n\n');
|
|
24880
24857
|
}
|
|
24881
24858
|
}
|
|
24882
|
-
|
|
24883
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24884
|
-
*/
|
|
24859
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24885
24860
|
|
|
24886
24861
|
/**
|
|
24887
24862
|
* `WRITING SAMPLE` commitment definition.
|
|
@@ -24951,9 +24926,7 @@
|
|
|
24951
24926
|
return this.appendToSystemMessage(requirements, this.createSystemMessageSection('Writing sample', createWritingSampleSection(trimmedContent)), '\n\n');
|
|
24952
24927
|
}
|
|
24953
24928
|
}
|
|
24954
|
-
|
|
24955
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24956
|
-
*/
|
|
24929
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
24957
24930
|
|
|
24958
24931
|
/**
|
|
24959
24932
|
* Placeholder commitment definition for commitments that are not yet implemented
|
|
@@ -25115,13 +25088,12 @@
|
|
|
25115
25088
|
new NotYetImplementedCommitmentDefinition('CONTEXT'),
|
|
25116
25089
|
// <- TODO: Prompt: Leverage aliases instead of duplicating commitment definitions
|
|
25117
25090
|
];
|
|
25118
|
-
|
|
25119
|
-
|
|
25120
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
25121
|
-
*/
|
|
25091
|
+
// TODO: [🧠] Maybe create through standardized $register
|
|
25092
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
25122
25093
|
|
|
25123
25094
|
/**
|
|
25124
25095
|
* Gets all available commitment definitions
|
|
25096
|
+
*
|
|
25125
25097
|
* @returns Array of all commitment definitions
|
|
25126
25098
|
*
|
|
25127
25099
|
* @public exported from `@promptbook/core`
|
|
@@ -25134,6 +25106,7 @@
|
|
|
25134
25106
|
* Collects tool functions from all commitment definitions.
|
|
25135
25107
|
*
|
|
25136
25108
|
* @returns Map of tool function implementations.
|
|
25109
|
+
*
|
|
25137
25110
|
* @private internal helper for commitment tool registry
|
|
25138
25111
|
*/
|
|
25139
25112
|
function collectCommitmentToolFunctions() {
|
|
@@ -25155,6 +25128,7 @@
|
|
|
25155
25128
|
*
|
|
25156
25129
|
* @param getFunctions - Provider of current tool functions.
|
|
25157
25130
|
* @returns Proxy exposing tool functions as properties.
|
|
25131
|
+
*
|
|
25158
25132
|
* @private internal helper for commitment tool registry
|
|
25159
25133
|
*/
|
|
25160
25134
|
function createToolFunctionsProxy(getFunctions) {
|
|
@@ -25192,10 +25166,11 @@
|
|
|
25192
25166
|
},
|
|
25193
25167
|
});
|
|
25194
25168
|
}
|
|
25169
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
25170
|
+
|
|
25195
25171
|
/**
|
|
25196
|
-
*
|
|
25172
|
+
* Map of node tool functions.
|
|
25197
25173
|
*/
|
|
25198
|
-
|
|
25199
25174
|
const nodeToolFunctions = {
|
|
25200
25175
|
/**
|
|
25201
25176
|
* @@@
|
|
@@ -25227,6 +25202,9 @@
|
|
|
25227
25202
|
spawn_agent: resolveSpawnAgentToolForNode(),
|
|
25228
25203
|
// TODO: !!!! Unhardcode, make proper server function register from definitions
|
|
25229
25204
|
};
|
|
25205
|
+
/**
|
|
25206
|
+
* Constant for node tool functions proxy.
|
|
25207
|
+
*/
|
|
25230
25208
|
const nodeToolFunctionsProxy = createToolFunctionsProxy(() => ({
|
|
25231
25209
|
...collectCommitmentToolFunctions(),
|
|
25232
25210
|
...nodeToolFunctions,
|
|
@@ -25250,10 +25228,8 @@
|
|
|
25250
25228
|
}
|
|
25251
25229
|
return nodeToolFunctionsProxy;
|
|
25252
25230
|
}
|
|
25253
|
-
|
|
25254
|
-
|
|
25255
|
-
* TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
|
|
25256
|
-
*/
|
|
25231
|
+
// Note: [??] Code in this file should never be never released in packages that could be imported into browser environment
|
|
25232
|
+
// TODO: [??] Unite `xxxForServer` and `xxxForNode` naming
|
|
25257
25233
|
|
|
25258
25234
|
/**
|
|
25259
25235
|
* Normalize options for `execCommand` and `execCommands`
|
|
@@ -25321,7 +25297,6 @@
|
|
|
25321
25297
|
/**
|
|
25322
25298
|
* Run one command in a shell
|
|
25323
25299
|
*
|
|
25324
|
-
*
|
|
25325
25300
|
* Note: There are 2 similar functions in the codebase:
|
|
25326
25301
|
* - `$execCommand` which runs a single command
|
|
25327
25302
|
* - `$execCommands` which runs multiple commands
|
|
@@ -25420,7 +25395,7 @@
|
|
|
25420
25395
|
}
|
|
25421
25396
|
});
|
|
25422
25397
|
}
|
|
25423
|
-
|
|
25398
|
+
// Note: [🟢] Code for Node command-execution helper [$execCommand](src/utils/execCommand/$execCommand.ts) should never be published into packages that could be imported into browser environment
|
|
25424
25399
|
|
|
25425
25400
|
/**
|
|
25426
25401
|
* Attempts to locate the specified application on a Linux system using the 'which' command.
|
|
@@ -25438,8 +25413,8 @@
|
|
|
25438
25413
|
return null;
|
|
25439
25414
|
}
|
|
25440
25415
|
}
|
|
25441
|
-
|
|
25442
|
-
|
|
25416
|
+
// Note: [🟢] Code for Node executable locator [locateAppOnLinux](src/executables/platforms/locateAppOnLinux.ts) should never be published into packages that could be imported into browser environment
|
|
25417
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
25443
25418
|
|
|
25444
25419
|
/**
|
|
25445
25420
|
* Checks if the file is executable
|
|
@@ -25455,15 +25430,15 @@
|
|
|
25455
25430
|
return false;
|
|
25456
25431
|
}
|
|
25457
25432
|
}
|
|
25458
|
-
|
|
25459
|
-
|
|
25460
|
-
* TODO: [🖇] What about symlinks?
|
|
25461
|
-
*/
|
|
25433
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
25434
|
+
// TODO: [🖇] What about symlinks?
|
|
25462
25435
|
|
|
25463
25436
|
// Note: Module `userhome` has no types available, so it is imported using `require`
|
|
25464
25437
|
// @see https://stackoverflow.com/questions/37000981/how-to-import-node-module-in-typescript-without-type-definitions
|
|
25465
|
-
|
|
25466
|
-
|
|
25438
|
+
/**
|
|
25439
|
+
* Constant for userhome.
|
|
25440
|
+
*/
|
|
25441
|
+
const userhome = require('userhome'); // eslint-disable-line @typescript-eslint/no-var-requires
|
|
25467
25442
|
/**
|
|
25468
25443
|
* Attempts to locate the specified application on a macOS system by checking standard application paths and using mdfind.
|
|
25469
25444
|
* Returns the path to the executable if found, or null otherwise.
|
|
@@ -25492,8 +25467,8 @@
|
|
|
25492
25467
|
return null;
|
|
25493
25468
|
}
|
|
25494
25469
|
}
|
|
25495
|
-
|
|
25496
|
-
|
|
25470
|
+
// Note: [🟢] Code for Node executable locator [locateAppOnMacOs](src/executables/platforms/locateAppOnMacOs.ts) should never be published into packages that could be imported into browser environment
|
|
25471
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
25497
25472
|
|
|
25498
25473
|
/**
|
|
25499
25474
|
* Attempts to locate the specified application on a Windows system by searching common installation directories.
|
|
@@ -25522,8 +25497,8 @@
|
|
|
25522
25497
|
return null;
|
|
25523
25498
|
}
|
|
25524
25499
|
}
|
|
25525
|
-
|
|
25526
|
-
|
|
25500
|
+
// Note: [🟢] Code for Node executable locator [locateAppOnWindows](src/executables/platforms/locateAppOnWindows.ts) should never be published into packages that could be imported into browser environment
|
|
25501
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
25527
25502
|
|
|
25528
25503
|
/**
|
|
25529
25504
|
* Locates an application on the system
|
|
@@ -25560,8 +25535,8 @@
|
|
|
25560
25535
|
}
|
|
25561
25536
|
}
|
|
25562
25537
|
}
|
|
25563
|
-
|
|
25564
|
-
|
|
25538
|
+
// Note: [🟢] Code for Node executable locator [locateApp](src/executables/locateApp.ts) should never be published into packages that could be imported into browser environment
|
|
25539
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node`
|
|
25565
25540
|
|
|
25566
25541
|
/**
|
|
25567
25542
|
* Locates the LibreOffice executable on the current system by searching platform-specific paths.
|
|
@@ -25577,8 +25552,8 @@
|
|
|
25577
25552
|
macOsName: 'LibreOffice',
|
|
25578
25553
|
});
|
|
25579
25554
|
}
|
|
25580
|
-
|
|
25581
|
-
|
|
25555
|
+
// Note: [🟢] Code for Node executable locator [locateLibreoffice](src/executables/apps/locateLibreoffice.ts) should never be published into packages that could be imported into browser environment
|
|
25556
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/legacy-documents`
|
|
25582
25557
|
|
|
25583
25558
|
/**
|
|
25584
25559
|
* Locates the Pandoc executable on the current system by searching platform-specific paths.
|
|
@@ -25594,8 +25569,8 @@
|
|
|
25594
25569
|
macOsName: 'Pandoc',
|
|
25595
25570
|
});
|
|
25596
25571
|
}
|
|
25597
|
-
|
|
25598
|
-
|
|
25572
|
+
// Note: [🟢] Code for Node executable locator [locatePandoc](src/executables/apps/locatePandoc.ts) should never be published into packages that could be imported into browser environment
|
|
25573
|
+
// TODO: [🧠][♿] Maybe export through `@promptbook/node` OR `@promptbook/documents`
|
|
25599
25574
|
|
|
25600
25575
|
/**
|
|
25601
25576
|
* Provides paths to required executables (i.e. as Pandoc and LibreOffice) for Node.js environments.
|
|
@@ -25612,35 +25587,33 @@
|
|
|
25612
25587
|
// <- TODO: [🧠] `null` vs `undefined`
|
|
25613
25588
|
};
|
|
25614
25589
|
}
|
|
25615
|
-
|
|
25616
|
-
|
|
25617
|
-
|
|
25618
|
-
* TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
25619
|
-
*/
|
|
25590
|
+
// Note: [🟢] Code for Node executable locator [$provideExecutablesForNode](src/executables/$provideExecutablesForNode.ts) should never be published into packages that could be imported into browser environment
|
|
25591
|
+
// TODO: [🧠] Allow to override the executables without need to call `locatePandoc` / `locateLibreoffice` in case of provided
|
|
25592
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
25620
25593
|
|
|
25621
25594
|
/**
|
|
25622
25595
|
* Register for LLM tools metadata.
|
|
25623
25596
|
*
|
|
25624
25597
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
25598
|
+
*
|
|
25625
25599
|
* @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
|
|
25600
|
+
*
|
|
25626
25601
|
* @public exported from `@promptbook/core`
|
|
25627
25602
|
*/
|
|
25628
25603
|
const $llmToolsMetadataRegister = new $Register('llm_tools_metadata');
|
|
25629
|
-
|
|
25630
|
-
* TODO: [®] DRY Register logic
|
|
25631
|
-
*/
|
|
25604
|
+
// TODO: [®] DRY Register logic
|
|
25632
25605
|
|
|
25633
25606
|
/**
|
|
25634
25607
|
* Register for LLM tools.
|
|
25635
25608
|
*
|
|
25636
25609
|
* Note: `$` is used to indicate that this interacts with the global scope
|
|
25610
|
+
*
|
|
25637
25611
|
* @singleton Only one instance of each register is created per build, but there can be more instances across different builds or environments.
|
|
25612
|
+
*
|
|
25638
25613
|
* @public exported from `@promptbook/core`
|
|
25639
25614
|
*/
|
|
25640
25615
|
const $llmToolsRegister = new $Register('llm_execution_tools_constructors');
|
|
25641
|
-
|
|
25642
|
-
* TODO: [®] DRY Register logic
|
|
25643
|
-
*/
|
|
25616
|
+
// TODO: [®] DRY Register logic
|
|
25644
25617
|
|
|
25645
25618
|
/**
|
|
25646
25619
|
* Path to the `.env` file which was used to configure LLM tools
|
|
@@ -25777,10 +25750,8 @@
|
|
|
25777
25750
|
.join('\n'))}
|
|
25778
25751
|
`);
|
|
25779
25752
|
}
|
|
25780
|
-
|
|
25781
|
-
|
|
25782
|
-
* TODO: [🧠][⚛] Maybe pass env as argument
|
|
25783
|
-
*/
|
|
25753
|
+
// TODO: [®] DRY Register logic
|
|
25754
|
+
// TODO: [🧠][⚛] Maybe pass env as argument
|
|
25784
25755
|
|
|
25785
25756
|
/**
|
|
25786
25757
|
* Provides the path to the `.env` file
|
|
@@ -25822,7 +25793,7 @@
|
|
|
25822
25793
|
}
|
|
25823
25794
|
return null;
|
|
25824
25795
|
}
|
|
25825
|
-
|
|
25796
|
+
// Note: [🟢] Code for Node environment helper [$provideEnvFilename](src/llm-providers/_common/register/$provideEnvFilename.ts) should never be published into packages that could be imported into browser environment
|
|
25826
25797
|
|
|
25827
25798
|
/**
|
|
25828
25799
|
* Provides LLM tools configuration by reading environment variables.
|
|
@@ -25836,6 +25807,7 @@
|
|
|
25836
25807
|
*
|
|
25837
25808
|
* @see Environment variables documentation or .env file for required variables.
|
|
25838
25809
|
* @returns A promise that resolves to the LLM tools configuration, or null if configuration is incomplete or missing.
|
|
25810
|
+
*
|
|
25839
25811
|
* @public exported from `@promptbook/node`
|
|
25840
25812
|
*/
|
|
25841
25813
|
async function $provideLlmToolsConfigurationFromEnv() {
|
|
@@ -25852,7 +25824,7 @@
|
|
|
25852
25824
|
.filter((configuration) => configuration !== null);
|
|
25853
25825
|
return llmToolsConfiguration;
|
|
25854
25826
|
}
|
|
25855
|
-
|
|
25827
|
+
// Note: [🟢] Code for Node environment helper [$provideLlmToolsConfigurationFromEnv](src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.ts) should never be published into packages that could be imported into browser environment
|
|
25856
25828
|
|
|
25857
25829
|
/**
|
|
25858
25830
|
* Creates LLM execution tools from provided configuration objects
|
|
@@ -25865,6 +25837,7 @@
|
|
|
25865
25837
|
* @param configuration Array of LLM tool configurations to instantiate
|
|
25866
25838
|
* @param options Additional options for configuring the LLM tools
|
|
25867
25839
|
* @returns A unified interface combining all successfully instantiated LLM tools
|
|
25840
|
+
*
|
|
25868
25841
|
* @public exported from `@promptbook/core`
|
|
25869
25842
|
*/
|
|
25870
25843
|
function createLlmToolsFromConfiguration(configuration, options = {}) {
|
|
@@ -25934,6 +25907,7 @@
|
|
|
25934
25907
|
*
|
|
25935
25908
|
* @param options Configuration options for the LLM tools
|
|
25936
25909
|
* @returns A unified interface containing all detected and configured LLM tools
|
|
25910
|
+
*
|
|
25937
25911
|
* @public exported from `@promptbook/node`
|
|
25938
25912
|
*/
|
|
25939
25913
|
async function $provideLlmToolsFromEnv(options = {}) {
|
|
@@ -25958,27 +25932,26 @@
|
|
|
25958
25932
|
}
|
|
25959
25933
|
return createLlmToolsFromConfiguration(configuration, options);
|
|
25960
25934
|
}
|
|
25961
|
-
|
|
25962
|
-
|
|
25963
|
-
|
|
25964
|
-
|
|
25965
|
-
|
|
25966
|
-
|
|
25967
|
-
|
|
25968
|
-
|
|
25969
|
-
|
|
25970
|
-
|
|
25971
|
-
|
|
25972
|
-
|
|
25973
|
-
|
|
25974
|
-
|
|
25975
|
-
* TODO: [®] DRY Register logic
|
|
25976
|
-
*/
|
|
25935
|
+
// Note: [🟢] Code for Node environment helper [$provideLlmToolsFromEnv](src/llm-providers/_common/register/$provideLlmToolsFromEnv.ts) should never be published into packages that could be imported into browser environment
|
|
25936
|
+
// TODO: The architecture for LLM tools configuration consists of three key functions:
|
|
25937
|
+
// 1. `$provideLlmToolsFromEnv` - High-level function that detects available providers from env vars and returns ready-to-use LLM tools
|
|
25938
|
+
// 2. `$provideLlmToolsConfigurationFromEnv` - Middle layer that extracts configuration objects from environment variables
|
|
25939
|
+
// 3. `createLlmToolsFromConfiguration` - Low-level function that instantiates LLM tools from explicit configuration
|
|
25940
|
+
// This layered approach allows flexibility in how tools are configured:
|
|
25941
|
+
// - Use $provideLlmToolsFromEnv for automatic detection and setup in Node.js environments
|
|
25942
|
+
// - Use $provideLlmToolsConfigurationFromEnv to extract config objects for modification before instantiation
|
|
25943
|
+
// - Use createLlmToolsFromConfiguration for explicit control over tool configurations
|
|
25944
|
+
// TODO: [🧠][🍛] Which name is better `$provideLlmToolsFromEnv` or `$provideLlmToolsFromEnvironment`?
|
|
25945
|
+
// TODO: [🧠] Is there some meaningfull way how to test this util
|
|
25946
|
+
// TODO: [🥃] Allow `ptbk make` without llm tools
|
|
25947
|
+
// TODO: This should be maybe not under `_common` but under `utils`
|
|
25948
|
+
// TODO: [®] DRY Register logic
|
|
25977
25949
|
|
|
25978
25950
|
/**
|
|
25979
25951
|
* Provides a collection of scrapers optimized for Node.js environment.
|
|
25980
25952
|
* 1) `provideScrapersForNode` use as default
|
|
25981
25953
|
* 2) `provideScrapersForBrowser` use in limited browser environment *
|
|
25954
|
+
*
|
|
25982
25955
|
* @public exported from `@promptbook/node`
|
|
25983
25956
|
*/
|
|
25984
25957
|
async function $provideScrapersForNode(tools, options) {
|
|
@@ -25998,8 +25971,8 @@
|
|
|
25998
25971
|
}
|
|
25999
25972
|
return scrapers;
|
|
26000
25973
|
}
|
|
26001
|
-
|
|
26002
|
-
|
|
25974
|
+
// Note: [🟢] Code for Node scraper registration helper [$provideScrapersForNode](src/scrapers/_common/register/$provideScrapersForNode.ts) should never be published into packages that could be imported into browser environment
|
|
25975
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
26003
25976
|
|
|
26004
25977
|
/**
|
|
26005
25978
|
* Extracts code block from markdown.
|
|
@@ -26012,8 +25985,9 @@
|
|
|
26012
25985
|
* - `extractOneBlockFromMarkdown` extracts exactly one code block with language of the code block
|
|
26013
25986
|
* - `extractAllBlocksFromMarkdown` extracts all code blocks with language of the code block
|
|
26014
25987
|
*
|
|
26015
|
-
* @public exported from `@promptbook/markdown-utils`
|
|
26016
25988
|
* @throws {ParseError} if there is not exactly one code block in the markdown
|
|
25989
|
+
*
|
|
25990
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
26017
25991
|
*/
|
|
26018
25992
|
function extractBlock(markdown) {
|
|
26019
25993
|
const { content } = extractOneBlockFromMarkdown(markdown);
|
|
@@ -26025,7 +25999,7 @@
|
|
|
26025
25999
|
*
|
|
26026
26000
|
* Note: [🔂] This function is idempotent.
|
|
26027
26001
|
* Note: This is useful for post-processing of the result of the chat LLM model
|
|
26028
|
-
*
|
|
26002
|
+
* when the model wraps the result in the (markdown) code block.
|
|
26029
26003
|
*
|
|
26030
26004
|
* @public exported from `@promptbook/markdown-utils`
|
|
26031
26005
|
*/
|
|
@@ -26044,7 +26018,7 @@
|
|
|
26044
26018
|
* Function trimEndOfCodeBlock will remove ending code block from the string if it is present.
|
|
26045
26019
|
*
|
|
26046
26020
|
* Note: This is useful for post-processing of the result of the completion LLM model
|
|
26047
|
-
*
|
|
26021
|
+
* if you want to start code block in the prompt but you don't want to end it in the result.
|
|
26048
26022
|
*
|
|
26049
26023
|
* @public exported from `@promptbook/markdown-utils`
|
|
26050
26024
|
*/
|
|
@@ -26056,6 +26030,8 @@
|
|
|
26056
26030
|
}
|
|
26057
26031
|
|
|
26058
26032
|
/**
|
|
26033
|
+
* Collection of preserved.
|
|
26034
|
+
*
|
|
26059
26035
|
* @private internal for `preserve`
|
|
26060
26036
|
*/
|
|
26061
26037
|
const _preserved = [];
|
|
@@ -26065,21 +26041,20 @@
|
|
|
26065
26041
|
*
|
|
26066
26042
|
* @param value any function to preserve
|
|
26067
26043
|
* @returns nothing
|
|
26044
|
+
*
|
|
26068
26045
|
* @private within the repository
|
|
26069
26046
|
*/
|
|
26070
26047
|
function $preserve(...value) {
|
|
26071
26048
|
_preserved.push(...value);
|
|
26072
26049
|
}
|
|
26073
|
-
|
|
26074
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26075
|
-
*/
|
|
26050
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26076
26051
|
|
|
26077
26052
|
// Note: [💎]
|
|
26078
26053
|
/**
|
|
26079
26054
|
* ScriptExecutionTools for JavaScript implemented via eval
|
|
26080
26055
|
*
|
|
26081
26056
|
* Warning: It is used for testing and mocking
|
|
26082
|
-
*
|
|
26057
|
+
* **NOT intended to use in the production** due to its unsafe nature, use `JavascriptExecutionTools` instead.
|
|
26083
26058
|
*
|
|
26084
26059
|
* @public exported from `@promptbook/javascript`
|
|
26085
26060
|
*/
|
|
@@ -26274,23 +26249,22 @@
|
|
|
26274
26249
|
return result;
|
|
26275
26250
|
}
|
|
26276
26251
|
}
|
|
26277
|
-
|
|
26278
|
-
|
|
26279
|
-
* TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
26280
|
-
*/
|
|
26252
|
+
// TODO: Put predefined functions (like removeQuotes, spaceTrim, etc.) into annotation OR pass into constructor
|
|
26253
|
+
// TODO: [🧠][💙] Distinct between options passed into ExecutionTools and to ExecutionTools.execute
|
|
26281
26254
|
|
|
26282
26255
|
/**
|
|
26283
26256
|
* Placeholder for better implementation of JavascriptExecutionTools - some proper sandboxing
|
|
26284
26257
|
*
|
|
26285
26258
|
* @alias JavascriptExecutionTools
|
|
26259
|
+
*
|
|
26286
26260
|
* @public exported from `@promptbook/javascript`
|
|
26287
26261
|
*/
|
|
26288
26262
|
const JavascriptExecutionTools = JavascriptEvalExecutionTools;
|
|
26289
26263
|
|
|
26290
26264
|
/**
|
|
26291
26265
|
* Note: There is unfortunately no equivalent for this function in the browser environment
|
|
26292
|
-
*
|
|
26293
|
-
*
|
|
26266
|
+
* because it is not possible automatically detect configured LLM providers
|
|
26267
|
+
* you need to provide them manually BUT you can help by utilities like `$provideScrapersForBrowser`
|
|
26294
26268
|
*
|
|
26295
26269
|
* @public exported from `@promptbook/node`
|
|
26296
26270
|
*/
|
|
@@ -26315,8 +26289,8 @@
|
|
|
26315
26289
|
};
|
|
26316
26290
|
return tools;
|
|
26317
26291
|
}
|
|
26318
|
-
|
|
26319
|
-
|
|
26292
|
+
// Note: [🟢] Code for Node execution helper [$provideExecutionToolsForNode](src/execution/utils/$provideExecutionToolsForNode.ts) should never be published into packages that could be imported into browser environment
|
|
26293
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
26320
26294
|
|
|
26321
26295
|
/**
|
|
26322
26296
|
* Checks if the directory exists
|
|
@@ -26337,12 +26311,10 @@
|
|
|
26337
26311
|
.catch(() => false);
|
|
26338
26312
|
return isDirectory;
|
|
26339
26313
|
}
|
|
26340
|
-
|
|
26341
|
-
|
|
26342
|
-
|
|
26343
|
-
|
|
26344
|
-
* TODO: [🖇] What about symlinks?
|
|
26345
|
-
*/
|
|
26314
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
26315
|
+
// TODO: [🐠] This can be a validator - with variants that return true/false and variants that throw errors with meaningless messages
|
|
26316
|
+
// TODO: [🧠][📂] "directory" vs "folder"
|
|
26317
|
+
// TODO: [🖇] What about symlinks?
|
|
26346
26318
|
|
|
26347
26319
|
/**
|
|
26348
26320
|
* Reads all files in the directory
|
|
@@ -26350,6 +26322,7 @@
|
|
|
26350
26322
|
* @param path
|
|
26351
26323
|
* @param isRecursive
|
|
26352
26324
|
* @returns List of all files in the directory
|
|
26325
|
+
*
|
|
26353
26326
|
* @private internal function of `AgentCollectionInDirectory` and `createPipelineCollectionFromDirectory`
|
|
26354
26327
|
*/
|
|
26355
26328
|
async function listAllFiles(path$1, isRecursive, fs) {
|
|
@@ -26371,11 +26344,9 @@
|
|
|
26371
26344
|
}
|
|
26372
26345
|
return fileNames;
|
|
26373
26346
|
}
|
|
26374
|
-
|
|
26375
|
-
|
|
26376
|
-
|
|
26377
|
-
* TODO: [🖇] What about symlinks?
|
|
26378
|
-
*/
|
|
26347
|
+
// TODO: [😶] Unite folder listing
|
|
26348
|
+
// Note: Not [~🟢~] because it is not directly dependent on `fs
|
|
26349
|
+
// TODO: [🖇] What about symlinks?
|
|
26379
26350
|
|
|
26380
26351
|
/**
|
|
26381
26352
|
* Constructs `PipelineCollection` from async sources
|
|
@@ -26385,17 +26356,18 @@
|
|
|
26385
26356
|
* - Factory function that returns Promise of array of PipelineJson or PipelineString
|
|
26386
26357
|
*
|
|
26387
26358
|
* Note: This is useful as internal tool for other constructor functions like
|
|
26388
|
-
*
|
|
26389
|
-
*
|
|
26359
|
+
* `createPipelineCollectionFromUrl` or `createPipelineCollectionFromDirectory`
|
|
26360
|
+
* Consider using those functions instead of this one
|
|
26390
26361
|
*
|
|
26391
26362
|
* Note: The function does NOT return promise it returns the collection directly which waits for the sources to be resolved
|
|
26392
|
-
*
|
|
26363
|
+
* when error occurs in given promise or factory function, it is thrown during `listPipelines` or `getPipelineByUrl` call
|
|
26393
26364
|
*
|
|
26394
26365
|
* Note: Consider using `createPipelineCollectionFromDirectory` or `createPipelineCollectionFromUrl`
|
|
26395
26366
|
*
|
|
26396
26367
|
* @param promptbookSourcesPromiseOrFactory
|
|
26397
26368
|
* @returns PipelineCollection
|
|
26398
26369
|
* @deprecated Do not use, it will became internal tool for other constructor functions
|
|
26370
|
+
*
|
|
26399
26371
|
* @public exported from `@promptbook/core`
|
|
26400
26372
|
*/
|
|
26401
26373
|
function createPipelineCollectionFromPromise(promptbookSourcesPromiseOrFactory) {
|
|
@@ -26439,6 +26411,7 @@
|
|
|
26439
26411
|
* @param tools - Execution tools to be used for pipeline preparation if needed - If not provided, `$provideExecutionToolsForNode` will be used
|
|
26440
26412
|
* @param options - Options for the collection creation
|
|
26441
26413
|
* @returns PipelineCollection
|
|
26414
|
+
*
|
|
26442
26415
|
* @public exported from `@promptbook/node`
|
|
26443
26416
|
*/
|
|
26444
26417
|
async function createPipelineCollectionFromDirectory(rootPath, tools, options) {
|
|
@@ -26622,10 +26595,8 @@
|
|
|
26622
26595
|
}
|
|
26623
26596
|
return collection;
|
|
26624
26597
|
}
|
|
26625
|
-
|
|
26626
|
-
|
|
26627
|
-
* TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
|
|
26628
|
-
*/
|
|
26598
|
+
// TODO: [🖇] What about symlinks? Maybe option `isSymlinksFollowed`
|
|
26599
|
+
// TODO: Maybe move from `@promptbook/node` to `@promptbook/core` as we removes direct dependency on `fs`
|
|
26629
26600
|
|
|
26630
26601
|
/**
|
|
26631
26602
|
* Provides script execution tools
|
|
@@ -26639,8 +26610,8 @@
|
|
|
26639
26610
|
// TODO: [🔱] Do here auto-installation
|
|
26640
26611
|
return [new JavascriptExecutionTools({ ...options, functions: getAllCommitmentsToolFunctionsForNode() })];
|
|
26641
26612
|
}
|
|
26642
|
-
|
|
26643
|
-
|
|
26613
|
+
// Note: [🟢] Code for Node scraper registration helper [$provideScriptingForNode](src/scrapers/_common/register/$provideScriptingForNode.ts) should never be published into packages that could be imported into browser environment
|
|
26614
|
+
// TODO: [🏓] Unite `xxxForServer` and `xxxForNode` naming
|
|
26644
26615
|
|
|
26645
26616
|
/**
|
|
26646
26617
|
* Stringify the PipelineJson with proper formatting
|
|
@@ -26668,12 +26639,10 @@
|
|
|
26668
26639
|
pipelineJsonStringified += '\n';
|
|
26669
26640
|
return pipelineJsonStringified;
|
|
26670
26641
|
}
|
|
26671
|
-
|
|
26672
|
-
|
|
26673
|
-
|
|
26674
|
-
|
|
26675
|
-
* TODO: [🍙] Make some standard order of json properties
|
|
26676
|
-
*/
|
|
26642
|
+
// TODO: [🐝] Not Working properly @see https://promptbook.studio/examples/mixed-knowledge.book
|
|
26643
|
+
// TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
26644
|
+
// TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
26645
|
+
// TODO: [🍙] Make some standard order of json properties
|
|
26677
26646
|
|
|
26678
26647
|
/**
|
|
26679
26648
|
* A storage implementation that caches data in files organized in a directory structure.
|
|
@@ -26763,8 +26732,8 @@
|
|
|
26763
26732
|
// [0] When `setItem` and `removeItem` called, the state of the file system should be the same
|
|
26764
26733
|
}
|
|
26765
26734
|
}
|
|
26766
|
-
|
|
26767
|
-
|
|
26735
|
+
// Note: [🟢] Code for Node file-cache storage [FileCacheStorage](src/storage/file-cache-storage/FileCacheStorage.ts) should never be published into packages that could be imported into browser environment
|
|
26736
|
+
// TODO: [🌗] Maybe some checkers, not all valid JSONs are desired and valid values
|
|
26768
26737
|
|
|
26769
26738
|
/**
|
|
26770
26739
|
* Run multiple commands in a shell in sequence
|
|
@@ -26781,7 +26750,7 @@
|
|
|
26781
26750
|
await $execCommand({ command, cwd, crashOnError });
|
|
26782
26751
|
}
|
|
26783
26752
|
}
|
|
26784
|
-
|
|
26753
|
+
// Note: [🟢] Code for Node command-execution helper [$execCommands](src/utils/execCommand/$execCommands.ts) should never be published into packages that could be imported into browser environment
|
|
26785
26754
|
|
|
26786
26755
|
/**
|
|
26787
26756
|
* Keep-alive helpers used for streaming chat responses.
|
|
@@ -26793,9 +26762,7 @@
|
|
|
26793
26762
|
* @private internal streaming helper for Promptbook chat connections
|
|
26794
26763
|
*/
|
|
26795
26764
|
const CHAT_STREAM_KEEP_ALIVE_TOKEN = 'STREAM_KEEP_ALIVE';
|
|
26796
|
-
|
|
26797
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26798
|
-
*/
|
|
26765
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26799
26766
|
|
|
26800
26767
|
/**
|
|
26801
26768
|
* Type guard to check if a string is a valid agent source
|
|
@@ -26825,6 +26792,7 @@
|
|
|
26825
26792
|
* Default book
|
|
26826
26793
|
*
|
|
26827
26794
|
* @deprecated Use `$generateBookBoilerplate` instead
|
|
26795
|
+
*
|
|
26828
26796
|
* @public exported from `@promptbook/core`
|
|
26829
26797
|
*/
|
|
26830
26798
|
padBook(validateBook(_spaceTrim.spaceTrim(`
|
|
@@ -26843,6 +26811,7 @@
|
|
|
26843
26811
|
*
|
|
26844
26812
|
* @param {string} pipelineString the candidate for a pipeline string
|
|
26845
26813
|
* @returns {boolean} if the string is a valid pipeline string
|
|
26814
|
+
*
|
|
26846
26815
|
* @public exported from `@promptbook/core`
|
|
26847
26816
|
*/
|
|
26848
26817
|
function isValidPipelineString(pipelineString) {
|
|
@@ -26855,9 +26824,7 @@
|
|
|
26855
26824
|
return false;
|
|
26856
26825
|
}
|
|
26857
26826
|
}
|
|
26858
|
-
|
|
26859
|
-
* TODO: [🧠][🈴] Where is the best location for this file
|
|
26860
|
-
*/
|
|
26827
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
26861
26828
|
|
|
26862
26829
|
/**
|
|
26863
26830
|
* Tag function for notating a pipeline with a book\`...\ notation as template literal
|
|
@@ -26870,6 +26837,7 @@
|
|
|
26870
26837
|
* @param strings The static string parts of the template literal
|
|
26871
26838
|
* @param values The dynamic values embedded within the template literal used as data
|
|
26872
26839
|
* @returns the pipeline string
|
|
26840
|
+
*
|
|
26873
26841
|
* @public exported from `@promptbook/core`
|
|
26874
26842
|
*/
|
|
26875
26843
|
function book(strings, ...values) {
|
|
@@ -26896,10 +26864,8 @@
|
|
|
26896
26864
|
}
|
|
26897
26865
|
return padBook(bookString);
|
|
26898
26866
|
}
|
|
26899
|
-
|
|
26900
|
-
|
|
26901
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26902
|
-
*/
|
|
26867
|
+
// TODO: [🧠][🈴] Where is the best location for this file
|
|
26868
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26903
26869
|
|
|
26904
26870
|
/**
|
|
26905
26871
|
* Tool call name emitted while preparing a GPT assistant for an agent.
|
|
@@ -26944,9 +26910,7 @@
|
|
|
26944
26910
|
{ token: CHAT_STREAM_WHITESPACE_TOKEN_TAB, value: '\t' },
|
|
26945
26911
|
{ token: CHAT_STREAM_WHITESPACE_TOKEN_SPACE, value: ' ' },
|
|
26946
26912
|
];
|
|
26947
|
-
|
|
26948
|
-
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26949
|
-
*/
|
|
26913
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
26950
26914
|
|
|
26951
26915
|
/**
|
|
26952
26916
|
* Converts encoded whitespace markers back into real whitespace so the UI can render the message
|
|
@@ -26964,6 +26928,9 @@
|
|
|
26964
26928
|
}, content);
|
|
26965
26929
|
}
|
|
26966
26930
|
|
|
26931
|
+
/**
|
|
26932
|
+
* Constant for raw tool call ID fields.
|
|
26933
|
+
*/
|
|
26967
26934
|
const RAW_TOOL_CALL_ID_FIELDS = ['callId', 'call_id', 'id'];
|
|
26968
26935
|
/**
|
|
26969
26936
|
* Builds a deterministic idempotency key for tool calls so the UI can track updates.
|
|
@@ -26994,6 +26961,9 @@
|
|
|
26994
26961
|
}
|
|
26995
26962
|
return `fallback:${toolCall.name}`;
|
|
26996
26963
|
}
|
|
26964
|
+
/**
|
|
26965
|
+
* Gets arguments key.
|
|
26966
|
+
*/
|
|
26997
26967
|
function getArgumentsKey(value) {
|
|
26998
26968
|
if (typeof value === 'string') {
|
|
26999
26969
|
return value;
|
|
@@ -27067,6 +27037,7 @@
|
|
|
27067
27037
|
* @param existingToolCall - Previous snapshot.
|
|
27068
27038
|
* @param incomingToolCall - New snapshot.
|
|
27069
27039
|
* @returns One merged snapshot.
|
|
27040
|
+
*
|
|
27070
27041
|
* @private helper of `mergeToolCalls`
|
|
27071
27042
|
*/
|
|
27072
27043
|
function mergeToolCallSnapshot(existingToolCall, incomingToolCall) {
|
|
@@ -27089,6 +27060,7 @@
|
|
|
27089
27060
|
* @param existingToolCall - Previous snapshot.
|
|
27090
27061
|
* @param incomingToolCall - New snapshot.
|
|
27091
27062
|
* @returns Resolved lifecycle state or `undefined` when neither snapshot provides enough data.
|
|
27063
|
+
*
|
|
27092
27064
|
* @private helper of `mergeToolCalls`
|
|
27093
27065
|
*/
|
|
27094
27066
|
function resolveMergedToolCallState(existingToolCall, incomingToolCall) {
|
|
@@ -27102,6 +27074,7 @@
|
|
|
27102
27074
|
*
|
|
27103
27075
|
* @param toolCall - Tool call snapshot to inspect.
|
|
27104
27076
|
* @returns Inferred lifecycle state or `undefined`.
|
|
27077
|
+
*
|
|
27105
27078
|
* @private helper of `mergeToolCalls`
|
|
27106
27079
|
*/
|
|
27107
27080
|
function inferToolCallState(toolCall) {
|
|
@@ -27125,6 +27098,7 @@
|
|
|
27125
27098
|
* @param existingValues - Previous list.
|
|
27126
27099
|
* @param incomingValues - Incoming list.
|
|
27127
27100
|
* @returns Deduplicated merged list or `undefined`.
|
|
27101
|
+
*
|
|
27128
27102
|
* @private helper of `mergeToolCalls`
|
|
27129
27103
|
*/
|
|
27130
27104
|
function mergeUnknownLists(existingValues, incomingValues) {
|
|
@@ -27151,6 +27125,7 @@
|
|
|
27151
27125
|
*
|
|
27152
27126
|
* @param value - Value to serialize.
|
|
27153
27127
|
* @returns String signature.
|
|
27128
|
+
*
|
|
27154
27129
|
* @private helper of `mergeToolCalls`
|
|
27155
27130
|
*/
|
|
27156
27131
|
function serializeValueForMerge(value) {
|
|
@@ -27168,6 +27143,7 @@
|
|
|
27168
27143
|
*
|
|
27169
27144
|
* @param toolCalls - Mutable list to deduplicate in-place.
|
|
27170
27145
|
* @returns The same array after removing redundant preparation entries.
|
|
27146
|
+
*
|
|
27171
27147
|
* @private helper of `mergeToolCalls`
|
|
27172
27148
|
*/
|
|
27173
27149
|
function deduplicatePreparationToolCalls(toolCalls) {
|
|
@@ -27225,6 +27201,7 @@
|
|
|
27225
27201
|
*
|
|
27226
27202
|
* @param rawDomain - Raw domain value (for example `my-agent.com` or `https://my-agent.com/path`).
|
|
27227
27203
|
* @returns Normalized hostname or `null` when the value cannot be normalized.
|
|
27204
|
+
*
|
|
27228
27205
|
* @private utility for host/domain matching
|
|
27229
27206
|
*/
|
|
27230
27207
|
function normalizeDomainForMatching(rawDomain) {
|
|
@@ -27247,6 +27224,7 @@
|
|
|
27247
27224
|
*
|
|
27248
27225
|
* @param value - Raw value to inspect.
|
|
27249
27226
|
* @returns True when the value starts with `http://` or `https://`.
|
|
27227
|
+
*
|
|
27250
27228
|
* @private utility for host/domain matching
|
|
27251
27229
|
*/
|
|
27252
27230
|
function hasHttpProtocol(value) {
|
|
@@ -27262,6 +27240,7 @@
|
|
|
27262
27240
|
*
|
|
27263
27241
|
* @param agentSource - Raw agent source.
|
|
27264
27242
|
* @returns Parsed prelude with shared line metadata.
|
|
27243
|
+
*
|
|
27265
27244
|
* @private internal utility of book agent-source parsing
|
|
27266
27245
|
*/
|
|
27267
27246
|
function parseAgentSourcePrelude(agentSource) {
|
|
@@ -27437,6 +27416,7 @@
|
|
|
27437
27416
|
*
|
|
27438
27417
|
* @param text - Text to extract parameters from
|
|
27439
27418
|
* @returns Array of parsed parameters with unified representation
|
|
27419
|
+
*
|
|
27440
27420
|
* @public exported from `@promptbook/core`
|
|
27441
27421
|
*/
|
|
27442
27422
|
function parseParameters(text) {
|
|
@@ -27865,9 +27845,7 @@
|
|
|
27865
27845
|
const trimmed = _spaceTrim.spaceTrim(content);
|
|
27866
27846
|
return normalizeDomainForMatching(trimmed) || trimmed.toLowerCase();
|
|
27867
27847
|
}
|
|
27868
|
-
|
|
27869
|
-
* TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
27870
|
-
*/
|
|
27848
|
+
// TODO: [🕛] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
|
|
27871
27849
|
|
|
27872
27850
|
/**
|
|
27873
27851
|
* Gets all tool titles provided by all commitments
|
|
@@ -27893,6 +27871,7 @@
|
|
|
27893
27871
|
* Restricts an Updatable to a (2) BehaviorSubject variant
|
|
27894
27872
|
*
|
|
27895
27873
|
* @see Updatable
|
|
27874
|
+
*
|
|
27896
27875
|
* @private internal utility <- TODO: [🧠] Maybe export from `@promptbook/types`
|
|
27897
27876
|
*/
|
|
27898
27877
|
function asUpdatableSubject(value) {
|
|
@@ -27917,9 +27896,7 @@
|
|
|
27917
27896
|
return new rxjs.BehaviorSubject(value);
|
|
27918
27897
|
}
|
|
27919
27898
|
}
|
|
27920
|
-
|
|
27921
|
-
* TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
|
|
27922
|
-
*/
|
|
27899
|
+
// TODO: [🧠] Maybe `BehaviorSubject` is too heavy for this use case, maybe just tuple `[value,setValue]` is enough
|
|
27923
27900
|
|
|
27924
27901
|
/**
|
|
27925
27902
|
* Creates an empty/basic agent model requirements object
|
|
@@ -27954,12 +27931,11 @@
|
|
|
27954
27931
|
systemMessage: `You are ${agentName || 'AI Agent'}`,
|
|
27955
27932
|
};
|
|
27956
27933
|
}
|
|
27957
|
-
|
|
27958
|
-
* TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
|
|
27959
|
-
*/
|
|
27934
|
+
// TODO: [🐤] Deduplicate `AgentModelRequirements` and `ModelRequirements` model requirements
|
|
27960
27935
|
|
|
27961
27936
|
/**
|
|
27962
27937
|
* Gets a commitment definition by its type
|
|
27938
|
+
*
|
|
27963
27939
|
* @param type The commitment type to look up
|
|
27964
27940
|
* @returns The commitment definition or null if not found
|
|
27965
27941
|
*
|
|
@@ -28338,7 +28314,9 @@
|
|
|
28338
28314
|
};
|
|
28339
28315
|
}
|
|
28340
28316
|
/**
|
|
28341
|
-
*
|
|
28317
|
+
* Attempts to upload inline knowledge entries, falling back to legacy data URLs when the upload fails or is not configured.
|
|
28318
|
+
*
|
|
28319
|
+
* @private
|
|
28342
28320
|
*/
|
|
28343
28321
|
async function applyPendingInlineKnowledgeSources(requirements, uploader) {
|
|
28344
28322
|
var _a;
|
|
@@ -28359,6 +28337,9 @@
|
|
|
28359
28337
|
_metadata: stripInlineKnowledgeMetadata(requirements._metadata),
|
|
28360
28338
|
};
|
|
28361
28339
|
}
|
|
28340
|
+
/**
|
|
28341
|
+
* Handles upload inline knowledge source with fallback.
|
|
28342
|
+
*/
|
|
28362
28343
|
async function uploadInlineKnowledgeSourceWithFallback(inlineSource, uploader) {
|
|
28363
28344
|
try {
|
|
28364
28345
|
return await uploader(inlineSource);
|
|
@@ -28371,6 +28352,9 @@
|
|
|
28371
28352
|
return inlineKnowledgeSourceToDataUrl(inlineSource);
|
|
28372
28353
|
}
|
|
28373
28354
|
}
|
|
28355
|
+
/**
|
|
28356
|
+
* Extracts inline knowledge sources.
|
|
28357
|
+
*/
|
|
28374
28358
|
function extractInlineKnowledgeSources(metadata) {
|
|
28375
28359
|
if (!metadata) {
|
|
28376
28360
|
return [];
|
|
@@ -28378,6 +28362,9 @@
|
|
|
28378
28362
|
const value = metadata.inlineKnowledgeSources;
|
|
28379
28363
|
return Array.isArray(value) ? value : [];
|
|
28380
28364
|
}
|
|
28365
|
+
/**
|
|
28366
|
+
* Strips inline knowledge metadata.
|
|
28367
|
+
*/
|
|
28381
28368
|
function stripInlineKnowledgeMetadata(metadata) {
|
|
28382
28369
|
if (!metadata || !Object.prototype.hasOwnProperty.call(metadata, 'inlineKnowledgeSources')) {
|
|
28383
28370
|
return metadata;
|
|
@@ -28428,6 +28415,7 @@
|
|
|
28428
28415
|
* @param availableModels - Models that could fulfill the agent.
|
|
28429
28416
|
* @param llmTools - Execution tools used when selecting a best model.
|
|
28430
28417
|
* @param options - Optional hooks such as the agent reference resolver.
|
|
28418
|
+
*
|
|
28431
28419
|
* @public exported from `@promptbook/core`
|
|
28432
28420
|
*/
|
|
28433
28421
|
async function createAgentModelRequirements(agentSource, modelName, availableModels, llmTools, options) {
|
|
@@ -28447,6 +28435,7 @@
|
|
|
28447
28435
|
* @param agentSource The agent source to derive persona description from
|
|
28448
28436
|
* @param llmTools LLM tools for preparing persona
|
|
28449
28437
|
* @returns The name of the best selected model
|
|
28438
|
+
*
|
|
28450
28439
|
* @private function of `createAgentModelRequirements`
|
|
28451
28440
|
*/
|
|
28452
28441
|
async function selectBestModelUsingPersona(agentSource, llmTools) {
|
|
@@ -28582,6 +28571,7 @@
|
|
|
28582
28571
|
*
|
|
28583
28572
|
* @param {unknown} rawAttachments - The raw attachments to normalize.
|
|
28584
28573
|
* @returns {Array<ChatAttachment>} The normalized attachments.
|
|
28574
|
+
*
|
|
28585
28575
|
* @public exported from `@promptbook/core`
|
|
28586
28576
|
*/
|
|
28587
28577
|
function normalizeChatAttachments(rawAttachments) {
|
|
@@ -28626,6 +28616,7 @@
|
|
|
28626
28616
|
*
|
|
28627
28617
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to format.
|
|
28628
28618
|
* @returns {string} The formatted context.
|
|
28619
|
+
*
|
|
28629
28620
|
* @public exported from `@promptbook/core`
|
|
28630
28621
|
*/
|
|
28631
28622
|
function formatChatAttachmentContext(attachments) {
|
|
@@ -28646,6 +28637,7 @@
|
|
|
28646
28637
|
* @param {number} maxBytes - Maximum number of bytes to capture.
|
|
28647
28638
|
* @param {{ captureOverflowByte?: boolean }} [options] - Optional capture behavior.
|
|
28648
28639
|
* @returns {Promise<{ bytes: Uint8Array }>} Captured bytes, optionally including one overflow byte.
|
|
28640
|
+
*
|
|
28649
28641
|
* @private internal utility for bounded response reads
|
|
28650
28642
|
*/
|
|
28651
28643
|
async function readResponseBytes(response, maxBytes, options = {}) {
|
|
@@ -28742,6 +28734,7 @@
|
|
|
28742
28734
|
* @param {number} maxInlineCharacters - Maximum number of characters to inline.
|
|
28743
28735
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
28744
28736
|
* @returns {Promise<ResolvedChatAttachmentContent>} The resolved content.
|
|
28737
|
+
*
|
|
28745
28738
|
* @private function of resolveChatAttachmentContents
|
|
28746
28739
|
*/
|
|
28747
28740
|
async function resolveChatAttachmentContent(attachment, maxInlineCharacters, options = {}) {
|
|
@@ -28833,6 +28826,7 @@
|
|
|
28833
28826
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to resolve.
|
|
28834
28827
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
28835
28828
|
* @returns {Promise<Array<ResolvedChatAttachmentContent>>} The resolved contents.
|
|
28829
|
+
*
|
|
28836
28830
|
* @public exported from `@promptbook/core`
|
|
28837
28831
|
*/
|
|
28838
28832
|
async function resolveChatAttachmentContents(attachments, options = {}) {
|
|
@@ -28898,6 +28892,7 @@
|
|
|
28898
28892
|
*
|
|
28899
28893
|
* @param {ReadonlyArray<ResolvedChatAttachmentContent>} resolvedContents - The resolved contents to format.
|
|
28900
28894
|
* @returns {string} The formatted context.
|
|
28895
|
+
*
|
|
28901
28896
|
* @public exported from `@promptbook/core`
|
|
28902
28897
|
*/
|
|
28903
28898
|
function formatChatAttachmentContentContext(resolvedContents) {
|
|
@@ -28938,6 +28933,7 @@
|
|
|
28938
28933
|
* @param {ReadonlyArray<ChatAttachment>} attachments - The attachments to append.
|
|
28939
28934
|
* @param {ResolveChatAttachmentOptions} options - Options for resolution.
|
|
28940
28935
|
* @returns {Promise<string>} The updated message content.
|
|
28936
|
+
*
|
|
28941
28937
|
* @public exported from `@promptbook/core`
|
|
28942
28938
|
*/
|
|
28943
28939
|
async function appendChatAttachmentContextWithContent(messageContent, attachments, options = {}) {
|
|
@@ -28966,9 +28962,7 @@
|
|
|
28966
28962
|
function humanizeAiTextEllipsis(aiText) {
|
|
28967
28963
|
return aiText.replace(/[…⋯]/g, '...').replace(/\.\s+\.\s+\./g, '...');
|
|
28968
28964
|
}
|
|
28969
|
-
|
|
28970
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
28971
|
-
*/
|
|
28965
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
28972
28966
|
|
|
28973
28967
|
/**
|
|
28974
28968
|
* Change dash-like characters to regular dashes `—` -> `-` and remove soft hyphens
|
|
@@ -28981,9 +28975,7 @@
|
|
|
28981
28975
|
function humanizeAiTextEmdashed(aiText) {
|
|
28982
28976
|
return aiText.replace(/\u00AD/g, '').replace(/[‐‑‒–—―−⁃﹣-]/g, '-');
|
|
28983
28977
|
}
|
|
28984
|
-
|
|
28985
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
28986
|
-
*/
|
|
28978
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
28987
28979
|
|
|
28988
28980
|
/**
|
|
28989
28981
|
* Change smart quotes to regular quotes
|
|
@@ -28996,9 +28988,7 @@
|
|
|
28996
28988
|
function humanizeAiTextQuotes(aiText) {
|
|
28997
28989
|
return aiText.replace(/[“”„‟«»❝❞〝〞〟"]/g, '"').replace(/[‚‘’‛‹›❛❜'ʼ]/g, "'");
|
|
28998
28990
|
}
|
|
28999
|
-
|
|
29000
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
29001
|
-
*/
|
|
28991
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
29002
28992
|
|
|
29003
28993
|
/**
|
|
29004
28994
|
* Remove bracketed source citation artifacts like `\u30105:1\u2020source\u3011`.
|
|
@@ -29011,9 +29001,7 @@
|
|
|
29011
29001
|
function humanizeAiTextSources(aiText) {
|
|
29012
29002
|
return aiText.replace(/[ \t]*\u3010\s*\d+(?:\s*:\s*\d+)?\s*\u2020source\s*\u3011/g, '');
|
|
29013
29003
|
}
|
|
29014
|
-
|
|
29015
|
-
* Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
29016
|
-
*/
|
|
29004
|
+
// Note: [??] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
29017
29005
|
|
|
29018
29006
|
/**
|
|
29019
29007
|
* Change unprintable hard spaces to regular spaces and drop zero-width spaces
|
|
@@ -29026,9 +29014,7 @@
|
|
|
29026
29014
|
function humanizeAiTextWhitespace(aiText) {
|
|
29027
29015
|
return aiText.replace(/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g, ' ').replace(/[\u200B\uFEFF\u2060]/g, '');
|
|
29028
29016
|
}
|
|
29029
|
-
|
|
29030
|
-
* Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
29031
|
-
*/
|
|
29017
|
+
// Note: [🏂] This function is not tested by itself but together with other cleanup functions with `humanizeAiText`
|
|
29032
29018
|
|
|
29033
29019
|
/**
|
|
29034
29020
|
* Function `humanizeAiText` will remove traces of AI text generation artifacts
|
|
@@ -29047,11 +29033,11 @@
|
|
|
29047
29033
|
cleanedText = humanizeAiTextWhitespace(cleanedText);
|
|
29048
29034
|
return cleanedText;
|
|
29049
29035
|
}
|
|
29050
|
-
|
|
29051
|
-
* TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
|
|
29052
|
-
*/
|
|
29036
|
+
// TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
|
|
29053
29037
|
|
|
29054
29038
|
/**
|
|
29039
|
+
* Map of promptbook pseudotoken substitution.
|
|
29040
|
+
*
|
|
29055
29041
|
* @private
|
|
29056
29042
|
*/
|
|
29057
29043
|
const PROMPTBOOK_PSEUDOTOKEN_SUBSTITUTION = {
|
|
@@ -29099,9 +29085,7 @@
|
|
|
29099
29085
|
}
|
|
29100
29086
|
return promptbookifiedTextTokens.join('');
|
|
29101
29087
|
}
|
|
29102
|
-
|
|
29103
|
-
* TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
29104
|
-
*/
|
|
29088
|
+
// TODO: [🧠][✌️] Make some Promptbook-native token system
|
|
29105
29089
|
|
|
29106
29090
|
/**
|
|
29107
29091
|
* Make UncertainNumber
|
|
@@ -29157,6 +29141,7 @@
|
|
|
29157
29141
|
*
|
|
29158
29142
|
* @see https://platform.openai.com/docs/models/
|
|
29159
29143
|
* @see https://openai.com/api/pricing/
|
|
29144
|
+
*
|
|
29160
29145
|
* @public exported from `@promptbook/openai`
|
|
29161
29146
|
*/
|
|
29162
29147
|
const OPENAI_MODELS = exportJson({
|
|
@@ -29833,6 +29818,7 @@
|
|
|
29833
29818
|
* @param rawResponse The raw response from OpenAI API
|
|
29834
29819
|
* @param duration The duration of the execution
|
|
29835
29820
|
* @throws {PipelineExecutionError} If the usage is not defined in the response from OpenAI
|
|
29821
|
+
*
|
|
29836
29822
|
* @private internal utility of `OpenAiExecutionTools`
|
|
29837
29823
|
*/
|
|
29838
29824
|
function computeOpenAiUsage(promptContent, // <- Note: Intentionally using [] to access type properties to bring jsdoc from Prompt/PromptResult to consumer
|
|
@@ -29875,15 +29861,14 @@
|
|
|
29875
29861
|
},
|
|
29876
29862
|
};
|
|
29877
29863
|
}
|
|
29878
|
-
|
|
29879
|
-
* TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
|
|
29880
|
-
*/
|
|
29864
|
+
// TODO: [🤝] DRY Maybe some common abstraction between `computeOpenAiUsage` and `computeAnthropicClaudeUsage`
|
|
29881
29865
|
|
|
29882
29866
|
/**
|
|
29883
29867
|
* Parses an OpenAI error message to identify which parameter is unsupported
|
|
29884
29868
|
*
|
|
29885
29869
|
* @param errorMessage The error message from OpenAI API
|
|
29886
29870
|
* @returns The parameter name that is unsupported, or null if not an unsupported parameter error
|
|
29871
|
+
*
|
|
29887
29872
|
* @private utility of LLM Tools
|
|
29888
29873
|
*/
|
|
29889
29874
|
function parseUnsupportedParameterError(errorMessage) {
|
|
@@ -29905,6 +29890,7 @@
|
|
|
29905
29890
|
* @param modelRequirements Original model requirements
|
|
29906
29891
|
* @param unsupportedParameter The parameter to remove
|
|
29907
29892
|
* @returns New model requirements without the unsupported parameter
|
|
29893
|
+
*
|
|
29908
29894
|
* @private utility of LLM Tools
|
|
29909
29895
|
*/
|
|
29910
29896
|
function removeUnsupportedModelRequirement(modelRequirements, unsupportedParameter) {
|
|
@@ -29924,8 +29910,10 @@
|
|
|
29924
29910
|
}
|
|
29925
29911
|
/**
|
|
29926
29912
|
* Checks if an error is an "Unsupported value" error from OpenAI
|
|
29913
|
+
*
|
|
29927
29914
|
* @param error The error to check
|
|
29928
29915
|
* @returns true if this is an unsupported parameter error
|
|
29916
|
+
*
|
|
29929
29917
|
* @private utility of LLM Tools
|
|
29930
29918
|
*/
|
|
29931
29919
|
function isUnsupportedParameterError(error) {
|
|
@@ -31031,13 +31019,11 @@
|
|
|
31031
31019
|
return false;
|
|
31032
31020
|
}
|
|
31033
31021
|
}
|
|
31034
|
-
|
|
31035
|
-
|
|
31036
|
-
|
|
31037
|
-
|
|
31038
|
-
|
|
31039
|
-
* TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
|
|
31040
|
-
*/
|
|
31022
|
+
// TODO: [🛄] Some way how to re-wrap the errors from `OpenAiCompatibleExecutionTools`
|
|
31023
|
+
// TODO: [🛄] Maybe make custom `OpenAiCompatibleError`
|
|
31024
|
+
// TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
31025
|
+
// TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
31026
|
+
// TODO: [🧠][🦢] Make reverse adapter from LlmExecutionTools to OpenAI-compatible:
|
|
31041
31027
|
|
|
31042
31028
|
/**
|
|
31043
31029
|
* Profile for OpenAI provider
|
|
@@ -31105,9 +31091,21 @@
|
|
|
31105
31091
|
}
|
|
31106
31092
|
}
|
|
31107
31093
|
|
|
31094
|
+
/**
|
|
31095
|
+
* Constant for default knowledge source download timeout ms.
|
|
31096
|
+
*/
|
|
31108
31097
|
const DEFAULT_KNOWLEDGE_SOURCE_DOWNLOAD_TIMEOUT_MS = 30000;
|
|
31098
|
+
/**
|
|
31099
|
+
* Constant for default knowledge source upload timeout ms.
|
|
31100
|
+
*/
|
|
31109
31101
|
const DEFAULT_KNOWLEDGE_SOURCE_UPLOAD_TIMEOUT_MS = 900000;
|
|
31102
|
+
/**
|
|
31103
|
+
* Constant for vector store progress log interval min ms.
|
|
31104
|
+
*/
|
|
31110
31105
|
const VECTOR_STORE_PROGRESS_LOG_INTERVAL_MIN_MS = 15000;
|
|
31106
|
+
/**
|
|
31107
|
+
* Constant for vector store stall log threshold ms.
|
|
31108
|
+
*/
|
|
31111
31109
|
const VECTOR_STORE_STALL_LOG_THRESHOLD_MS = 30000;
|
|
31112
31110
|
/**
|
|
31113
31111
|
* Base class for OpenAI execution tools that need hosted vector stores.
|
|
@@ -31874,6 +31872,9 @@
|
|
|
31874
31872
|
}
|
|
31875
31873
|
}
|
|
31876
31874
|
|
|
31875
|
+
/**
|
|
31876
|
+
* Constant for default agent kit model name.
|
|
31877
|
+
*/
|
|
31877
31878
|
const DEFAULT_AGENT_KIT_MODEL_NAME = 'gpt-5.4-nano';
|
|
31878
31879
|
/**
|
|
31879
31880
|
* Creates one structured log entry for streamed tool-call updates.
|
|
@@ -31917,6 +31918,9 @@
|
|
|
31917
31918
|
}
|
|
31918
31919
|
return 'COMPLETE';
|
|
31919
31920
|
}
|
|
31921
|
+
/**
|
|
31922
|
+
* Constant for default JSON schema name.
|
|
31923
|
+
*/
|
|
31920
31924
|
const DEFAULT_JSON_SCHEMA_NAME = 'StructuredOutput';
|
|
31921
31925
|
/**
|
|
31922
31926
|
* File extensions considered image inputs when MIME type is missing or generic.
|
|
@@ -32072,6 +32076,7 @@
|
|
|
32072
32076
|
*
|
|
32073
32077
|
* @param responseFormat - The OpenAI `response_format` payload from the user request.
|
|
32074
32078
|
* @returns An Agent output type compatible with the requested schema or `undefined` when no impact is required.
|
|
32079
|
+
*
|
|
32075
32080
|
* @private utility of Open AI
|
|
32076
32081
|
*/
|
|
32077
32082
|
function mapResponseFormatToAgentOutputType(responseFormat) {
|
|
@@ -32830,6 +32835,7 @@
|
|
|
32830
32835
|
* - `RemoteAgent` - which is an `Agent` that connects to a Promptbook Agents Server
|
|
32831
32836
|
*
|
|
32832
32837
|
* @deprecated Use `OpenAiAgentKitExecutionTools` instead.
|
|
32838
|
+
*
|
|
32833
32839
|
* @public exported from `@promptbook/openai`
|
|
32834
32840
|
*/
|
|
32835
32841
|
class OpenAiAssistantExecutionTools extends OpenAiVectorStoreHandler {
|
|
@@ -33521,14 +33527,12 @@
|
|
|
33521
33527
|
* @private const of `OpenAiAssistantExecutionTools`
|
|
33522
33528
|
*/
|
|
33523
33529
|
const DISCRIMINANT = 'OPEN_AI_ASSISTANT_V1';
|
|
33524
|
-
|
|
33525
|
-
|
|
33526
|
-
|
|
33527
|
-
|
|
33528
|
-
|
|
33529
|
-
|
|
33530
|
-
* TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
33531
|
-
*/
|
|
33530
|
+
// TODO: !!!!! [✨🥚] Knowledge should work both with and without scrapers
|
|
33531
|
+
// TODO: [🙎] In `OpenAiAssistantExecutionTools` Allow to create abstract assistants with `isCreatingNewAssistantsAllowed`
|
|
33532
|
+
// TODO: [🧠][🧙♂️] Maybe there can be some wizard for those who want to use just OpenAI
|
|
33533
|
+
// TODO: Maybe make custom OpenAiError
|
|
33534
|
+
// TODO: [🧠][🈁] Maybe use `isDeterministic` from options
|
|
33535
|
+
// TODO: [🧠][🌰] Allow to pass `title` for tracking purposes
|
|
33532
33536
|
|
|
33533
33537
|
/**
|
|
33534
33538
|
* Emits a progress update to signal assistant preparation before long setup work.
|
|
@@ -34005,10 +34009,8 @@
|
|
|
34005
34009
|
* Cache of OpenAI vector stores to avoid creating duplicates
|
|
34006
34010
|
*/
|
|
34007
34011
|
AgentLlmExecutionTools.vectorStoreCache = new Map();
|
|
34008
|
-
|
|
34009
|
-
|
|
34010
|
-
* TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
|
|
34011
|
-
*/
|
|
34012
|
+
// TODO: [🍚] Implement Destroyable pattern to free resources
|
|
34013
|
+
// TODO: [🧠] Adding parameter substitution support (here or should be responsibility of the underlying LLM Tools)
|
|
34012
34014
|
|
|
34013
34015
|
/**
|
|
34014
34016
|
* Extracts the teacher-focused instructions from the latest `OPEN` commitment in the book.
|
|
@@ -34018,6 +34020,7 @@
|
|
|
34018
34020
|
*
|
|
34019
34021
|
* @param agentSource - The raw agent book source
|
|
34020
34022
|
* @returns The trimmed instructions or `null` when no instructive `OPEN` commitment exists.
|
|
34023
|
+
*
|
|
34021
34024
|
* @private Internal helper shared between self-learning and related features.
|
|
34022
34025
|
*/
|
|
34023
34026
|
function extractOpenTeacherInstructions(agentSource) {
|
|
@@ -34225,6 +34228,7 @@
|
|
|
34225
34228
|
*
|
|
34226
34229
|
* @param section Raw fragment from self-learning workflow.
|
|
34227
34230
|
* @returns Trimmed fragment, or empty string when nothing remains.
|
|
34231
|
+
*
|
|
34228
34232
|
* @private function of Agent
|
|
34229
34233
|
*/
|
|
34230
34234
|
function normalizeBookSection(section) {
|
|
@@ -34236,6 +34240,7 @@
|
|
|
34236
34240
|
* @param agentSource Current source.
|
|
34237
34241
|
* @param normalizedSection Candidate fragment expected to be normalized first.
|
|
34238
34242
|
* @returns True when appending would duplicate an existing fragment.
|
|
34243
|
+
*
|
|
34239
34244
|
* @private function of Agent
|
|
34240
34245
|
*/
|
|
34241
34246
|
function containsNormalizedBookSection(agentSource, normalizedSection) {
|
|
@@ -34250,6 +34255,7 @@
|
|
|
34250
34255
|
*
|
|
34251
34256
|
* @param responseFormat Prompt response format requirements
|
|
34252
34257
|
* @returns True when JSON schema mode is active
|
|
34258
|
+
*
|
|
34253
34259
|
* @private function of Agent
|
|
34254
34260
|
*/
|
|
34255
34261
|
function isJsonSchemaResponseFormat(responseFormat) {
|
|
@@ -34261,6 +34267,7 @@
|
|
|
34261
34267
|
* @param content Original agent answer content
|
|
34262
34268
|
* @param isJsonMode Whether the interaction requested JSON schema output
|
|
34263
34269
|
* @returns Agent answer, wrapped in a formatted JSON code block when possible
|
|
34270
|
+
*
|
|
34264
34271
|
* @private function of Agent
|
|
34265
34272
|
*/
|
|
34266
34273
|
function formatAgentMessageForJsonMode(content, isJsonMode) {
|
|
@@ -34286,6 +34293,7 @@
|
|
|
34286
34293
|
*
|
|
34287
34294
|
* @param content Text to parse as JSON
|
|
34288
34295
|
* @returns Parsed JSON value or null when parsing fails
|
|
34296
|
+
*
|
|
34289
34297
|
* @private function of Agent
|
|
34290
34298
|
*/
|
|
34291
34299
|
function tryParseJson(content) {
|
|
@@ -34301,6 +34309,7 @@
|
|
|
34301
34309
|
*
|
|
34302
34310
|
* @param options - Normalized sample parts.
|
|
34303
34311
|
* @returns Book-language sample section ready to append into agent source.
|
|
34312
|
+
*
|
|
34304
34313
|
* @private function of Agent
|
|
34305
34314
|
*/
|
|
34306
34315
|
function formatSelfLearningSample(options) {
|
|
@@ -34322,6 +34331,7 @@
|
|
|
34322
34331
|
*
|
|
34323
34332
|
* @param internalMessage Internal trace payload.
|
|
34324
34333
|
* @returns Book-language INTERNAL MESSAGE block.
|
|
34334
|
+
*
|
|
34325
34335
|
* @private function of Agent
|
|
34326
34336
|
*/
|
|
34327
34337
|
function formatInternalLearningMessage(internalMessage) {
|
|
@@ -34335,6 +34345,7 @@
|
|
|
34335
34345
|
*
|
|
34336
34346
|
* @param result Final chat result used in self-learning.
|
|
34337
34347
|
* @returns Internal payloads that capture request/response/tool-call context.
|
|
34348
|
+
*
|
|
34338
34349
|
* @private function of Agent
|
|
34339
34350
|
*/
|
|
34340
34351
|
function buildInternalLearningMessages(result) {
|
|
@@ -34364,6 +34375,7 @@
|
|
|
34364
34375
|
*
|
|
34365
34376
|
* @param toolCall Tool call produced during execution.
|
|
34366
34377
|
* @returns Sanitized and serializable tool-call payload.
|
|
34378
|
+
*
|
|
34367
34379
|
* @private function of Agent
|
|
34368
34380
|
*/
|
|
34369
34381
|
function sanitizeToolCallForLearning(toolCall) {
|
|
@@ -34383,6 +34395,7 @@
|
|
|
34383
34395
|
*
|
|
34384
34396
|
* @param payload Internal payload to serialize.
|
|
34385
34397
|
* @returns Pretty JSON string that can be embedded in BOOK.
|
|
34398
|
+
*
|
|
34386
34399
|
* @private function of Agent
|
|
34387
34400
|
*/
|
|
34388
34401
|
function stringifyInternalLearningPayload(payload) {
|
|
@@ -34432,6 +34445,7 @@
|
|
|
34432
34445
|
* Normalizes teacher commitments into trimmed, display-ready lines.
|
|
34433
34446
|
*
|
|
34434
34447
|
* @param commitments Raw teacher output
|
|
34448
|
+
*
|
|
34435
34449
|
* @private function of Agent
|
|
34436
34450
|
*/
|
|
34437
34451
|
function getTeacherCommitmentLines(commitments) {
|
|
@@ -34444,6 +34458,7 @@
|
|
|
34444
34458
|
* Summarizes teacher commitment lines into user-friendly counts for self-learning.
|
|
34445
34459
|
*
|
|
34446
34460
|
* @param lines Parsed teacher commitment lines
|
|
34461
|
+
*
|
|
34447
34462
|
* @private function of Agent
|
|
34448
34463
|
*/
|
|
34449
34464
|
function summarizeTeacherCommitmentLines(lines) {
|
|
@@ -34476,6 +34491,7 @@
|
|
|
34476
34491
|
* @param commitments Raw teacher commitments
|
|
34477
34492
|
* @param used Whether the teacher was invoked
|
|
34478
34493
|
* @returns Summary of learned commitments
|
|
34494
|
+
*
|
|
34479
34495
|
* @private function of Agent
|
|
34480
34496
|
*/
|
|
34481
34497
|
function buildTeacherSummary(commitments, used) {
|
|
@@ -34712,9 +34728,7 @@
|
|
|
34712
34728
|
return finalResult;
|
|
34713
34729
|
}
|
|
34714
34730
|
}
|
|
34715
|
-
|
|
34716
|
-
* TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
34717
|
-
*/
|
|
34731
|
+
// TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
34718
34732
|
|
|
34719
34733
|
/**
|
|
34720
34734
|
* Parses one failed remote agent response into a structured error.
|
|
@@ -35180,10 +35194,8 @@
|
|
|
35180
35194
|
return agentResult;
|
|
35181
35195
|
}
|
|
35182
35196
|
}
|
|
35183
|
-
|
|
35184
|
-
|
|
35185
|
-
* TODO: !!! Agent on remote server
|
|
35186
|
-
*/
|
|
35197
|
+
// TODO: [🧠][😰]Agent is not working with the parameters, should it be?
|
|
35198
|
+
// TODO: !!! Agent on remote server
|
|
35187
35199
|
|
|
35188
35200
|
var RemoteAgent$1 = /*#__PURE__*/Object.freeze({
|
|
35189
35201
|
__proto__: null,
|