@promptbook/editable 0.81.0-11
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 +422 -0
- package/esm/index.es.js +631 -0
- package/esm/index.es.js.map +1 -0
- package/esm/typings/books/index.d.ts +93 -0
- package/esm/typings/src/_packages/anthropic-claude.index.d.ts +16 -0
- package/esm/typings/src/_packages/azure-openai.index.d.ts +10 -0
- package/esm/typings/src/_packages/browser.index.d.ts +10 -0
- package/esm/typings/src/_packages/cli.index.d.ts +44 -0
- package/esm/typings/src/_packages/core.index.d.ts +238 -0
- package/esm/typings/src/_packages/documents.index.d.ts +8 -0
- package/esm/typings/src/_packages/editable.index.d.ts +10 -0
- package/esm/typings/src/_packages/execute-javascript.index.d.ts +8 -0
- package/esm/typings/src/_packages/fake-llm.index.d.ts +6 -0
- package/esm/typings/src/_packages/google.index.d.ts +10 -0
- package/esm/typings/src/_packages/legacy-documents.index.d.ts +8 -0
- package/esm/typings/src/_packages/markdown-utils.index.d.ts +48 -0
- package/esm/typings/src/_packages/node.index.d.ts +22 -0
- package/esm/typings/src/_packages/openai.index.d.ts +20 -0
- package/esm/typings/src/_packages/pdf.index.d.ts +8 -0
- package/esm/typings/src/_packages/remote-client.index.d.ts +8 -0
- package/esm/typings/src/_packages/remote-server.index.d.ts +6 -0
- package/esm/typings/src/_packages/templates.index.d.ts +4 -0
- package/esm/typings/src/_packages/types.index.d.ts +530 -0
- package/esm/typings/src/_packages/utils.index.d.ts +158 -0
- package/esm/typings/src/_packages/vercel.index.d.ts +6 -0
- package/esm/typings/src/_packages/website-crawler.index.d.ts +8 -0
- package/esm/typings/src/_packages/wizzard.index.d.ts +44 -0
- package/esm/typings/src/cli/cli-commands/about.d.ts +12 -0
- package/esm/typings/src/cli/cli-commands/hello.d.ts +12 -0
- package/esm/typings/src/cli/cli-commands/list-models.d.ts +11 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +14 -0
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +13 -0
- package/esm/typings/src/cli/cli-commands/run.d.ts +15 -0
- package/esm/typings/src/cli/cli-commands/runInteractiveChatbot.d.ts +32 -0
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +14 -0
- package/esm/typings/src/cli/main.d.ts +16 -0
- package/esm/typings/src/cli/promptbookCli.d.ts +13 -0
- package/esm/typings/src/cli/test/ptbk.d.ts +5 -0
- package/esm/typings/src/cli/test/ptbk.test.d.ts +1 -0
- package/esm/typings/src/collection/PipelineCollection.d.ts +25 -0
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +37 -0
- package/esm/typings/src/collection/collectionToJson.d.ts +13 -0
- package/esm/typings/src/collection/collectionToJson.test.d.ts +7 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.d.ts +54 -0
- package/esm/typings/src/collection/constructors/createCollectionFromDirectory.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +13 -0
- package/esm/typings/src/collection/constructors/createCollectionFromJson.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +23 -0
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.test.d.ts +1 -0
- package/esm/typings/src/collection/constructors/createCollectionFromUrl.d.ts +29 -0
- package/esm/typings/src/collection/constructors/createSubcollection.d.ts +13 -0
- package/esm/typings/src/commands/BOOK_VERSION/BookVersionCommand.d.ts +11 -0
- package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/BOOK_VERSION/bookVersionCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +17 -0
- package/esm/typings/src/commands/EXPECT/expectCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +10 -0
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +27 -0
- package/esm/typings/src/commands/FOREACH/foreachCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +14 -0
- package/esm/typings/src/commands/FORMAT/FormatCommand.d.ts +9 -0
- package/esm/typings/src/commands/FORMAT/formatCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/FORMAT/formatCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/FORMFACTOR/FormfactorCommand.d.ts +11 -0
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/FORMFACTOR/formfactorCommandParser.d.ts +11 -0
- package/esm/typings/src/commands/JOKER/JokerCommand.d.ts +11 -0
- package/esm/typings/src/commands/JOKER/jokerCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/KNOWLEDGE/KnowledgeCommand.d.ts +11 -0
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +12 -0
- package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.d.ts +11 -0
- package/esm/typings/src/commands/KNOWLEDGE/utils/sourceContentToName.test.d.ts +4 -0
- package/esm/typings/src/commands/MODEL/ModelCommand.d.ts +13 -0
- package/esm/typings/src/commands/MODEL/modelCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/MODEL/modelCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PARAMETER/ParameterCommand.d.ts +15 -0
- package/esm/typings/src/commands/PARAMETER/parameterCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PARAMETER/parameterCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/PERSONA/PersonaCommand.d.ts +13 -0
- package/esm/typings/src/commands/PERSONA/personaCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/PERSONA/personaCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/POSTPROCESS/PostprocessCommand.d.ts +11 -0
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/SECTION/SectionCommand.d.ts +11 -0
- package/esm/typings/src/commands/SECTION/sectionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/SECTION/sectionCommandParser.d.ts +20 -0
- package/esm/typings/src/commands/URL/UrlCommand.d.ts +10 -0
- package/esm/typings/src/commands/URL/urlCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/URL/urlCommandParser.d.ts +9 -0
- package/esm/typings/src/commands/X_ACTION/ActionCommand.d.ts +9 -0
- package/esm/typings/src/commands/X_ACTION/actionCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +12 -0
- package/esm/typings/src/commands/X_INSTRUMENT/InstrumentCommand.d.ts +9 -0
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +12 -0
- package/esm/typings/src/commands/_BOILERPLATE/BoilerplateCommand.d.ts +10 -0
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_BOILERPLATE/boilerplateCommandParser.d.ts +11 -0
- package/esm/typings/src/commands/_common/getParserForCommand.d.ts +11 -0
- package/esm/typings/src/commands/_common/getParserForCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_common/parseCommand.d.ts +12 -0
- package/esm/typings/src/commands/_common/parseCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_common/stringifyCommand.d.ts +11 -0
- package/esm/typings/src/commands/_common/stringifyCommand.test.d.ts +1 -0
- package/esm/typings/src/commands/_common/types/Command.d.ts +6 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +189 -0
- package/esm/typings/src/commands/_common/types/CommandType.d.ts +17 -0
- package/esm/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +11 -0
- package/esm/typings/src/commands/index.d.ts +9 -0
- package/esm/typings/src/config.d.ts +253 -0
- package/esm/typings/src/config.test.d.ts +4 -0
- package/esm/typings/src/constants.d.ts +35 -0
- package/esm/typings/src/conversion/compilePipeline.d.ts +28 -0
- package/esm/typings/src/conversion/compilePipeline.test.d.ts +1 -0
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +18 -0
- package/esm/typings/src/conversion/precompilePipeline.d.ts +30 -0
- package/esm/typings/src/conversion/precompilePipeline.test.d.ts +1 -0
- package/esm/typings/src/conversion/prettify/PrettifyOptions.d.ts +13 -0
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +12 -0
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +30 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTask.d.ts +15 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTask.test.d.ts +1 -0
- package/esm/typings/src/conversion/utils/extractVariablesFromScript.d.ts +14 -0
- package/esm/typings/src/conversion/utils/extractVariablesFromScript.test.d.ts +1 -0
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +30 -0
- package/esm/typings/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +4 -0
- package/esm/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +4 -0
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +42 -0
- package/esm/typings/src/conversion/validation/validatePipeline.test.d.ts +4 -0
- package/esm/typings/src/dialogs/callback/CallbackInterfaceTools.d.ts +17 -0
- package/esm/typings/src/dialogs/callback/CallbackInterfaceToolsOptions.d.ts +14 -0
- package/esm/typings/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +22 -0
- package/esm/typings/src/dialogs/user-interface-execution-tools.test.d.ts +1 -0
- package/esm/typings/src/errors/0-BoilerplateError.d.ts +12 -0
- package/esm/typings/src/errors/0-index.d.ts +85 -0
- package/esm/typings/src/errors/AbstractFormatError.d.ts +11 -0
- package/esm/typings/src/errors/CollectionError.d.ts +9 -0
- package/esm/typings/src/errors/EnvironmentMismatchError.d.ts +9 -0
- package/esm/typings/src/errors/ExpectError.d.ts +12 -0
- package/esm/typings/src/errors/KnowledgeScrapeError.d.ts +9 -0
- package/esm/typings/src/errors/LimitReachedError.d.ts +9 -0
- package/esm/typings/src/errors/MissingToolsError.d.ts +9 -0
- package/esm/typings/src/errors/NotFoundError.d.ts +9 -0
- package/esm/typings/src/errors/NotYetImplementedError.d.ts +9 -0
- package/esm/typings/src/errors/ParseError.d.ts +12 -0
- package/esm/typings/src/errors/PipelineExecutionError.d.ts +9 -0
- package/esm/typings/src/errors/PipelineLogicError.d.ts +9 -0
- package/esm/typings/src/errors/PipelineUrlError.d.ts +9 -0
- package/esm/typings/src/errors/UnexpectedError.d.ts +9 -0
- package/esm/typings/src/errors/utils/ErrorJson.d.ts +20 -0
- package/esm/typings/src/errors/utils/deserializeError.d.ts +7 -0
- package/esm/typings/src/errors/utils/deserializeError.test.d.ts +1 -0
- package/esm/typings/src/errors/utils/getErrorReportUrl.d.ts +6 -0
- package/esm/typings/src/errors/utils/serializeError.d.ts +7 -0
- package/esm/typings/src/errors/utils/serializeError.test.d.ts +1 -0
- package/esm/typings/src/executables/$provideExecutablesForNode.d.ts +12 -0
- package/esm/typings/src/executables/apps/locateLibreoffice.d.ts +11 -0
- package/esm/typings/src/executables/apps/locateLibreoffice.test.d.ts +1 -0
- package/esm/typings/src/executables/apps/locatePandoc.d.ts +11 -0
- package/esm/typings/src/executables/apps/locatePandoc.test.d.ts +1 -0
- package/esm/typings/src/executables/locateApp.d.ts +33 -0
- package/esm/typings/src/executables/locateApp.test.d.ts +1 -0
- package/esm/typings/src/executables/platforms/locateAppOnLinux.d.ts +12 -0
- package/esm/typings/src/executables/platforms/locateAppOnMacOs.d.ts +12 -0
- package/esm/typings/src/executables/platforms/locateAppOnWindows.d.ts +12 -0
- package/esm/typings/src/execution/AvailableModel.d.ts +38 -0
- package/esm/typings/src/execution/CommonToolsOptions.d.ts +24 -0
- package/esm/typings/src/execution/EmbeddingVector.d.ts +8 -0
- package/esm/typings/src/execution/Executables.d.ts +18 -0
- package/esm/typings/src/execution/ExecutionTools.d.ts +69 -0
- package/esm/typings/src/execution/FilesystemTools.d.ts +9 -0
- package/esm/typings/src/execution/LlmExecutionTools.d.ts +61 -0
- package/esm/typings/src/execution/LlmExecutionToolsConstructor.d.ts +10 -0
- package/esm/typings/src/execution/PipelineExecutor.d.ts +19 -0
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +50 -0
- package/esm/typings/src/execution/PromptResult.d.ts +101 -0
- package/esm/typings/src/execution/PromptResultUsage.d.ts +33 -0
- package/esm/typings/src/execution/PromptbookFetch.d.ts +5 -0
- package/esm/typings/src/execution/PromptbookFetch.test-type.d.ts +5 -0
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +39 -0
- package/esm/typings/src/execution/UncertainNumber.d.ts +19 -0
- package/esm/typings/src/execution/UserInterfaceTools.d.ts +46 -0
- package/esm/typings/src/execution/assertsExecutionSuccessful.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/$OngoingTaskResult.d.ts +45 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +46 -0
- package/esm/typings/src/execution/createPipelineExecutor/00-createPipelineExecutor.d.ts +13 -0
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +49 -0
- package/esm/typings/src/execution/createPipelineExecutor/20-executeTask.d.ts +51 -0
- package/esm/typings/src/execution/createPipelineExecutor/30-executeFormatSubvalues.d.ts +15 -0
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +64 -0
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +34 -0
- package/esm/typings/src/execution/createPipelineExecutor/getContextForTask.d.ts +10 -0
- package/esm/typings/src/execution/createPipelineExecutor/getExamplesForTask.d.ts +10 -0
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +27 -0
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTask.d.ts +30 -0
- package/esm/typings/src/execution/embeddingVectorToString.d.ts +7 -0
- package/esm/typings/src/execution/execution-report/ExecutionPromptReportJson.d.ts +24 -0
- package/esm/typings/src/execution/execution-report/ExecutionReportJson.d.ts +41 -0
- package/esm/typings/src/execution/execution-report/ExecutionReportString.d.ts +16 -0
- package/esm/typings/src/execution/execution-report/ExecutionReportStringOptions.d.ts +25 -0
- package/esm/typings/src/execution/execution-report/countWorkingDuration.d.ts +7 -0
- package/esm/typings/src/execution/execution-report/countWorkingDuration.test.d.ts +1 -0
- package/esm/typings/src/execution/execution-report/executionReportJsonToString.d.ts +15 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/AutomaticTranslator.d.ts +7 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/DebugAutomaticTranslator.d.ts +11 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/FakeAutomaticTranslator.d.ts +8 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/LindatAutomaticTranslator.d.ts +22 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/TranslatorOptions.d.ts +7 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.d.ts +8 -0
- package/esm/typings/src/execution/translation/automatic-translate/automatic-translators/utils/extractMultiplicatedOccurrence.test.d.ts +1 -0
- package/esm/typings/src/execution/translation/automatic-translate/translateMessages.d.ts +12 -0
- package/esm/typings/src/execution/utils/$provideExecutionToolsForNode.d.ts +13 -0
- package/esm/typings/src/execution/utils/addUsage.d.ts +9 -0
- package/esm/typings/src/execution/utils/addUsage.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +29 -0
- package/esm/typings/src/execution/utils/checkExpectations.test.d.ts +1 -0
- package/esm/typings/src/execution/utils/computeUsageCounts.d.ts +10 -0
- package/esm/typings/src/execution/utils/forEachAsync.d.ts +20 -0
- package/esm/typings/src/execution/utils/uncertainNumber.d.ts +9 -0
- package/esm/typings/src/execution/utils/usage-constants.d.ts +130 -0
- package/esm/typings/src/execution/utils/usageToHuman.d.ts +16 -0
- package/esm/typings/src/execution/utils/usageToWorktime.d.ts +12 -0
- package/esm/typings/src/execution/utils/usageToWorktime.test.d.ts +1 -0
- package/esm/typings/src/expectations/drafts/isDomainNameFree.d.ts +10 -0
- package/esm/typings/src/expectations/drafts/isGithubNameFree.d.ts +10 -0
- package/esm/typings/src/formats/_common/FormatDefinition.d.ts +70 -0
- package/esm/typings/src/formats/_common/FormatSubvalueDefinition.d.ts +31 -0
- package/esm/typings/src/formats/csv/CsvFormatDefinition.d.ts +17 -0
- package/esm/typings/src/formats/csv/CsvFormatError.d.ts +10 -0
- package/esm/typings/src/formats/csv/CsvSettings.d.ts +13 -0
- package/esm/typings/src/formats/index.d.ts +9 -0
- package/esm/typings/src/formats/json/JsonFormatDefinition.d.ts +19 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.d.ts +6 -0
- package/esm/typings/src/formats/json/utils/isValidJsonString.test.d.ts +1 -0
- package/esm/typings/src/formats/text/TextFormatDefinition.d.ts +19 -0
- package/esm/typings/src/formats/xml/XmlFormatDefinition.d.ts +19 -0
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +40 -0
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +8 -0
- package/esm/typings/src/formfactors/_common/string_formfactor_name.d.ts +5 -0
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +45 -0
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +19 -0
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/index.d.ts +123 -0
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +19 -0
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +25 -0
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +24 -0
- package/esm/typings/src/high-level-abstractions/_common/HighLevelAbstraction.d.ts +20 -0
- package/esm/typings/src/high-level-abstractions/implicit-formfactor/ImplicitFormfactorHla.d.ts +10 -0
- package/esm/typings/src/high-level-abstractions/index.d.ts +54 -0
- package/esm/typings/src/high-level-abstractions/quick-chatbot/QuickChatbotHla.d.ts +10 -0
- package/esm/typings/src/llm-providers/_common/register/$llmToolsMetadataRegister.d.ts +13 -0
- package/esm/typings/src/llm-providers/_common/register/$llmToolsRegister.d.ts +13 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +25 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +24 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizzardOrCli.d.ts +15 -0
- package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsFromEnv.d.ts +27 -0
- package/esm/typings/src/llm-providers/_common/register/$registeredLlmToolsMessage.d.ts +13 -0
- package/esm/typings/src/llm-providers/_common/register/LlmToolsConfiguration.d.ts +23 -0
- package/esm/typings/src/llm-providers/_common/register/LlmToolsMetadata.d.ts +36 -0
- package/esm/typings/src/llm-providers/_common/register/LlmToolsOptions.d.ts +10 -0
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +40 -0
- package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheItem.d.ts +28 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/CacheLlmToolsOptions.d.ts +19 -0
- package/esm/typings/src/llm-providers/_common/utils/cache/cacheLlmTools.d.ts +19 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage.d.ts +15 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/countTotalUsage.d.ts +17 -0
- package/esm/typings/src/llm-providers/_common/utils/count-total-usage/limitTotalUsage.d.ts +36 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionTools.d.ts +60 -0
- package/esm/typings/src/llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions.d.ts +31 -0
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +24 -0
- package/esm/typings/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.d.ts +18 -0
- package/esm/typings/src/llm-providers/anthropic-claude/computeAnthropicClaudeUsage.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/anthropic-claude/createAnthropicClaudeExecutionTools.d.ts +19 -0
- package/esm/typings/src/llm-providers/anthropic-claude/playground/playground.d.ts +7 -0
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +14 -0
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +16 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionTools.d.ts +63 -0
- package/esm/typings/src/llm-providers/azure-openai/AzureOpenAiExecutionToolsOptions.d.ts +37 -0
- package/esm/typings/src/llm-providers/azure-openai/createAzureOpenAiExecutionTools.d.ts +15 -0
- package/esm/typings/src/llm-providers/azure-openai/playground/playground.d.ts +6 -0
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +14 -0
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +15 -0
- package/esm/typings/src/llm-providers/google/GoogleExecutionToolsOptions.d.ts +9 -0
- package/esm/typings/src/llm-providers/google/createGoogleExecutionTools.d.ts +14 -0
- package/esm/typings/src/llm-providers/google/register-configuration.d.ts +14 -0
- package/esm/typings/src/llm-providers/google/register-constructor.d.ts +15 -0
- package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +15 -0
- package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +40 -0
- package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +44 -0
- package/esm/typings/src/llm-providers/mocked/test/fakeTextToExpectations.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/test/faked-completion.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/test/joker.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +5 -0
- package/esm/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/multiple/MultipleLlmExecutionTools.d.ts +63 -0
- package/esm/typings/src/llm-providers/multiple/joinLlmExecutionTools.d.ts +21 -0
- package/esm/typings/src/llm-providers/multiple/playground/playground.d.ts +5 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionTools.d.ts +36 -0
- package/esm/typings/src/llm-providers/openai/OpenAiAssistantExecutionToolsOptions.d.ts +14 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionTools.d.ts +84 -0
- package/esm/typings/src/llm-providers/openai/OpenAiExecutionToolsOptions.d.ts +11 -0
- package/esm/typings/src/llm-providers/openai/computeOpenAiUsage.d.ts +18 -0
- package/esm/typings/src/llm-providers/openai/computeOpenAiUsage.test.d.ts +4 -0
- package/esm/typings/src/llm-providers/openai/computeUsage.d.ts +16 -0
- package/esm/typings/src/llm-providers/openai/computeUsage.test.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/createOpenAiAssistantExecutionTools.d.ts +15 -0
- package/esm/typings/src/llm-providers/openai/createOpenAiExecutionTools.d.ts +15 -0
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +31 -0
- package/esm/typings/src/llm-providers/openai/playground/playground.d.ts +6 -0
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +24 -0
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +25 -0
- package/esm/typings/src/llm-providers/remote/RemoteLlmExecutionTools.d.ts +63 -0
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Error.d.ts +7 -0
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Request.d.ts +38 -0
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_ListModels_Response.d.ts +15 -0
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Progress.d.ts +12 -0
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Request.d.ts +45 -0
- package/esm/typings/src/llm-providers/remote/interfaces/PromptbookServer_Prompt_Response.d.ts +12 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteLlmExecutionToolsOptions.d.ts +54 -0
- package/esm/typings/src/llm-providers/remote/interfaces/RemoteServerOptions.d.ts +73 -0
- package/esm/typings/src/llm-providers/remote/playground/playground.d.ts +5 -0
- package/esm/typings/src/llm-providers/remote/startRemoteServer.d.ts +23 -0
- package/esm/typings/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +23 -0
- package/esm/typings/src/llm-providers/vercel/VercelProvider.d.ts +13 -0
- package/esm/typings/src/llm-providers/vercel/createExecutionToolsFromVercelProvider.d.ts +8 -0
- package/esm/typings/src/llm-providers/vercel/playground/playground.d.ts +6 -0
- package/esm/typings/src/other/templates/getBookTemplate.d.ts +21 -0
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +10 -0
- package/esm/typings/src/personas/preparePersona.d.ts +17 -0
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +22 -0
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +14 -0
- package/esm/typings/src/pipeline/PipelineInterface/getPipelineInterface.d.ts +11 -0
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineImplementingInterface.d.ts +26 -0
- package/esm/typings/src/pipeline/PipelineInterface/isPipelineInterfacesEqual.d.ts +10 -0
- package/esm/typings/src/pipeline/PipelineJson/CommonTaskJson.d.ts +100 -0
- package/esm/typings/src/pipeline/PipelineJson/DialogTaskJson.d.ts +13 -0
- package/esm/typings/src/pipeline/PipelineJson/Expectations.d.ts +40 -0
- package/esm/typings/src/pipeline/PipelineJson/KnowledgePieceJson.d.ts +73 -0
- package/esm/typings/src/pipeline/PipelineJson/KnowledgeSourceJson.d.ts +44 -0
- package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +98 -0
- package/esm/typings/src/pipeline/PipelineJson/PersonaJson.d.ts +45 -0
- package/esm/typings/src/pipeline/PipelineJson/PipelineJson.d.ts +112 -0
- package/esm/typings/src/pipeline/PipelineJson/PreparationJson.d.ts +22 -0
- package/esm/typings/src/pipeline/PipelineJson/PromptTaskJson.d.ts +26 -0
- package/esm/typings/src/pipeline/PipelineJson/ScriptTaskJson.d.ts +20 -0
- package/esm/typings/src/pipeline/PipelineJson/SimpleTaskJson.d.ts +13 -0
- package/esm/typings/src/pipeline/PipelineJson/TaskJson.d.ts +11 -0
- package/esm/typings/src/pipeline/PipelineString.d.ts +12 -0
- package/esm/typings/src/postprocessing/utils/extractBlock.d.ts +16 -0
- package/esm/typings/src/postprocessing/utils/extractJsonBlock.d.ts +25 -0
- package/esm/typings/src/postprocessing/utils/extractJsonBlock.test.d.ts +1 -0
- package/esm/typings/src/prepare/PrepareAndScrapeOptions.d.ts +51 -0
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +16 -0
- package/esm/typings/src/prepare/isPipelinePrepared.test.d.ts +1 -0
- package/esm/typings/src/prepare/preparePipeline.d.ts +20 -0
- package/esm/typings/src/prepare/prepareTasks.d.ts +33 -0
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/Converter.d.ts +22 -0
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +59 -0
- package/esm/typings/src/scrapers/_common/ScraperIntermediateSource.d.ts +11 -0
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +19 -0
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.test.d.ts +1 -0
- package/esm/typings/src/scrapers/_common/register/$provideFilesystemForNode.d.ts +11 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForBrowser.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/register/$provideScrapersForNode.d.ts +15 -0
- package/esm/typings/src/scrapers/_common/register/$registeredScrapersMessage.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/$scrapersMetadataRegister.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/$scrapersRegister.d.ts +13 -0
- package/esm/typings/src/scrapers/_common/register/ScraperAndConverterMetadata.d.ts +41 -0
- package/esm/typings/src/scrapers/_common/register/ScraperConstructor.d.ts +12 -0
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.d.ts +34 -0
- package/esm/typings/src/scrapers/_common/utils/getScraperIntermediateSource.test.d.ts +4 -0
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +11 -0
- package/esm/typings/src/scrapers/_common/utils/scraperFetch.d.ts +7 -0
- package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +43 -0
- package/esm/typings/src/scrapers/document/DocumentScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/document/createDocumentScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/document/playground/document-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +15 -0
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +28 -0
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +43 -0
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/document-legacy/createLegacyDocumentScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/document-legacy/playground/legacy-document-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +15 -0
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +28 -0
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +29 -0
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.test.d.ts +4 -0
- package/esm/typings/src/scrapers/markdown/createMarkdownScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/markdown/playground/markdown-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +15 -0
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +28 -0
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +40 -0
- package/esm/typings/src/scrapers/pdf/createPdfScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/pdf/playground/pdf-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +15 -0
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +28 -0
- package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +50 -0
- package/esm/typings/src/scrapers/website/createWebsiteScraper.d.ts +20 -0
- package/esm/typings/src/scrapers/website/playground/website-scraper-playground.d.ts +5 -0
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +15 -0
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +28 -0
- package/esm/typings/src/scrapers/website/utils/createShowdownConverter.d.ts +7 -0
- package/esm/typings/src/scrapers/website/utils/createShowdownConverter.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-async.test.ts.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-missing.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function-with-dependencies.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/custom-function.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/postprocessing.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/script-execution-errors.test.d.ts +1 -0
- package/esm/typings/src/scripting/_test/script-execution-tools.test.d.ts +1 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.d.ts +22 -0
- package/esm/typings/src/scripting/javascript/JavascriptEvalExecutionTools.test.d.ts +4 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionTools.d.ts +8 -0
- package/esm/typings/src/scripting/javascript/JavascriptExecutionToolsOptions.d.ts +26 -0
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +52 -0
- package/esm/typings/src/scripting/javascript/utils/preserve.d.ts +13 -0
- package/esm/typings/src/scripting/javascript/utils/unknownToString.d.ts +8 -0
- package/esm/typings/src/scripting/python/PythonExecutionTools.d.ts +18 -0
- package/esm/typings/src/scripting/typescript/TypescriptExecutionTools.d.ts +18 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.d.ts +24 -0
- package/esm/typings/src/storage/_common/PromptbookStorage.test-type.d.ts +5 -0
- package/esm/typings/src/storage/blackhole/BlackholeStorage.d.ts +33 -0
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorage.d.ts +33 -0
- package/esm/typings/src/storage/file-cache-storage/FileCacheStorageOptions.d.ts +10 -0
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.d.ts +7 -0
- package/esm/typings/src/storage/file-cache-storage/utils/nameToSubfolderPath.test.d.ts +1 -0
- package/esm/typings/src/storage/local-storage/getLocalStorage.d.ts +10 -0
- package/esm/typings/src/storage/local-storage/getSessionStorage.d.ts +10 -0
- package/esm/typings/src/storage/local-storage/utils/makePromptbookStorageFromWebStorage.d.ts +11 -0
- package/esm/typings/src/storage/memory/MemoryStorage.d.ts +33 -0
- package/esm/typings/src/storage/utils/PrefixStorage.d.ts +25 -0
- package/esm/typings/src/types/Arrayable.d.ts +10 -0
- package/esm/typings/src/types/IntermediateFilesStrategy.d.ts +7 -0
- package/esm/typings/src/types/ModelRequirements.d.ts +104 -0
- package/esm/typings/src/types/ModelVariant.d.ts +15 -0
- package/esm/typings/src/types/Prompt.d.ts +111 -0
- package/esm/typings/src/types/ScriptLanguage.d.ts +13 -0
- package/esm/typings/src/types/SectionType.d.ts +21 -0
- package/esm/typings/src/types/TaskProgress.d.ts +43 -0
- package/esm/typings/src/types/TaskType.d.ts +15 -0
- package/esm/typings/src/types/typeAliasEmoji.d.ts +12 -0
- package/esm/typings/src/types/typeAliases.d.ts +630 -0
- package/esm/typings/src/utils/$Register.d.ts +39 -0
- package/esm/typings/src/utils/$getCurrentDate.d.ts +10 -0
- package/esm/typings/src/utils/FromtoItems.d.ts +19 -0
- package/esm/typings/src/utils/arrayableToArray.d.ts +11 -0
- package/esm/typings/src/utils/arrayableToArray.test.d.ts +1 -0
- package/esm/typings/src/utils/editable/types/PipelineEditableSerialized.d.ts +27 -0
- package/esm/typings/src/utils/editable/utils/removePipelineCommand.d.ts +22 -0
- package/esm/typings/src/utils/editable/utils/removePipelineCommand.test.d.ts +1 -0
- package/esm/typings/src/utils/editable/utils/renamePipelineParameter.d.ts +26 -0
- package/esm/typings/src/utils/editable/utils/renamePipelineParameter.test.d.ts +1 -0
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.d.ts +16 -0
- package/esm/typings/src/utils/editable/utils/stringifyPipelineJson.test.d.ts +1 -0
- package/esm/typings/src/utils/emojis.d.ts +24 -0
- package/esm/typings/src/utils/environment/$getGlobalScope.d.ts +9 -0
- package/esm/typings/src/utils/environment/$isRunningInBrowser.d.ts +8 -0
- package/esm/typings/src/utils/environment/$isRunningInJest.d.ts +8 -0
- package/esm/typings/src/utils/environment/$isRunningInNode.d.ts +8 -0
- package/esm/typings/src/utils/environment/$isRunningInWebWorker.d.ts +8 -0
- package/esm/typings/src/utils/execCommand/$execCommand.d.ts +16 -0
- package/esm/typings/src/utils/execCommand/$execCommandNormalizeOptions.d.ts +12 -0
- package/esm/typings/src/utils/execCommand/$execCommands.d.ts +18 -0
- package/esm/typings/src/utils/execCommand/ExecCommandOptions.d.ts +45 -0
- package/esm/typings/src/utils/execCommand/execCommand.test.d.ts +1 -0
- package/esm/typings/src/utils/execCommand/execCommandNormalizeOptions.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/constants.d.ts +16 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +9 -0
- package/esm/typings/src/utils/expectation-counters/countLines.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +9 -0
- package/esm/typings/src/utils/expectation-counters/countPages.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countParagraphs.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +13 -0
- package/esm/typings/src/utils/expectation-counters/countSentences.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +7 -0
- package/esm/typings/src/utils/expectation-counters/countWords.test.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/index.d.ts +12 -0
- package/esm/typings/src/utils/files/extensionToMimeType.d.ts +8 -0
- package/esm/typings/src/utils/files/extensionToMimeType.test.d.ts +1 -0
- package/esm/typings/src/utils/files/getFileExtension.d.ts +8 -0
- package/esm/typings/src/utils/files/getFileExtension.test.d.ts +1 -0
- package/esm/typings/src/utils/files/isDirectoryExisting.d.ts +14 -0
- package/esm/typings/src/utils/files/isDirectoryExisting.test.d.ts +1 -0
- package/esm/typings/src/utils/files/isExecutable.d.ts +11 -0
- package/esm/typings/src/utils/files/isFileExisting.d.ts +13 -0
- package/esm/typings/src/utils/files/isFileExisting.test.d.ts +1 -0
- package/esm/typings/src/utils/files/listAllFiles.d.ts +17 -0
- package/esm/typings/src/utils/files/listAllFiles.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +14 -0
- package/esm/typings/src/utils/markdown/addAutoGeneratedSection.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/createMarkdownChart.d.ts +38 -0
- package/esm/typings/src/utils/markdown/createMarkdownChart.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/createMarkdownTable.d.ts +11 -0
- package/esm/typings/src/utils/markdown/createMarkdownTable.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.d.ts +11 -0
- package/esm/typings/src/utils/markdown/escapeMarkdownBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown-real.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.d.ts +36 -0
- package/esm/typings/src/utils/markdown/extractAllBlocksFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.d.ts +15 -0
- package/esm/typings/src/utils/markdown/extractAllListItemsFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.d.ts +22 -0
- package/esm/typings/src/utils/markdown/extractOneBlockFromMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.d.ts +17 -0
- package/esm/typings/src/utils/markdown/flattenMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.d.ts +34 -0
- package/esm/typings/src/utils/markdown/parseMarkdownSection.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.d.ts +9 -0
- package/esm/typings/src/utils/markdown/prettifyMarkdown.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeContentComments.d.ts +10 -0
- package/esm/typings/src/utils/markdown/removeContentComments.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.d.ts +9 -0
- package/esm/typings/src/utils/markdown/removeMarkdownFormatting.test.d.ts +1 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.d.ts +15 -0
- package/esm/typings/src/utils/markdown/splitMarkdownIntoSections.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/DIACRITIC_VARIANTS_LETTERS.d.ts +12 -0
- package/esm/typings/src/utils/normalization/IKeywords.d.ts +21 -0
- package/esm/typings/src/utils/normalization/capitalize.d.ts +6 -0
- package/esm/typings/src/utils/normalization/capitalize.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/decapitalize.d.ts +6 -0
- package/esm/typings/src/utils/normalization/decapitalize.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.d.ts +10 -0
- package/esm/typings/src/utils/normalization/isValidKeyword.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.d.ts +9 -0
- package/esm/typings/src/utils/normalization/nameToUriPart.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.d.ts +9 -0
- package/esm/typings/src/utils/normalization/nameToUriParts.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +21 -0
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.d.ts +17 -0
- package/esm/typings/src/utils/normalization/normalizeTo_PascalCase.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.d.ts +26 -0
- package/esm/typings/src/utils/normalization/normalizeTo_SCREAMING_CASE.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.d.ts +22 -0
- package/esm/typings/src/utils/normalization/normalizeTo_camelCase.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.d.ts +17 -0
- package/esm/typings/src/utils/normalization/normalizeTo_snake_case.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.d.ts +6 -0
- package/esm/typings/src/utils/normalization/normalizeWhitespaces.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/orderJson.d.ts +21 -0
- package/esm/typings/src/utils/normalization/orderJson.test.d.ts +4 -0
- package/esm/typings/src/utils/normalization/parseKeywords.d.ts +16 -0
- package/esm/typings/src/utils/normalization/parseKeywords.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.d.ts +9 -0
- package/esm/typings/src/utils/normalization/parseKeywordsFromString.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.d.ts +11 -0
- package/esm/typings/src/utils/normalization/removeDiacritics.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/searchKeywords.d.ts +10 -0
- package/esm/typings/src/utils/normalization/searchKeywords.test.d.ts +1 -0
- package/esm/typings/src/utils/normalization/titleToName.d.ts +9 -0
- package/esm/typings/src/utils/normalization/titleToName.test.d.ts +1 -0
- package/esm/typings/src/utils/organization/TODO_USE.d.ts +12 -0
- package/esm/typings/src/utils/organization/TODO_any.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_object.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_remove_as.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_string.d.ts +6 -0
- package/esm/typings/src/utils/organization/TODO_unknown.d.ts +6 -0
- package/esm/typings/src/utils/organization/___and___.d.ts +7 -0
- package/esm/typings/src/utils/organization/___or___.d.ts +6 -0
- package/esm/typings/src/utils/organization/empty_object.d.ts +10 -0
- package/esm/typings/src/utils/organization/just.d.ts +14 -0
- package/esm/typings/src/utils/organization/just_empty_object.d.ts +12 -0
- package/esm/typings/src/utils/organization/keepTypeImported.d.ts +9 -0
- package/esm/typings/src/utils/organization/keepUnused.d.ts +16 -0
- package/esm/typings/src/utils/organization/really_any.d.ts +6 -0
- package/esm/typings/src/utils/organization/really_unknown.d.ts +6 -0
- package/esm/typings/src/utils/organization/spaceTrim.d.ts +11 -0
- package/esm/typings/src/utils/parameters/extractParameterNames.d.ts +10 -0
- package/esm/typings/src/utils/parameters/extractParameterNames.test.d.ts +1 -0
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.d.ts +27 -0
- package/esm/typings/src/utils/parameters/mapAvailableToExpectedParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/parameters/numberToString.d.ts +7 -0
- package/esm/typings/src/utils/parameters/numberToString.test.d.ts +1 -0
- package/esm/typings/src/utils/parameters/templateParameters.d.ts +16 -0
- package/esm/typings/src/utils/parameters/templateParameters.test.d.ts +1 -0
- package/esm/typings/src/utils/parameters/valueToString.d.ts +17 -0
- package/esm/typings/src/utils/parameters/valueToString.test.d.ts +1 -0
- package/esm/typings/src/utils/parseNumber.d.ts +16 -0
- package/esm/typings/src/utils/parseNumber.test.d.ts +1 -0
- package/esm/typings/src/utils/random/$randomSeed.d.ts +9 -0
- package/esm/typings/src/utils/removeEmojis.d.ts +8 -0
- package/esm/typings/src/utils/removeEmojis.test.d.ts +1 -0
- package/esm/typings/src/utils/removeQuotes.d.ts +14 -0
- package/esm/typings/src/utils/removeQuotes.test.d.ts +1 -0
- package/esm/typings/src/utils/serialization/$deepFreeze.d.ts +14 -0
- package/esm/typings/src/utils/serialization/asSerializable.d.ts +15 -0
- package/esm/typings/src/utils/serialization/asSerializable.test.d.ts +1 -0
- package/esm/typings/src/utils/serialization/checkSerializableAsJson.d.ts +45 -0
- package/esm/typings/src/utils/serialization/clonePipeline.d.ts +13 -0
- package/esm/typings/src/utils/serialization/deepClone.d.ts +10 -0
- package/esm/typings/src/utils/serialization/deepClone.test.d.ts +1 -0
- package/esm/typings/src/utils/serialization/exportJson.d.ts +29 -0
- package/esm/typings/src/utils/serialization/isSerializableAsJson.d.ts +25 -0
- package/esm/typings/src/utils/serialization/isSerializableAsJson.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/difference.d.ts +10 -0
- package/esm/typings/src/utils/sets/difference.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/intersection.d.ts +7 -0
- package/esm/typings/src/utils/sets/intersection.test.d.ts +1 -0
- package/esm/typings/src/utils/sets/union.d.ts +7 -0
- package/esm/typings/src/utils/sets/union.test.d.ts +1 -0
- package/esm/typings/src/utils/trimCodeBlock.d.ts +9 -0
- package/esm/typings/src/utils/trimCodeBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.d.ts +9 -0
- package/esm/typings/src/utils/trimEndOfCodeBlock.test.d.ts +1 -0
- package/esm/typings/src/utils/unwrapResult.d.ts +37 -0
- package/esm/typings/src/utils/unwrapResult.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.d.ts +8 -0
- package/esm/typings/src/utils/validators/email/isValidEmail.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.d.ts +9 -0
- package/esm/typings/src/utils/validators/filePath/isValidFilePath.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.d.ts +10 -0
- package/esm/typings/src/utils/validators/javascriptName/isValidJavascriptName.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.d.ts +10 -0
- package/esm/typings/src/utils/validators/parameterName/validateParameterName.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.d.ts +15 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidPromptbookVersion.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.d.ts +12 -0
- package/esm/typings/src/utils/validators/semanticVersion/isValidSemanticVersion.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.d.ts +11 -0
- package/esm/typings/src/utils/validators/url/isHostnameOnPrivateNetwork.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.d.ts +13 -0
- package/esm/typings/src/utils/validators/url/isUrlOnPrivateNetwork.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.d.ts +15 -0
- package/esm/typings/src/utils/validators/url/isValidPipelineUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.d.ts +13 -0
- package/esm/typings/src/utils/validators/url/isValidUrl.test.d.ts +1 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.d.ts +8 -0
- package/esm/typings/src/utils/validators/uuid/isValidUuid.test.d.ts +1 -0
- package/esm/typings/src/version.d.ts +25 -0
- package/esm/typings/src/wizzard/wizzard.d.ts +51 -0
- package/package.json +63 -0
- package/umd/index.umd.js +647 -0
- package/umd/index.umd.js.map +1 -0
package/esm/index.es.js
ADDED
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
import spaceTrim, { spaceTrim as spaceTrim$1 } from 'spacetrim';
|
|
2
|
+
|
|
3
|
+
// ⚠️ WARNING: This code has been generated so that any manual changes will be overwritten
|
|
4
|
+
/**
|
|
5
|
+
* The version of the Book language
|
|
6
|
+
*
|
|
7
|
+
* @generated
|
|
8
|
+
* @see https://github.com/webgptorg/book
|
|
9
|
+
*/
|
|
10
|
+
var BOOK_LANGUAGE_VERSION = '1.0.0';
|
|
11
|
+
/**
|
|
12
|
+
* The version of the Promptbook engine
|
|
13
|
+
*
|
|
14
|
+
* @generated
|
|
15
|
+
* @see https://github.com/webgptorg/promptbook
|
|
16
|
+
*/
|
|
17
|
+
var PROMPTBOOK_ENGINE_VERSION = '0.81.0-10';
|
|
18
|
+
/**
|
|
19
|
+
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
20
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/*! *****************************************************************************
|
|
24
|
+
Copyright (c) Microsoft Corporation.
|
|
25
|
+
|
|
26
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
27
|
+
purpose with or without fee is hereby granted.
|
|
28
|
+
|
|
29
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
30
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
31
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
32
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
33
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
34
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
35
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
36
|
+
***************************************************************************** */
|
|
37
|
+
/* global Reflect, Promise */
|
|
38
|
+
|
|
39
|
+
var extendStatics = function(d, b) {
|
|
40
|
+
extendStatics = Object.setPrototypeOf ||
|
|
41
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
42
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
43
|
+
return extendStatics(d, b);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
function __extends(d, b) {
|
|
47
|
+
if (typeof b !== "function" && b !== null)
|
|
48
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
49
|
+
extendStatics(d, b);
|
|
50
|
+
function __() { this.constructor = d; }
|
|
51
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var __assign = function() {
|
|
55
|
+
__assign = Object.assign || function __assign(t) {
|
|
56
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
57
|
+
s = arguments[i];
|
|
58
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
59
|
+
}
|
|
60
|
+
return t;
|
|
61
|
+
};
|
|
62
|
+
return __assign.apply(this, arguments);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
function __values(o) {
|
|
66
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
67
|
+
if (m) return m.call(o);
|
|
68
|
+
if (o && typeof o.length === "number") return {
|
|
69
|
+
next: function () {
|
|
70
|
+
if (o && i >= o.length) o = void 0;
|
|
71
|
+
return { value: o && o[i++], done: !o };
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function __read(o, n) {
|
|
78
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
79
|
+
if (!m) return o;
|
|
80
|
+
var i = m.call(o), r, ar = [], e;
|
|
81
|
+
try {
|
|
82
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
83
|
+
}
|
|
84
|
+
catch (error) { e = { error: error }; }
|
|
85
|
+
finally {
|
|
86
|
+
try {
|
|
87
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
88
|
+
}
|
|
89
|
+
finally { if (e) throw e.error; }
|
|
90
|
+
}
|
|
91
|
+
return ar;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function __spreadArray(to, from, pack) {
|
|
95
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
96
|
+
if (ar || !(i in from)) {
|
|
97
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
98
|
+
ar[i] = from[i];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Function `removePipelineCommand` will remove one command from pipeline string
|
|
106
|
+
*
|
|
107
|
+
* @public exported from `@promptbook/editable`
|
|
108
|
+
*/
|
|
109
|
+
function removePipelineCommand(options) {
|
|
110
|
+
var e_1, _a;
|
|
111
|
+
var command = options.command, pipeline = options.pipeline;
|
|
112
|
+
var lines = pipeline.split('\n');
|
|
113
|
+
// TODO: [🧽] DRY
|
|
114
|
+
var currentType = 'MARKDOWN';
|
|
115
|
+
var newLines = [];
|
|
116
|
+
try {
|
|
117
|
+
for (var lines_1 = __values(lines), lines_1_1 = lines_1.next(); !lines_1_1.done; lines_1_1 = lines_1.next()) {
|
|
118
|
+
var line = lines_1_1.value;
|
|
119
|
+
if (currentType === 'MARKDOWN') {
|
|
120
|
+
if (line.startsWith('```')) {
|
|
121
|
+
currentType = 'CODE_BLOCK';
|
|
122
|
+
}
|
|
123
|
+
else if (line.includes('<!--')) {
|
|
124
|
+
currentType = 'COMMENT';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else if (currentType === 'CODE_BLOCK') {
|
|
128
|
+
if (line.startsWith('```')) {
|
|
129
|
+
currentType = 'MARKDOWN';
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (currentType === 'COMMENT') {
|
|
133
|
+
if (line.includes('-->')) {
|
|
134
|
+
currentType = 'MARKDOWN';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (currentType === 'MARKDOWN' && /^(-|\d\))/m.test(line) && line.toUpperCase().includes(command)) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
newLines.push(line);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
144
|
+
finally {
|
|
145
|
+
try {
|
|
146
|
+
if (lines_1_1 && !lines_1_1.done && (_a = lines_1.return)) _a.call(lines_1);
|
|
147
|
+
}
|
|
148
|
+
finally { if (e_1) throw e_1.error; }
|
|
149
|
+
}
|
|
150
|
+
var newPipeline = spaceTrim(newLines.join('\n'));
|
|
151
|
+
return newPipeline;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
|
|
156
|
+
*
|
|
157
|
+
* @public exported from `@promptbook/core`
|
|
158
|
+
*/
|
|
159
|
+
var PipelineLogicError = /** @class */ (function (_super) {
|
|
160
|
+
__extends(PipelineLogicError, _super);
|
|
161
|
+
function PipelineLogicError(message) {
|
|
162
|
+
var _this = _super.call(this, message) || this;
|
|
163
|
+
_this.name = 'PipelineLogicError';
|
|
164
|
+
Object.setPrototypeOf(_this, PipelineLogicError.prototype);
|
|
165
|
+
return _this;
|
|
166
|
+
}
|
|
167
|
+
return PipelineLogicError;
|
|
168
|
+
}(Error));
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Function `renamePipelineParameter` will find all usable parameters for given task
|
|
172
|
+
* In other words, it will find all parameters that are not used in the task itseld and all its dependencies
|
|
173
|
+
*
|
|
174
|
+
* @throws {PipelineLogicError} If the new parameter name is already used in the pipeline
|
|
175
|
+
* @public exported from `@promptbook/editable`
|
|
176
|
+
*/
|
|
177
|
+
function renamePipelineParameter(options) {
|
|
178
|
+
var e_1, _a, e_2, _b;
|
|
179
|
+
var pipeline = options.pipeline, oldParameterName = options.oldParameterName, newParameterName = options.newParameterName;
|
|
180
|
+
if (pipeline.parameters.some(function (parameter) { return parameter.name === newParameterName; })) {
|
|
181
|
+
throw new PipelineLogicError("Can not replace {".concat(oldParameterName, "} to {").concat(newParameterName, "} because {").concat(newParameterName, "} is already used in the pipeline"));
|
|
182
|
+
}
|
|
183
|
+
var renamedPipeline = __assign(__assign({}, pipeline), {
|
|
184
|
+
// <- TODO: [🪓] This should be without `as $PipelineJson`
|
|
185
|
+
parameters: __spreadArray([], __read(pipeline.parameters), false), tasks: __spreadArray([], __read(pipeline.tasks), false) });
|
|
186
|
+
try {
|
|
187
|
+
for (var _c = __values(renamedPipeline.parameters), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
188
|
+
var parameter = _d.value;
|
|
189
|
+
if (parameter.name !== oldParameterName) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
parameter.name = newParameterName;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
196
|
+
finally {
|
|
197
|
+
try {
|
|
198
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
199
|
+
}
|
|
200
|
+
finally { if (e_1) throw e_1.error; }
|
|
201
|
+
}
|
|
202
|
+
try {
|
|
203
|
+
for (var _e = __values(renamedPipeline.tasks), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
204
|
+
var task = _f.value;
|
|
205
|
+
if (task.resultingParameterName === oldParameterName) {
|
|
206
|
+
task.resultingParameterName = newParameterName;
|
|
207
|
+
}
|
|
208
|
+
task.dependentParameterNames = task.dependentParameterNames.map(function (dependentParameterName) {
|
|
209
|
+
return dependentParameterName === oldParameterName ? newParameterName : dependentParameterName;
|
|
210
|
+
});
|
|
211
|
+
task.content = task.content.replace(new RegExp("{".concat(oldParameterName, "}"), 'g'), "{".concat(newParameterName, "}"));
|
|
212
|
+
task.title = task.title.replace(new RegExp("{".concat(oldParameterName, "}"), 'g'), "{".concat(newParameterName, "}"));
|
|
213
|
+
task.description =
|
|
214
|
+
task.description === undefined
|
|
215
|
+
? undefined
|
|
216
|
+
: task.description.replace(new RegExp("{".concat(oldParameterName, "}"), 'g'), "{".concat(newParameterName, "}"));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
220
|
+
finally {
|
|
221
|
+
try {
|
|
222
|
+
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
223
|
+
}
|
|
224
|
+
finally { if (e_2) throw e_2.error; }
|
|
225
|
+
}
|
|
226
|
+
return renamedPipeline;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Name for the Promptbook
|
|
231
|
+
*
|
|
232
|
+
* TODO: [🗽] Unite branding and make single place for it
|
|
233
|
+
*
|
|
234
|
+
* @public exported from `@promptbook/core`
|
|
235
|
+
*/
|
|
236
|
+
var NAME = "Promptbook";
|
|
237
|
+
/**
|
|
238
|
+
* Email of the responsible person
|
|
239
|
+
*
|
|
240
|
+
* @public exported from `@promptbook/core`
|
|
241
|
+
*/
|
|
242
|
+
var ADMIN_EMAIL = 'me@pavolhejny.com';
|
|
243
|
+
/**
|
|
244
|
+
* Name of the responsible person for the Promptbook on GitHub
|
|
245
|
+
*
|
|
246
|
+
* @public exported from `@promptbook/core`
|
|
247
|
+
*/
|
|
248
|
+
var ADMIN_GITHUB_NAME = 'hejny';
|
|
249
|
+
// <- TODO: [🧠] Better system for generator warnings - not always "code" and "by `@promptbook/cli`"
|
|
250
|
+
/**
|
|
251
|
+
* The maximum number of iterations for a loops
|
|
252
|
+
*
|
|
253
|
+
* @private within the repository - too low-level in comparison with other `MAX_...`
|
|
254
|
+
*/
|
|
255
|
+
var LOOP_LIMIT = 1000;
|
|
256
|
+
// <- TODO: [🧜♂️]
|
|
257
|
+
/**
|
|
258
|
+
* @@@
|
|
259
|
+
*
|
|
260
|
+
* @public exported from `@promptbook/core`
|
|
261
|
+
*/
|
|
262
|
+
Object.freeze({
|
|
263
|
+
delimiter: ',',
|
|
264
|
+
quoteChar: '"',
|
|
265
|
+
newline: '\n',
|
|
266
|
+
skipEmptyLines: true,
|
|
267
|
+
});
|
|
268
|
+
/**
|
|
269
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
270
|
+
* TODO: [🧠][🧜♂️] Maybe join remoteUrl and path into single value
|
|
271
|
+
*/
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Orders JSON object by keys
|
|
275
|
+
*
|
|
276
|
+
* @returns The same type of object as the input re-ordered
|
|
277
|
+
* @public exported from `@promptbook/utils`
|
|
278
|
+
*/
|
|
279
|
+
function orderJson(options) {
|
|
280
|
+
var value = options.value, order = options.order;
|
|
281
|
+
var orderedValue = __assign(__assign({}, (order === undefined ? {} : Object.fromEntries(order.map(function (key) { return [key, undefined]; })))), value);
|
|
282
|
+
return orderedValue;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Freezes the given object and all its nested objects recursively
|
|
287
|
+
*
|
|
288
|
+
* Note: `$` is used to indicate that this function is not a pure function - it mutates given object
|
|
289
|
+
* Note: This function mutates the object and returns the original (but mutated-deep-freezed) object
|
|
290
|
+
*
|
|
291
|
+
* @returns The same object as the input, but deeply frozen
|
|
292
|
+
* @public exported from `@promptbook/utils`
|
|
293
|
+
*/
|
|
294
|
+
function $deepFreeze(objectValue) {
|
|
295
|
+
var e_1, _a;
|
|
296
|
+
if (Array.isArray(objectValue)) {
|
|
297
|
+
return Object.freeze(objectValue.map(function (item) { return $deepFreeze(item); }));
|
|
298
|
+
}
|
|
299
|
+
var propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
300
|
+
try {
|
|
301
|
+
for (var propertyNames_1 = __values(propertyNames), propertyNames_1_1 = propertyNames_1.next(); !propertyNames_1_1.done; propertyNames_1_1 = propertyNames_1.next()) {
|
|
302
|
+
var propertyName = propertyNames_1_1.value;
|
|
303
|
+
var value = objectValue[propertyName];
|
|
304
|
+
if (value && typeof value === 'object') {
|
|
305
|
+
$deepFreeze(value);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
310
|
+
finally {
|
|
311
|
+
try {
|
|
312
|
+
if (propertyNames_1_1 && !propertyNames_1_1.done && (_a = propertyNames_1.return)) _a.call(propertyNames_1);
|
|
313
|
+
}
|
|
314
|
+
finally { if (e_1) throw e_1.error; }
|
|
315
|
+
}
|
|
316
|
+
Object.freeze(objectValue);
|
|
317
|
+
return objectValue;
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
321
|
+
*/
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Make error report URL for the given error
|
|
325
|
+
*
|
|
326
|
+
* @private !!!!!!
|
|
327
|
+
*/
|
|
328
|
+
function getErrorReportUrl(error) {
|
|
329
|
+
var report = {
|
|
330
|
+
title: "\uD83D\uDC1C Error report from ".concat(NAME),
|
|
331
|
+
body: spaceTrim(function (block) { return "\n\n\n `".concat(error.name || 'Error', "` has occurred in the [").concat(NAME, "], please look into it @").concat(ADMIN_GITHUB_NAME, ".\n\n ```\n ").concat(block(error.message || '(no error message)'), "\n ```\n\n\n ## More info:\n\n - **Promptbook engine version:** ").concat(PROMPTBOOK_ENGINE_VERSION, "\n - **Book language version:** ").concat(BOOK_LANGUAGE_VERSION, "\n - **Time:** ").concat(new Date().toISOString(), "\n\n <details>\n <summary>Stack trace:</summary>\n\n ## Stack trace:\n\n ```stacktrace\n ").concat(block(error.stack || '(empty)'), "\n ```\n </details>\n\n "); }),
|
|
332
|
+
};
|
|
333
|
+
var reportUrl = new URL("https://github.com/webgptorg/promptbook/issues/new");
|
|
334
|
+
reportUrl.searchParams.set('labels', 'bug');
|
|
335
|
+
reportUrl.searchParams.set('assignees', ADMIN_GITHUB_NAME);
|
|
336
|
+
reportUrl.searchParams.set('title', report.title);
|
|
337
|
+
reportUrl.searchParams.set('body', report.body);
|
|
338
|
+
return reportUrl;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* This error type indicates that the error should not happen and its last check before crashing with some other error
|
|
343
|
+
*
|
|
344
|
+
* @public exported from `@promptbook/core`
|
|
345
|
+
*/
|
|
346
|
+
var UnexpectedError = /** @class */ (function (_super) {
|
|
347
|
+
__extends(UnexpectedError, _super);
|
|
348
|
+
function UnexpectedError(message) {
|
|
349
|
+
var _this = _super.call(this, spaceTrim$1(function (block) { return "\n ".concat(block(message), "\n\n Note: This error should not happen.\n It's probbably a bug in the pipeline collection\n\n Please report issue:\n ").concat(block(getErrorReportUrl(new Error(message)).href), "\n\n Or contact us on ").concat(ADMIN_EMAIL, "\n\n "); })) || this;
|
|
350
|
+
_this.name = 'UnexpectedError';
|
|
351
|
+
Object.setPrototypeOf(_this, UnexpectedError.prototype);
|
|
352
|
+
return _this;
|
|
353
|
+
}
|
|
354
|
+
return UnexpectedError;
|
|
355
|
+
}(Error));
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Checks if the value is [🚉] serializable as JSON
|
|
359
|
+
* If not, throws an UnexpectedError with a rich error message and tracking
|
|
360
|
+
*
|
|
361
|
+
* - Almost all primitives are serializable BUT:
|
|
362
|
+
* - `undefined` is not serializable
|
|
363
|
+
* - `NaN` is not serializable
|
|
364
|
+
* - Objects and arrays are serializable if all their properties are serializable
|
|
365
|
+
* - Functions are not serializable
|
|
366
|
+
* - Circular references are not serializable
|
|
367
|
+
* - `Date` objects are not serializable
|
|
368
|
+
* - `Map` and `Set` objects are not serializable
|
|
369
|
+
* - `RegExp` objects are not serializable
|
|
370
|
+
* - `Error` objects are not serializable
|
|
371
|
+
* - `Symbol` objects are not serializable
|
|
372
|
+
* - And much more...
|
|
373
|
+
*
|
|
374
|
+
* @throws UnexpectedError if the value is not serializable as JSON
|
|
375
|
+
* @public exported from `@promptbook/utils`
|
|
376
|
+
*/
|
|
377
|
+
function checkSerializableAsJson(options) {
|
|
378
|
+
var e_1, _a;
|
|
379
|
+
var value = options.value, name = options.name, message = options.message;
|
|
380
|
+
if (value === undefined) {
|
|
381
|
+
throw new UnexpectedError("".concat(name, " is undefined"));
|
|
382
|
+
}
|
|
383
|
+
else if (value === null) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
else if (typeof value === 'boolean') {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
else if (typeof value === 'number' && !isNaN(value)) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
else if (typeof value === 'string') {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
else if (typeof value === 'symbol') {
|
|
396
|
+
throw new UnexpectedError("".concat(name, " is symbol"));
|
|
397
|
+
}
|
|
398
|
+
else if (typeof value === 'function') {
|
|
399
|
+
throw new UnexpectedError("".concat(name, " is function"));
|
|
400
|
+
}
|
|
401
|
+
else if (typeof value === 'object' && Array.isArray(value)) {
|
|
402
|
+
for (var i = 0; i < value.length; i++) {
|
|
403
|
+
checkSerializableAsJson({ name: "".concat(name, "[").concat(i, "]"), value: value[i], message: message });
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
else if (typeof value === 'object') {
|
|
407
|
+
if (value instanceof Date) {
|
|
408
|
+
throw new UnexpectedError(spaceTrim(function (block) { return "\n `".concat(name, "` is Date\n\n Use `string_date_iso8601` instead\n\n Additional message for `").concat(name, "`:\n ").concat(block(message || '(nothing)'), "\n "); }));
|
|
409
|
+
}
|
|
410
|
+
else if (value instanceof Map) {
|
|
411
|
+
throw new UnexpectedError("".concat(name, " is Map"));
|
|
412
|
+
}
|
|
413
|
+
else if (value instanceof Set) {
|
|
414
|
+
throw new UnexpectedError("".concat(name, " is Set"));
|
|
415
|
+
}
|
|
416
|
+
else if (value instanceof RegExp) {
|
|
417
|
+
throw new UnexpectedError("".concat(name, " is RegExp"));
|
|
418
|
+
}
|
|
419
|
+
else if (value instanceof Error) {
|
|
420
|
+
throw new UnexpectedError(spaceTrim(function (block) { return "\n `".concat(name, "` is unserialized Error\n\n Use function `serializeError`\n\n Additional message for `").concat(name, "`:\n ").concat(block(message || '(nothing)'), "\n\n "); }));
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
try {
|
|
424
|
+
for (var _b = __values(Object.entries(value)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
425
|
+
var _d = __read(_c.value, 2), subName = _d[0], subValue = _d[1];
|
|
426
|
+
if (subValue === undefined) {
|
|
427
|
+
// Note: undefined in object is serializable - it is just omited
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
checkSerializableAsJson({ name: "".concat(name, ".").concat(subName), value: subValue, message: message });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
434
|
+
finally {
|
|
435
|
+
try {
|
|
436
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
437
|
+
}
|
|
438
|
+
finally { if (e_1) throw e_1.error; }
|
|
439
|
+
}
|
|
440
|
+
try {
|
|
441
|
+
JSON.stringify(value); // <- TODO: [0]
|
|
442
|
+
}
|
|
443
|
+
catch (error) {
|
|
444
|
+
if (!(error instanceof Error)) {
|
|
445
|
+
throw error;
|
|
446
|
+
}
|
|
447
|
+
throw new UnexpectedError(spaceTrim(function (block) { return "\n `".concat(name, "` is not serializable\n\n ").concat(block(error.toString()), "\n\n Additional message for `").concat(name, "`:\n ").concat(block(message || '(nothing)'), "\n "); }));
|
|
448
|
+
}
|
|
449
|
+
/*
|
|
450
|
+
TODO: [0] Is there some more elegant way to check circular references?
|
|
451
|
+
const seen = new Set();
|
|
452
|
+
const stack = [{ value }];
|
|
453
|
+
while (stack.length > 0) {
|
|
454
|
+
const { value } = stack.pop()!;
|
|
455
|
+
if (typeof value === 'object' && value !== null) {
|
|
456
|
+
if (seen.has(value)) {
|
|
457
|
+
throw new UnexpectedError(`${name} has circular reference`);
|
|
458
|
+
}
|
|
459
|
+
seen.add(value);
|
|
460
|
+
if (Array.isArray(value)) {
|
|
461
|
+
stack.push(...value.map((value) => ({ value })));
|
|
462
|
+
} else {
|
|
463
|
+
stack.push(...Object.values(value).map((value) => ({ value })));
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
*/
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
else {
|
|
472
|
+
throw new UnexpectedError(spaceTrim(function (block) { return "\n `".concat(name, "` is unknown type\n\n Additional message for `").concat(name, "`:\n ").concat(block(message || '(nothing)'), "\n "); }));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* TODO: Can be return type more type-safe? like `asserts options.value is JsonValue`
|
|
477
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
478
|
+
* Note: [🐠] This is how `checkSerializableAsJson` + `isSerializableAsJson` together can just retun true/false or rich error message
|
|
479
|
+
*/
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* @@@
|
|
483
|
+
*
|
|
484
|
+
* @public exported from `@promptbook/utils`
|
|
485
|
+
*/
|
|
486
|
+
function deepClone(objectValue) {
|
|
487
|
+
return JSON.parse(JSON.stringify(objectValue));
|
|
488
|
+
/*
|
|
489
|
+
!!!!!!!!
|
|
490
|
+
TODO: [🧠] Is there a better implementation?
|
|
491
|
+
> const propertyNames = Object.getOwnPropertyNames(objectValue);
|
|
492
|
+
> for (const propertyName of propertyNames) {
|
|
493
|
+
> const value = (objectValue as really_any)[propertyName];
|
|
494
|
+
> if (value && typeof value === 'object') {
|
|
495
|
+
> deepClone(value);
|
|
496
|
+
> }
|
|
497
|
+
> }
|
|
498
|
+
> return Object.assign({}, objectValue);
|
|
499
|
+
*/
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
503
|
+
*/
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Utility to export a JSON object from a function
|
|
507
|
+
*
|
|
508
|
+
* 1) Checks if the value is serializable as JSON
|
|
509
|
+
* 2) Makes a deep clone of the object
|
|
510
|
+
* 2) Orders the object properties
|
|
511
|
+
* 2) Deeply freezes the cloned object
|
|
512
|
+
*
|
|
513
|
+
* Note: This function does not mutates the given object
|
|
514
|
+
*
|
|
515
|
+
* @returns The same type of object as the input but read-only and re-ordered
|
|
516
|
+
* @public exported from `@promptbook/utils`
|
|
517
|
+
*/
|
|
518
|
+
function exportJson(options) {
|
|
519
|
+
var name = options.name, value = options.value, order = options.order, message = options.message;
|
|
520
|
+
checkSerializableAsJson({ name: name, value: value, message: message });
|
|
521
|
+
var orderedValue =
|
|
522
|
+
// TODO: Fix error "Type instantiation is excessively deep and possibly infinite."
|
|
523
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
524
|
+
// @ts-ignore
|
|
525
|
+
order === undefined
|
|
526
|
+
? deepClone(value)
|
|
527
|
+
: orderJson({
|
|
528
|
+
value: value,
|
|
529
|
+
// <- Note: checkSerializableAsJson asserts that the value is serializable as JSON
|
|
530
|
+
order: order,
|
|
531
|
+
});
|
|
532
|
+
$deepFreeze(orderedValue);
|
|
533
|
+
return orderedValue;
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* TODO: [🧠] Is there a way how to meaningfully test this utility
|
|
537
|
+
*/
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Nonce which is used for replacing things in strings
|
|
541
|
+
*
|
|
542
|
+
* @private within the repository
|
|
543
|
+
*/
|
|
544
|
+
var REPLACING_NONCE = 'u$k42k%!V2zo34w7Fu#@QUHYPW';
|
|
545
|
+
/**
|
|
546
|
+
* The names of the parameters that are reserved for special purposes
|
|
547
|
+
*
|
|
548
|
+
* @public exported from `@promptbook/core`
|
|
549
|
+
*/
|
|
550
|
+
exportJson({
|
|
551
|
+
name: 'RESERVED_PARAMETER_NAMES',
|
|
552
|
+
message: "The names of the parameters that are reserved for special purposes",
|
|
553
|
+
value: [
|
|
554
|
+
'content',
|
|
555
|
+
'context',
|
|
556
|
+
'knowledge',
|
|
557
|
+
'examples',
|
|
558
|
+
'modelName',
|
|
559
|
+
'currentDate',
|
|
560
|
+
// <- TODO: list here all command names
|
|
561
|
+
// <- TODO: Add more like 'date', 'modelName',...
|
|
562
|
+
// <- TODO: Add [emoji] + instructions ACRY when adding new reserved parameter
|
|
563
|
+
],
|
|
564
|
+
});
|
|
565
|
+
/**
|
|
566
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
567
|
+
*/
|
|
568
|
+
|
|
569
|
+
// <- TODO: !!!!!!! Auto convert to type `import { ... } from 'type-fest';`
|
|
570
|
+
/**
|
|
571
|
+
* Tests if the value is [🚉] serializable as JSON
|
|
572
|
+
*
|
|
573
|
+
* - Almost all primitives are serializable BUT:
|
|
574
|
+
* - `undefined` is not serializable
|
|
575
|
+
* - `NaN` is not serializable
|
|
576
|
+
* - Objects and arrays are serializable if all their properties are serializable
|
|
577
|
+
* - Functions are not serializable
|
|
578
|
+
* - Circular references are not serializable
|
|
579
|
+
* - `Date` objects are not serializable
|
|
580
|
+
* - `Map` and `Set` objects are not serializable
|
|
581
|
+
* - `RegExp` objects are not serializable
|
|
582
|
+
* - `Error` objects are not serializable
|
|
583
|
+
* - `Symbol` objects are not serializable
|
|
584
|
+
* - And much more...
|
|
585
|
+
*
|
|
586
|
+
*
|
|
587
|
+
* @public exported from `@promptbook/utils`
|
|
588
|
+
*/
|
|
589
|
+
function isSerializableAsJson(value) {
|
|
590
|
+
try {
|
|
591
|
+
checkSerializableAsJson({ value: value });
|
|
592
|
+
return true;
|
|
593
|
+
}
|
|
594
|
+
catch (error) {
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* TODO: [🧠][main] !!! In-memory cache of same values to prevent multiple checks
|
|
600
|
+
* TODO: [🧠][💺] Can be done this on type-level?
|
|
601
|
+
*/
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Stringify the PipelineJson with proper formatting
|
|
605
|
+
*
|
|
606
|
+
* Note: [0] It can be used for more JSON types like whole collection of pipelines, single knowledge piece, etc.
|
|
607
|
+
* Note: In contrast to JSON.stringify, this function ensures that **embedding index** is on single line
|
|
608
|
+
*
|
|
609
|
+
* @public exported from `@promptbook/editable`
|
|
610
|
+
*/
|
|
611
|
+
function stringifyPipelineJson(pipeline) {
|
|
612
|
+
if (!isSerializableAsJson(pipeline)) {
|
|
613
|
+
throw new UnexpectedError(spaceTrim("\n Cannot stringify the pipeline, because it is not serializable as JSON\n\n There can be multiple reasons:\n 1) The pipeline contains circular references\n 2) It is not a valid PipelineJson\n "));
|
|
614
|
+
}
|
|
615
|
+
var pipelineJsonStringified = JSON.stringify(pipeline, null, 4);
|
|
616
|
+
for (var i = 0; i < LOOP_LIMIT; i++) {
|
|
617
|
+
pipelineJsonStringified = pipelineJsonStringified.replace(/(-?0\.\d+),[\n\s]+(-?0\.\d+)/gms, "$1".concat(REPLACING_NONCE, "$2"));
|
|
618
|
+
}
|
|
619
|
+
pipelineJsonStringified = pipelineJsonStringified.split(REPLACING_NONCE).join(', ');
|
|
620
|
+
pipelineJsonStringified += '\n';
|
|
621
|
+
return pipelineJsonStringified;
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* TODO: [🐝] Not Working propperly @see https://promptbook.studio/examples/mixed-knowledge.book.md
|
|
625
|
+
* TODO: [🧠][0] Maybe rename to `stringifyPipelineJson`, `stringifyIndexedJson`,...
|
|
626
|
+
* TODO: [🧠] Maybe more elegant solution than replacing via regex
|
|
627
|
+
* TODO: [🍙] Make some standard order of json properties
|
|
628
|
+
*/
|
|
629
|
+
|
|
630
|
+
export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION, removePipelineCommand, renamePipelineParameter, stringifyPipelineJson };
|
|
631
|
+
//# sourceMappingURL=index.es.js.map
|