@promptbook/remote-server 0.68.0-2 → 0.68.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.
Files changed (42) hide show
  1. package/README.md +2 -2
  2. package/esm/index.es.js +2 -2
  3. package/esm/typings/promptbook-collection/index.d.ts +3 -3
  4. package/esm/typings/src/_packages/core.index.d.ts +4 -4
  5. package/esm/typings/src/_packages/types.index.d.ts +2 -2
  6. package/esm/typings/src/collection/constructors/createCollectionFromJson.d.ts +1 -1
  7. package/esm/typings/src/commands/FOREACH/foreachCommandParser.d.ts +1 -1
  8. package/esm/typings/src/commands/KNOWLEDGE/knowledgeCommandParser.d.ts +3 -0
  9. package/esm/typings/src/commands/TEMPLATE/TemplateCommand.d.ts +11 -0
  10. package/esm/typings/src/commands/TEMPLATE/TemplateTypes.d.ts +15 -0
  11. package/esm/typings/src/commands/TEMPLATE/templateCommandParser.d.ts +12 -0
  12. package/esm/typings/src/commands/X_ACTION/actionCommandParser.d.ts +3 -0
  13. package/esm/typings/src/commands/X_INSTRUMENT/instrumentCommandParser.d.ts +3 -0
  14. package/esm/typings/src/commands/_common/getParserForCommand.d.ts +11 -0
  15. package/esm/typings/src/commands/_common/stringifyCommand.d.ts +11 -0
  16. package/esm/typings/src/commands/_common/stringifyCommand.test.d.ts +1 -0
  17. package/esm/typings/src/commands/_common/types/CommandParser.d.ts +2 -2
  18. package/esm/typings/src/commands/index.d.ts +1 -1
  19. package/esm/typings/src/conversion/pipelineJsonToString.d.ts +1 -1
  20. package/esm/typings/src/conversion/pipelineStringToJson.d.ts +1 -1
  21. package/esm/typings/src/conversion/pipelineStringToJsonSync.d.ts +1 -1
  22. package/esm/typings/src/conversion/utils/extractParameterNamesFromTemplate.d.ts +1 -1
  23. package/esm/typings/src/conversion/validation/pipelineStringToJson-parseErrors.test.d.ts +4 -0
  24. package/esm/typings/src/conversion/validation/validatePipeline-logicErrors.test.d.ts +1 -1
  25. package/esm/typings/src/conversion/validation/validatePipeline.test.d.ts +3 -0
  26. package/esm/typings/src/errors/PipelineLogicError.d.ts +1 -1
  27. package/esm/typings/src/execution/ScriptExecutionTools.d.ts +1 -1
  28. package/esm/typings/src/knowledge/dialogs/simple-prompt/SimplePromptInterfaceTools.d.ts +1 -1
  29. package/esm/typings/src/types/PipelineJson/DialogTemplateJson.d.ts +1 -1
  30. package/esm/typings/src/types/PipelineJson/PromptTemplateJson.d.ts +2 -2
  31. package/esm/typings/src/types/PipelineJson/ScriptTemplateJson.d.ts +2 -2
  32. package/esm/typings/src/types/PipelineJson/SimpleTemplateJson.d.ts +1 -1
  33. package/esm/typings/src/types/PipelineJson/TemplateJsonCommon.d.ts +2 -2
  34. package/esm/typings/src/types/TaskProgress.d.ts +2 -2
  35. package/esm/typings/src/utils/markdown/addAutoGeneratedSection.d.ts +0 -1
  36. package/package.json +2 -2
  37. package/umd/index.umd.js +2 -2
  38. package/esm/typings/src/commands/BLOCK/BlockCommand.d.ts +0 -11
  39. package/esm/typings/src/commands/BLOCK/BlockTypes.d.ts +0 -15
  40. package/esm/typings/src/commands/BLOCK/blockCommandParser.d.ts +0 -9
  41. /package/esm/typings/src/commands/{BLOCK/blockCommand.test.d.ts → TEMPLATE/templateCommand.test.d.ts} +0 -0
  42. /package/esm/typings/src/{conversion/validation/pipelineStringToJson-syntaxErrors.test.d.ts → commands/_common/getParserForCommand.test.d.ts} +0 -0
package/README.md CHANGED
@@ -89,7 +89,7 @@ File `write-website-content.ptbk.md`:
89
89
  >
90
90
  > What is your web about?
91
91
  >
92
- > - DIALOG BLOCK
92
+ > - DIALOG TEMPLATE
93
93
  >
