@promptbook/types 0.69.0-1 → 0.69.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/typings/src/_packages/types.index.d.ts +2 -0
- package/esm/typings/src/commands/FOREACH/ForeachCommand.d.ts +2 -6
- package/esm/typings/src/commands/FOREACH/ForeachJson.d.ts +26 -0
- package/esm/typings/src/commands/_common/types/CommandParser.d.ts +4 -4
- package/esm/typings/src/config.d.ts +7 -1
- package/esm/typings/src/conversion/prettify/renderPipelineMermaidOptions.d.ts +3 -0
- package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +1 -1
- package/esm/typings/src/conversion/validation/validatePipeline.d.ts +4 -0
- package/esm/typings/src/types/PipelineJson/ParameterJson.d.ts +1 -0
- package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +5 -0
- package/esm/typings/src/types/execution-report/ExecutionReportJson.d.ts +3 -0
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import type { PipelineTemplateCommandParser } from '../commands/_common/types/Co
|
|
|
7
7
|
import type { CommandParserInput } from '../commands/_common/types/CommandParser';
|
|
8
8
|
import type { CommandUsagePlace } from '../commands/_common/types/CommandUsagePlaces';
|
|
9
9
|
import type { ExpectCommand } from '../commands/EXPECT/ExpectCommand';
|
|
10
|
+
import type { ForeachJson } from '../commands/FOREACH/ForeachJson';
|
|
10
11
|
import type { FormatCommand } from '../commands/FORMAT/FormatCommand';
|
|
11
12
|
import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
|
|
12
13
|
import type { PipelineStringToJsonOptions } from '../conversion/pipelineStringToJson';
|
|
@@ -232,6 +233,7 @@ export type { PipelineTemplateCommandParser };
|
|
|
232
233
|
export type { CommandParserInput };
|
|
233
234
|
export type { CommandUsagePlace };
|
|
234
235
|
export type { ExpectCommand };
|
|
236
|
+
export type { ForeachJson };
|
|
235
237
|
export type { FormatCommand };
|
|
236
238
|
export type { TemplateType };
|
|
237
239
|
export type { PipelineStringToJsonOptions };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
1
|
+
import type { ForeachJson } from './ForeachJson';
|
|
3
2
|
/**
|
|
4
3
|
* Parsed FOREACH command <- Write [🍭] !!!!!!
|
|
5
4
|
*
|
|
@@ -8,7 +7,4 @@ import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
|
8
7
|
*/
|
|
9
8
|
export type ForeachCommand = {
|
|
10
9
|
readonly type: 'FOREACH';
|
|
11
|
-
|
|
12
|
-
cellName: TODO_string;
|
|
13
|
-
parameterName: string_parameter_name;
|
|
14
|
-
};
|
|
10
|
+
} & ForeachJson;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { string_parameter_name } from '../../types/typeAliases';
|
|
2
|
+
import type { TODO_string } from '../../utils/organization/TODO_string';
|
|
3
|
+
/**
|
|
4
|
+
* @@@
|
|
5
|
+
*/
|
|
6
|
+
export type ForeachJson = {
|
|
7
|
+
/**
|
|
8
|
+
* @@@
|
|
9
|
+
*/
|
|
10
|
+
readonly formatName: TODO_string;
|
|
11
|
+
/**
|
|
12
|
+
* @@@
|
|
13
|
+
*/
|
|
14
|
+
readonly cellName: TODO_string;
|
|
15
|
+
/**
|
|
16
|
+
* @@@
|
|
17
|
+
*/
|
|
18
|
+
readonly parameterName: string_parameter_name;
|
|
19
|
+
/**
|
|
20
|
+
* @@@
|
|
21
|
+
*/
|
|
22
|
+
readonly subparameterName: string_parameter_name;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* TODO: [🧠] Betetr name for `parameterName` and `subparameterName`
|
|
26
|
+
*/
|
|
@@ -156,28 +156,28 @@ export type CommandParserInput = {
|
|
|
156
156
|
* @@@
|
|
157
157
|
*
|
|
158
158
|
* @example 'promptbook version 0.62.0'
|
|
159
|
-
* @example 'FOREACH List Line -> `{customer}`'
|
|
159
|
+
* @example 'FOREACH List Line `{customers}` -> `{customer}`'
|
|
160
160
|
*/
|
|
161
161
|
readonly raw: string_markdown_text;
|
|
162
162
|
/**
|
|
163
163
|
* @@@
|
|
164
164
|
*
|
|
165
165
|
* @example '0.62.0'
|
|
166
|
-
* @example 'List Line -> `{customer}`'
|
|
166
|
+
* @example 'List Line `{customers}` -> `{customer}`'
|
|
167
167
|
*/
|
|
168
168
|
readonly rawArgs: string_markdown_text;
|
|
169
169
|
/**
|
|
170
170
|
* @@@
|
|
171
171
|
*
|
|
172
172
|
* @example 'PROMPTBOOK_VERSION_0_62_0'
|
|
173
|
-
* @example '
|
|
173
|
+
* @example 'FOREACH_LIST_LINE_CUSTOMERS_CUSTOMER'
|
|
174
174
|
*/
|
|
175
175
|
readonly normalized: string_name & string_SCREAMING_CASE;
|
|
176
176
|
/**
|
|
177
177
|
* @@@
|
|
178
178
|
*
|
|
179
179
|
* @example [ '0.62.0' ]
|
|
180
|
-
* @example [ 'List', 'Line', '', '{customer}' ]
|
|
180
|
+
* @example [ 'List', 'Line', '{customers}', '', '{customer}' ]
|
|
181
181
|
*/
|
|
182
182
|
readonly args: Array<string_name>;
|
|
183
183
|
};
|
|
@@ -148,7 +148,13 @@ export declare const IS_VERBOSE = false;
|
|
|
148
148
|
*
|
|
149
149
|
* @private within the repository
|
|
150
150
|
*/
|
|
151
|
-
export declare const
|
|
151
|
+
export declare const IS_COST_PREVENTED: boolean;
|
|
152
|
+
/**
|
|
153
|
+
* @@@
|
|
154
|
+
*
|
|
155
|
+
* @private within the repository
|
|
156
|
+
*/
|
|
157
|
+
export declare const IS_PIPELINE_LOGIC_VALIDATED: boolean;
|
|
152
158
|
/**
|
|
153
159
|
* TODO: [🧠][🧜♂️] Maybe join remoteUrl and path into single value
|
|
154
160
|
*/
|
|
@@ -22,6 +22,9 @@ export type renderPipelineMermaidOptions = {
|
|
|
22
22
|
*/
|
|
23
23
|
export declare function renderPromptbookMermaid(pipelineJson: PipelineJson, options?: renderPipelineMermaidOptions): string;
|
|
24
24
|
/**
|
|
25
|
+
* TODO: !!!!!! FOREACH in mermaid graph
|
|
26
|
+
* TODO: !!!!!! Knowledge in mermaid graph
|
|
27
|
+
* TODO: !!!!!! Personas in mermaid graph
|
|
25
28
|
* TODO: Maybe use some Mermaid package instead of string templating
|
|
26
29
|
* TODO: [🕌] When more than 2 functionalities, split into separate functions
|
|
27
30
|
*/
|
|
@@ -8,7 +8,7 @@ import type { string_parameter_name } from '../../types/typeAliases';
|
|
|
8
8
|
* @throws {ParseError} if the script is invalid
|
|
9
9
|
* @public exported from `@promptbook/utils`
|
|
10
10
|
*/
|
|
11
|
-
export declare function extractParameterNamesFromTemplate(template: Pick<TemplateJson, 'title' | 'description' | 'templateType' | 'content' | 'preparedContent' | 'jokerParameterNames'>): Set<string_parameter_name>;
|
|
11
|
+
export declare function extractParameterNamesFromTemplate(template: Pick<TemplateJson, 'title' | 'description' | 'templateType' | 'content' | 'preparedContent' | 'jokerParameterNames' | 'foreach'>): Set<string_parameter_name>;
|
|
12
12
|
/**
|
|
13
13
|
* TODO: [🔣] If script require contentLanguage
|
|
14
14
|
*/
|
|
@@ -15,6 +15,10 @@ import type { PipelineJson } from '../../types/PipelineJson/PipelineJson';
|
|
|
15
15
|
* @public exported from `@promptbook/core`
|
|
16
16
|
*/
|
|
17
17
|
export declare function validatePipeline(pipeline: PipelineJson): PipelineJson;
|
|
18
|
+
/**
|
|
19
|
+
* @private internal function for `validatePipeline`
|
|
20
|
+
*/
|
|
21
|
+
export declare function validatePipelineCore(pipeline: PipelineJson): void;
|
|
18
22
|
/**
|
|
19
23
|
* TODO: [🧠] Work with promptbookVersion
|
|
20
24
|
* TODO: Use here some json-schema, Zod or something similar and change it to:
|
|
@@ -33,6 +33,7 @@ export type ParameterJson = {
|
|
|
33
33
|
readonly sampleValues?: Array<string_parameter_value>;
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
+
* TODO: [🧠] !!!!!! Should be here registered subparameter from foreach or not?
|
|
36
37
|
* TODO: [♈] Probbably move expectations from templates to parameters
|
|
37
38
|
* TODO: [🍙] Make some standard order of json properties
|
|
38
39
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ForeachJson } from '../../commands/FOREACH/ForeachJson';
|
|
1
2
|
import type { FormatCommand } from '../../commands/FORMAT/FormatCommand';
|
|
2
3
|
import type { TemplateType } from '../../commands/TEMPLATE/TemplateTypes';
|
|
3
4
|
import type { string_javascript } from '../typeAliases';
|
|
@@ -42,6 +43,10 @@ export interface TemplateJsonCommon {
|
|
|
42
43
|
* @see https://github.com/webgptorg/promptbook/discussions/66
|
|
43
44
|
*/
|
|
44
45
|
readonly jokerParameterNames?: Array<string_parameter_name>;
|
|
46
|
+
/**
|
|
47
|
+
* @@@
|
|
48
|
+
*/
|
|
49
|
+
readonly foreach?: ForeachJson;
|
|
45
50
|
/**
|
|
46
51
|
* Type of the execution
|
|
47
52
|
* This determines if the template is send to LLM, user or some scripting evaluation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/types",
|
|
3
|
-
"version": "0.69.0-
|
|
3
|
+
"version": "0.69.0-2",
|
|
4
4
|
"description": "Supercharge your use of large language models",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -45,6 +45,6 @@
|
|
|
45
45
|
],
|
|
46
46
|
"typings": "./esm/typings/src/_packages/types.index.d.ts",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@promptbook/core": "0.69.0-
|
|
48
|
+
"@promptbook/core": "0.69.0-2"
|
|
49
49
|
}
|
|
50
50
|
}
|