@promptbook/remote-server 0.75.0-1 → 0.75.0-4
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 +28 -17
- package/esm/index.es.js +6 -1
- package/esm/index.es.js.map +1 -1
- package/esm/typings/{promptbook-collection → books}/index.d.ts +6 -6
- package/esm/typings/src/_packages/core.index.d.ts +28 -20
- package/esm/typings/src/_packages/types.index.d.ts +62 -52
- package/esm/typings/src/_packages/utils.index.d.ts +2 -2
- package/esm/typings/src/cli/cli-commands/about.d.ts +1 -0
- package/esm/typings/src/cli/cli-commands/hello.d.ts +1 -0
- package/esm/typings/src/cli/cli-commands/make.d.ts +1 -0
- package/esm/typings/src/cli/cli-commands/prettify.d.ts +1 -0
- package/esm/typings/src/cli/cli-commands/run.d.ts +1 -0
- package/esm/typings/src/cli/cli-commands/test-command.d.ts +1 -0
- package/esm/typings/src/cli/main.d.ts +1 -0
- package/esm/typings/src/collection/PipelineCollection.d.ts +1 -1
- package/esm/typings/src/collection/SimplePipelineCollection.d.ts +1 -1
- package/esm/typings/src/collection/collectionToJson.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -1
- package/esm/typings/src/collection/constructors/createCollectionFromPromise.d.ts +1 -1
- package/esm/typings/src/commands/EXPECT/ExpectCommand.d.ts +3 -3
- package/esm/typings/src/commands/EXPECT/expectCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/FORMAT/formatCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/JOKER/jokerCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/POSTPROCESS/postprocessCommandParser.d.ts +2 -2
- package/esm/typings/src/commands/SECTION/SectionCommand.d.ts +11 -0
- package/esm/typings/src/commands/{TEMPLATE/templateCommandParser.d.ts → SECTION/sectionCommandParser.d.ts} +6 -6
- package/esm/typings/src/commands/_common/types/Command.d.ts +1 -1
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +17 -19
- package/esm/typings/src/commands/_common/types/CommandUsagePlaces.d.ts +1 -1
- package/esm/typings/src/commands/index.d.ts +4 -1
- package/esm/typings/src/config.d.ts +11 -3
- package/esm/typings/src/conversion/pipelineJsonToString.d.ts +3 -3
- package/esm/typings/src/conversion/pipelineStringToJson.d.ts +2 -2
- package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +3 -3
- package/esm/typings/src/conversion/prettify/prettifyPipelineString.d.ts +1 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +4 -4
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTask.d.ts +15 -0
- package/esm/typings/src/conversion/utils/renameParameter.d.ts +3 -3
- package/esm/typings/src/conversion/validation/_importPipeline.d.ts +3 -2
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +1 -1
- package/esm/typings/src/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -1
- package/esm/typings/src/errors/index.d.ts +3 -0
- package/esm/typings/src/execution/PipelineExecutorResult.d.ts +2 -2
- package/esm/typings/src/execution/PromptResultUsage.d.ts +1 -1
- package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/{$OngoingTemplateResult.d.ts → $OngoingTaskResult.d.ts} +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/10-executePipeline.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/{20-executeTemplate.d.ts → 20-executeTask.d.ts} +7 -7
- package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +5 -5
- package/esm/typings/src/execution/createPipelineExecutor/filterJustOutputParameters.d.ts +1 -1
- package/esm/typings/src/execution/createPipelineExecutor/{getContextForTemplate.d.ts → getContextForTask.d.ts} +2 -2
- package/esm/typings/src/execution/createPipelineExecutor/{getExamplesForTemplate.d.ts → getExamplesForTask.d.ts} +2 -2
- 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/{types → execution}/execution-report/ExecutionPromptReportJson.d.ts +2 -2
- package/esm/typings/src/{types → execution}/execution-report/ExecutionReportJson.d.ts +4 -4
- package/esm/typings/src/{types → execution}/execution-report/ExecutionReportStringOptions.d.ts +1 -1
- package/esm/typings/src/execution/utils/checkExpectations.d.ts +1 -1
- package/esm/typings/src/execution/utils/usage-constants.d.ts +3 -0
- package/esm/typings/src/formats/index.d.ts +3 -0
- package/esm/typings/src/formfactors/_boilerplate/BoilerplateFormfactorDefinition.d.ts +2 -2
- package/esm/typings/src/formfactors/_common/AbstractFormfactorDefinition.d.ts +7 -1
- package/esm/typings/src/formfactors/_common/FormfactorDefinition.d.ts +3 -0
- package/esm/typings/src/formfactors/chatbot/ChatbotFormfactorDefinition.d.ts +45 -0
- package/esm/typings/src/formfactors/generator/GeneratorFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/generic/GenericFormfactorDefinition.d.ts +3 -3
- package/esm/typings/src/formfactors/index.d.ts +85 -12
- package/esm/typings/src/formfactors/matcher/MatcherFormfactorDefinition.d.ts +14 -0
- package/esm/typings/src/formfactors/sheets/SheetsFormfactorDefinition.d.ts +13 -3
- package/esm/typings/src/formfactors/translator/TranslatorFormfactorDefinition.d.ts +13 -3
- package/esm/typings/src/llm-providers/anthropic-claude/anthropic-claude-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/anthropic-claude/register-configuration.d.ts +3 -0
- package/esm/typings/src/llm-providers/anthropic-claude/register-constructor.d.ts +1 -0
- package/esm/typings/src/llm-providers/azure-openai/register-configuration.d.ts +3 -0
- package/esm/typings/src/llm-providers/azure-openai/register-constructor.d.ts +1 -0
- package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -1
- package/esm/typings/src/llm-providers/openai/openai-models.d.ts +1 -0
- package/esm/typings/src/llm-providers/openai/register-configuration.d.ts +3 -0
- package/esm/typings/src/llm-providers/openai/register-constructor.d.ts +1 -0
- package/esm/typings/src/personas/preparePersona.d.ts +1 -1
- package/esm/typings/src/pipeline/PipelineInterface/PipelineInterface.d.ts +26 -0
- package/esm/typings/src/pipeline/PipelineInterface/constants.d.ts +14 -0
- package/esm/typings/src/pipeline/{pipeline-interface → PipelineInterface}/getPipelineInterface.d.ts +3 -1
- package/esm/typings/src/pipeline/{pipeline-interface → PipelineInterface}/isPipelineImplementingInterface.d.ts +5 -1
- package/esm/typings/src/pipeline/{pipeline-interface → PipelineInterface}/isPipelineInterfacesEqual.d.ts +2 -0
- package/esm/typings/src/{types/PipelineJson/TemplateJsonCommon.d.ts → pipeline/PipelineJson/CommonTaskJson.d.ts} +24 -24
- package/esm/typings/src/pipeline/PipelineJson/DialogTaskJson.d.ts +13 -0
- package/esm/typings/src/{types → pipeline}/PipelineJson/Expectations.d.ts +2 -2
- package/esm/typings/src/{types → pipeline}/PipelineJson/KnowledgePieceJson.d.ts +7 -6
- package/esm/typings/src/{types → pipeline}/PipelineJson/KnowledgeSourceJson.d.ts +3 -3
- package/esm/typings/src/pipeline/PipelineJson/ParameterJson.d.ts +98 -0
- package/esm/typings/src/{types → pipeline}/PipelineJson/PersonaJson.d.ts +5 -5
- package/esm/typings/src/{types → pipeline}/PipelineJson/PipelineJson.d.ts +11 -11
- package/esm/typings/src/{types → pipeline}/PipelineJson/PreparationJson.d.ts +1 -1
- package/esm/typings/src/{types/PipelineJson/PromptTemplateJson.d.ts → pipeline/PipelineJson/PromptTaskJson.d.ts} +8 -8
- 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/{types → pipeline}/PipelineString.d.ts +1 -1
- package/esm/typings/src/prepare/isPipelinePrepared.d.ts +3 -3
- package/esm/typings/src/prepare/preparePipeline.d.ts +1 -1
- package/esm/typings/src/prepare/prepareTasks.d.ts +32 -0
- package/esm/typings/src/prepare/unpreparePipeline.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/Scraper.d.ts +1 -1
- package/esm/typings/src/scrapers/_common/prepareKnowledgePieces.d.ts +2 -2
- package/esm/typings/src/scrapers/_common/utils/makeKnowledgeSourceHandler.d.ts +1 -1
- package/esm/typings/src/scrapers/document/DocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/document/register-metadata.d.ts +3 -0
- package/esm/typings/src/scrapers/document-legacy/LegacyDocumentScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/document-legacy/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/document-legacy/register-metadata.d.ts +3 -0
- package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/markdown/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/markdown/register-metadata.d.ts +3 -0
- package/esm/typings/src/scrapers/pdf/PdfScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/pdf/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/pdf/register-metadata.d.ts +3 -0
- package/esm/typings/src/scrapers/website/WebsiteScraper.d.ts +1 -1
- package/esm/typings/src/scrapers/website/register-constructor.d.ts +1 -0
- package/esm/typings/src/scrapers/website/register-metadata.d.ts +3 -0
- package/esm/typings/src/scripting/javascript/postprocessing-functions.d.ts +1 -0
- package/esm/typings/src/types/Prompt.d.ts +4 -4
- package/esm/typings/src/types/SectionType.d.ts +21 -0
- package/esm/typings/src/types/TaskProgress.d.ts +2 -2
- package/esm/typings/src/types/TaskType.d.ts +15 -0
- package/esm/typings/src/types/typeAliasEmoji.d.ts +3 -0
- package/esm/typings/src/types/typeAliases.d.ts +2 -1
- package/esm/typings/src/utils/emojis.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/constants.d.ts +1 -0
- package/esm/typings/src/utils/expectation-counters/countCharacters.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countLines.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countPages.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countParagraphs.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countSentences.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/countWords.d.ts +1 -1
- package/esm/typings/src/utils/expectation-counters/index.d.ts +3 -2
- package/esm/typings/src/utils/normalization/normalize-to-kebab-case.d.ts +3 -0
- package/esm/typings/src/utils/organization/TODO_remove_as.d.ts +6 -0
- package/esm/typings/src/utils/parameters/extractParameterNames.d.ts +2 -2
- package/esm/typings/src/utils/serialization/clonePipeline.d.ts +1 -1
- package/esm/typings/src/version.d.ts +2 -1
- package/package.json +5 -4
- package/umd/index.umd.js +6 -1
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/commands/TEMPLATE/TemplateCommand.d.ts +0 -11
- package/esm/typings/src/commands/TEMPLATE/TemplateTypes.d.ts +0 -15
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +0 -15
- package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTemplate.d.ts +0 -27
- package/esm/typings/src/execution/createPipelineExecutor/getReservedParametersForTemplate.d.ts +0 -30
- package/esm/typings/src/formfactors/chat/ChatFormfactorDefinition.d.ts +0 -15
- package/esm/typings/src/pipeline/pipeline-interface/PipelineInterface.d.ts +0 -22
- package/esm/typings/src/pipeline/pipeline-interface/constants.d.ts +0 -9
- package/esm/typings/src/prepare/prepareTemplates.d.ts +0 -32
- package/esm/typings/src/types/PipelineJson/DialogTemplateJson.d.ts +0 -13
- package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +0 -39
- package/esm/typings/src/types/PipelineJson/ScriptTemplateJson.d.ts +0 -20
- package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +0 -13
- package/esm/typings/src/types/PipelineJson/TemplateJson.d.ts +0 -11
- /package/esm/typings/src/commands/{TEMPLATE/templateCommand.test.d.ts → SECTION/sectionCommand.test.d.ts} +0 -0
- /package/esm/typings/src/conversion/utils/{extractParameterNamesFromTemplate.test.d.ts → extractParameterNamesFromTask.test.d.ts} +0 -0
- /package/esm/typings/src/{types → execution}/execution-report/ExecutionReportString.d.ts +0 -0
- /package/esm/typings/src/{types → execution}/execution-report/countWorkingDuration.d.ts +0 -0
- /package/esm/typings/src/{types → execution}/execution-report/countWorkingDuration.test.d.ts +0 -0
- /package/esm/typings/src/{types → execution}/execution-report/executionReportJsonToString.d.ts +0 -0
|
@@ -13,7 +13,7 @@ export declare const GENERATOR_WARNING = "\u26A0\uFE0F WARNING: This code has be
|
|
|
13
13
|
*
|
|
14
14
|
* @public exported from `@promptbook/core`
|
|
15
15
|
*/
|
|
16
|
-
export declare const CLAIM = "
|
|
16
|
+
export declare const CLAIM = "It's time for a paradigm shift. The future of software in plain English, French or Latin";
|
|
17
17
|
/**
|
|
18
18
|
* When the title is not provided, the default title is used
|
|
19
19
|
*
|
|
@@ -94,6 +94,13 @@ export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_DEPTH = 3;
|
|
|
94
94
|
* @public exported from `@promptbook/core`
|
|
95
95
|
*/
|
|
96
96
|
export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
|
|
97
|
+
/**
|
|
98
|
+
* Where to store your books
|
|
99
|
+
* This is kind of a "src" for your books
|
|
100
|
+
*
|
|
101
|
+
* @public exported from `@promptbook/core`
|
|
102
|
+
*/
|
|
103
|
+
export declare const DEFAULT_BOOKS_DIRNAME = "./books";
|
|
97
104
|
/**
|
|
98
105
|
* Where to store the cache of executions for promptbook CLI
|
|
99
106
|
*
|
|
@@ -101,7 +108,7 @@ export declare const DEFAULT_MAX_KNOWLEDGE_SOURCES_SCRAPING_TOTAL = 200;
|
|
|
101
108
|
*
|
|
102
109
|
* @public exported from `@promptbook/core`
|
|
103
110
|
*/
|
|
104
|
-
export declare const DEFAULT_EXECUTIONS_CACHE_DIRNAME = "
|
|
111
|
+
export declare const DEFAULT_EXECUTIONS_CACHE_DIRNAME = "./.promptbook/executions-cache";
|
|
105
112
|
/**
|
|
106
113
|
* Where to store the scrape cache
|
|
107
114
|
*
|
|
@@ -109,7 +116,7 @@ export declare const DEFAULT_EXECUTIONS_CACHE_DIRNAME = "/.promptbook/executions
|
|
|
109
116
|
*
|
|
110
117
|
* @public exported from `@promptbook/core`
|
|
111
118
|
*/
|
|
112
|
-
export declare const DEFAULT_SCRAPE_CACHE_DIRNAME = "
|
|
119
|
+
export declare const DEFAULT_SCRAPE_CACHE_DIRNAME = "./.promptbook/scrape-cache";
|
|
113
120
|
/**
|
|
114
121
|
* The name of the builded pipeline collection made by CLI `ptbk make` and for lookup in `createCollectionFromDirectory`
|
|
115
122
|
*
|
|
@@ -193,5 +200,6 @@ export declare const IS_PIPELINE_LOGIC_VALIDATED: boolean;
|
|
|
193
200
|
export declare const IS_COST_PREVENTED: boolean;
|
|
194
201
|
/**
|
|
195
202
|
* TODO: Extract `constants.ts` from `config.ts`
|
|
203
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
196
204
|
* TODO: [🧠][🧜♂️] Maybe join remoteUrl and path into single value
|
|
197
205
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PipelineJson } from '../
|
|
2
|
-
import type { PipelineString } from '../
|
|
1
|
+
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../pipeline/PipelineString';
|
|
3
3
|
/**
|
|
4
4
|
* Converts promptbook in JSON format to string format
|
|
5
5
|
*
|
|
@@ -9,7 +9,7 @@ import type { PipelineString } from '../types/PipelineString';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function pipelineJsonToString(pipelineJson: PipelineJson): PipelineString;
|
|
11
11
|
/**
|
|
12
|
-
* TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `
|
|
12
|
+
* TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `taskParameterJsonToString` , use `stringifyCommand`
|
|
13
13
|
* TODO: [🧠] Is there a way to auto-detect missing features in pipelineJsonToString
|
|
14
14
|
* TODO: [🏛] Maybe make some markdown builder
|
|
15
15
|
* TODO: [🏛] Escape all
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExecutionTools } from '../execution/ExecutionTools';
|
|
2
|
+
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { PipelineString } from '../pipeline/PipelineString';
|
|
2
4
|
import type { PrepareAndScrapeOptions } from '../prepare/PrepareAndScrapeOptions';
|
|
3
|
-
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
4
|
-
import type { PipelineString } from '../types/PipelineString';
|
|
5
5
|
/**
|
|
6
6
|
* Compile pipeline from string (markdown) format to JSON format
|
|
7
7
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PipelineJson } from '../
|
|
2
|
-
import type { PipelineString } from '../
|
|
1
|
+
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../pipeline/PipelineString';
|
|
3
3
|
/**
|
|
4
4
|
* Compile pipeline from string (markdown) format to JSON format synchronously
|
|
5
5
|
*
|
|
@@ -23,7 +23,7 @@ export declare function pipelineStringToJsonSync(pipelineString: PipelineString)
|
|
|
23
23
|
* TODO: Use spaceTrim more effectively
|
|
24
24
|
* TODO: [🧠] Parameter flags - isInput, isOutput, isInternal
|
|
25
25
|
* TODO: [🥞] Not optimal parsing because `splitMarkdownIntoSections` is executed twice with same string, once through `flattenMarkdown` and second directly here
|
|
26
|
-
* TODO: [♈] Probbably move expectations from
|
|
26
|
+
* TODO: [♈] Probbably move expectations from tasks to parameters
|
|
27
27
|
* TODO: [🛠] Actions, instruments (and maybe knowledge) => Functions and tools
|
|
28
28
|
* TODO: [🍙] Make some standard order of json properties
|
|
29
29
|
*/
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { PipelineJson } from '../../
|
|
2
|
-
import type {
|
|
1
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
3
3
|
import type { string_href } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* Addtional options for rendering Mermaid graph
|
|
6
6
|
*/
|
|
7
7
|
export type renderPipelineMermaidOptions = {
|
|
8
8
|
/**
|
|
9
|
-
* Callback for creating from
|
|
9
|
+
* Callback for creating from task graph node
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
linkTask?(task: TaskJson): {
|
|
12
12
|
href: string_href;
|
|
13
13
|
title: string;
|
|
14
14
|
} | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
3
|
+
import type { string_parameter_name } from '../../types/typeAliases';
|
|
4
|
+
/**
|
|
5
|
+
* Parses the task and returns the set of all used parameters
|
|
6
|
+
*
|
|
7
|
+
* @param task the task with used parameters
|
|
8
|
+
* @returns the set of parameter names
|
|
9
|
+
* @throws {ParseError} if the script is invalid
|
|
10
|
+
* @public exported from `@promptbook/utils`
|
|
11
|
+
*/
|
|
12
|
+
export declare function extractParameterNamesFromTask(task: ReadonlyDeep<Pick<TaskJson, 'title' | 'description' | 'taskType' | 'content' | 'preparedContent' | 'jokerParameterNames' | 'foreach'>>): Set<string_parameter_name>;
|
|
13
|
+
/**
|
|
14
|
+
* TODO: [🔣] If script require contentLanguage
|
|
15
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PipelineJson } from '../../
|
|
1
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
2
|
import type { string_name } from '../../types/typeAliases';
|
|
3
3
|
type RenameParameterOptions = {
|
|
4
4
|
/**
|
|
@@ -16,8 +16,8 @@ type RenameParameterOptions = {
|
|
|
16
16
|
readonly newParameterName: string_name;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* Function `renameParameter` will find all usable parameters for given
|
|
20
|
-
* In other words, it will find all parameters that are not used in the
|
|
19
|
+
* Function `renameParameter` will find all usable parameters for given task
|
|
20
|
+
* In other words, it will find all parameters that are not used in the task itseld and all its dependencies
|
|
21
21
|
*
|
|
22
22
|
* @throws {PipelineLogicError} If the new parameter name is already used in the pipeline
|
|
23
23
|
* @public exported from `@promptbook/utils`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PipelineJson } from '../../
|
|
2
|
-
import type { PipelineString } from '../../
|
|
1
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
|
+
import type { PipelineString } from '../../pipeline/PipelineString';
|
|
3
3
|
import type { string_json } from '../../types/typeAliases';
|
|
4
4
|
/**
|
|
5
5
|
* Import the pipeline.book.md or pipeline.book.json file
|
|
@@ -25,5 +25,6 @@ export declare function importPipelineJson(path: `${string}.book.json`): Pipelin
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function importPipelineJsonAsString(path: `${string}.book.json`): string_json<PipelineJson>;
|
|
27
27
|
/**
|
|
28
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
28
29
|
* Note: [⚫] Code in this file should never be published in any package
|
|
29
30
|
*/
|
|
@@ -13,7 +13,7 @@ export declare class SimplePromptInterfaceTools implements UserInterfaceTools {
|
|
|
13
13
|
protected readonly options: CommonToolsOptions;
|
|
14
14
|
constructor(options?: CommonToolsOptions);
|
|
15
15
|
/**
|
|
16
|
-
* Trigger window.
|
|
16
|
+
* Trigger window.prompt dialog
|
|
17
17
|
*/
|
|
18
18
|
promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
|
|
19
19
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import type { ErrorJson } from '../errors/utils/ErrorJson';
|
|
3
|
-
import type {
|
|
4
|
-
import type { PipelineJson } from '../types/PipelineJson/PipelineJson';
|
|
3
|
+
import type { PipelineJson } from '../pipeline/PipelineJson/PipelineJson';
|
|
5
4
|
import type { Parameters } from '../types/typeAliases';
|
|
5
|
+
import type { ExecutionReportJson } from './execution-report/ExecutionReportJson';
|
|
6
6
|
import type { PromptResultUsage } from './PromptResultUsage';
|
|
7
7
|
/**
|
|
8
8
|
* @@@
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KebabCase } from 'type-fest';
|
|
2
|
-
import type { ExpectationUnit } from '../
|
|
2
|
+
import type { ExpectationUnit } from '../pipeline/PipelineJson/Expectations';
|
|
3
3
|
import type { UncertainNumber } from './UncertainNumber';
|
|
4
4
|
/**
|
|
5
5
|
* Usage statistics for one or many prompt results
|
|
@@ -2,7 +2,7 @@ import type { ScriptLanguage } from '../types/ScriptLanguage';
|
|
|
2
2
|
import type { Parameters } from '../types/typeAliases';
|
|
3
3
|
import type { string_script } from '../types/typeAliases';
|
|
4
4
|
/**
|
|
5
|
-
* Represents all the tools needed to execute SCRIPT
|
|
5
|
+
* Represents all the tools needed to execute `SCRIPT` tasks
|
|
6
6
|
*
|
|
7
7
|
* @see https://github.com/webgptorg/promptbook#script-execution-tools
|
|
8
8
|
*/
|
package/esm/typings/src/execution/createPipelineExecutor/00-CreatePipelineExecutorOptions.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CsvSettings } from '../../formats/csv/CsvSettings';
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
2
3
|
import type { PrepareAndScrapeOptions } from '../../prepare/PrepareAndScrapeOptions';
|
|
3
|
-
import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
4
4
|
import type { ExecutionTools } from '../ExecutionTools';
|
|
5
5
|
/**
|
|
6
6
|
* Options for `createPipelineExecutor`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Promisable, ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import type { PipelineJson } from '../../
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
3
|
import type { TaskProgress } from '../../types/TaskProgress';
|
|
4
4
|
import type { Parameters } from '../../types/typeAliases';
|
|
5
5
|
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { Promisable, ReadonlyDeep, WritableDeep } from 'type-fest';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { TemplateJson } from '../../types/PipelineJson/TemplateJson';
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
5
4
|
import type { TaskProgress } from '../../types/TaskProgress';
|
|
6
5
|
import type { Parameters } from '../../types/typeAliases';
|
|
6
|
+
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson';
|
|
7
7
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
8
8
|
/**
|
|
9
9
|
* @@@
|
|
10
10
|
*
|
|
11
|
-
* @private internal type of `
|
|
11
|
+
* @private internal type of `executeTask`
|
|
12
12
|
*/
|
|
13
|
-
type
|
|
13
|
+
type executeSingleTaskOptions = CreatePipelineExecutorOptions & {
|
|
14
14
|
/**
|
|
15
15
|
* @@@
|
|
16
16
|
*/
|
|
17
|
-
readonly
|
|
17
|
+
readonly currentTask: ReadonlyDeep<TaskJson>;
|
|
18
18
|
/**
|
|
19
19
|
* @@@
|
|
20
20
|
*/
|
|
@@ -41,7 +41,7 @@ type executeSingleTemplateOptions = CreatePipelineExecutorOptions & {
|
|
|
41
41
|
*
|
|
42
42
|
* @private internal utility of `createPipelineExecutor`
|
|
43
43
|
*/
|
|
44
|
-
export declare function
|
|
44
|
+
export declare function executeTask(options: executeSingleTaskOptions): Promise<Readonly<Parameters>>;
|
|
45
45
|
export {};
|
|
46
46
|
/**
|
|
47
47
|
* TODO: [🤹♂️]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ReadonlyDeep, WritableDeep } from 'type-fest';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { TemplateJson } from '../../types/PipelineJson/TemplateJson';
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
5
4
|
import type { Parameters } from '../../types/typeAliases';
|
|
6
5
|
import type { string_parameter_name } from '../../types/typeAliases';
|
|
7
6
|
import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
7
|
+
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson';
|
|
8
8
|
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
|
|
9
9
|
/**
|
|
10
10
|
* @@@
|
|
@@ -25,7 +25,7 @@ export type ExecuteAttemptsOptions = Omit<CreatePipelineExecutorOptions, 'pipeli
|
|
|
25
25
|
*
|
|
26
26
|
* Note: [💂] There are two distinct variabiles
|
|
27
27
|
* 1) `maxExecutionAttempts` - the amount of attempts LLM model
|
|
28
|
-
* 2) `maxAttempts` - the amount of attempts for any
|
|
28
|
+
* 2) `maxAttempts` - the amount of attempts for any task - LLM, SCRIPT, DIALOG, etc.
|
|
29
29
|
*/
|
|
30
30
|
readonly maxAttempts: number;
|
|
31
31
|
/**
|
|
@@ -39,7 +39,7 @@ export type ExecuteAttemptsOptions = Omit<CreatePipelineExecutorOptions, 'pipeli
|
|
|
39
39
|
/**
|
|
40
40
|
* @@@
|
|
41
41
|
*/
|
|
42
|
-
readonly
|
|
42
|
+
readonly task: ReadonlyDeep<TaskJson>;
|
|
43
43
|
/**
|
|
44
44
|
* @@@
|
|
45
45
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import { PipelineExecutionError } from '../../errors/PipelineExecutionError';
|
|
3
|
-
import type { PipelineJson } from '../../
|
|
3
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
4
4
|
import type { Parameters } from '../../types/typeAliases';
|
|
5
5
|
/**
|
|
6
6
|
* @@@
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
3
3
|
import type { string_markdown } from '../../types/typeAliases';
|
|
4
4
|
import type { string_parameter_value } from '../../types/typeAliases';
|
|
5
5
|
/**
|
|
@@ -7,4 +7,4 @@ import type { string_parameter_value } from '../../types/typeAliases';
|
|
|
7
7
|
*
|
|
8
8
|
* @private internal utility of `createPipelineExecutor`
|
|
9
9
|
*/
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function getContextForTask(task: ReadonlyDeep<TaskJson>): Promise<string_parameter_value & string_markdown>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
3
3
|
import type { string_markdown } from '../../types/typeAliases';
|
|
4
4
|
import type { string_parameter_value } from '../../types/typeAliases';
|
|
5
5
|
/**
|
|
@@ -7,4 +7,4 @@ import type { string_parameter_value } from '../../types/typeAliases';
|
|
|
7
7
|
*
|
|
8
8
|
* @private internal utility of `createPipelineExecutor`
|
|
9
9
|
*/
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function getExamplesForTask(task: ReadonlyDeep<TaskJson>): Promise<string_parameter_value & string_markdown>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
4
|
+
import type { string_markdown } from '../../types/typeAliases';
|
|
5
|
+
import type { string_parameter_value } from '../../types/typeAliases';
|
|
6
|
+
/**
|
|
7
|
+
* @@@
|
|
8
|
+
*
|
|
9
|
+
* @private internal type of `getKnowledgeFoTask`
|
|
10
|
+
*/
|
|
11
|
+
type GetKnowledgeForTaskOptions = {
|
|
12
|
+
/**
|
|
13
|
+
* @@@
|
|
14
|
+
*/
|
|
15
|
+
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
16
|
+
/**
|
|
17
|
+
* @@@
|
|
18
|
+
*/
|
|
19
|
+
readonly task: ReadonlyDeep<TaskJson>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @@@
|
|
23
|
+
*
|
|
24
|
+
* @private internal utility of `createPipelineExecutor`
|
|
25
|
+
*/
|
|
26
|
+
export declare function getKnowledgeForTask(options: GetKnowledgeForTaskOptions): Promise<string_parameter_value & string_markdown>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReadonlyDeep } from 'type-fest';
|
|
2
|
+
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
|
|
3
|
+
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
|
|
4
|
+
import type { ReservedParameters } from '../../types/typeAliases';
|
|
5
|
+
/**
|
|
6
|
+
* @@@
|
|
7
|
+
*
|
|
8
|
+
* @private internal type of `getReservedParametersForTask`
|
|
9
|
+
*/
|
|
10
|
+
type GetReservedParametersForTaskOptions = {
|
|
11
|
+
/**
|
|
12
|
+
* @@@
|
|
13
|
+
*/
|
|
14
|
+
readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
|
|
15
|
+
/**
|
|
16
|
+
* @@@
|
|
17
|
+
*/
|
|
18
|
+
readonly task: ReadonlyDeep<TaskJson>;
|
|
19
|
+
/**
|
|
20
|
+
* @@@
|
|
21
|
+
*/
|
|
22
|
+
readonly pipelineIdentification: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* @@@
|
|
26
|
+
*
|
|
27
|
+
* @private internal utility of `createPipelineExecutor`
|
|
28
|
+
*/
|
|
29
|
+
export declare function getReservedParametersForTask(options: GetReservedParametersForTaskOptions): Promise<Readonly<ReservedParameters>>;
|
|
30
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ErrorJson } from '../../errors/utils/ErrorJson';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { Prompt } from '../../types/Prompt';
|
|
3
|
+
import type { PromptResult } from '../PromptResult';
|
|
4
4
|
/**
|
|
5
5
|
* Report of single prompt execution
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { string_markdown_text } from '
|
|
2
|
-
import type { string_pipeline_url } from '
|
|
3
|
-
import type { string_semantic_version } from '
|
|
1
|
+
import type { string_markdown_text } from '../../types/typeAliases';
|
|
2
|
+
import type { string_pipeline_url } from '../../types/typeAliases';
|
|
3
|
+
import type { string_semantic_version } from '../../types/typeAliases';
|
|
4
4
|
import type { ExecutionPromptReportJson } from './ExecutionPromptReportJson';
|
|
5
5
|
/**
|
|
6
6
|
* ExecutionReport is result of executing one promptbook
|
|
@@ -35,7 +35,7 @@ export type ExecutionReportJson = {
|
|
|
35
35
|
*/
|
|
36
36
|
readonly description?: string_markdown_text;
|
|
37
37
|
/**
|
|
38
|
-
* Sequence of
|
|
38
|
+
* Sequence of tasks in order which were executed
|
|
39
39
|
*/
|
|
40
40
|
readonly promptExecutions: ReadonlyArray<ExecutionPromptReportJson>;
|
|
41
41
|
};
|
|
@@ -4,3 +4,6 @@
|
|
|
4
4
|
* @private internal index of `...` <- TODO [🏢]
|
|
5
5
|
*/
|
|
6
6
|
export declare const FORMAT_DEFINITIONS: readonly [import("./_common/FormatDefinition").FormatDefinition<string, string, any, any>, import("./_common/FormatDefinition").FormatDefinition<string, string, any, any>, import("./_common/FormatDefinition").FormatDefinition<string, string, any, any>, import("./_common/FormatDefinition").FormatDefinition<string, string, import("./csv/CsvSettings").CsvSettings, any>];
|
|
7
|
+
/**
|
|
8
|
+
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
9
|
+
*/
|
|
@@ -8,7 +8,7 @@ export declare const BoilerplateFormfactorDefinition: {
|
|
|
8
8
|
readonly description: "@@@";
|
|
9
9
|
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/@@";
|
|
10
10
|
readonly pipelineInterface: {
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
11
|
+
readonly inputParameters: readonly [];
|
|
12
|
+
readonly outputParameters: readonly [];
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { PipelineInterface } from '../../pipeline/
|
|
1
|
+
import type { PipelineInterface } from '../../pipeline/PipelineInterface/PipelineInterface';
|
|
2
2
|
import type { string_markdown_text } from '../../types/typeAliases';
|
|
3
3
|
import type { string_name } from '../../types/typeAliases';
|
|
4
4
|
import type { string_promptbook_documentation_url } from '../../types/typeAliases';
|
|
5
5
|
import type { string_SCREAMING_CASE } from '../../utils/normalization/normalizeTo_SCREAMING_CASE';
|
|
6
6
|
/**
|
|
7
7
|
* @@@
|
|
8
|
+
*
|
|
9
|
+
* Note: [🚉] This is fully serializable as JSON
|
|
10
|
+
* @see https://github.com/webgptorg/promptbook/discussions/172
|
|
8
11
|
*/
|
|
9
12
|
export type AbstractFormfactorDefinition = {
|
|
10
13
|
/**
|
|
@@ -32,3 +35,6 @@ export type AbstractFormfactorDefinition = {
|
|
|
32
35
|
*/
|
|
33
36
|
readonly pipelineInterface: PipelineInterface;
|
|
34
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* TODO: [🧠][🤓] How to pass optional parameters - for example summary in FORMFACTOR Translator
|
|
40
|
+
*/
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @@@
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare const ChatbotFormfactorDefinition: {
|
|
7
|
+
readonly name: "CHATBOT";
|
|
8
|
+
readonly aliasNames: readonly ["CHAT"];
|
|
9
|
+
readonly description: "@@@";
|
|
10
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/174";
|
|
11
|
+
readonly pipelineInterface: {
|
|
12
|
+
readonly inputParameters: readonly [{
|
|
13
|
+
readonly name: "previousTitle";
|
|
14
|
+
readonly description: "Previous title of the conversation";
|
|
15
|
+
readonly isInput: true;
|
|
16
|
+
readonly isOutput: false;
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "previousConversationSummary";
|
|
19
|
+
readonly description: "Previous conversation summary";
|
|
20
|
+
readonly isInput: true;
|
|
21
|
+
readonly isOutput: false;
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "userMessage";
|
|
24
|
+
readonly description: "User message";
|
|
25
|
+
readonly isInput: true;
|
|
26
|
+
readonly isOutput: false;
|
|
27
|
+
}];
|
|
28
|
+
readonly outputParameters: readonly [{
|
|
29
|
+
readonly name: "title";
|
|
30
|
+
readonly description: "Title of the conversation";
|
|
31
|
+
readonly isInput: false;
|
|
32
|
+
readonly isOutput: true;
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "conversationSummary";
|
|
35
|
+
readonly description: "Summary of the conversation";
|
|
36
|
+
readonly isInput: false;
|
|
37
|
+
readonly isOutput: true;
|
|
38
|
+
}, {
|
|
39
|
+
readonly name: "chatbotResponse";
|
|
40
|
+
readonly description: "Chatbot response";
|
|
41
|
+
readonly isInput: false;
|
|
42
|
+
readonly isOutput: true;
|
|
43
|
+
}];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generator is form of app that @@@
|
|
3
|
+
*
|
|
4
|
+
* @public exported from `@promptbook/core`
|
|
5
|
+
*/
|
|
6
|
+
export declare const GeneratorFormfactorDefinition: {
|
|
7
|
+
readonly name: "GENERATOR";
|
|
8
|
+
readonly description: "@@@";
|
|
9
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/184";
|
|
10
|
+
readonly pipelineInterface: {
|
|
11
|
+
readonly inputParameters: readonly [];
|
|
12
|
+
readonly outputParameters: readonly [];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
export declare const GenericFormfactorDefinition: {
|
|
7
7
|
readonly name: "GENERIC";
|
|
8
8
|
readonly description: "@@@";
|
|
9
|
-
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions
|
|
9
|
+
readonly documentationUrl: "https://github.com/webgptorg/promptbook/discussions/173";
|
|
10
10
|
readonly pipelineInterface: {
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
11
|
+
readonly inputParameters: readonly [];
|
|
12
|
+
readonly outputParameters: readonly [];
|
|
13
13
|
};
|
|
14
14
|
};
|