94
94
  > ```
95
95
  > {rawAssigment}
@@ -123,7 +123,7 @@ File `write-website-content.ptbk.md`:
123
123
  >
124
124
  > Is the title for your website okay?
125
125
  >
126
- > - DIALOG BLOCK
126
+ > - DIALOG TEMPLATE
127
127
  >
128
128
  > ```
129
129
  > {enhancedTitle}
package/esm/index.es.js CHANGED
@@ -7,7 +7,7 @@ import spaceTrim$1, { spaceTrim } from 'spacetrim';
7
7
  /**
8
8
  * The version of the Promptbook library
9
9
  */
10
- var PROMPTBOOK_VERSION = '0.68.0-1';
10
+ var PROMPTBOOK_VERSION = '0.68.0-3';
11
11
  // TODO: !!!! List here all the versions and annotate + put into script
12
12
 
13
13
  /*! *****************************************************************************
@@ -503,7 +503,7 @@ var ParseError = /** @class */ (function (_super) {
503
503
  */
504
504
 
505
505
  /**
506
- * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
506
+ * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
507
507
  *
508
508
  * @public exported from `@promptbook/core`
509
509
  */
@@ -9,7 +9,7 @@ declare const _default: ({
9
9
  isOutput: boolean;
10
10
  }[];
11
11
  templates: {
12
- blockType: string;
12
+ templateType: string;
13
13
  name: string;
14
14
  title: string;
15
15
  content: string;
@@ -32,7 +32,7 @@ declare const _default: ({
32
32
  isOutput: boolean;
33
33
  }[];
34
34
  templates: {
35
- blockType: string;
35
+ templateType: string;
36
36
  name: string;
37
37
  title: string;
38
38
  content: string;
@@ -61,7 +61,7 @@ declare const _default: ({
61
61
  isOutput: boolean;
62
62
  }[];
63
63
  templates: {
64
- blockType: string;
64
+ templateType: string;
65
65
  name: string;
66
66
  title: string;
67
67
  content: string;
@@ -4,8 +4,8 @@ import { createCollectionFromJson } from '../collection/constructors/createColle
4
4
  import { createCollectionFromPromise } from '../collection/constructors/createCollectionFromPromise';
5
5
  import { createCollectionFromUrl } from '../collection/constructors/createCollectionFromUrl';
6
6
  import { createSubcollection } from '../collection/constructors/createSubcollection';
7
- import type { BlockType } from '../commands/BLOCK/BlockTypes';
8
- import { BlockTypes } from '../commands/BLOCK/BlockTypes';
7
+ import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
8
+ import { TemplateTypes } from '../commands/TEMPLATE/TemplateTypes';
9
9
  import { CLAIM } from '../config';
10
10
  import { MAX_PARALLEL_COUNT } from '../config';
11
11
  import { MAX_EXECUTION_ATTEMPTS } from '../config';
@@ -77,8 +77,8 @@ export { createCollectionFromJson };
77
77
  export { createCollectionFromPromise };
78
78
  export { createCollectionFromUrl };
79
79
  export { createSubcollection };
80
- export type { BlockType };
81
- export { BlockTypes };
80
+ export type { TemplateType };
81
+ export { TemplateTypes };
82
82
  export { CLAIM };
83
83
  export { MAX_PARALLEL_COUNT };
84
84
  export { MAX_EXECUTION_ATTEMPTS };
@@ -6,9 +6,9 @@ import type { PipelineHeadCommandParser } from '../commands/_common/types/Comman
6
6
  import type { PipelineTemplateCommandParser } from '../commands/_common/types/CommandParser';
7
7
  import type { CommandParserInput } from '../commands/_common/types/CommandParser';
8
8
  import type { CommandUsagePlace } from '../commands/_common/types/CommandUsagePlaces';
9
- import type { BlockType } from '../commands/BLOCK/BlockTypes';
10
9
  import type { ExpectCommand } from '../commands/EXPECT/ExpectCommand';
11
10
  import type { FormatCommand } from '../commands/FORMAT/FormatCommand';
11
+ import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
12
12
  import type { PipelineStringToJsonOptions } from '../conversion/pipelineStringToJson';
13
13
  import type { PrettifyOptions } from '../conversion/prettify/PrettifyOptions';
14
14
  import type { renderPipelineMermaidOptions } from '../conversion/prettify/renderPipelineMermaidOptions';
@@ -230,9 +230,9 @@ export type { PipelineHeadCommandParser };
230
230
  export type { PipelineTemplateCommandParser };
231
231
  export type { CommandParserInput };
232
232
  export type { CommandUsagePlace };
233
- export type { BlockType };
234
233
  export type { ExpectCommand };
235
234
  export type { FormatCommand };
235
+ export type { TemplateType };
236
236
  export type { PipelineStringToJsonOptions };
237
237
  export type { PrettifyOptions };
238
238
  export type { renderPipelineMermaidOptions };
@@ -4,7 +4,7 @@ import type { PipelineCollection } from '../PipelineCollection';
4
4
  * Creates PipelineCollection from array of PipelineJson or PipelineString
5
5
  *
6
6
  * Note: Functions `collectionToJson` and `createCollectionFromJson` are complementary
7
- * Note: During the construction syntax and logic of all sources are validated
7
+ * Note: Syntax, parsing, and logic consistency checks are performed on all sources during build
8
8
  *
9
9
  * @param promptbookSources
10
10
  * @returns PipelineCollection
@@ -10,5 +10,5 @@ import type { ForeachCommand } from './ForeachCommand';
10
10
  */
11
11
  export declare const foreachCommandParser: PipelineTemplateCommandParser<ForeachCommand>;
12
12
  /**
13
- * TODO: [🍭] Make .ptbk.md file with examples of the FOREACH command and also with wrong syntax and logic
13
+ * TODO: [🍭] Make .ptbk.md file with examples of the FOREACH command and also with wrong parsing and logic
14
14
  */
@@ -7,3 +7,6 @@ import type { KnowledgeCommand } from './KnowledgeCommand';
7
7
  * @private within the commands folder
8
8
  */
9
9
  export declare const knowledgeCommandParser: PipelineHeadCommandParser<KnowledgeCommand>;
10
+ /**
11
+ * Note: [⛱] There are two types of KNOWLEDGE commands *...(read more in [⛱])*
12
+ */
@@ -0,0 +1,11 @@
1
+ import type { TemplateType } from './TemplateTypes';
2
+ /**
3
+ * Parsed TEMPLATE command
4
+ *
5
+ * @see ./templateCommandParser.ts for more details
6
+ * @private within the commands folder
7
+ */
8
+ export type TemplateCommand = {
9
+ readonly type: 'TEMPLATE';
10
+ readonly templateType: TemplateType;
11
+ };
@@ -0,0 +1,15 @@
1
+ import type { TupleToUnion } from 'type-fest';
2
+ /**
3
+ * Template type describes the way how the template is templated
4
+ *
5
+ * @see https://github.com/webgptorg/promptbook#template-type
6
+ * @public exported from `@promptbook/core`
7
+ */
8
+ export type TemplateType = TupleToUnion<typeof TemplateTypes>;
9
+ /**
10
+ * Template type describes the way how the template is templated
11
+ *
12
+ * @see https://github.com/webgptorg/promptbook#template-type
13
+ * @public exported from `@promptbook/core`
14
+ */
15
+ export declare const TemplateTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT_TEMPLATE", "DIALOG_TEMPLATE", "SAMPLE", "KNOWLEDGE", "INSTRUMENT", "ACTION"];
@@ -0,0 +1,12 @@
1
+ import type { PipelineTemplateCommandParser } from '../_common/types/CommandParser';
2
+ import type { TemplateCommand } from './TemplateCommand';
3
+ /**
4
+ * Parses the template command
5
+ *
6
+ * @see ./TEMPLATE-README.md for more details
7
+ * @private within the commands folder
8
+ */
9
+ export declare const templateCommandParser: PipelineTemplateCommandParser<TemplateCommand>;
10
+ /**
11
+ * Note: [⛱] There are two types of KNOWLEDGE, ACTION and INSTRUMENT commands @@@!!!!!!
12
+ */
@@ -7,3 +7,6 @@ import type { ActionCommand } from './ActionCommand';
7
7
  * @private within the commands folder
8
8
  */
9
9
  export declare const actionCommandParser: PipelineHeadCommandParser<ActionCommand>;
10
+ /**
11
+ * Note: [⛱] There are two types of ACTION commands *...(read more in [⛱])*
12
+ */
@@ -7,3 +7,6 @@ import type { InstrumentCommand } from './InstrumentCommand';
7
7
  * @private within the commands folder
8
8
  */
9
9
  export declare const instrumentCommandParser: PipelineHeadCommandParser<InstrumentCommand>;
10
+ /**
11
+ * Note: [⛱] There are two types of INSTRUMENT commands *...(read more in [⛱])*
12
+ */
@@ -0,0 +1,11 @@
1
+ import type { Command } from './types/Command';
2
+ import type { CommandParser } from './types/CommandParser';
3
+ /**
4
+ * Gets the parser for the command
5
+ *
6
+ * @returns the parser for the command
7
+ * @throws {UnexpectedError} if the parser is not found
8
+ *
9
+ * @private within the pipelineStringToJson
10
+ */
11
+ export declare function getParserForCommand<TCommand extends Command>(command: TCommand): CommandParser<TCommand>;
@@ -0,0 +1,11 @@
1
+ import type { string_markdown_text } from '../../types/typeAliases';
2
+ import type { Command } from './types/Command';
3
+ /**
4
+ * Stringifies the command
5
+ *
6
+ * @returns stringified command
7
+ * @throws {UnexpectedError} if the command is invalid
8
+ *
9
+ * @private within the pipelineStringToJson
10
+ */
11
+ export declare function stringifyCommand(command: Command): string_markdown_text;
@@ -130,8 +130,8 @@ export type PipelineTemplateCommandParser<TCommand extends CommandBase> = Common
130
130
  * @private internal helper for command parsers
131
131
  */
132
132
  export type $TemplateJson = {
133
- isBlockTypeSet: boolean;
134
- isTemplateBlock: boolean;
133
+ isTemplateTypeSet: boolean;
134
+ isTemplate: boolean;
135
135
  } & Partial<WritableDeep<TemplateJson>>;
136
136
  /**
137
137
  * @@@
@@ -3,4 +3,4 @@
3
3
  *
4
4
  * @private internal index of `parseCommand`
5
5
  */
6
- export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./BLOCK/BlockCommand").BlockCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./PROMPTBOOK_VERSION/PromptbookVersionCommand").PromptbookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
6
+ export declare const COMMANDS: readonly [import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./TEMPLATE/TemplateCommand").TemplateCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./EXPECT/ExpectCommand").ExpectCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FORMAT/FormatCommand").FormatCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./JOKER/JokerCommand").JokerCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./MODEL/ModelCommand").ModelCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PARAMETER/ParameterCommand").ParameterCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./POSTPROCESS/PostprocessCommand").PostprocessCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./PROMPTBOOK_VERSION/PromptbookVersionCommand").PromptbookVersionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./URL/UrlCommand").UrlCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./KNOWLEDGE/KnowledgeCommand").KnowledgeCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_ACTION/ActionCommand").ActionCommand>, import("./_common/types/CommandParser").PipelineHeadCommandParser<import("./X_INSTRUMENT/InstrumentCommand").InstrumentCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./PERSONA/PersonaCommand").PersonaCommand>, import("./_common/types/CommandParser").PipelineTemplateCommandParser<import("./FOREACH/ForeachCommand").ForeachCommand>, import("./_common/types/CommandParser").PipelineBothCommandParser<import("./_BOILERPLATE/BoilerplateCommand").BoilerplateCommand>];
@@ -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 `templateParameterJsonToString`
12
+ * TODO: [🛋] Implement new features and commands into `pipelineJsonToString` + `templateParameterJsonToString` , 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
@@ -22,7 +22,7 @@ export type PipelineStringToJsonOptions = {
22
22
  * - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
23
23
  * - `preparePipeline` - just one step in the compilation process
24
24
  *
25
- * Note: This function does not validate logic of the pipeline only the syntax
25
+ * Note: This function does not validate logic of the pipeline only the parsing
26
26
  * Note: This function acts as compilation process
27
27
  *
28
28
  * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
@@ -8,7 +8,7 @@ import type { PipelineString } from '../types/PipelineString';
8
8
  * - `pipelineStringToJsonSync` - use only if you need to compile promptbook synchronously and it contains NO external knowledge
9
9
  * - `preparePipeline` - just one step in the compilation process
10
10
  *
11
- * Note: This function does not validate logic of the pipeline only the syntax
11
+ * Note: This function does not validate logic of the pipeline only the parsing
12
12
  * Note: This function acts as compilation process
13
13
  *
14
14
  * @param pipelineString {Promptbook} in string markdown format (.ptbk.md)
@@ -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' | 'blockType' | 'content' | 'preparedContent' | 'jokerParameterNames'>): Set<string_parameter_name>;
11
+ export declare function extractParameterNamesFromTemplate(template: Pick<TemplateJson, 'title' | 'description' | 'templateType' | 'content' | 'preparedContent' | 'jokerParameterNames'>): Set<string_parameter_name>;
12
12
  /**
13
13
  * TODO: [🔣] If script require contentLanguage
14
14
  */
@@ -0,0 +1,4 @@
1
+ export {};
2
+ /**
3
+ * TODO: [🚏] DRY
4
+ */
@@ -1,4 +1,4 @@
1
1
  export {};
2
2
  /**
3
- * TODO: Include automatically all samples from logic errors folder (same with syntax errors)
3
+ * TODO: [🚏] DRY
4
4
  */
@@ -1 +1,4 @@
1
1
  export {};
2
+ /**
3
+ * TODO: [🚏] DRY
4
+ */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
2
+ * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
3
3
  *
4
4
  * @public exported from `@promptbook/core`
5
5
  */
@@ -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 SCRIPTs
5
+ * Represents all the tools needed to execute SCRIPT TEMPLATE
6
6
  *
7
7
  * @see https://github.com/webgptorg/promptbook#script-execution-tools
8
8
  */
@@ -13,7 +13,7 @@ export declare class SimplePromptInterfaceTools implements UserInterfaceTools {
13
13
  private readonly options;
14
14
  constructor(options?: CommonExecutionToolsOptions);
15
15
  /**
16
- * Trigger window.DIALOG BLOCK
16
+ * Trigger window.DIALOG TEMPLATE
17
17
  */
18
18
  promptDialog(options: UserInterfaceToolsPromptDialogOptions): Promise<string>;
19
19
  }
@@ -6,7 +6,7 @@ import type { TemplateJsonCommon } from './TemplateJsonCommon';
6
6
  * @see https://github.com/webgptorg/promptbook/discussions/76
7
7
  */
8
8
  export type DialogTemplateJson = TemplateJsonCommon & {
9
- readonly blockType: 'DIALOG_TEMPLATE';
9
+ readonly templateType: 'DIALOG_TEMPLATE';
10
10
  };
11
11
  /**
12
12
  * TODO: [🍙] Make some standard order of json properties
@@ -7,14 +7,14 @@ import type { TemplateJsonCommon } from './TemplateJsonCommon';
7
7
  * Note: [🚉] This is fully serializable as JSON
8
8
  */
9
9
  export type PromptTemplateJson = TemplateJsonCommon & {
10
- readonly blockType: 'PROMPT_TEMPLATE';
10
+ readonly templateType: 'PROMPT_TEMPLATE';
11
11
  /**
12
12
  * Name of the persona who will be responding to this prompt
13
13
  */
14
14
  readonly personaName?: string_name;
15
15
  /**
16
16
  * Requirements for the model
17
- * - This is required only for blockType PROMPT_TEMPLATE
17
+ * - This is required only for templateType PROMPT_TEMPLATE
18
18
  */
19
19
  readonly modelRequirements?: Partial<ModelRequirements>;
20
20
  };
@@ -7,10 +7,10 @@ import type { TemplateJsonCommon } from './TemplateJsonCommon';
7
7
  * @see https://github.com/webgptorg/promptbook/discussions/77
8
8
  */
9
9
  export type ScriptTemplateJson = TemplateJsonCommon & {
10
- readonly blockType: 'SCRIPT_TEMPLATE';
10
+ readonly templateType: 'SCRIPT_TEMPLATE';
11
11
  /**
12
12
  * Language of the script
13
- * - This is required only for blockType SCRIPT
13
+ * - This is required only for templateType SCRIPT
14
14
  *
15
15
  */
16
16
  readonly contentLanguage?: ScriptLanguage;
@@ -6,7 +6,7 @@ import type { TemplateJsonCommon } from './TemplateJsonCommon';
6
6
  * @see https://github.com/webgptorg/promptbook/discussions/17
7
7
  */
8
8
  export type SimpleTemplateJson = TemplateJsonCommon & {
9
- readonly blockType: 'SIMPLE_TEMPLATE';
9
+ readonly templateType: 'SIMPLE_TEMPLATE';
10
10
  };
11
11
  /**
12
12
  * TODO: [🍙] Make some standard order of json properties
@@ -1,5 +1,5 @@
1
- import type { BlockType } from '../../commands/BLOCK/BlockTypes';
2
1
  import type { FormatCommand } from '../../commands/FORMAT/FormatCommand';
2
+ import type { TemplateType } from '../../commands/TEMPLATE/TemplateTypes';
3
3
  import type { string_javascript } from '../typeAliases';
4
4
  import type { string_markdown } from '../typeAliases';
5
5
  import type { string_markdown_text } from '../typeAliases';
@@ -46,7 +46,7 @@ export interface TemplateJsonCommon {
46
46
  * Type of the execution
47
47
  * This determines if the template is send to LLM, user or some scripting evaluation
48
48
  */
49
- readonly blockType: BlockType;
49
+ readonly templateType: TemplateType;
50
50
  /**
51
51
  * Content of the template with {placeholders} for parameters
52
52
  *
@@ -1,4 +1,4 @@
1
- import type { BlockType } from '../commands/BLOCK/BlockTypes';
1
+ import type { TemplateType } from '../commands/TEMPLATE/TemplateTypes';
2
2
  import type { string_markdown_text } from './typeAliases';
3
3
  import type { string_name } from './typeAliases';
4
4
  /**
@@ -31,7 +31,7 @@ export type TaskProgress = {
31
31
  * The type of the execution.
32
32
  * Note: The pipeline executor reports everything, in the app level you can filter out the execution types that you don't want to show to the user.
33
33
  */
34
- readonly blockType: BlockType;
34
+ readonly templateType: TemplateType;
35
35
  /**
36
36
  * The parameter name that is being processed.
37
37
  */
@@ -10,6 +10,5 @@ export declare function addAutoGeneratedSection(content: string_markdown, option
10
10
  readonly sectionContent: string_markdown;
11
11
  }): string_markdown;
12
12
  /**
13
- * TODO: !!!!!! Somw way how to connect this with commands
14
13
  * TODO: [🏛] This can be part of markdown builder
15
14
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/remote-server",
3
- "version": "0.68.0-2",
3
+ "version": "0.68.0-4",
4
4
  "description": "Supercharge your use of large language models",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -47,7 +47,7 @@
47
47
  "module": "./esm/index.es.js",
48
48
  "typings": "./esm/typings/src/_packages/remote-server.index.d.ts",
49
49
  "peerDependencies": {
50
- "@promptbook/core": "0.68.0-2"
50
+ "@promptbook/core": "0.68.0-4"
51
51
  },
52
52
  "dependencies": {
53
53
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /**
15
15
  * The version of the Promptbook library
16
16
  */
17
- var PROMPTBOOK_VERSION = '0.68.0-1';
17
+ var PROMPTBOOK_VERSION = '0.68.0-3';
18
18
  // TODO: !!!! List here all the versions and annotate + put into script
19
19
 
20
20
  /*! *****************************************************************************
@@ -510,7 +510,7 @@
510
510
  */
511
511
 
512
512
  /**
513
- * This error indicates that the promptbook object has valid syntax but contains logical errors (like circular dependencies)
513
+ * This error indicates that the promptbook object has valid syntax (=can be parsed) but contains logical errors (like circular dependencies)
514
514
  *
515
515
  * @public exported from `@promptbook/core`
516
516
  */
@@ -1,11 +0,0 @@
1
- import type { BlockType } from './BlockTypes';
2
- /**
3
- * Parsed BLOCK command
4
- *
5
- * @see ./blockCommandParser.ts for more details
6
- * @private within the commands folder
7
- */
8
- export type BlockCommand = {
9
- readonly type: 'BLOCK';
10
- readonly blockType: BlockType;
11
- };
@@ -1,15 +0,0 @@
1
- import type { TupleToUnion } from 'type-fest';
2
- /**
3
- * Block type describes the way how the block is blockd
4
- *
5
- * @see https://github.com/webgptorg/promptbook#block-type
6
- * @public exported from `@promptbook/core`
7
- */
8
- export type BlockType = TupleToUnion<typeof BlockTypes>;
9
- /**
10
- * Block type describes the way how the block is blockd
11
- *
12
- * @see https://github.com/webgptorg/promptbook#block-type
13
- * @public exported from `@promptbook/core`
14
- */
15
- export declare const BlockTypes: readonly ["PROMPT_TEMPLATE", "SIMPLE_TEMPLATE", "SCRIPT_TEMPLATE", "DIALOG_TEMPLATE", "SAMPLE", "KNOWLEDGE", "INSTRUMENT", "ACTION"];
@@ -1,9 +0,0 @@
1
- import type { PipelineTemplateCommandParser } from '../_common/types/CommandParser';
2
- import type { BlockCommand } from './BlockCommand';
3
- /**
4
- * Parses the block command
5
- *
6
- * @see ./BLOCK-README.md for more details
7
- * @private within the commands folder
8
- */
9
- export declare const blockCommandParser: PipelineTemplateCommandParser<BlockCommand>;