@promptbook/utils 0.62.0 → 0.63.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.es.js +266 -68
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +3 -2
- package/esm/typings/src/_packages/azure-openai.index.d.ts +4 -2
- package/esm/typings/src/_packages/browser.index.d.ts +6 -0
- package/esm/typings/src/_packages/cli.index.d.ts +1 -7
- package/esm/typings/src/_packages/core.index.d.ts +87 -13
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +5 -45
- package/esm/typings/src/_packages/fake-llm.index.d.ts +4 -5
- package/esm/typings/src/_packages/langtail.index.d.ts +4 -2
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +23 -4
- package/esm/typings/src/_packages/node.index.d.ts +5 -2
- package/esm/typings/src/_packages/openai.index.d.ts +5 -2
- package/esm/typings/src/_packages/remote-client.index.d.ts +5 -2
- package/esm/typings/src/_packages/remote-server.index.d.ts +4 -2
- package/esm/typings/src/_packages/types.index.d.ts +441 -21
- package/esm/typings/src/_packages/utils.index.d.ts +84 -31
- package/esm/typings/src/cli/main.d.ts +12 -0
- package/esm/typings/src/collection/collectionToJson.d.ts +2 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createSubcollection.d.ts +1 -0
- package/esm/typings/src/commands/BLOCK/BlockTypes.d.ts +2 -0
- package/esm/typings/src/config.d.ts +27 -1
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -0
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +6 -3
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -3
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +2 -0
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +2 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +1 -0
- package/esm/typings/src/conversion/utils/extractVariables.d.ts +1 -0
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +1 -0
- package/esm/typings/src/conversion/utils/stringifyPipelineJson.d.ts +2 -0
- package/esm/typings/src/conversion/utils/titleToName.d.ts +6 -1
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +1 -0
- package/esm/typings/src/errors/CollectionError.d.ts +2 -0
- package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +2 -0
- package/esm/typings/src/errors/LimitReachedError.d.ts +2 -0
- package/esm/typings/src/errors/NotFoundError.d.ts +2 -0
- package/esm/typings/src/errors/NotYetImplementedError.d.ts +2 -0
- package/esm/typings/src/errors/ParsingError.d.ts +2 -0
- package/esm/typings/src/errors/PipelineExecutionError.d.ts +2 -0
- package/esm/typings/src/errors/PipelineLogicError.d.ts +2 -0
- package/esm/typings/src/errors/ReferenceError.d.ts +2 -0
- package/esm/typings/src/errors/UnexpectedError.d.ts +2 -0
- package/esm/typings/src/errors/VersionMismatchError.d.ts +2 -0
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -0
- package/esm/typings/src/execution/createPipelineExecutor.d.ts +1 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +2 -0
- package/esm/typings/src/execution/utils/addUsage.d.ts +3 -1
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +1 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +2 -0
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +2 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +2 -1
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +2 -0
- package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -1
- package/esm/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +10 -0
- package/esm/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +1 -1
- package/esm/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +2 -0
- package/esm/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +4 -1
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +1 -1
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +2 -1
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -1
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +2 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +2 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +7 -1
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
- package/esm/typings/src/personas/preparePersona.d.ts +1 -1
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +5 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +2 -1
- package/esm/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/esm/typings/src/prepare/prepareTemplates.d.ts +2 -1
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +2 -1
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +2 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +51 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +0 -1
- package/esm/typings/src/storage/files-storage/FilesStorage.d.ts +2 -1
- package/esm/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -3
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +2 -1
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +2 -1
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +2 -3
- package/esm/typings/src/storage/utils/PrefixStorage.d.ts +2 -3
- package/esm/typings/src/types/ModelRequirements.d.ts +0 -1
- package/esm/typings/src/types/Prompt.d.ts +0 -1
- package/esm/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +4 -0
- package/esm/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -0
- package/esm/typings/src/types/typeAliases.d.ts +9 -2
- package/esm/typings/src/utils/currentDate.d.ts +1 -0
- package/esm/typings/src/utils/deepClone.d.ts +2 -1
- package/esm/typings/src/utils/deepFreeze.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +4 -0
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +2 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +2 -0
- package/esm/typings/src/utils/extractParameterNames.d.ts +1 -0
- package/esm/typings/src/utils/isRunningInWhatever.d.ts +6 -3
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +4 -1
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +4 -1
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +5 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +2 -1
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +3 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +4 -0
- package/esm/typings/src/utils/markdown/removeContentComments.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +3 -0
- package/esm/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +2 -0
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +3 -0
- package/esm/typings/src/utils/normalization/capitalize.d.ts +1 -0
- package/esm/typings/src/utils/normalization/decapitalize.d.ts +1 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.d.ts +2 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +8 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +8 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +10 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +9 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +10 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +11 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +9 -0
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +7 -0
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +5 -0
- package/esm/typings/src/utils/parseNumber.d.ts +2 -1
- package/esm/typings/src/utils/random/randomSeed.d.ts +1 -0
- package/esm/typings/src/utils/removeEmojis.d.ts +1 -0
- package/esm/typings/src/utils/removeQuotes.d.ts +1 -0
- package/esm/typings/src/utils/replaceParameters.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +1 -0
- package/esm/typings/src/utils/sets/intersection.d.ts +1 -0
- package/esm/typings/src/utils/sets/union.d.ts +1 -0
- package/esm/typings/src/utils/trimCodeBlock.d.ts +1 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +2 -0
- package/esm/typings/src/utils/unwrapResult.d.ts +1 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +1 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +7 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +2 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +2 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -0
- package/package.json +1 -1
- package/umd/index.umd.js +270 -72
- package/umd/index.umd.js.map +1 -1
- package/umd/typings/src/_packages/anthropic-claude.index.d.ts +3 -2
- package/umd/typings/src/_packages/azure-openai.index.d.ts +4 -2
- package/umd/typings/src/_packages/browser.index.d.ts +6 -0
- package/umd/typings/src/_packages/cli.index.d.ts +1 -7
- package/umd/typings/src/_packages/core.index.d.ts +87 -13
- package/umd/typings/src/_packages/execute-javascript.index.d.ts +5 -45
- package/umd/typings/src/_packages/fake-llm.index.d.ts +4 -5
- package/umd/typings/src/_packages/langtail.index.d.ts +4 -2
- package/umd/typings/src/_packages/markdown-utils.index.d.ts +23 -4
- package/umd/typings/src/_packages/node.index.d.ts +5 -2
- package/umd/typings/src/_packages/openai.index.d.ts +5 -2
- package/umd/typings/src/_packages/remote-client.index.d.ts +5 -2
- package/umd/typings/src/_packages/remote-server.index.d.ts +4 -2
- package/umd/typings/src/_packages/types.index.d.ts +441 -21
- package/umd/typings/src/_packages/utils.index.d.ts +84 -31
- package/umd/typings/src/cli/main.d.ts +12 -0
- package/umd/typings/src/collection/collectionToJson.d.ts +2 -0
- package/umd/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -0
- package/umd/typings/src/collection/constructors/createCollectionFromUrl.d.ts +1 -1
- package/umd/typings/src/collection/constructors/createSubcollection.d.ts +1 -0
- package/umd/typings/src/commands/BLOCK/BlockTypes.d.ts +2 -0
- package/umd/typings/src/config.d.ts +27 -1
- package/umd/typings/src/conversion/pipelineJsonToString.d.ts +1 -0
- package/umd/typings/src/conversion/pipelineStringToJson.d.ts +6 -3
- package/umd/typings/src/conversion/pipelineStringToJsonSync.d.ts +4 -3
- package/umd/typings/src/conversion/prettify/prettifyPipelineString.d.ts +2 -0
- package/umd/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +2 -0
- package/umd/typings/src/conversion/utils/extractParameterNamesFromPromptTemplate.d.ts +1 -0
- package/umd/typings/src/conversion/utils/extractVariables.d.ts +1 -0
- package/umd/typings/src/conversion/utils/renameParameter.d.ts +1 -0
- package/umd/typings/src/conversion/utils/stringifyPipelineJson.d.ts +2 -0
- package/umd/typings/src/conversion/utils/titleToName.d.ts +6 -1
- package/umd/typings/src/conversion/validation/validatePipeline.d.ts +1 -0
- package/umd/typings/src/errors/CollectionError.d.ts +2 -0
- package/umd/typings/src/errors/EnvironmentMismatchError.d.ts +2 -0
- package/umd/typings/src/errors/LimitReachedError.d.ts +2 -0
- package/umd/typings/src/errors/NotFoundError.d.ts +2 -0
- package/umd/typings/src/errors/NotYetImplementedError.d.ts +2 -0
- package/umd/typings/src/errors/ParsingError.d.ts +2 -0
- package/umd/typings/src/errors/PipelineExecutionError.d.ts +2 -0
- package/umd/typings/src/errors/PipelineLogicError.d.ts +2 -0
- package/umd/typings/src/errors/ReferenceError.d.ts +2 -0
- package/umd/typings/src/errors/UnexpectedError.d.ts +2 -0
- package/umd/typings/src/errors/VersionMismatchError.d.ts +2 -0
- package/umd/typings/src/execution/assertsExecutionSuccessful.d.ts +1 -0
- package/umd/typings/src/execution/createPipelineExecutor.d.ts +1 -0
- package/umd/typings/src/execution/embeddingVectorToString.d.ts +2 -0
- package/umd/typings/src/execution/utils/addUsage.d.ts +3 -1
- package/umd/typings/src/execution/utils/checkExpectations.d.ts +2 -0
- package/umd/typings/src/execution/utils/forEachAsync.d.ts +1 -0
- package/umd/typings/src/execution/utils/usageToHuman.d.ts +2 -0
- package/umd/typings/src/execution/utils/usageToWorktime.d.ts +2 -0
- package/umd/typings/src/formats/_common/FormatDefinition.d.ts +2 -1
- package/umd/typings/src/formats/json/utils/isValidJsonString.d.ts +2 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceTools.d.ts +2 -0
- package/umd/typings/src/knowledge/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +2 -0
- package/umd/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +3 -1
- package/umd/typings/src/knowledge/prepare-knowledge/_common/Scraper.d.ts +10 -0
- package/umd/typings/src/knowledge/prepare-knowledge/_common/prepareKnowledgePieces.d.ts +1 -1
- package/umd/typings/src/knowledge/prepare-knowledge/markdown/prepareKnowledgeFromMarkdown.d.ts +2 -0
- package/umd/typings/src/llm-providers/_common/createLlmToolsFromEnv.d.ts +4 -1
- package/umd/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +1 -1
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +1 -1
- package/umd/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +2 -1
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +2 -1
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +1 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/langtail/LangtailExecutionToolsOptions.d.ts +2 -0
- package/umd/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +2 -0
- package/umd/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +1 -0
- package/umd/typings/src/llm-providers/remote/RemoteLlmExecutionToolsOptions.d.ts +2 -0
- package/umd/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +7 -1
- package/umd/typings/src/llm-providers/remote/startRemoteServer.d.ts +1 -0
- package/umd/typings/src/personas/preparePersona.d.ts +1 -1
- package/umd/typings/src/postprocessing/utils/extractBlock.d.ts +5 -0
- package/umd/typings/src/prepare/isPipelinePrepared.d.ts +2 -1
- package/umd/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/umd/typings/src/prepare/prepareTemplates.d.ts +2 -1
- package/umd/typings/src/prepare/unpreparePipeline.d.ts +2 -1
- package/umd/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +2 -0
- package/umd/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +1 -0
- package/umd/typings/src/scripting/javascript/postprocessing-functions.d.ts +51 -0
- package/umd/typings/src/storage/_common/PromptbookStorage.d.ts +0 -1
- package/umd/typings/src/storage/files-storage/FilesStorage.d.ts +2 -1
- package/umd/typings/src/storage/files-storage/FilesStorageOptions.d.ts +0 -3
- package/umd/typings/src/storage/local-storage/getLocalStorage.d.ts +2 -1
- package/umd/typings/src/storage/local-storage/getSessionStorage.d.ts +2 -1
- package/umd/typings/src/storage/memory/MemoryStorage.d.ts +2 -3
- package/umd/typings/src/storage/utils/PrefixStorage.d.ts +2 -3
- package/umd/typings/src/types/ModelRequirements.d.ts +0 -1
- package/umd/typings/src/types/Prompt.d.ts +0 -1
- package/umd/typings/src/types/execution-report/ExecutionReportStringOptions.d.ts +4 -0
- package/umd/typings/src/types/execution-report/executionReportJsonToString.d.ts +2 -0
- package/umd/typings/src/types/typeAliases.d.ts +9 -2
- package/umd/typings/src/utils/currentDate.d.ts +1 -0
- package/umd/typings/src/utils/deepClone.d.ts +2 -1
- package/umd/typings/src/utils/deepFreeze.d.ts +1 -1
- package/umd/typings/src/utils/expectation-counters/countCharacters.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countLines.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countPages.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countParagraphs.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/countSentences.d.ts +4 -0
- package/umd/typings/src/utils/expectation-counters/countWords.d.ts +2 -0
- package/umd/typings/src/utils/expectation-counters/index.d.ts +2 -0
- package/umd/typings/src/utils/extractParameterNames.d.ts +1 -0
- package/umd/typings/src/utils/isRunningInWhatever.d.ts +6 -3
- package/umd/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +4 -1
- package/umd/typings/src/utils/markdown/createMarkdownChart.d.ts +1 -1
- package/umd/typings/src/utils/markdown/createMarkdownTable.d.ts +4 -1
- package/umd/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +5 -0
- package/umd/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +1 -1
- package/umd/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +2 -1
- package/umd/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +1 -0
- package/umd/typings/src/utils/markdown/flattenMarkdown.d.ts +3 -0
- package/umd/typings/src/utils/markdown/parseMarkdownSection.d.ts +4 -0
- package/umd/typings/src/utils/markdown/removeContentComments.d.ts +1 -0
- package/umd/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +1 -0
- package/umd/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +3 -0
- package/umd/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +2 -0
- package/umd/typings/src/utils/normalization/IKeywords.d.ts +3 -0
- package/umd/typings/src/utils/normalization/capitalize.d.ts +1 -0
- package/umd/typings/src/utils/normalization/decapitalize.d.ts +1 -0
- package/umd/typings/src/utils/normalization/isValidKeyword.d.ts +2 -0
- package/umd/typings/src/utils/normalization/nameToUriPart.d.ts +8 -0
- package/umd/typings/src/utils/normalization/nameToUriParts.d.ts +8 -0
- package/umd/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +10 -0
- package/umd/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +9 -0
- package/umd/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +10 -0
- package/umd/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +11 -0
- package/umd/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +9 -0
- package/umd/typings/src/utils/normalization/parseKeywords.d.ts +1 -0
- package/umd/typings/src/utils/normalization/parseKeywordsFromString.d.ts +1 -0
- package/umd/typings/src/utils/normalization/removeDiacritics.d.ts +7 -0
- package/umd/typings/src/utils/normalization/searchKeywords.d.ts +5 -0
- package/umd/typings/src/utils/parseNumber.d.ts +2 -1
- package/umd/typings/src/utils/random/randomSeed.d.ts +1 -0
- package/umd/typings/src/utils/removeEmojis.d.ts +1 -0
- package/umd/typings/src/utils/removeQuotes.d.ts +1 -0
- package/umd/typings/src/utils/replaceParameters.d.ts +1 -0
- package/umd/typings/src/utils/sets/difference.d.ts +1 -0
- package/umd/typings/src/utils/sets/intersection.d.ts +1 -0
- package/umd/typings/src/utils/sets/union.d.ts +1 -0
- package/umd/typings/src/utils/trimCodeBlock.d.ts +1 -0
- package/umd/typings/src/utils/trimEndOfCodeBlock.d.ts +2 -0
- package/umd/typings/src/utils/unwrapResult.d.ts +1 -0
- package/umd/typings/src/utils/validators/filePath/isValidFilePath.d.ts +1 -0
- package/umd/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +7 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +2 -0
- package/umd/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +2 -0
- package/umd/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +2 -0
- package/umd/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +1 -0
- package/umd/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +2 -0
- package/umd/typings/src/utils/validators/url/isValidUrl.d.ts +2 -0
- package/umd/typings/src/utils/validators/uuid/isValidUuid.d.ts +2 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { number_percent } from '../typeAliases';
|
|
2
2
|
/**
|
|
3
3
|
* Options for `executionReportJsonToString`
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/core`
|
|
4
6
|
*/
|
|
5
7
|
export type ExecutionReportStringOptions = {
|
|
6
8
|
/**
|
|
@@ -14,6 +16,8 @@ export type ExecutionReportStringOptions = {
|
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* Default options for generating an execution report string
|
|
19
|
+
*
|
|
20
|
+
* @public exported from `@promptbook/core`
|
|
17
21
|
*/
|
|
18
22
|
export declare const ExecutionReportStringOptionsDefaults: {
|
|
19
23
|
taxRate: number;
|
|
@@ -3,6 +3,8 @@ import type { ExecutionReportString } from './ExecutionReportString';
|
|
|
3
3
|
import type { ExecutionReportStringOptions } from './ExecutionReportStringOptions';
|
|
4
4
|
/**
|
|
5
5
|
* Converts execution report from JSON to string format
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/core`
|
|
6
8
|
*/
|
|
7
9
|
export declare function executionReportJsonToString(executionReportJson: ExecutionReportJson, options?: Partial<ExecutionReportStringOptions>): ExecutionReportString;
|
|
8
10
|
/**
|
|
@@ -172,12 +172,16 @@ export type string_xml = string;
|
|
|
172
172
|
* Semantic helper
|
|
173
173
|
*
|
|
174
174
|
* For example `"**Hello** World!"`
|
|
175
|
+
*
|
|
176
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
175
177
|
*/
|
|
176
178
|
export type string_markdown = string;
|
|
177
179
|
/**
|
|
178
180
|
* Semantic helper
|
|
179
181
|
*
|
|
180
182
|
* Markdown text with exactly ONE heading on first line NO less NO more
|
|
183
|
+
*
|
|
184
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
181
185
|
*/
|
|
182
186
|
export type string_markdown_section = string;
|
|
183
187
|
/**
|
|
@@ -185,6 +189,8 @@ export type string_markdown_section = string;
|
|
|
185
189
|
*
|
|
186
190
|
* Markdown without any headings like h1, h2
|
|
187
191
|
* BUT with formatting, lists, blockquotes, blocks, etc. is allowed
|
|
192
|
+
*
|
|
193
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
188
194
|
*/
|
|
189
195
|
export type string_markdown_section_content = string;
|
|
190
196
|
/**
|
|
@@ -194,6 +200,8 @@ export type string_markdown_section_content = string;
|
|
|
194
200
|
* BUT with bold, italic, etc. is allowed
|
|
195
201
|
*
|
|
196
202
|
* For example `"**Hello** World!"`
|
|
203
|
+
*
|
|
204
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
197
205
|
*/
|
|
198
206
|
export type string_markdown_text = string;
|
|
199
207
|
/**
|
|
@@ -573,7 +581,6 @@ export type number_gigabytes = number_positive;
|
|
|
573
581
|
export type number_terabytes = number_positive;
|
|
574
582
|
/**.
|
|
575
583
|
* TODO: !!! Change "For example" to @example
|
|
576
|
-
* TODO: !! Cleanup
|
|
577
584
|
* TODO: !! Change to branded types
|
|
578
|
-
* TODO:
|
|
585
|
+
* TODO: Delete type aliases that are not exported or used internally
|
|
579
586
|
*/
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { WritableDeep } from 'type-fest';
|
|
2
2
|
/**
|
|
3
3
|
* @@@
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
4
6
|
*/
|
|
5
7
|
export declare function deepClone<TObject>(objectValue: TObject): WritableDeep<TObject>;
|
|
6
8
|
/**
|
|
7
|
-
* TODO: [🔼] Export from `@promptbook/utils`
|
|
8
9
|
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
9
10
|
*/
|
|
@@ -12,11 +12,11 @@ export declare function deepFreeze<TObject>(objectValue: TObject): ReadonlyDeep<
|
|
|
12
12
|
* @@@
|
|
13
13
|
*
|
|
14
14
|
* @returns The same object as the input, but deeply frozen
|
|
15
|
+
* @public exported from `@promptbook/utils`
|
|
15
16
|
*
|
|
16
17
|
* Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
|
|
17
18
|
*/
|
|
18
19
|
export declare function deepFreezeWithSameType<TObject>(objectValue: TObject): TObject;
|
|
19
20
|
/**
|
|
20
|
-
* TODO: [🔼] Export from `@promptbook/utils`
|
|
21
21
|
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
22
22
|
*/
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
|
|
2
2
|
/**
|
|
3
3
|
* Split text into sentences
|
|
4
|
+
*
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
4
6
|
*/
|
|
5
7
|
export declare function splitIntoSentences(text: string): Array<string>;
|
|
6
8
|
/**
|
|
7
9
|
* Counts number of sentences in the text
|
|
10
|
+
*
|
|
11
|
+
* @public exported from `@promptbook/utils`
|
|
8
12
|
*/
|
|
9
13
|
export declare function countSentences(text: string): ExpectationAmount;
|
|
@@ -2,5 +2,7 @@ import type { ExpectationAmount } from '../../types/PipelineJson/Expectations';
|
|
|
2
2
|
import type { ExpectationUnit } from '../../types/PipelineJson/Expectations';
|
|
3
3
|
/**
|
|
4
4
|
* Index of all counter functions
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
5
7
|
*/
|
|
6
8
|
export declare const CountUtils: Record<ExpectationUnit, (text: string) => ExpectationAmount>;
|
|
@@ -5,5 +5,6 @@ import type { string_template } from '../types/typeAliases';
|
|
|
5
5
|
*
|
|
6
6
|
* @param template the template with parameters in {curly} braces
|
|
7
7
|
* @returns the list of parameter names
|
|
8
|
+
* @public exported from `@promptbook/utils`
|
|
8
9
|
*/
|
|
9
10
|
export declare function extractParameterNames(template: string_template): Set<string_parameter_name>;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Detects if the code is running in a browser environment in main thread (Not in a web worker)
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/utils`
|
|
3
5
|
*/
|
|
4
6
|
export declare const isRunningInBrowser: Function;
|
|
5
7
|
/**
|
|
6
8
|
* Detects if the code is running in a Node.js environment
|
|
9
|
+
*
|
|
10
|
+
* @public exported from `@promptbook/utils`
|
|
7
11
|
*/
|
|
8
12
|
export declare const isRunningInNode: Function;
|
|
9
13
|
/**
|
|
10
14
|
* Detects if the code is running in a web worker
|
|
15
|
+
*
|
|
16
|
+
* @public exported from `@promptbook/utils`
|
|
11
17
|
*/
|
|
12
18
|
export declare const isRunningInWebWorker: Function;
|
|
13
|
-
/**
|
|
14
|
-
* TODO: [🔼] !!! Export via `@promptbook/utils`
|
|
15
|
-
*/
|
|
@@ -3,9 +3,12 @@ import type { string_name } from '../../types/typeAliases';
|
|
|
3
3
|
/**
|
|
4
4
|
* Add or modify an auto-generated section in a markdown file
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
7
7
|
*/
|
|
8
8
|
export declare function addAutoGeneratedSection(content: string_markdown, options: {
|
|
9
9
|
readonly sectionName: string_name;
|
|
10
10
|
readonly sectionContent: string_markdown;
|
|
11
11
|
}): string_markdown;
|
|
12
|
+
/**
|
|
13
|
+
* TODO: [🏛] This can be part of markdown builder
|
|
14
|
+
*/
|
|
@@ -28,7 +28,7 @@ type CreateMarkdownChartOptions = {
|
|
|
28
28
|
/**
|
|
29
29
|
* Function createMarkdownChart will draw a chart in markdown from ⬛+🟦 tiles
|
|
30
30
|
*
|
|
31
|
-
* @
|
|
31
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
32
32
|
*/
|
|
33
33
|
export declare function createMarkdownChart(options: CreateMarkdownChartOptions): string_markdown;
|
|
34
34
|
export {};
|
|
@@ -3,6 +3,9 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
3
3
|
/**
|
|
4
4
|
* Create a markdown table from a 2D array of strings
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
7
7
|
*/
|
|
8
8
|
export declare function createMarkdownTable(table: Array<Array<string_markdown_text>>): string_markdown;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: [🏛] This can be part of markdown builder
|
|
11
|
+
*/
|
|
@@ -2,5 +2,10 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
2
2
|
/**
|
|
3
3
|
* Function escapeMarkdownBlock will escape markdown block if needed
|
|
4
4
|
* It is useful when you want have block in block
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
5
7
|
*/
|
|
6
8
|
export declare function escapeMarkdownBlock(value: string_markdown_text): string_markdown_text;
|
|
9
|
+
/**
|
|
10
|
+
* TODO: [🏛] This can be part of markdown builder
|
|
11
|
+
*/
|
|
@@ -26,7 +26,7 @@ export type CodeBlock = {
|
|
|
26
26
|
*
|
|
27
27
|
* @param markdown any valid markdown
|
|
28
28
|
* @returns code blocks with language and content
|
|
29
|
-
*
|
|
29
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
30
30
|
*/
|
|
31
31
|
export declare function extractAllBlocksFromMarkdown(markdown: string_markdown): Array<CodeBlock>;
|
|
32
32
|
/**
|
|
@@ -9,6 +9,7 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
9
9
|
* Note: It can not work with html syntax and comments
|
|
10
10
|
*
|
|
11
11
|
* @param markdown any valid markdown
|
|
12
|
-
* @returns
|
|
12
|
+
* @returns @@@
|
|
13
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
13
14
|
*/
|
|
14
15
|
export declare function extractAllListItemsFromMarkdown(markdown: string_markdown): string_markdown_text[];
|
|
@@ -12,6 +12,7 @@ import type { CodeBlock } from './extractAllBlocksFromMarkdown';
|
|
|
12
12
|
*
|
|
13
13
|
* @param markdown any valid markdown
|
|
14
14
|
* @returns code block with language and content
|
|
15
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
15
16
|
*/
|
|
16
17
|
export declare function extractOneBlockFromMarkdown(markdown: string_markdown): CodeBlock;
|
|
17
18
|
/***
|
|
@@ -4,9 +4,12 @@ import type { string_markdown } from '../../types/typeAliases';
|
|
|
4
4
|
*
|
|
5
5
|
* - It always have h1 - if there is no h1 in the markdown, it will be added "# Untitled"
|
|
6
6
|
* - All other headings are normalized to h2
|
|
7
|
+
*
|
|
8
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
7
9
|
*/
|
|
8
10
|
export declare function flattenMarkdown<TContent extends string_markdown>(markdown: TContent): TContent;
|
|
9
11
|
/**
|
|
12
|
+
* TODO: [🏛] This can be part of markdown builder
|
|
10
13
|
* Note: [🕞] In past (commit 42086e1603cbed506482997c00a8ee979af0a247) there was much more
|
|
11
14
|
* sophisticated implementation of this function through parsing markdown into JSON structure
|
|
12
15
|
* and flattening the actual structure
|
|
@@ -3,6 +3,8 @@ import type { string_markdown_section_content } from '../../types/typeAliases';
|
|
|
3
3
|
import type { string_markdown_text } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* Parsed markdown section
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
6
8
|
*/
|
|
7
9
|
export type MarkdownSection = {
|
|
8
10
|
/**
|
|
@@ -20,6 +22,8 @@ export type MarkdownSection = {
|
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
24
|
* Parses markdown section to title its level and content
|
|
25
|
+
*
|
|
26
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
23
27
|
*/
|
|
24
28
|
export declare function parseMarkdownSection(value: string_markdown_section): MarkdownSection;
|
|
25
29
|
/**
|
|
@@ -5,5 +5,6 @@ import type { string_markdown } from '../../types/typeAliases';
|
|
|
5
5
|
*
|
|
6
6
|
* @param {string} content - The string to remove comments from.
|
|
7
7
|
* @returns {string} The input string with all comments removed.
|
|
8
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
8
9
|
*/
|
|
9
10
|
export declare function removeContentComments<TContent extends string_html | string_markdown>(content: TContent): TContent;
|
|
@@ -4,5 +4,6 @@ import type { string_markdown_text } from '../../types/typeAliases';
|
|
|
4
4
|
*
|
|
5
5
|
* @param {string} str - The string to remove Markdown tags from.
|
|
6
6
|
* @returns {string} The input string with all Markdown tags removed.
|
|
7
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
7
8
|
*/
|
|
8
9
|
export declare function removeMarkdownFormatting(str: string_markdown_text): string;
|
|
@@ -2,9 +2,12 @@ import type { string_markdown } from '../../types/typeAliases';
|
|
|
2
2
|
import type { string_markdown_section } from '../../types/typeAliases';
|
|
3
3
|
/**
|
|
4
4
|
* Splits the markdown into sections by headings
|
|
5
|
+
*
|
|
6
|
+
* @public exported from `@promptbook/markdown-utils`
|
|
5
7
|
*/
|
|
6
8
|
export declare function splitMarkdownIntoSections(markdown: string_markdown): Array<string_markdown_section>;
|
|
7
9
|
/**
|
|
10
|
+
* TODO: [🏛] This can be part of markdown builder
|
|
8
11
|
* Note: [🕞] In past (commit 42086e1603cbed506482997c00a8ee979af0a247) there was much more
|
|
9
12
|
* sophisticated implementation of this function through parsing markdown into JSON structure
|
|
10
13
|
* and flattening the actual structure
|
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
* Words are splitted between multiple keywords @see IKeywords
|
|
6
6
|
*
|
|
7
7
|
* For example `"keyword"`
|
|
8
|
+
*
|
|
9
|
+
* @public exported from `@promptbook/utils`
|
|
8
10
|
*/
|
|
9
11
|
export type string_keyword = string;
|
|
10
12
|
/**
|
|
11
13
|
* Semantic helper
|
|
12
14
|
* Set of keywords @see string_keyword
|
|
13
15
|
*
|
|
16
|
+
* @public exported from `@promptbook/utils`
|
|
14
17
|
*/
|
|
15
18
|
export type IKeywords = Set<string_keyword>;
|
|
16
19
|
/**
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @example 'hello-world'
|
|
5
5
|
* @example 'i-love-promptbook'
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
6
7
|
*/
|
|
7
8
|
export type string_kebab_case = string;
|
|
9
|
+
/**
|
|
10
|
+
* @@@
|
|
11
|
+
*
|
|
12
|
+
* @param text @@@
|
|
13
|
+
* @returns @@@
|
|
14
|
+
* @example 'hello-world'
|
|
15
|
+
* @example 'i-love-promptbook'
|
|
16
|
+
* @public exported from `@promptbook/utils`
|
|
17
|
+
*/
|
|
8
18
|
export declare function normalizeToKebabCase(text: string): string_kebab_case;
|
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @example 'HelloWorld'
|
|
5
5
|
* @example 'ILovePromptbook'
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
6
7
|
*/
|
|
7
8
|
export type string_PascalCase = string;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param text @public exported from `@promptbook/utils`
|
|
12
|
+
* @returns
|
|
13
|
+
* @example 'HelloWorld'
|
|
14
|
+
* @example 'ILovePromptbook'
|
|
15
|
+
* @public exported from `@promptbook/utils`
|
|
16
|
+
*/
|
|
8
17
|
export declare function normalizeTo_PascalCase(text: string): string_PascalCase;
|
|
@@ -3,8 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @example 'HELLO_WORLD'
|
|
5
5
|
* @example 'I_LOVE_PROMPTBOOK'
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
6
7
|
*/
|
|
7
8
|
export type string_SCREAMING_CASE = string;
|
|
9
|
+
/**
|
|
10
|
+
* @@@
|
|
11
|
+
*
|
|
12
|
+
* @param text @@@
|
|
13
|
+
* @returns @@@
|
|
14
|
+
* @example 'HELLO_WORLD'
|
|
15
|
+
* @example 'I_LOVE_PROMPTBOOK'
|
|
16
|
+
* @public exported from `@promptbook/utils`
|
|
17
|
+
*/
|
|
8
18
|
export declare function normalizeTo_SCREAMING_CASE(text: string): string_SCREAMING_CASE;
|
|
9
19
|
/**
|
|
10
20
|
* TODO: Tests
|
|
@@ -3,8 +3,19 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @example 'helloWorld'
|
|
5
5
|
* @example 'iLovePromptbook'
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
6
7
|
*/
|
|
7
8
|
export type string_camelCase = string;
|
|
9
|
+
/**
|
|
10
|
+
* @@@
|
|
11
|
+
*
|
|
12
|
+
* @param text @@@
|
|
13
|
+
* @param _isFirstLetterCapital @@@
|
|
14
|
+
* @returns @@@
|
|
15
|
+
* @example 'helloWorld'
|
|
16
|
+
* @example 'iLovePromptbook'
|
|
17
|
+
* @public exported from `@promptbook/utils`
|
|
18
|
+
*/
|
|
8
19
|
export declare function normalizeTo_camelCase(text: string, _isFirstLetterCapital?: boolean): string_camelCase;
|
|
9
20
|
/**
|
|
10
21
|
* TODO: [🌺] Use some intermediate util splitWords
|
|
@@ -5,4 +5,13 @@
|
|
|
5
5
|
* @example 'i_love_promptbook'
|
|
6
6
|
*/
|
|
7
7
|
export type string_snake_case = string;
|
|
8
|
+
/**
|
|
9
|
+
* @@@
|
|
10
|
+
*
|
|
11
|
+
* @param text @@@
|
|
12
|
+
* @returns @@@
|
|
13
|
+
* @example 'hello_world'
|
|
14
|
+
* @example 'i_love_promptbook'
|
|
15
|
+
* @public exported from `@promptbook/utils`
|
|
16
|
+
*/
|
|
8
17
|
export declare function normalizeTo_snake_case(text: string): string_snake_case;
|
|
@@ -7,6 +7,7 @@ import type { IKeywords } from './IKeywords';
|
|
|
7
7
|
*
|
|
8
8
|
* @param input of any kind
|
|
9
9
|
* @returns {Set} of keywords without diacritics in lowercase
|
|
10
|
+
* @public exported from `@promptbook/utils`
|
|
10
11
|
*/
|
|
11
12
|
export declare function parseKeywords(input: really_unknown): IKeywords;
|
|
12
13
|
/**
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* @returns parsed number
|
|
8
8
|
* @throws {ParsingError} if the value is not a number
|
|
9
9
|
*
|
|
10
|
-
* @
|
|
10
|
+
* @public exported from `@promptbook/utils`
|
|
11
11
|
*/
|
|
12
12
|
export declare function parseNumber(value: string | number): number;
|
|
13
13
|
/**
|
|
14
14
|
* TODO: Maybe use sth. like safe-eval in fraction/calculation case @see https://www.npmjs.com/package/safe-eval
|
|
15
|
+
* TODO: [🧠][🌻] Maybe export through `@promptbook/markdown-utils` not `@promptbook/utils`
|
|
15
16
|
*/
|
|
@@ -3,5 +3,6 @@ import type { number_seed } from '../../types/typeAliases';
|
|
|
3
3
|
* Generates random seed
|
|
4
4
|
*
|
|
5
5
|
* Warning: This function is not cryptographically secure (it uses Math.random internally)
|
|
6
|
+
* @public exported from `@promptbook/utils`
|
|
6
7
|
*/
|
|
7
8
|
export declare function $randomSeed(): number_seed;
|
|
@@ -7,5 +7,6 @@ import type { string_template } from '../types/typeAliases';
|
|
|
7
7
|
* @param parameters the object with parameters
|
|
8
8
|
* @returns the template with replaced parameters
|
|
9
9
|
* @throws {PipelineExecutionError} if parameter is not defined, not closed, or not opened
|
|
10
|
+
* @public exported from `@promptbook/utils`
|
|
10
11
|
*/
|
|
11
12
|
export declare function replaceParameters(template: string_template, parameters: Parameters): string;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Create difference set of two sets.
|
|
3
3
|
*
|
|
4
4
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
5
6
|
*/
|
|
6
7
|
export declare function difference<TItem>(a: Set<TItem>, b: Set<TItem>, isEqual?: (a: TItem, b: TItem) => boolean): Set<TItem>;
|
|
7
8
|
/**
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* Creates a new set with all elements that are present in all sets
|
|
3
3
|
*
|
|
4
4
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
5
6
|
*/
|
|
6
7
|
export declare function intersection<TItem>(...sets: Array<Set<TItem>>): Set<TItem>;
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
* Creates a new set with all elements that are present in either set
|
|
3
3
|
*
|
|
4
4
|
* @deprecated use new javascript set methods instead @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
|
|
5
|
+
* @public exported from `@promptbook/utils`
|
|
5
6
|
*/
|
|
6
7
|
export declare function union<TItem>(...sets: Array<Set<TItem>>): Set<TItem>;
|
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Note: This is usefull for post-processing of the result of the completion LLM model
|
|
5
5
|
* if you want to start code block in the prompt but you don't want to end it in the result.
|
|
6
|
+
*
|
|
7
|
+
* @public exported from `@promptbook/utils`
|
|
6
8
|
*/
|
|
7
9
|
export declare function trimEndOfCodeBlock(value: string): string;
|