@promptbook/javascript 0.103.0-9 → 0.103.0
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 +59 -39
- package/esm/index.es.js +138 -124
- package/esm/index.es.js.map +1 -1
- package/esm/typings/books/index.d.ts +0 -81
- package/esm/typings/servers.d.ts +9 -7
- package/esm/typings/src/_packages/browser.index.d.ts +6 -0
- package/esm/typings/src/_packages/cli.index.d.ts +4 -0
- package/esm/typings/src/_packages/components.index.d.ts +22 -8
- package/esm/typings/src/_packages/core.index.d.ts +58 -18
- package/esm/typings/src/_packages/node.index.d.ts +2 -2
- package/esm/typings/src/_packages/remote-server.index.d.ts +2 -0
- package/esm/typings/src/_packages/types.index.d.ts +70 -8
- package/esm/typings/src/_packages/utils.index.d.ts +6 -0
- package/esm/typings/src/_packages/wizard.index.d.ts +4 -0
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +20 -5
- package/esm/typings/src/book-2.0/agent-source/AgentModelRequirements.d.ts +17 -1
- package/esm/typings/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +3 -2
- package/esm/typings/src/book-2.0/agent-source/computeAgentHash.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +3 -3
- package/esm/typings/src/book-2.0/agent-source/createDefaultAgentName.d.ts +8 -0
- package/esm/typings/src/book-2.0/agent-source/normalizeAgentName.d.ts +9 -0
- package/esm/typings/src/book-2.0/agent-source/padBook.d.ts +18 -0
- package/esm/typings/src/book-2.0/agent-source/parseAgentSourceWithCommitments.d.ts +1 -1
- package/esm/typings/src/book-2.0/agent-source/string_book.d.ts +3 -0
- package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/AvatarProfile.d.ts +6 -1
- package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +85 -14
- package/esm/typings/src/book-components/BookEditor/BookEditorActionbar.d.ts +18 -0
- package/esm/typings/src/book-components/BookEditor/BookEditorMonaco.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +17 -0
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChatProps.d.ts +13 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +16 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +15 -0
- package/esm/typings/src/book-components/Chat/MockedChat/MockedChat.d.ts +5 -0
- package/esm/typings/src/book-components/Chat/save/_common/ChatSaveFormatDefinition.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/save/html/htmlSaveFormatDefinition.d.ts +1 -0
- package/esm/typings/src/book-components/Chat/save/pdf/pdfSaveFormatDefinition.d.ts +4 -0
- package/esm/typings/src/book-components/Chat/types/ChatParticipant.d.ts +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/Qr/BrandedQrCode.d.ts +18 -0
- package/esm/typings/src/book-components/Qr/GenericQrCode.d.ts +10 -0
- package/esm/typings/src/book-components/Qr/PromptbookQrCode.d.ts +18 -0
- package/esm/typings/src/book-components/Qr/useQrCode.d.ts +15 -0
- package/esm/typings/src/book-components/_common/Dropdown/Dropdown.d.ts +15 -0
- package/esm/typings/src/book-components/_common/HamburgerMenu/HamburgerMenu.d.ts +12 -0
- package/esm/typings/src/book-components/_common/Modal/Modal.d.ts +2 -2
- package/esm/typings/src/book-components/_common/Tooltip/Tooltip.d.ts +47 -0
- package/esm/typings/src/book-components/icons/AboutIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/CameraIcon.d.ts +11 -0
- package/esm/typings/src/book-components/icons/CloseIcon.d.ts +4 -8
- package/esm/typings/src/book-components/icons/DownloadIcon.d.ts +9 -0
- package/esm/typings/src/book-components/icons/ExitFullscreenIcon.d.ts +7 -0
- package/esm/typings/src/book-components/icons/FullscreenIcon.d.ts +7 -0
- package/esm/typings/src/book-components/icons/MenuIcon.d.ts +12 -0
- package/esm/typings/src/book-components/icons/MicIcon.d.ts +8 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/cli/cli-commands/_boilerplate.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/about.d.ts +3 -1
- package/esm/typings/src/cli/cli-commands/hello.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/list-scrapers.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/login.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/make.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/run.d.ts +2 -1
- package/esm/typings/src/cli/cli-commands/{start-server.d.ts → start-agents-server.d.ts} +3 -2
- package/esm/typings/src/cli/cli-commands/start-pipelines-server.d.ts +15 -0
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +2 -1
- package/esm/typings/src/cli/common/$addGlobalOptionsToCommand.d.ts +2 -1
- package/esm/typings/src/collection/agent-collection/AgentCollection.d.ts +12 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +75 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabaseOptions.d.ts +10 -0
- package/esm/typings/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentsDatabaseSchema.d.ts +154 -0
- package/esm/typings/src/collection/{PipelineCollection.d.ts → pipeline-collection/PipelineCollection.d.ts} +7 -3
- package/esm/typings/src/collection/{SimplePipelineCollection.d.ts → pipeline-collection/SimplePipelineCollection.d.ts} +5 -5
- package/esm/typings/src/collection/{constructors/createCollectionFromDirectory.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.d.ts} +8 -11
- package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromJson.d.ts +13 -0
- package/esm/typings/src/collection/{constructors/createCollectionFromPromise.d.ts → pipeline-collection/constructors/createPipelineCollectionFromPromise.d.ts} +6 -5
- package/esm/typings/src/collection/pipeline-collection/constructors/createPipelineCollectionFromPromise.test.d.ts +1 -0
- package/esm/typings/src/collection/{constructors/createCollectionFromUrl.d.ts → pipeline-collection/constructors/createPipelineCollectionFromUrl.d.ts} +3 -3
- package/esm/typings/src/collection/{constructors/createSubcollection.d.ts → pipeline-collection/constructors/createPipelineSubcollection.d.ts} +3 -3
- package/esm/typings/src/collection/pipeline-collection/pipelineCollectionToJson.d.ts +13 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -5
- package/esm/typings/src/{book-2.0/commitments → commitments}/ACTION/ACTION.d.ts +5 -1
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +39 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/COMPONENT/COMPONENT.d.ts +28 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/DELETE/DELETE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/FORMAT/FORMAT.d.ts +5 -1
- package/esm/typings/src/commitments/FROM/FROM.d.ts +34 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/GOAL/GOAL.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/KNOWLEDGE/KNOWLEDGE.d.ts +5 -5
- package/esm/typings/src/commitments/LANGUAGE/LANGUAGE.d.ts +35 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/MEMORY/MEMORY.d.ts +5 -1
- package/esm/typings/src/commitments/MESSAGE/AgentMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/commitments/MESSAGE/InitialMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/MESSAGE/MESSAGE.d.ts +5 -1
- package/esm/typings/src/commitments/MESSAGE/UserMessageCommitmentDefinition.d.ts +32 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/META/META.d.ts +5 -1
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +48 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_IMAGE/META_IMAGE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/META_LINK/META_LINK.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/MODEL/MODEL.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/NOTE/NOTE.d.ts +5 -1
- package/esm/typings/src/commitments/OPEN/OPEN.d.ts +35 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/PERSONA/PERSONA.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/RULE/RULE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SAMPLE/SAMPLE.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/SCENARIO/SCENARIO.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/STYLE/STYLE.d.ts +5 -1
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/USE_MCP/USE_MCP.d.ts +37 -0
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BaseCommitmentDefinition.d.ts +14 -2
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/CommitmentDefinition.d.ts +6 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/NotYetImplementedCommitmentDefinition.d.ts +5 -1
- package/esm/typings/src/{book-2.0/commitments → commitments}/_base/createEmptyAgentModelRequirements.d.ts +1 -1
- package/esm/typings/src/commitments/index.d.ts +93 -0
- package/esm/typings/src/config.d.ts +24 -3
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +2 -0
- package/esm/typings/src/errors/0-index.d.ts +6 -0
- package/esm/typings/src/errors/DatabaseError.d.ts +12 -0
- package/esm/typings/src/errors/NotAllowed.d.ts +9 -0
- package/esm/typings/src/errors/WrappedError.d.ts +2 -2
- package/esm/typings/src/execution/AvailableModel.d.ts +1 -0
- package/esm/typings/src/execution/Executables.d.ts +3 -0
- package/esm/typings/src/execution/ExecutionTask.d.ts +12 -3
- package/esm/typings/src/execution/ExecutionTools.d.ts +5 -0
- package/esm/typings/src/execution/FilesystemTools.d.ts +1 -1
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +26 -2
- package/esm/typings/src/execution/PromptResult.d.ts +7 -1
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +5 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +5 -0
- package/esm/typings/src/execution/utils/usage-constants.d.ts +4 -124
- package/esm/typings/src/execution/utils/validatePromptResult.d.ts +2 -0
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +2 -2
- package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +2 -1
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/assertUniqueModels.d.ts +12 -0
- package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +72 -0
- package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +26 -4
- package/esm/typings/src/llm-providers/agent/AgentOptions.d.ts +19 -0
- package/esm/typings/src/llm-providers/agent/CreateAgentLlmExecutionToolsOptions.d.ts +17 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgent.d.ts +50 -0
- package/esm/typings/src/llm-providers/agent/RemoteAgentOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +1 -19
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/google/google-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/ollama/OllamaExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +60 -2
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +7 -1
- package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +13 -1
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/createOpenAiCompatibleExecutionTools.d.ts +6 -6
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.test.d.ts +4 -0
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/pipeline/validatePipelineString.d.ts +2 -0
- package/esm/typings/src/playground/permanent/_boilerplate.d.ts +5 -0
- package/esm/typings/src/playground/permanent/agent-with-browser-playground.d.ts +5 -0
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +1 -0
- package/esm/typings/src/remote-server/startAgentServer.d.ts +26 -0
- package/esm/typings/src/remote-server/startRemoteServer.d.ts +4 -1
- package/esm/typings/src/remote-server/types/RemoteServerOptions.d.ts +3 -8
- package/esm/typings/src/scrapers/_boilerplate/createBoilerplateScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/_boilerplate/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/markitdown/createMarkitdownScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/markitdown/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +1 -9
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +1 -12
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +1 -9
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +1 -0
- package/esm/typings/src/storage/env-storage/$EnvStorage.d.ts +2 -1
- package/esm/typings/src/transpilers/_common/BookTranspiler.d.ts +33 -0
- package/esm/typings/src/transpilers/_common/BookTranspilerOptions.d.ts +18 -0
- package/esm/typings/src/transpilers/_common/register/$bookTranspilersRegister.d.ts +15 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/FormattedBookInMarkdownTranspiler.d.ts +16 -0
- package/esm/typings/src/transpilers/formatted-book-in-markdown/register.d.ts +15 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.d.ts +16 -0
- package/esm/typings/src/transpilers/openai-sdk/OpenAiSdkTranspiler.test.d.ts +1 -0
- package/esm/typings/src/transpilers/openai-sdk/playground/playground.d.ts +5 -0
- package/esm/typings/src/transpilers/openai-sdk/register.d.ts +15 -0
- package/esm/typings/src/types/LlmCall.d.ts +20 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +13 -1
- package/esm/typings/src/types/ModelVariant.d.ts +1 -1
- package/esm/typings/src/types/Prompt.d.ts +13 -1
- package/esm/typings/src/types/Updatable.d.ts +19 -0
- package/esm/typings/src/types/typeAliases.d.ts +38 -2
- package/esm/typings/src/utils/color/$randomColor.d.ts +1 -0
- package/esm/typings/src/utils/color/Color.d.ts +16 -1
- package/esm/typings/src/utils/color/Color.test.d.ts +1 -0
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/utils/color/internal-utils/checkChannelValue.d.ts +0 -3
- package/esm/typings/src/utils/color/operators/darken.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/grayscale.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/lighten.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/mixWithColor.d.ts +1 -1
- package/esm/typings/src/utils/color/operators/saturate.d.ts +1 -1
- package/esm/typings/src/utils/environment/$detectRuntimeEnvironment.d.ts +16 -0
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +2 -2
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +2 -1
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +2 -1
- package/esm/typings/src/utils/files/$induceBookDownload.d.ts +13 -0
- package/esm/typings/src/utils/files/$induceFileDownload.d.ts +13 -0
- package/esm/typings/src/utils/files/ObjectUrl.d.ts +46 -0
- package/esm/typings/src/utils/files/listAllFiles.d.ts +2 -3
- package/esm/typings/src/utils/misc/aboutPromptbookInformation.d.ts +27 -0
- package/esm/typings/src/utils/misc/computeHash.d.ts +11 -0
- package/esm/typings/src/utils/misc/computeHash.test.d.ts +1 -0
- package/esm/typings/src/utils/misc/injectCssModuleIntoShadowRoot.d.ts +1 -0
- package/esm/typings/src/utils/misc/xAboutPromptbookInformation.d.ts +13 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +2 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.d.ts +9 -0
- package/esm/typings/src/utils/normalization/normalizeMessageText.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +3 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +2 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +2 -0
- package/esm/typings/src/utils/organization/$sideEffect.d.ts +2 -2
- package/esm/typings/src/utils/organization/$side_effect.d.ts +7 -0
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +2 -2
- package/esm/typings/src/utils/organization/keepUnused.d.ts +2 -2
- package/esm/typings/src/utils/organization/preserve.d.ts +3 -3
- package/esm/typings/src/utils/organization/really_any.d.ts +7 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +31 -0
- package/esm/typings/src/utils/random/$randomAgentPersona.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomFullnameWithColor.d.ts +13 -0
- package/esm/typings/src/utils/random/$randomItem.d.ts +9 -0
- package/esm/typings/src/utils/random/$randomSeed.d.ts +3 -0
- package/esm/typings/src/utils/random/$randomToken.d.ts +2 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +2 -1
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +2 -2
- package/esm/typings/src/utils/serialization/serializeToPromptbookJavascript.d.ts +2 -2
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +2 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/esm/typings/src/wizard/$getCompiledBook.d.ts +1 -2
- package/package.json +5 -5
- package/umd/index.umd.js +135 -123
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-2.0/commitments/index.d.ts +0 -60
- package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +0 -5
- package/esm/typings/src/book-components/BookEditor/BookEditorWrapper.d.ts +0 -9
- package/esm/typings/src/book-components/BookEditor/config.d.ts +0 -10
- package/esm/typings/src/book-components/Chat/utils/renderMarkdown.d.ts +0 -21
- package/esm/typings/src/collection/collectionToJson.d.ts +0 -13
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +0 -13
- /package/esm/typings/src/{book-components/Chat/utils/renderMarkdown.test.d.ts → book-2.0/agent-source/computeAgentHash.test.d.ts} +0 -0
- /package/esm/typings/src/{collection/constructors/createCollectionFromDirectory.test.d.ts → book-2.0/agent-source/normalizeAgentName.test.d.ts} +0 -0
- /package/esm/typings/src/{collection/constructors/createCollectionFromJson.test.d.ts → book-components/Chat/AgentChat/AgentChat.test.d.ts} +0 -0
- /package/esm/typings/src/collection/{constructors/createCollectionFromPromise.test.d.ts → pipeline-collection/constructors/createPipelineCollectionFromDirectory.test.d.ts} +0 -0
- /package/esm/typings/src/{commands/_common/parseCommand.test.d.ts → collection/pipeline-collection/constructors/createPipelineCollectionFromJson.test.d.ts} +0 -0
- /package/esm/typings/src/collection/{collectionToJson.test.d.ts → pipeline-collection/pipelineCollectionToJson.test.d.ts} +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/BookCommitment.d.ts +0 -0
- /package/esm/typings/src/{book-2.0/commitments → commitments}/_base/ParsedCommitment.d.ts +0 -0
package/umd/index.umd.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('path'), require('crypto')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', 'path', 'crypto'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-javascript"] = {}, global.spaceTrim, null, global.crypto));
|
|
5
|
-
})(this, (function (exports, spaceTrim, path, crypto) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('spacetrim'), require('path'), require('crypto'), require('crypto-js'), require('crypto-js/enc-hex')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'spacetrim', 'path', 'crypto', 'crypto-js', 'crypto-js/enc-hex'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["promptbook-javascript"] = {}, global.spaceTrim$1, null, global.crypto));
|
|
5
|
+
})(this, (function (exports, spaceTrim$1, path, crypto) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim);
|
|
9
|
+
var spaceTrim__default = /*#__PURE__*/_interopDefaultLegacy(spaceTrim$1);
|
|
10
10
|
|
|
11
11
|
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
12
12
|
/**
|
|
@@ -15,19 +15,30 @@
|
|
|
15
15
|
* @generated
|
|
16
16
|
* @see https://github.com/webgptorg/book
|
|
17
17
|
*/
|
|
18
|
-
const BOOK_LANGUAGE_VERSION = '
|
|
18
|
+
const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
19
19
|
/**
|
|
20
20
|
* The version of the Promptbook engine
|
|
21
21
|
*
|
|
22
22
|
* @generated
|
|
23
23
|
* @see https://github.com/webgptorg/promptbook
|
|
24
24
|
*/
|
|
25
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.103.0
|
|
25
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.103.0';
|
|
26
26
|
/**
|
|
27
27
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
28
28
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Trims string from all 4 sides
|
|
33
|
+
*
|
|
34
|
+
* Note: This is a re-exported function from the `spacetrim` package which is
|
|
35
|
+
* Developed by same author @hejny as this package
|
|
36
|
+
*
|
|
37
|
+
* @public exported from `@promptbook/utils`
|
|
38
|
+
* @see https://github.com/hejny/spacetrim#usage
|
|
39
|
+
*/
|
|
40
|
+
const spaceTrim = spaceTrim$1.spaceTrim;
|
|
41
|
+
|
|
31
42
|
/**
|
|
32
43
|
* @private util of `@promptbook/color`
|
|
33
44
|
* @de
|
|
@@ -76,6 +87,7 @@
|
|
|
76
87
|
* @public exported from `@promptbook/color`
|
|
77
88
|
*/
|
|
78
89
|
const CSS_COLORS = {
|
|
90
|
+
promptbook: '#79EAFD',
|
|
79
91
|
transparent: 'rgba(0,0,0,0)',
|
|
80
92
|
aliceblue: '#f0f8ff',
|
|
81
93
|
antiquewhite: '#faebd7',
|
|
@@ -257,9 +269,6 @@
|
|
|
257
269
|
throw new Error(`${channelName} channel is greater than 255, it is ${value}`);
|
|
258
270
|
}
|
|
259
271
|
}
|
|
260
|
-
/**
|
|
261
|
-
* TODO: [🧠][🚓] Is/which combination it better to use asserts/check, validate or is utility function?
|
|
262
|
-
*/
|
|
263
272
|
|
|
264
273
|
/**
|
|
265
274
|
* Color object represents an RGB color with alpha channel
|
|
@@ -279,21 +288,61 @@
|
|
|
279
288
|
* @param color
|
|
280
289
|
* @returns Color object
|
|
281
290
|
*/
|
|
282
|
-
static from(color) {
|
|
283
|
-
if (color
|
|
291
|
+
static from(color, _isSingleValue = false) {
|
|
292
|
+
if (color === '') {
|
|
293
|
+
throw new Error(`Can not create color from empty string`);
|
|
294
|
+
}
|
|
295
|
+
else if (color instanceof Color) {
|
|
284
296
|
return take(color);
|
|
285
297
|
}
|
|
286
298
|
else if (Color.isColor(color)) {
|
|
287
299
|
return take(color);
|
|
288
300
|
}
|
|
289
301
|
else if (typeof color === 'string') {
|
|
290
|
-
|
|
302
|
+
try {
|
|
303
|
+
return Color.fromString(color);
|
|
304
|
+
}
|
|
305
|
+
catch (error) {
|
|
306
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
307
|
+
if (_isSingleValue) {
|
|
308
|
+
throw error;
|
|
309
|
+
}
|
|
310
|
+
const parts = color.split(/[\s+,;|]/);
|
|
311
|
+
if (parts.length > 0) {
|
|
312
|
+
return Color.from(parts[0].trim(), true);
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
throw new Error(`Can not create color from given string "${color}"`);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
291
318
|
}
|
|
292
319
|
else {
|
|
293
320
|
console.error({ color });
|
|
294
321
|
throw new Error(`Can not create color from given object`);
|
|
295
322
|
}
|
|
296
323
|
}
|
|
324
|
+
/**
|
|
325
|
+
* Creates a new Color instance from miscellaneous formats
|
|
326
|
+
* It just does not throw error when it fails, it returns PROMPTBOOK_COLOR instead
|
|
327
|
+
*
|
|
328
|
+
* @param color
|
|
329
|
+
* @returns Color object
|
|
330
|
+
*/
|
|
331
|
+
static fromSafe(color) {
|
|
332
|
+
try {
|
|
333
|
+
return Color.from(color);
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
// <- Note: Can not use `assertsError(error)` here because it causes circular dependency
|
|
337
|
+
console.warn(spaceTrim((block) => `
|
|
338
|
+
Color.fromSafe error:
|
|
339
|
+
${block(error.message)}
|
|
340
|
+
|
|
341
|
+
Returning default PROMPTBOOK_COLOR.
|
|
342
|
+
`));
|
|
343
|
+
return Color.fromString('promptbook');
|
|
344
|
+
}
|
|
345
|
+
}
|
|
297
346
|
/**
|
|
298
347
|
* Creates a new Color instance from miscellaneous string formats
|
|
299
348
|
*
|
|
@@ -361,6 +410,9 @@
|
|
|
361
410
|
if (hex.length === 3) {
|
|
362
411
|
return Color.fromHex3(hex);
|
|
363
412
|
}
|
|
413
|
+
if (hex.length === 4) {
|
|
414
|
+
return Color.fromHex4(hex);
|
|
415
|
+
}
|
|
364
416
|
if (hex.length === 6) {
|
|
365
417
|
return Color.fromHex6(hex);
|
|
366
418
|
}
|
|
@@ -381,6 +433,19 @@
|
|
|
381
433
|
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
382
434
|
return take(new Color(r, g, b));
|
|
383
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Creates a new Color instance from color in hex format with 4 digits (with alpha channel)
|
|
438
|
+
*
|
|
439
|
+
* @param color in hex for example `09df`
|
|
440
|
+
* @returns Color object
|
|
441
|
+
*/
|
|
442
|
+
static fromHex4(hex) {
|
|
443
|
+
const r = parseInt(hex.substr(0, 1), 16) * 16;
|
|
444
|
+
const g = parseInt(hex.substr(1, 1), 16) * 16;
|
|
445
|
+
const b = parseInt(hex.substr(2, 1), 16) * 16;
|
|
446
|
+
const a = parseInt(hex.substr(3, 1), 16) * 16;
|
|
447
|
+
return take(new Color(r, g, b, a));
|
|
448
|
+
}
|
|
384
449
|
/**
|
|
385
450
|
* Creates a new Color instance from color in hex format with 6 color digits (without alpha channel)
|
|
386
451
|
*
|
|
@@ -571,7 +636,8 @@
|
|
|
571
636
|
* @returns true if the value is a valid hex color string (e.g., `#009edd`, `#fff`, etc.)
|
|
572
637
|
*/
|
|
573
638
|
static isHexColorString(value) {
|
|
574
|
-
return typeof value === 'string' &&
|
|
639
|
+
return (typeof value === 'string' &&
|
|
640
|
+
/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(value));
|
|
575
641
|
}
|
|
576
642
|
/**
|
|
577
643
|
* Creates new Color object
|
|
@@ -686,6 +752,23 @@
|
|
|
686
752
|
* TODO: Maybe connect with textures
|
|
687
753
|
*/
|
|
688
754
|
|
|
755
|
+
/**
|
|
756
|
+
* Makes color transformer which returns a grayscale version of the color
|
|
757
|
+
*
|
|
758
|
+
* @param amount from 0 to 1
|
|
759
|
+
*
|
|
760
|
+
* @public exported from `@promptbook/color`
|
|
761
|
+
*/
|
|
762
|
+
function grayscale(amount) {
|
|
763
|
+
return ({ red, green, blue, alpha }) => {
|
|
764
|
+
const average = (red + green + blue) / 3;
|
|
765
|
+
red = Math.round(average * amount + red * (1 - amount));
|
|
766
|
+
green = Math.round(average * amount + green * (1 - amount));
|
|
767
|
+
blue = Math.round(average * amount + blue * (1 - amount));
|
|
768
|
+
return Color.fromValues(red, green, blue, alpha);
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
|
|
689
772
|
/**
|
|
690
773
|
* Converts HSL values to RGB values
|
|
691
774
|
*
|
|
@@ -801,102 +884,6 @@
|
|
|
801
884
|
* TODO: Maybe implement by mix+hsl
|
|
802
885
|
*/
|
|
803
886
|
|
|
804
|
-
/**
|
|
805
|
-
* Calculates distance between two colors
|
|
806
|
-
*
|
|
807
|
-
* @param color1 first color
|
|
808
|
-
* @param color2 second color
|
|
809
|
-
*
|
|
810
|
-
* Note: This function is inefficient. Use colorDistanceSquared instead if possible.
|
|
811
|
-
*
|
|
812
|
-
* @public exported from `@promptbook/color`
|
|
813
|
-
*/
|
|
814
|
-
/**
|
|
815
|
-
* Calculates distance between two colors without square root
|
|
816
|
-
*
|
|
817
|
-
* @param color1 first color
|
|
818
|
-
* @param color2 second color
|
|
819
|
-
*
|
|
820
|
-
* @public exported from `@promptbook/color`
|
|
821
|
-
*/
|
|
822
|
-
function colorDistanceSquared(color1, color2) {
|
|
823
|
-
const rmean = (color1.red + color2.red) / 2;
|
|
824
|
-
const r = color1.red - color2.red;
|
|
825
|
-
const g = color1.green - color2.green;
|
|
826
|
-
const b = color1.blue - color2.blue;
|
|
827
|
-
const weightR = 2 + rmean / 256;
|
|
828
|
-
const weightG = 4.0;
|
|
829
|
-
const weightB = 2 + (255 - rmean) / 256;
|
|
830
|
-
const distance = weightR * r * r + weightG * g * g + weightB * b * b;
|
|
831
|
-
return distance;
|
|
832
|
-
}
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Makes color transformer which finds the nearest color from the given list
|
|
836
|
-
*
|
|
837
|
-
* @param colors array of colors to choose from
|
|
838
|
-
*
|
|
839
|
-
* @public exported from `@promptbook/color`
|
|
840
|
-
*/
|
|
841
|
-
function nearest(...colors) {
|
|
842
|
-
return (color) => {
|
|
843
|
-
const distances = colors.map((c) => colorDistanceSquared(c, color));
|
|
844
|
-
const minDistance = Math.min(...distances);
|
|
845
|
-
const minIndex = distances.indexOf(minDistance);
|
|
846
|
-
const nearestColor = colors[minIndex];
|
|
847
|
-
return nearestColor;
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
* Color transformer which returns the negative color
|
|
853
|
-
*
|
|
854
|
-
* @public exported from `@promptbook/color`
|
|
855
|
-
*/
|
|
856
|
-
function negative(color) {
|
|
857
|
-
const r = 255 - color.red;
|
|
858
|
-
const g = 255 - color.green;
|
|
859
|
-
const b = 255 - color.blue;
|
|
860
|
-
return Color.fromValues(r, g, b, color.alpha);
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
/**
|
|
864
|
-
* Makes color transformer which finds the furthest color from the given list
|
|
865
|
-
*
|
|
866
|
-
* @param colors array of colors to choose from
|
|
867
|
-
*
|
|
868
|
-
* @public exported from `@promptbook/color`
|
|
869
|
-
*/
|
|
870
|
-
function furthest(...colors) {
|
|
871
|
-
return (color) => {
|
|
872
|
-
const furthestColor = negative(nearest(...colors.map(negative))(color));
|
|
873
|
-
return furthestColor;
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
/**
|
|
877
|
-
* Makes color transformer which finds the best text color (black or white) for the given background color
|
|
878
|
-
*
|
|
879
|
-
* @public exported from `@promptbook/color`
|
|
880
|
-
*/
|
|
881
|
-
furthest(Color.get('white'), Color.from('black'));
|
|
882
|
-
|
|
883
|
-
/**
|
|
884
|
-
* Makes color transformer which returns a grayscale version of the color
|
|
885
|
-
*
|
|
886
|
-
* @param amount from 0 to 1
|
|
887
|
-
*
|
|
888
|
-
* @public exported from `@promptbook/color`
|
|
889
|
-
*/
|
|
890
|
-
function grayscale(amount) {
|
|
891
|
-
return ({ red, green, blue, alpha }) => {
|
|
892
|
-
const average = (red + green + blue) / 3;
|
|
893
|
-
red = Math.round(average * amount + red * (1 - amount));
|
|
894
|
-
green = Math.round(average * amount + green * (1 - amount));
|
|
895
|
-
blue = Math.round(average * amount + blue * (1 - amount));
|
|
896
|
-
return Color.fromValues(red, green, blue, alpha);
|
|
897
|
-
};
|
|
898
|
-
}
|
|
899
|
-
|
|
900
887
|
/**
|
|
901
888
|
* Makes color transformer which saturate the given color
|
|
902
889
|
*
|
|
@@ -945,16 +932,32 @@
|
|
|
945
932
|
*
|
|
946
933
|
* @public exported from `@promptbook/core`
|
|
947
934
|
*/
|
|
948
|
-
const PROMPTBOOK_COLOR = Color.
|
|
949
|
-
// <- TODO: [🧠] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
935
|
+
const PROMPTBOOK_COLOR = Color.fromString('promptbook');
|
|
936
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
937
|
+
/**
|
|
938
|
+
* Colors for syntax highlighting in the `<BookEditor/>`
|
|
939
|
+
*
|
|
940
|
+
* TODO: [🗽] Unite branding and make single place for it
|
|
941
|
+
*
|
|
942
|
+
* @public exported from `@promptbook/core`
|
|
943
|
+
*/
|
|
944
|
+
({
|
|
945
|
+
TITLE: Color.fromHex('#244EA8'),
|
|
946
|
+
LINE: Color.fromHex('#eeeeee'),
|
|
947
|
+
SEPARATOR: Color.fromHex('#cccccc'),
|
|
948
|
+
COMMITMENT: Color.fromHex('#DA0F78'),
|
|
949
|
+
PARAMETER: Color.fromHex('#8e44ad'),
|
|
950
|
+
});
|
|
951
|
+
// <- TODO: [🧠][🈵] Using `Color` here increases the package size approx 3kb, maybe remove it
|
|
950
952
|
/**
|
|
951
|
-
*
|
|
953
|
+
* Chat color of the Promptbook (in chat)
|
|
952
954
|
*
|
|
953
955
|
* TODO: [🗽] Unite branding and make single place for it
|
|
954
956
|
*
|
|
955
957
|
* @public exported from `@promptbook/core`
|
|
956
958
|
*/
|
|
957
959
|
PROMPTBOOK_COLOR.then(lighten(0.1)).then(saturate(0.9)).then(grayscale(0.9));
|
|
960
|
+
// <- TODO: [🧠][🈵] Using `Color` and `lighten`, `saturate`,... here increases the package size approx 3kb, maybe remove it
|
|
958
961
|
/**
|
|
959
962
|
* Color of the user (in chat)
|
|
960
963
|
*
|
|
@@ -1108,7 +1111,7 @@
|
|
|
1108
1111
|
*/
|
|
1109
1112
|
class UnexpectedError extends Error {
|
|
1110
1113
|
constructor(message) {
|
|
1111
|
-
super(spaceTrim.spaceTrim((block) => `
|
|
1114
|
+
super(spaceTrim$1.spaceTrim((block) => `
|
|
1112
1115
|
${block(message)}
|
|
1113
1116
|
|
|
1114
1117
|
Note: This error should not happen.
|
|
@@ -1134,7 +1137,7 @@
|
|
|
1134
1137
|
constructor(whatWasThrown) {
|
|
1135
1138
|
const tag = `[🤮]`;
|
|
1136
1139
|
console.error(tag, whatWasThrown);
|
|
1137
|
-
super(spaceTrim.spaceTrim(`
|
|
1140
|
+
super(spaceTrim$1.spaceTrim(`
|
|
1138
1141
|
Non-Error object was thrown
|
|
1139
1142
|
|
|
1140
1143
|
Note: Look for ${tag} in the console for more details
|
|
@@ -1327,7 +1330,7 @@
|
|
|
1327
1330
|
TODO: [🧠] Is there a better implementation?
|
|
1328
1331
|
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
1329
1332
|
> for (const propertyName of propertyNames) {
|
|
1330
|
-
> const value = (objectValue as
|
|
1333
|
+
> const value = (objectValue as chococake)[propertyName];
|
|
1331
1334
|
> if (value && typeof value === 'object') {
|
|
1332
1335
|
> deepClone(value);
|
|
1333
1336
|
> }
|
|
@@ -1400,6 +1403,8 @@
|
|
|
1400
1403
|
/**
|
|
1401
1404
|
* Normalizes a given text to camelCase format.
|
|
1402
1405
|
*
|
|
1406
|
+
* Note: [🔂] This function is idempotent.
|
|
1407
|
+
*
|
|
1403
1408
|
* @param text The text to be normalized.
|
|
1404
1409
|
* @param _isFirstLetterCapital Whether the first letter should be capitalized.
|
|
1405
1410
|
* @returns The camelCase formatted string.
|
|
@@ -1715,6 +1720,8 @@
|
|
|
1715
1720
|
/**
|
|
1716
1721
|
* Converts a given text to kebab-case format.
|
|
1717
1722
|
*
|
|
1723
|
+
* Note: [🔂] This function is idempotent.
|
|
1724
|
+
*
|
|
1718
1725
|
* @param text The text to be converted.
|
|
1719
1726
|
* @returns The kebab-case formatted string.
|
|
1720
1727
|
* @example 'hello-world'
|
|
@@ -1800,6 +1807,7 @@
|
|
|
1800
1807
|
/**
|
|
1801
1808
|
* Generates random token
|
|
1802
1809
|
*
|
|
1810
|
+
* Note: `$` is used to indicate that this function is not a pure function - it is not deterministic
|
|
1803
1811
|
* Note: This function is cryptographically secure (it uses crypto.randomBytes internally)
|
|
1804
1812
|
*
|
|
1805
1813
|
* @private internal helper function
|
|
@@ -1809,6 +1817,7 @@
|
|
|
1809
1817
|
return crypto.randomBytes(randomness).toString('hex');
|
|
1810
1818
|
}
|
|
1811
1819
|
/**
|
|
1820
|
+
* TODO: [🤶] Maybe export through `@promptbook/utils` or `@promptbook/random` package
|
|
1812
1821
|
* TODO: Maybe use nanoid instead https://github.com/ai/nanoid
|
|
1813
1822
|
*/
|
|
1814
1823
|
|
|
@@ -2142,6 +2151,9 @@
|
|
|
2142
2151
|
}
|
|
2143
2152
|
|
|
2144
2153
|
/**
|
|
2154
|
+
* Normalizes a given text to PascalCase format.
|
|
2155
|
+
*
|
|
2156
|
+
* Note: [🔂] This function is idempotent.
|
|
2145
2157
|
*
|
|
2146
2158
|
* @param text @public exported from `@promptbook/utils`
|
|
2147
2159
|
* @returns
|
|
@@ -2221,7 +2233,7 @@
|
|
|
2221
2233
|
let trimmedText = text;
|
|
2222
2234
|
// Remove leading and trailing spaces and newlines
|
|
2223
2235
|
if (isTrimmed) {
|
|
2224
|
-
trimmedText = spaceTrim.spaceTrim(trimmedText);
|
|
2236
|
+
trimmedText = spaceTrim$1.spaceTrim(trimmedText);
|
|
2225
2237
|
}
|
|
2226
2238
|
let processedText = trimmedText;
|
|
2227
2239
|
if (isIntroduceSentenceRemoved) {
|
|
@@ -2230,7 +2242,7 @@
|
|
|
2230
2242
|
// Remove the introduce sentence and quotes by replacing it with an empty string
|
|
2231
2243
|
processedText = processedText.replace(introduceSentenceRegex, '');
|
|
2232
2244
|
}
|
|
2233
|
-
processedText = spaceTrim.spaceTrim(processedText);
|
|
2245
|
+
processedText = spaceTrim$1.spaceTrim(processedText);
|
|
2234
2246
|
}
|
|
2235
2247
|
if (processedText.length < 3) {
|
|
2236
2248
|
return trimmedText;
|
|
@@ -2412,13 +2424,13 @@
|
|
|
2412
2424
|
* @public exported from `@promptbook/markdown-utils`
|
|
2413
2425
|
*/
|
|
2414
2426
|
function trimCodeBlock(value) {
|
|
2415
|
-
value = spaceTrim.spaceTrim(value);
|
|
2427
|
+
value = spaceTrim$1.spaceTrim(value);
|
|
2416
2428
|
if (!/^```[a-z]*(.*)```$/is.test(value)) {
|
|
2417
2429
|
return value;
|
|
2418
2430
|
}
|
|
2419
2431
|
value = value.replace(/^```[a-z]*/i, '');
|
|
2420
2432
|
value = value.replace(/```$/i, '');
|
|
2421
|
-
value = spaceTrim.spaceTrim(value);
|
|
2433
|
+
value = spaceTrim$1.spaceTrim(value);
|
|
2422
2434
|
return value;
|
|
2423
2435
|
}
|
|
2424
2436
|
|
|
@@ -2431,9 +2443,9 @@
|
|
|
2431
2443
|
* @public exported from `@promptbook/markdown-utils`
|
|
2432
2444
|
*/
|
|
2433
2445
|
function trimEndOfCodeBlock(value) {
|
|
2434
|
-
value = spaceTrim.spaceTrim(value);
|
|
2446
|
+
value = spaceTrim$1.spaceTrim(value);
|
|
2435
2447
|
value = value.replace(/```$/g, '');
|
|
2436
|
-
value = spaceTrim.spaceTrim(value);
|
|
2448
|
+
value = spaceTrim$1.spaceTrim(value);
|
|
2437
2449
|
return value;
|
|
2438
2450
|
}
|
|
2439
2451
|
|
|
@@ -2760,7 +2772,7 @@
|
|
|
2760
2772
|
}
|
|
2761
2773
|
catch (error) {
|
|
2762
2774
|
assertsError(error);
|
|
2763
|
-
throw new ParseError(spaceTrim.spaceTrim((block) => `
|
|
2775
|
+
throw new ParseError(spaceTrim$1.spaceTrim((block) => `
|
|
2764
2776
|
Can not extract variables from the script
|
|
2765
2777
|
${block(error.stack || error.message)}
|
|
2766
2778
|
|