@promptbook/types 0.101.0-1 β†’ 0.101.0-10

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 (34) hide show
  1. package/README.md +188 -96
  2. package/esm/typings/src/_packages/components.index.d.ts +14 -0
  3. package/esm/typings/src/_packages/core.index.d.ts +2 -0
  4. package/esm/typings/src/_packages/types.index.d.ts +6 -0
  5. package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +41 -3
  6. package/esm/typings/src/book-2.0/agent-source/parseParameters.d.ts +13 -0
  7. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +8 -2
  8. package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +59 -0
  9. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +8 -2
  10. package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +45 -0
  11. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +1 -1
  12. package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +46 -0
  13. package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +47 -0
  14. package/esm/typings/src/book-2.0/commitments/META/META.d.ts +62 -0
  15. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +8 -2
  16. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +8 -2
  17. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +8 -2
  18. package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +46 -0
  19. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +8 -2
  20. package/esm/typings/src/book-2.0/commitments/index.d.ts +7 -3
  21. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +46 -0
  22. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/index.d.ts +3 -0
  23. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +10 -0
  24. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +3 -0
  25. package/esm/typings/src/book-components/Chat/Chat/Chat.d.ts +0 -5
  26. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +28 -2
  27. package/esm/typings/src/book-components/Chat/Chat/constants.d.ts +8 -0
  28. package/esm/typings/src/book-components/icons/ArrowIcon.d.ts +9 -0
  29. package/esm/typings/src/book-components/icons/ResetIcon.d.ts +6 -0
  30. package/esm/typings/src/book-components/icons/SendIcon.d.ts +8 -0
  31. package/esm/typings/src/book-components/icons/TemplateIcon.d.ts +8 -0
  32. package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +1 -0
  33. package/esm/typings/src/version.d.ts +1 -1
  34. package/package.json +2 -2
package/README.md CHANGED
@@ -47,7 +47,7 @@ npm i ptbk
47
47
  npm i -D @promptbook/types
48
48
  ```
49
49
 
50
- The types package provides comprehensive TypeScript type definitions for all Promptbook entities. It enables type-safe development when working with Promptbook APIs, ensuring compile-time validation and excellent IDE support.
50
+ Comprehensive TypeScript type definitions for all Promptbook entities, enabling type-safe development and excellent IDE support throughout the Promptbook ecosystem.
51
51
 
52
52
  ## 🎯 Purpose and Motivation
53
53
 
@@ -56,23 +56,24 @@ This package centralizes all TypeScript type definitions used throughout the Pro
56
56
  ## πŸ”§ High-Level Functionality
57
57
 
58
58
  The package provides type definitions for:
59
- - **Pipeline Structures**: Complete type definitions for promptbook JSON structures
60
- - **Execution Types**: Types for pipeline execution, results, and error handling
61
- - **LLM Provider Types**: Configuration and option types for all supported providers
62
- - **Command Types**: Type definitions for all promptbook commands
63
- - **Utility Types**: Helper types for common patterns and data structures
64
- - **Component Types**: React component prop types for UI components
59
+
60
+ - **Pipeline Structures**: Complete type definitions for promptbook JSON structures
61
+ - **Execution Types**: Types for pipeline execution, results, and error handling
62
+ - **LLM Provider Types**: Configuration and option types for all supported providers
63
+ - **Command Types**: Type definitions for all promptbook commands
64
+ - **Utility Types**: Helper types for common patterns and data structures
65
+ - **Component Types**: React component prop types for UI components
65
66
 
66
67
  ## ✨ Key Features
67
68
 
68
- - πŸ“ **Complete Type Coverage** - Types for all Promptbook entities and APIs
69
- - πŸ”’ **Type Safety** - Compile-time validation and error prevention
70
- - πŸ’‘ **Excellent IntelliSense** - Rich IDE support with autocomplete and documentation
71
- - πŸ—οΈ **Structural Types** - Detailed types for promptbook JSON structures
72
- - πŸ”§ **Provider-Agnostic** - Generic types that work across all LLM providers
73
- - πŸ“Š **Execution Types** - Comprehensive types for pipeline execution and results
74
- - 🎨 **Component Types** - React component prop types for UI development
75
- - πŸ”„ **Version Compatibility** - Types that evolve with the Promptbook ecosystem
69
+ - πŸ“ **Complete Type Coverage** - Types for all Promptbook entities and APIs
70
+ - πŸ”’ **Type Safety** - Compile-time validation and error prevention
71
+ - πŸ’‘ **Excellent IntelliSense** - Rich IDE support with autocomplete and documentation
72
+ - πŸ—οΈ **Structural Types** - Detailed types for promptbook JSON structures
73
+ - πŸ”§ **Provider-Agnostic** - Generic types that work across all LLM providers
74
+ - πŸ“Š **Execution Types** - Comprehensive types for pipeline execution and results
75
+ - 🎨 **Component Types** - React component prop types for UI development
76
+ - πŸ”„ **Version Compatibility** - Types that evolve with the Promptbook ecosystem
76
77
 
77
78
  ## Usage Example
78
79
 
@@ -103,106 +104,197 @@ const promptbook: PipelineJson = compilePipeline(
103
104
  ## πŸ“¦ Exported Type Categories
104
105
 
105
106
  ### Agent and Book Types
106
- - `AgentBasicInformation` - Basic agent information structure
107
- - `AgentModelRequirements` - Model requirements for agents
108
- - `string_book` - Book content string type
109
- - `BookCommitment` - Book commitment structure
110
- - `CommitmentDefinition` - Commitment definition interface
111
- - `ParsedCommitment` - Parsed commitment structure
107
+
108
+ - `AgentBasicInformation` - Basic agent information structure (type)
109
+ - `AgentModelRequirements` - Model requirements for agents (type)
110
+ - `string_book` - Book content string type (type)
111
+ - `BookCommitment` - Book commitment structure (type)
112
+ - `CommitmentDefinition` - Commitment definition interface (type)
113
+ - `ParsedCommitment` - Parsed commitment structure (type)
112
114
 
113
115
  ### Component Types
114
- - `AvatarChipProps` - Avatar chip component props
115
- - `AvatarChipFromSourceProps` - Avatar chip from source props
116
- - `AvatarProfileProps` - Avatar profile component props
117
- - `AvatarProfileFromSourceProps` - Avatar profile from source props
118
- - `BookEditorProps` - Book editor component props
119
- - `ChatProps` - Chat component props
120
- - `LlmChatProps` - LLM chat component props
121
- - `ChatMessage` - Chat message structure
122
- - `ChatParticipant` - Chat participant information
116
+
117
+ - `AvatarChipProps` - Avatar chip component props (type)
118
+ - `AvatarChipFromSourceProps` - Avatar chip from source props (type)
119
+ - `AvatarProfileProps` - Avatar profile component props (type)
120
+ - `AvatarProfileFromSourceProps` - Avatar profile from source props (type)
121
+ - `BookEditorProps` - Book editor component props (type)
122
+ - `ChatProps` - Chat component props (type)
123
+ - `LlmChatProps` - LLM chat component props (type)
124
+ - `ChatMessage` - Chat message structure (type)
125
+ - `ChatParticipant` - Chat participant information (type)
123
126
 
124
127
  ### Collection and Pipeline Types
125
- - `PipelineCollection` - Pipeline collection interface
126
- - `PipelineJson` - Complete pipeline JSON structure
127
- - `PipelineString` - Pipeline string format
128
- - `PipelineInterface` - Pipeline interface definition
129
- - `TaskJson` - Task JSON structure
130
- - `PromptTaskJson` - Prompt task structure
131
- - `ScriptTaskJson` - Script task structure
132
- - `SimpleTaskJson` - Simple task structure
133
- - `DialogTaskJson` - Dialog task structure
134
- - `CommonTaskJson` - Common task properties
128
+
129
+ - `PipelineCollection` - Pipeline collection interface (type)
130
+ - `PipelineJson` - Complete pipeline JSON structure (type)
131
+ - `PipelineString` - Pipeline string format (type)
132
+ - `PipelineInterface` - Pipeline interface definition (type)
133
+ - `TaskJson` - Task JSON structure (type)
134
+ - `PromptTaskJson` - Prompt task structure (type)
135
+ - `ScriptTaskJson` - Script task structure (type)
136
+ - `SimpleTaskJson` - Simple task structure (type)
137
+ - `DialogTaskJson` - Dialog task structure (type)
138
+ - `CommonTaskJson` - Common task properties (type)
135
139
 
136
140
  ### Command Types
137
- - `Command` - Base command interface
138
- - `CommandParser` - Command parser interface
139
- - `CommandType` - Command type enumeration
140
- - `CommandUsagePlace` - Command usage context
141
- - `BookVersionCommand` - Book version command
142
- - `ExpectCommand` - Expect command structure
143
- - `ForeachCommand` - Foreach command structure
144
- - `FormatCommand` - Format command structure
145
- - `FormfactorCommand` - Formfactor command structure
146
- - `KnowledgeCommand` - Knowledge command structure
147
- - `ModelCommand` - Model command structure
148
- - `ParameterCommand` - Parameter command structure
149
- - `PersonaCommand` - Persona command structure
150
- - `PostprocessCommand` - Postprocess command structure
141
+
142
+ - `Command` - Base command interface (type)
143
+ - `CommandParser` - Command parser interface (type)
144
+ - `PipelineBothCommandParser` - Pipeline both command parser (type)
145
+ - `PipelineHeadCommandParser` - Pipeline head command parser (type)
146
+ - `PipelineTaskCommandParser` - Pipeline task command parser (type)
147
+ - `CommandParserInput` - Command parser input (type)
148
+ - `CommandType` - Command type enumeration (type)
149
+ - `CommandUsagePlace` - Command usage context (type)
150
+ - `BookVersionCommand` - Book version command (type)
151
+ - `ExpectCommand` - Expect command structure (type)
152
+ - `ForeachCommand` - Foreach command structure (type)
153
+ - `ForeachJson` - Foreach JSON structure (type)
154
+ - `FormatCommand` - Format command structure (type)
155
+ - `FormfactorCommand` - Formfactor command structure (type)
156
+ - `JokerCommand` - Joker command structure (type)
157
+ - `KnowledgeCommand` - Knowledge command structure (type)
158
+ - `ModelCommand` - Model command structure (type)
159
+ - `ParameterCommand` - Parameter command structure (type)
160
+ - `PersonaCommand` - Persona command structure (type)
161
+ - `PostprocessCommand` - Postprocess command structure (type)
162
+ - `SectionCommand` - Section command structure (type)
163
+ - `UrlCommand` - URL command structure (type)
164
+ - `ActionCommand` - Action command structure (type)
165
+ - `InstrumentCommand` - Instrument command structure (type)
151
166
 
152
167
  ### Execution Types
153
- - `ExecutionTools` - Execution tools interface
154
- - `LlmExecutionTools` - LLM execution tools interface
155
- - `PipelineExecutor` - Pipeline executor interface
156
- - `PipelineExecutorResult` - Execution result structure
157
- - `ExecutionTask` - Execution task structure
158
- - `ExecutionReportJson` - Execution report structure
159
- - `PromptResult` - Prompt execution result
160
- - `Usage` - Usage tracking structure
161
- - `AvailableModel` - Available model information
168
+
169
+ - `ExecutionTools` - Execution tools interface (type)
170
+ - `LlmExecutionTools` - LLM execution tools interface (type)
171
+ - `LlmExecutionToolsConstructor` - LLM execution tools constructor (type)
172
+ - `PipelineExecutor` - Pipeline executor interface (type)
173
+ - `PipelineExecutorResult` - Execution result structure (type)
174
+ - `ExecutionTask` - Execution task structure (type)
175
+ - `PreparationTask` - Preparation task structure (type)
176
+ - `task_status` - Task status type (type)
177
+ - `AbstractTask` - Abstract task interface (type)
178
+ - `Task` - Task interface (type)
179
+ - `ExecutionReportJson` - Execution report structure (type)
180
+ - `ExecutionPromptReportJson` - Execution prompt report structure (type)
181
+ - `ExecutionReportString` - Execution report string (type)
182
+ - `ExecutionReportStringOptions` - Report formatting options (type)
183
+ - `PromptResult` - Prompt execution result (type)
184
+ - `CompletionPromptResult` - Completion prompt result (type)
185
+ - `ChatPromptResult` - Chat prompt result (type)
186
+ - `EmbeddingPromptResult` - Embedding prompt result (type)
187
+ - `Usage` - Usage tracking structure (type)
188
+ - `UsageCounts` - Usage counts structure (type)
189
+ - `UncertainNumber` - Uncertain number type (type)
190
+ - `AvailableModel` - Available model information (type)
191
+ - `AbstractTaskResult` - Abstract task result (type)
192
+ - `EmbeddingVector` - Embedding vector type (type)
162
193
 
163
194
  ### LLM Provider Configuration Types
164
- - `AnthropicClaudeExecutionToolsOptions` - Anthropic Claude configuration
165
- - `OpenAiExecutionToolsOptions` - OpenAI configuration
166
- - `AzureOpenAiExecutionToolsOptions` - Azure OpenAI configuration
167
- - `GoogleExecutionToolsOptions` - Google configuration
168
- - `DeepseekExecutionToolsOptions` - Deepseek configuration
169
- - `OllamaExecutionToolsOptions` - Ollama configuration
170
- - `VercelExecutionToolsOptions` - Vercel configuration
195
+
196
+ - `AnthropicClaudeExecutionToolsOptions` - Anthropic Claude configuration (type)
197
+ - `AnthropicClaudeExecutionToolsNonProxiedOptions` - Anthropic Claude non-proxied options (type)
198
+ - `AnthropicClaudeExecutionToolsProxiedOptions` - Anthropic Claude proxied options (type)
199
+ - `OpenAiExecutionToolsOptions` - OpenAI configuration (type)
200
+ - `OpenAiAssistantExecutionToolsOptions` - OpenAI Assistant configuration (type)
201
+ - `OpenAiCompatibleExecutionToolsOptions` - OpenAI Compatible configuration (type)
202
+ - `OpenAiCompatibleExecutionToolsNonProxiedOptions` - OpenAI Compatible non-proxied options (type)
203
+ - `OpenAiCompatibleExecutionToolsProxiedOptions` - OpenAI Compatible proxied options (type)
204
+ - `AzureOpenAiExecutionToolsOptions` - Azure OpenAI configuration (type)
205
+ - `GoogleExecutionToolsOptions` - Google configuration (type)
206
+ - `DeepseekExecutionToolsOptions` - Deepseek configuration (type)
207
+ - `OllamaExecutionToolsOptions` - Ollama configuration (type)
208
+ - `VercelExecutionToolsOptions` - Vercel configuration (type)
209
+ - `VercelProvider` - Vercel provider type (type)
171
210
 
172
211
  ### Parameter and Data Types
173
- - `ParameterJson` - Parameter definition structure
174
- - `InputParameterJson` - Input parameter structure
175
- - `OutputParameterJson` - Output parameter structure
176
- - `Parameters` - Parameter collection type
177
- - `Expectations` - Expectation validation structure
178
- - `PersonaJson` - Persona definition structure
179
- - `KnowledgeSourceJson` - Knowledge source structure
212
+
213
+ - `ParameterJson` - Parameter definition structure (type)
214
+ - `InputParameterJson` - Input parameter structure (type)
215
+ - `IntermediateParameterJson` - Intermediate parameter structure (type)
216
+ - `OutputParameterJson` - Output parameter structure (type)
217
+ - `CommonParameterJson` - Common parameter properties (type)
218
+ - `Parameters` - Parameter collection type (type)
219
+ - `InputParameters` - Input parameters type (type)
220
+ - `Expectations` - Expectation validation structure (type)
221
+ - `ExpectationUnit` - Expectation unit type (type)
222
+ - `ExpectationAmount` - Expectation amount type (type)
223
+ - `PersonaJson` - Persona definition structure (type)
224
+ - `PersonaPreparedJson` - Prepared persona structure (type)
225
+ - `KnowledgeSourceJson` - Knowledge source structure (type)
226
+ - `KnowledgeSourcePreparedJson` - Prepared knowledge source structure (type)
227
+ - `KnowledgePiecePreparedJson` - Prepared knowledge piece structure (type)
180
228
 
181
229
  ### Utility and Helper Types
182
- - `string_prompt` - Prompt string type
183
- - `string_template` - Template string type
184
- - `string_parameter_name` - Parameter name type
185
- - `string_model_name` - Model name type
186
- - `string_url` - URL string type
187
- - `string_filename` - Filename string type
188
- - `number_tokens` - Token count type
189
- - `number_usd` - USD amount type
190
- - `ModelVariant` - Model variant enumeration
191
- - `ScriptLanguage` - Script language enumeration
192
- - `TaskType` - Task type enumeration
230
+
231
+ - `string_prompt` - Prompt string type (type)
232
+ - `string_template` - Template string type (type)
233
+ - `string_text_prompt` - Text prompt string type (type)
234
+ - `string_chat_prompt` - Chat prompt string type (type)
235
+ - `string_system_message` - System message string type (type)
236
+ - `string_completion_prompt` - Completion prompt string type (type)
237
+ - `string_parameter_name` - Parameter name type (type)
238
+ - `string_parameter_value` - Parameter value type (type)
239
+ - `string_reserved_parameter_name` - Reserved parameter name type (type)
240
+ - `ReservedParameters` - Reserved parameters type (type)
241
+ - `string_model_name` - Model name type (type)
242
+ - `string_url` - URL string type (type)
243
+ - `string_filename` - Filename string type (type)
244
+ - `string_absolute_filename` - Absolute filename type (type)
245
+ - `string_relative_filename` - Relative filename type (type)
246
+ - `string_dirname` - Directory name type (type)
247
+ - `string_absolute_dirname` - Absolute directory name type (type)
248
+ - `string_relative_dirname` - Relative directory name type (type)
249
+ - `number_tokens` - Token count type (type)
250
+ - `number_usd` - USD amount type (type)
251
+ - `ModelVariant` - Model variant enumeration (type)
252
+ - `ScriptLanguage` - Script language enumeration (type)
253
+ - `TaskType` - Task type enumeration (type)
254
+ - `SectionType` - Section type enumeration (type)
255
+ - `ModelRequirements` - Model requirements type (type)
256
+ - `CompletionModelRequirements` - Completion model requirements (type)
257
+ - `ChatModelRequirements` - Chat model requirements (type)
258
+ - `EmbeddingModelRequirements` - Embedding model requirements (type)
193
259
 
194
260
  ### Remote Server Types
195
- - `RemoteServerOptions` - Remote server configuration
196
- - `RemoteClientOptions` - Remote client configuration
197
- - `Identification` - User identification structure
261
+
262
+ - `RemoteServerOptions` - Remote server configuration (type)
263
+ - `AnonymousRemoteServerOptions` - Anonymous remote server options (type)
264
+ - `ApplicationRemoteServerOptions` - Application remote server options (type)
265
+ - `ApplicationRemoteServerClientOptions` - Application remote server client options (type)
266
+ - `RemoteClientOptions` - Remote client configuration (type)
267
+ - `Identification` - User identification structure (type)
268
+ - `ApplicationModeIdentification` - Application mode identification (type)
269
+ - `AnonymousModeIdentification` - Anonymous mode identification (type)
270
+ - `LoginRequest` - Login request structure (type)
271
+ - `LoginResponse` - Login response structure (type)
272
+ - `RemoteServer` - Remote server interface (type)
198
273
 
199
274
  ### Storage and Scraper Types
200
- - `PromptbookStorage` - Storage interface
201
- - `Scraper` - Scraper interface
202
- - `ScraperConstructor` - Scraper constructor type
203
- - `Converter` - Content converter interface
204
275
 
205
- _Note: `@promptbook/types` does not export brand-specific types like `OpenAiExecutionToolsOptions`, `ClaudeExecutionToolsOptions`, `LangchainExecutionToolsOptions`,... etc._
276
+ - `PromptbookStorage` - Storage interface (type)
277
+ - `FileCacheStorageOptions` - File cache storage options (type)
278
+ - `IndexedDbStorageOptions` - IndexedDB storage options (type)
279
+ - `Scraper` - Scraper interface (type)
280
+ - `ScraperConstructor` - Scraper constructor type (type)
281
+ - `ScraperSourceHandler` - Scraper source handler (type)
282
+ - `ScraperIntermediateSource` - Scraper intermediate source (type)
283
+ - `ScraperAndConverterMetadata` - Scraper and converter metadata (type)
284
+ - `Converter` - Content converter interface (type)
285
+
286
+ ### Additional Types
287
+
288
+ - `Prompt` - Prompt interface (type)
289
+ - `CompletionPrompt` - Completion prompt interface (type)
290
+ - `ChatPrompt` - Chat prompt interface (type)
291
+ - `EmbeddingPrompt` - Embedding prompt interface (type)
292
+ - `NonEmptyArray` - Non-empty array type (type)
293
+ - `NonEmptyReadonlyArray` - Non-empty readonly array type (type)
294
+ - `IntermediateFilesStrategy` - Intermediate files strategy (type)
295
+ - `string_promptbook_version` - Promptbook version string type (type)
296
+
297
+ > πŸ’‘ This package provides TypeScript types for promptbook applications. For runtime functionality, see [@promptbook/core](#-packages) or install all packages with `npm i ptbk`
206
298
 
207
299
 
208
300
  ---
@@ -7,6 +7,9 @@ import type { AvatarProfileProps } from '../book-components/AvatarProfile/Avatar
7
7
  import { AvatarProfile } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
8
8
  import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
9
9
  import { AvatarProfileFromSource } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
10
+ import type { MockedChatDelayConfig } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
11
+ import type { MockedChatProps } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
12
+ import { MockedChat } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
10
13
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
11
14
  import { BookEditor } from '../book-components/BookEditor/BookEditor';
12
15
  import { DEFAULT_BOOK_FONT_CLASS } from '../book-components/BookEditor/config';
@@ -18,6 +21,10 @@ import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
18
21
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
19
22
  import { renderMarkdown } from '../book-components/Chat/utils/renderMarkdown';
20
23
  import { isMarkdownContent } from '../book-components/Chat/utils/renderMarkdown';
24
+ import { ArrowIcon } from '../book-components/icons/ArrowIcon';
25
+ import { ResetIcon } from '../book-components/icons/ResetIcon';
26
+ import { SendIcon } from '../book-components/icons/SendIcon';
27
+ import { TemplateIcon } from '../book-components/icons/TemplateIcon';
21
28
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
22
29
  export type { AvatarChipProps };
23
30
  export { AvatarChip };
@@ -27,6 +34,9 @@ export type { AvatarProfileProps };
27
34
  export { AvatarProfile };
28
35
  export type { AvatarProfileFromSourceProps };
29
36
  export { AvatarProfileFromSource };
37
+ export type { MockedChatDelayConfig };
38
+ export type { MockedChatProps };
39
+ export { MockedChat };
30
40
  export type { BookEditorProps };
31
41
  export { BookEditor };
32
42
  export { DEFAULT_BOOK_FONT_CLASS };
@@ -38,3 +48,7 @@ export type { ChatMessage };
38
48
  export type { ChatParticipant };
39
49
  export { renderMarkdown };
40
50
  export { isMarkdownContent };
51
+ export { ArrowIcon };
52
+ export { ResetIcon };
53
+ export { SendIcon };
54
+ export { TemplateIcon };
@@ -1,6 +1,7 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
3
3
  import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
4
+ import { parseParameters } from '../book-2.0/agent-source/parseParameters';
4
5
  import { isValidBook } from '../book-2.0/agent-source/string_book';
5
6
  import { validateBook } from '../book-2.0/agent-source/string_book';
6
7
  import { DEFAULT_BOOK } from '../book-2.0/agent-source/string_book';
@@ -166,6 +167,7 @@ import { REMOTE_SERVER_URLS } from '../../servers';
166
167
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
167
168
  export { createAgentModelRequirements };
168
169
  export { parseAgentSource };
170
+ export { parseParameters };
169
171
  export { isValidBook };
170
172
  export { validateBook };
171
173
  export { DEFAULT_BOOK };
@@ -1,3 +1,4 @@
1
+ import type { BookParameter } from '../book-2.0/agent-source/AgentBasicInformation';
1
2
  import type { AgentBasicInformation } from '../book-2.0/agent-source/AgentBasicInformation';
2
3
  import type { AgentModelRequirements } from '../book-2.0/agent-source/AgentModelRequirements';
3
4
  import type { string_book } from '../book-2.0/agent-source/string_book';
@@ -8,6 +9,8 @@ import type { AvatarChipProps } from '../book-components/AvatarProfile/AvatarChi
8
9
  import type { AvatarChipFromSourceProps } from '../book-components/AvatarProfile/AvatarChip/AvatarChipFromSource';
9
10
  import type { AvatarProfileProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfile';
10
11
  import type { AvatarProfileFromSourceProps } from '../book-components/AvatarProfile/AvatarProfile/AvatarProfileFromSource';
12
+ import type { MockedChatDelayConfig } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
13
+ import type { MockedChatProps } from '../book-components/AvatarProfile/AvatarProfile/MockedChat';
11
14
  import type { BookEditorProps } from '../book-components/BookEditor/BookEditor';
12
15
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
13
16
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
@@ -320,6 +323,7 @@ import type { CheckSerializableAsJsonOptions } from '../utils/serialization/chec
320
323
  import type { ExportJsonOptions } from '../utils/serialization/exportJson';
321
324
  import type { ITakeChain } from '../utils/take/interfaces/ITakeChain';
322
325
  import type { string_promptbook_version } from '../version';
326
+ export type { BookParameter };
323
327
  export type { AgentBasicInformation };
324
328
  export type { AgentModelRequirements };
325
329
  export type { string_book };
@@ -330,6 +334,8 @@ export type { AvatarChipProps };
330
334
  export type { AvatarChipFromSourceProps };
331
335
  export type { AvatarProfileProps };
332
336
  export type { AvatarProfileFromSourceProps };
337
+ export type { MockedChatDelayConfig };
338
+ export type { MockedChatProps };
333
339
  export type { BookEditorProps };
334
340
  export type { ChatProps };
335
341
  export type { LlmChatProps };
@@ -1,4 +1,28 @@
1
1
  import type { string_agent_name, string_url_image } from '../../types/typeAliases';
2
+ /**
3
+ * Unified parameter representation that supports two different notations:
4
+ * 1. @Parameter - single word parameter starting with @
5
+ * 2. {parameterName} or {parameter with multiple words} or {parameterName: description text}
6
+ * Both notations represent the same syntax feature - parameters
7
+ */
8
+ export type BookParameter = {
9
+ /**
10
+ * The raw text of the parameter as it appears in the source
11
+ */
12
+ text: string;
13
+ /**
14
+ * The notation used for this parameter
15
+ */
16
+ notation: 'at' | 'brace';
17
+ /**
18
+ * The parameter name (without @ or {})
19
+ */
20
+ name: string;
21
+ /**
22
+ * Optional description for {parameterName: description} notation
23
+ */
24
+ description?: string;
25
+ };
2
26
  export type AgentBasicInformation = {
3
27
  /**
4
28
  * Name of the agent
@@ -11,10 +35,24 @@ export type AgentBasicInformation = {
11
35
  */
12
36
  personaDescription: string | null;
13
37
  /**
14
- * Optional profile image URL
15
- * This is the line starting with "META IMAGE"
38
+ * Metadata commitments parsed from META lines
39
+ * Each META commitment has the format "META TYPE content"
40
+ * When there are multiple meta commitments of the same type, later overrides earlier
41
+ */
42
+ meta: {
43
+ image?: string_url_image;
44
+ link?: string;
45
+ title?: string;
46
+ description?: string;
47
+ [key: string]: string | undefined;
48
+ };
49
+ /**
50
+ * Parameters found in the agent source
51
+ * Supports two different notations for the same syntax feature:
52
+ * - @Parameter (single word parameter starting with @)
53
+ * - {parameterName} or {parameter with multiple words} or {parameterName: description text}
16
54
  */
17
- profileImageUrl: string_url_image;
55
+ parameters: BookParameter[];
18
56
  };
19
57
  /**
20
58
  * TODO: [πŸ•›] Unite `AgentBasicInformation`, `ChatParticipant`, `LlmExecutionTools` + `LlmToolsMetadata`
@@ -0,0 +1,13 @@
1
+ import type { BookParameter } from './AgentBasicInformation';
2
+ /**
3
+ * Parses parameters from text using both supported notations:
4
+ * 1. @Parameter - single word parameter starting with @
5
+ * 2. {parameterName} or {parameter with multiple words} or {parameterName: description text}
6
+ *
7
+ * Both notations represent the same syntax feature - parameters
8
+ *
9
+ * @param text - Text to extract parameters from
10
+ * @returns Array of parsed parameters with unified representation
11
+ * @public exported from `@promptbook/core`
12
+ */
13
+ export declare function parseParameters(text: string): BookParameter[];
@@ -15,8 +15,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
15
15
  *
16
16
  * @private [πŸͺ”] Maybe export the commitments through some package
17
17
  */
18
- export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition<'ACTION'> {
19
- constructor();
18
+ export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition<'ACTION' | 'ACTIONS'> {
19
+ constructor(type?: 'ACTION' | 'ACTIONS');
20
20
  /**
21
21
  * Short one-line description of ACTION.
22
22
  */
@@ -33,6 +33,12 @@ export declare class ActionCommitmentDefinition extends BaseCommitmentDefinition
33
33
  * @private [πŸͺ”] Maybe export the commitments through some package
34
34
  */
35
35
  export declare const ActionCommitment: ActionCommitmentDefinition;
36
+ /**
37
+ * Singleton instance of the ACTIONS commitment definition
38
+ *
39
+ * @private [πŸͺ”] Maybe export the commitments through some package
40
+ */
41
+ export declare const ActionsCommitment: ActionCommitmentDefinition;
36
42
  /**
37
43
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
38
44
  */
@@ -0,0 +1,59 @@
1
+ import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * DELETE commitment definition
5
+ *
6
+ * The DELETE commitment (and its aliases CANCEL, DISCARD, REMOVE) is used to
7
+ * remove or disregard certain information or context. This can be useful for
8
+ * overriding previous commitments or removing unwanted behaviors.
9
+ *
10
+ * Example usage in agent source:
11
+ *
12
+ * ```book
13
+ * DELETE Previous formatting requirements
14
+ * CANCEL All emotional responses
15
+ * DISCARD Technical jargon explanations
16
+ * REMOVE Casual conversational style
17
+ * ```
18
+ *
19
+ * @private [πŸͺ”] Maybe export the commitments through some package
20
+ */
21
+ export declare class DeleteCommitmentDefinition extends BaseCommitmentDefinition<'DELETE' | 'CANCEL' | 'DISCARD' | 'REMOVE'> {
22
+ constructor(type: 'DELETE' | 'CANCEL' | 'DISCARD' | 'REMOVE');
23
+ /**
24
+ * Short one-line description of DELETE/CANCEL/DISCARD/REMOVE.
25
+ */
26
+ get description(): string;
27
+ /**
28
+ * Markdown documentation for DELETE commitment.
29
+ */
30
+ get documentation(): string;
31
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
32
+ }
33
+ /**
34
+ * Singleton instances of the DELETE commitment definitions with aliases
35
+ *
36
+ * @private [πŸͺ”] Maybe export the commitments through some package
37
+ */
38
+ export declare const DeleteCommitment: DeleteCommitmentDefinition;
39
+ /**
40
+ * Singleton instances of the DELETE commitment definitions with aliases
41
+ *
42
+ * @private [πŸͺ”] Maybe export the commitments through some package
43
+ */
44
+ export declare const CancelCommitment: DeleteCommitmentDefinition;
45
+ /**
46
+ * Singleton instances of the DELETE commitment definitions with aliases
47
+ *
48
+ * @private [πŸͺ”] Maybe export the commitments through some package
49
+ */
50
+ export declare const DiscardCommitment: DeleteCommitmentDefinition;
51
+ /**
52
+ * Singleton instances of the DELETE commitment definitions with aliases
53
+ *
54
+ * @private [πŸͺ”] Maybe export the commitments through some package
55
+ */
56
+ export declare const RemoveCommitment: DeleteCommitmentDefinition;
57
+ /**
58
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
59
+ */
@@ -16,8 +16,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
16
16
  *
17
17
  * @private [πŸͺ”] Maybe export the commitments through some package
18
18
  */
19
- export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition<'FORMAT'> {
20
- constructor();
19
+ export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition<'FORMAT' | 'FORMATS'> {
20
+ constructor(type?: 'FORMAT' | 'FORMATS');
21
21
  /**
22
22
  * Short one-line description of FORMAT.
23
23
  */
@@ -34,6 +34,12 @@ export declare class FormatCommitmentDefinition extends BaseCommitmentDefinition
34
34
  * @private [πŸͺ”] Maybe export the commitments through some package
35
35
  */
36
36
  export declare const FormatCommitment: FormatCommitmentDefinition;
37
+ /**
38
+ * Singleton instance of the FORMATS commitment definition
39
+ *
40
+ * @private [πŸͺ”] Maybe export the commitments through some package
41
+ */
42
+ export declare const FormatsCommitment: FormatCommitmentDefinition;
37
43
  /**
38
44
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
39
45
  */
@@ -0,0 +1,45 @@
1
+ import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * GOAL commitment definition
5
+ *
6
+ * The GOAL commitment defines the main goal which should be achieved by the AI assistant.
7
+ * There can be multiple goals. Later goals are more important than earlier goals.
8
+ *
9
+ * Example usage in agent source:
10
+ *
11
+ * ```book
12
+ * GOAL Help users understand complex technical concepts
13
+ * GOAL Provide accurate and up-to-date information
14
+ * GOAL Always prioritize user safety and ethical guidelines
15
+ * ```
16
+ *
17
+ * @private [πŸͺ”] Maybe export the commitments through some package
18
+ */
19
+ export declare class GoalCommitmentDefinition extends BaseCommitmentDefinition<'GOAL' | 'GOALS'> {
20
+ constructor(type?: 'GOAL' | 'GOALS');
21
+ /**
22
+ * Short one-line description of GOAL.
23
+ */
24
+ get description(): string;
25
+ /**
26
+ * Markdown documentation for GOAL commitment.
27
+ */
28
+ get documentation(): string;
29
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
30
+ }
31
+ /**
32
+ * Singleton instance of the GOAL commitment definition
33
+ *
34
+ * @private [πŸͺ”] Maybe export the commitments through some package
35
+ */
36
+ export declare const GoalCommitment: GoalCommitmentDefinition;
37
+ /**
38
+ * Singleton instance of the GOALS commitment definition
39
+ *
40
+ * @private [πŸͺ”] Maybe export the commitments through some package
41
+ */
42
+ export declare const GoalsCommitment: GoalCommitmentDefinition;
43
+ /**
44
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
45
+ */
@@ -35,7 +35,7 @@ export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinit
35
35
  private isUrl;
36
36
  }
37
37
  /**
38
- * Singleton instance of the KNOWLEDGE commitment definition
38
+ * Singleton instance of the KNOWLEDGE commitment definition !!!!
39
39
  *
40
40
  * @private [πŸͺ”] Maybe export the commitments through some package
41
41
  */
@@ -0,0 +1,46 @@
1
+ import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * MEMORY commitment definition
5
+ *
6
+ * The MEMORY commitment is similar to KNOWLEDGE but has a focus on remembering past
7
+ * interactions and user preferences. It helps the agent maintain context about the
8
+ * user's history, preferences, and previous conversations.
9
+ *
10
+ * Example usage in agent source:
11
+ *
12
+ * ```book
13
+ * MEMORY User prefers detailed technical explanations
14
+ * MEMORY Previously worked on React projects
15
+ * MEMORY Timezone: UTC-5 (Eastern Time)
16
+ * ```
17
+ *
18
+ * @private [πŸͺ”] Maybe export the commitments through some package
19
+ */
20
+ export declare class MemoryCommitmentDefinition extends BaseCommitmentDefinition<'MEMORY' | 'MEMORIES'> {
21
+ constructor(type?: 'MEMORY' | 'MEMORIES');
22
+ /**
23
+ * Short one-line description of MEMORY.
24
+ */
25
+ get description(): string;
26
+ /**
27
+ * Markdown documentation for MEMORY commitment.
28
+ */
29
+ get documentation(): string;
30
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
31
+ }
32
+ /**
33
+ * Singleton instance of the MEMORY commitment definition
34
+ *
35
+ * @private [πŸͺ”] Maybe export the commitments through some package
36
+ */
37
+ export declare const MemoryCommitment: MemoryCommitmentDefinition;
38
+ /**
39
+ * Singleton instance of the MEMORIES commitment definition
40
+ *
41
+ * @private [πŸͺ”] Maybe export the commitments through some package
42
+ */
43
+ export declare const MemoriesCommitment: MemoryCommitmentDefinition;
44
+ /**
45
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
46
+ */
@@ -0,0 +1,47 @@
1
+ import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * MESSAGE commitment definition
5
+ *
6
+ * The MESSAGE commitment contains 1:1 text of the message which AI assistant already
7
+ * sent during the conversation. Later messages are later in the conversation.
8
+ * It is similar to EXAMPLE but it is not example, it is the real message which
9
+ * AI assistant already sent.
10
+ *
11
+ * Example usage in agent source:
12
+ *
13
+ * ```book
14
+ * MESSAGE Hello! How can I help you today?
15
+ * MESSAGE I understand you're looking for information about our services.
16
+ * MESSAGE Based on your requirements, I'd recommend our premium package.
17
+ * ```
18
+ *
19
+ * @private [πŸͺ”] Maybe export the commitments through some package
20
+ */
21
+ export declare class MessageCommitmentDefinition extends BaseCommitmentDefinition<'MESSAGE' | 'MESSAGES'> {
22
+ constructor(type?: 'MESSAGE' | 'MESSAGES');
23
+ /**
24
+ * Short one-line description of MESSAGE.
25
+ */
26
+ get description(): string;
27
+ /**
28
+ * Markdown documentation for MESSAGE commitment.
29
+ */
30
+ get documentation(): string;
31
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
32
+ }
33
+ /**
34
+ * Singleton instance of the MESSAGE commitment definition
35
+ *
36
+ * @private [πŸͺ”] Maybe export the commitments through some package
37
+ */
38
+ export declare const MessageCommitment: MessageCommitmentDefinition;
39
+ /**
40
+ * Singleton instance of the MESSAGES commitment definition
41
+ *
42
+ * @private [πŸͺ”] Maybe export the commitments through some package
43
+ */
44
+ export declare const MessagesCommitment: MessageCommitmentDefinition;
45
+ /**
46
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
47
+ */
@@ -0,0 +1,62 @@
1
+ import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * META commitment definition
5
+ *
6
+ * The META commitment handles all meta-information about the agent such as:
7
+ * - META IMAGE: Sets the agent's avatar/profile image URL
8
+ * - META LINK: Provides profile/source links for the person the agent models
9
+ * - META TITLE: Sets the agent's display title
10
+ * - META DESCRIPTION: Sets the agent's description
11
+ * - META [ANYTHING]: Any other meta information in uppercase format
12
+ *
13
+ * These commitments are special because they don't affect the system message,
14
+ * but are handled separately in the parsing logic for profile display.
15
+ *
16
+ * Example usage in agent source:
17
+ *
18
+ * ```book
19
+ * META IMAGE https://example.com/avatar.jpg
20
+ * META LINK https://twitter.com/username
21
+ * META TITLE Professional Assistant
22
+ * META DESCRIPTION An AI assistant specialized in business tasks
23
+ * META AUTHOR John Doe
24
+ * META VERSION 1.0
25
+ * ```
26
+ *
27
+ * @private [πŸͺ”] Maybe export the commitments through some package
28
+ */
29
+ export declare class MetaCommitmentDefinition extends BaseCommitmentDefinition<`META${string}`> {
30
+ constructor();
31
+ /**
32
+ * Short one-line description of META commitments.
33
+ */
34
+ get description(): string;
35
+ /**
36
+ * Markdown documentation for META commitment.
37
+ */
38
+ get documentation(): string;
39
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
40
+ /**
41
+ * Extracts meta information from the content based on the meta type
42
+ * This is used by the parsing logic
43
+ */
44
+ extractMetaValue(metaType: string, content: string): string | null;
45
+ /**
46
+ * Validates if the provided content is a valid URL (for IMAGE and LINK types)
47
+ */
48
+ isValidUrl(content: string): boolean;
49
+ /**
50
+ * Checks if this is a known meta type
51
+ */
52
+ isKnownMetaType(metaType: string): boolean;
53
+ }
54
+ /**
55
+ * Singleton instance of the META commitment definition
56
+ *
57
+ * @private [πŸͺ”] Maybe export the commitments through some package
58
+ */
59
+ export declare const MetaCommitment: MetaCommitmentDefinition;
60
+ /**
61
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
62
+ */
@@ -16,8 +16,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
16
16
  *
17
17
  * @private [πŸͺ”] Maybe export the commitments through some package
18
18
  */
19
- export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL'> {
20
- constructor();
19
+ export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<'MODEL' | 'MODELS'> {
20
+ constructor(type?: 'MODEL' | 'MODELS');
21
21
  /**
22
22
  * Short one-line description of MODEL.
23
23
  */
@@ -34,6 +34,12 @@ export declare class ModelCommitmentDefinition extends BaseCommitmentDefinition<
34
34
  * @private [πŸͺ”] Maybe export the commitments through some package
35
35
  */
36
36
  export declare const ModelCommitment: ModelCommitmentDefinition;
37
+ /**
38
+ * Singleton instance of the MODELS commitment definition
39
+ *
40
+ * @private [πŸͺ”] Maybe export the commitments through some package
41
+ */
42
+ export declare const ModelsCommitment: ModelCommitmentDefinition;
37
43
  /**
38
44
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
39
45
  */
@@ -26,8 +26,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
26
26
  *
27
27
  * @private [πŸͺ”] Maybe export the commitments through some package
28
28
  */
29
- export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE'> {
30
- constructor();
29
+ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'NOTE' | 'NOTES'> {
30
+ constructor(type?: 'NOTE' | 'NOTES');
31
31
  /**
32
32
  * Short one-line description of NOTE.
33
33
  */
@@ -44,6 +44,12 @@ export declare class NoteCommitmentDefinition extends BaseCommitmentDefinition<'
44
44
  * @private [πŸͺ”] Maybe export the commitments through some package
45
45
  */
46
46
  export declare const NoteCommitment: NoteCommitmentDefinition;
47
+ /**
48
+ * Singleton instance of the NOTES commitment definition
49
+ *
50
+ * @private [πŸͺ”] Maybe export the commitments through some package
51
+ */
52
+ export declare const NotesCommitment: NoteCommitmentDefinition;
47
53
  /**
48
54
  * [πŸ’ž] Ignore a discrepancy between file name and entity name
49
55
  */
@@ -23,8 +23,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
23
23
  *
24
24
  * @private [πŸͺ”] Maybe export the commitments through some package
25
25
  */
26
- export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinition<'PERSONA'> {
27
- constructor();
26
+ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinition<'PERSONA' | 'PERSONAE'> {
27
+ constructor(type?: 'PERSONA' | 'PERSONAE');
28
28
  /**
29
29
  * Short one-line description of PERSONA.
30
30
  */
@@ -41,6 +41,12 @@ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinitio
41
41
  * @private [πŸͺ”] Maybe export the commitments through some package
42
42
  */
43
43
  export declare const PersonaCommitment: PersonaCommitmentDefinition;
44
+ /**
45
+ * Singleton instance of the PERSONAE commitment definition
46
+ *
47
+ * @private [πŸͺ”] Maybe export the commitments through some package
48
+ */
49
+ export declare const PersonaeCommitment: PersonaCommitmentDefinition;
44
50
  /**
45
51
  * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
46
52
  */
@@ -0,0 +1,46 @@
1
+ import type { AgentModelRequirements } from '../../agent-source/AgentModelRequirements';
2
+ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
3
+ /**
4
+ * SCENARIO commitment definition
5
+ *
6
+ * The SCENARIO commitment defines a specific situation or context in which the AI
7
+ * assistant should operate. It helps to set the scene for the AI's responses.
8
+ * Later scenarios are more important than earlier scenarios.
9
+ *
10
+ * Example usage in agent source:
11
+ *
12
+ * ```book
13
+ * SCENARIO You are in a customer service call center during peak hours
14
+ * SCENARIO The customer is frustrated and has been on hold for 20 minutes
15
+ * SCENARIO This is the customer's third call about the same issue
16
+ * ```
17
+ *
18
+ * @private [πŸͺ”] Maybe export the commitments through some package
19
+ */
20
+ export declare class ScenarioCommitmentDefinition extends BaseCommitmentDefinition<'SCENARIO' | 'SCENARIOS'> {
21
+ constructor(type?: 'SCENARIO' | 'SCENARIOS');
22
+ /**
23
+ * Short one-line description of SCENARIO.
24
+ */
25
+ get description(): string;
26
+ /**
27
+ * Markdown documentation for SCENARIO commitment.
28
+ */
29
+ get documentation(): string;
30
+ applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
31
+ }
32
+ /**
33
+ * Singleton instance of the SCENARIO commitment definition
34
+ *
35
+ * @private [πŸͺ”] Maybe export the commitments through some package
36
+ */
37
+ export declare const ScenarioCommitment: ScenarioCommitmentDefinition;
38
+ /**
39
+ * Singleton instance of the SCENARIOS commitment definition
40
+ *
41
+ * @private [πŸͺ”] Maybe export the commitments through some package
42
+ */
43
+ export declare const ScenariosCommitment: ScenarioCommitmentDefinition;
44
+ /**
45
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
46
+ */
@@ -15,8 +15,8 @@ import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
15
15
  *
16
16
  * @private [πŸͺ”] Maybe export the commitments through some package
17
17
  */
18
- export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<'STYLE'> {
19
- constructor();
18
+ export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<'STYLE' | 'STYLES'> {
19
+ constructor(type?: 'STYLE' | 'STYLES');
20
20
  /**
21
21
  * Short one-line description of STYLE.
22
22
  */
@@ -33,6 +33,12 @@ export declare class StyleCommitmentDefinition extends BaseCommitmentDefinition<
33
33
  * @private [πŸͺ”] Maybe export the commitments through some package
34
34
  */
35
35
  export declare const StyleCommitment: StyleCommitmentDefinition;
36
+ /**
37
+ * Singleton instance of the STYLES commitment definition
38
+ *
39
+ * @private [πŸͺ”] Maybe export the commitments through some package
40
+ */
41
+ export declare const StylesCommitment: StyleCommitmentDefinition;
36
42
  /**
37
43
  * [πŸ’ž] Ignore a discrepancy between file name and entity name
38
44
  */
@@ -1,15 +1,19 @@
1
1
  import type { BookCommitment } from './_base/BookCommitment';
2
2
  import type { CommitmentDefinition } from './_base/CommitmentDefinition';
3
3
  import { ActionCommitmentDefinition } from './ACTION/ACTION';
4
+ import { DeleteCommitmentDefinition } from './DELETE/DELETE';
4
5
  import { FormatCommitmentDefinition } from './FORMAT/FORMAT';
6
+ import { GoalCommitmentDefinition } from './GOAL/GOAL';
5
7
  import { KnowledgeCommitmentDefinition } from './KNOWLEDGE/KNOWLEDGE';
6
- import { MetaImageCommitmentDefinition } from './META_IMAGE/META_IMAGE';
7
- import { MetaLinkCommitmentDefinition } from './META_LINK/META_LINK';
8
+ import { MemoryCommitmentDefinition } from './MEMORY/MEMORY';
9
+ import { MessageCommitmentDefinition } from './MESSAGE/MESSAGE';
10
+ import { MetaCommitmentDefinition } from './META/META';
8
11
  import { ModelCommitmentDefinition } from './MODEL/MODEL';
9
12
  import { NoteCommitmentDefinition } from './NOTE/NOTE';
10
13
  import { PersonaCommitmentDefinition } from './PERSONA/PERSONA';
11
14
  import { RuleCommitmentDefinition } from './RULE/RULE';
12
15
  import { SampleCommitmentDefinition } from './SAMPLE/SAMPLE';
16
+ import { ScenarioCommitmentDefinition } from './SCENARIO/SCENARIO';
13
17
  import { StyleCommitmentDefinition } from './STYLE/STYLE';
14
18
  import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplementedCommitmentDefinition';
15
19
  /**
@@ -19,7 +23,7 @@ import { NotYetImplementedCommitmentDefinition } from './_base/NotYetImplemented
19
23
  *
20
24
  * @private Use functions to access commitments instead of this array directly
21
25
  */
22
- export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, MetaImageCommitmentDefinition, MetaLinkCommitmentDefinition, NoteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"SCENARIO">, NotYetImplementedCommitmentDefinition<"SCENARIOS">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"GOAL">, NotYetImplementedCommitmentDefinition<"GOALS">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
26
+ export declare const COMMITMENT_REGISTRY: readonly [PersonaCommitmentDefinition, PersonaCommitmentDefinition, KnowledgeCommitmentDefinition, MemoryCommitmentDefinition, MemoryCommitmentDefinition, StyleCommitmentDefinition, StyleCommitmentDefinition, RuleCommitmentDefinition, RuleCommitmentDefinition, SampleCommitmentDefinition, SampleCommitmentDefinition, FormatCommitmentDefinition, FormatCommitmentDefinition, ModelCommitmentDefinition, ModelCommitmentDefinition, ActionCommitmentDefinition, ActionCommitmentDefinition, MetaCommitmentDefinition, NoteCommitmentDefinition, NoteCommitmentDefinition, GoalCommitmentDefinition, GoalCommitmentDefinition, MessageCommitmentDefinition, MessageCommitmentDefinition, ScenarioCommitmentDefinition, ScenarioCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, DeleteCommitmentDefinition, NotYetImplementedCommitmentDefinition<"EXPECT">, NotYetImplementedCommitmentDefinition<"BEHAVIOUR">, NotYetImplementedCommitmentDefinition<"BEHAVIOURS">, NotYetImplementedCommitmentDefinition<"AVOID">, NotYetImplementedCommitmentDefinition<"AVOIDANCE">, NotYetImplementedCommitmentDefinition<"CONTEXT">];
23
27
  /**
24
28
  * Gets a commitment definition by its type
25
29
  * @param type The commitment type to look up
@@ -0,0 +1,46 @@
1
+ import type { ChatProps } from '../../Chat/Chat/ChatProps';
2
+ /**
3
+ * Delay configuration for the MockedChat component
4
+ *
5
+ * @public exported from `@promptbook/components`
6
+ */
7
+ export type MockedChatDelayConfig = {
8
+ /**
9
+ * Delay before showing the first message (in milliseconds)
10
+ * @default 1000
11
+ */
12
+ beforeFirstMessage?: number;
13
+ /**
14
+ * Emulated thinking time between messages (in milliseconds)
15
+ * @default 2000
16
+ */
17
+ thinkingBetweenMessages?: number;
18
+ /**
19
+ * Wait time after each written word (in milliseconds)
20
+ * @default 100
21
+ */
22
+ waitAfterWord?: number;
23
+ /**
24
+ * Extra delay on top of the word waiting (in milliseconds)
25
+ * @default 50
26
+ */
27
+ extraWordDelay?: number;
28
+ };
29
+ /**
30
+ * Props for MockedChat component
31
+ *
32
+ * @public exported from `@promptbook/components`
33
+ */
34
+ export type MockedChatProps = ChatProps & {
35
+ /**
36
+ * Optional delays configuration for emulating typing behavior
37
+ */
38
+ delayConfig?: MockedChatDelayConfig;
39
+ };
40
+ /**
41
+ * MockedChat component that shows the same chat as Chat but emulates ongoing discussion
42
+ * with realistic typing delays and thinking pauses.
43
+ *
44
+ * @public exported from `@promptbook/components`
45
+ */
46
+ export declare function MockedChat(props: MockedChatProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export * from './AvatarProfile';
2
+ export * from './AvatarProfileFromSource';
3
+ export * from './MockedChat';
@@ -1,5 +1,7 @@
1
1
  import type { CSSProperties } from 'react';
2
+ import type { Promisable } from 'type-fest';
2
3
  import type { string_book } from '../../book-2.0/agent-source/string_book';
4
+ import { string_knowledge_source_content } from '../../types/typeAliases';
3
5
  /**
4
6
  * Props of `BookEditor`
5
7
  *
@@ -27,10 +29,18 @@ export type BookEditorProps = {
27
29
  * Callback function to handle changes in the book content.
28
30
  */
29
31
  onChange?(value: string_book): void;
32
+ /**
33
+ * returns the URL of the uploaded file on CDN or storage
34
+ */
35
+ onFileUpload?(file: File): Promisable<string_knowledge_source_content>;
30
36
  /**
31
37
  * If true, logs verbose debug info to the console and shows additional visual cues
32
38
  */
33
39
  readonly isVerbose?: boolean;
40
+ /**
41
+ * If true, disables border radius making the editor have sharp corners
42
+ */
43
+ readonly isBorderRadiusDisabled?: boolean;
34
44
  };
35
45
  /**
36
46
  * Renders a book editor
@@ -1,3 +1,4 @@
1
+ import { Promisable } from 'type-fest';
1
2
  import type { string_book } from '../../book-2.0/agent-source/string_book';
2
3
  /**
3
4
  * @private util of `<BookEditor />`
@@ -7,7 +8,9 @@ export type BookEditorInnerProps = {
7
8
  fontClassName?: string;
8
9
  value?: string_book;
9
10
  onChange?(value: string_book): void;
11
+ onFileUpload?(file: File): Promisable<string>;
10
12
  isVerbose?: boolean;
13
+ isBorderRadiusDisabled?: boolean;
11
14
  };
12
15
  /**
13
16
  * @private util of `<BookEditor />`
@@ -1,9 +1,4 @@
1
1
  import type { ChatProps } from './ChatProps';
2
- /**
3
- * @deprecated use `isComplete` instead
4
- * @private util of `<Chat />`
5
- */
6
- export declare const LOADING_INTERACTIVE_IMAGE = "Loading...";
7
2
  /**
8
3
  * Renders a chat with messages and input for new messages
9
4
  *
@@ -23,10 +23,16 @@ export type ChatProps = {
23
23
  * Called when user sends a message
24
24
  *
25
25
  * Note: You must handle the message yourself and add it to the `messages` array
26
+ *
27
+ * - When set, the send textarea and button will be shown
28
+ * - When undefined, the chat has no input and is read-only showing only the messages
26
29
  */
27
- onMessage(messageContent: string): Promisable<void>;
30
+ onMessage?(messageContent: string): Promisable<void>;
28
31
  /**
29
- * Optional callback, when set, button for resetting chat will be shown
32
+ * Optional callback
33
+ *
34
+ * - When set, button for resetting chat will be shown
35
+ * - When undefined, no reset button will be shown
30
36
  */
31
37
  onReset?(): Promisable<void>;
32
38
  /**
@@ -113,4 +119,24 @@ export type ChatProps = {
113
119
  * Keys should match ChatMessage.from values (e.g., 'USER', 'AGENT_{id}', etc.)
114
120
  */
115
121
  readonly participants?: ReadonlyArray<ChatParticipant>;
122
+ /**
123
+ * Optional callback for handling user feedback on messages
124
+ * When provided, star rating buttons (1-5 stars) will be displayed next to each message
125
+ *
126
+ * @param feedback - Object containing the feedback data
127
+ * @param feedback.message - The message being rated
128
+ * @param feedback.rating - Star rating from 1 to 5
129
+ * @param feedback.textRating - Optional text feedback/note from user
130
+ * @param feedback.chatThread - Complete chat thread as string
131
+ * @param feedback.expectedAnswer - Optional expected answer provided by user
132
+ * @param feedback.url - Current page URL where feedback was given
133
+ */
134
+ onFeedback?(feedback: {
135
+ message: ChatMessage;
136
+ rating: number;
137
+ textRating: string;
138
+ chatThread: string;
139
+ expectedAnswer: string | null;
140
+ url: string;
141
+ }): Promisable<void>;
116
142
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @deprecated use `isComplete` instead
3
+ * @private util of `<Chat />`
4
+ */
5
+ export declare const LOADING_INTERACTIVE_IMAGE = "Loading...";
6
+ /**
7
+ * Note: [πŸ’ž] Ignore a discrepancy between file name and entity name
8
+ */
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Shows simple arrow icon pointing up or down
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const ArrowIcon: ({ direction, size }: {
7
+ direction: string;
8
+ size: number;
9
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Shows simple reset icon
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const ResetIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shows simple send icon
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const SendIcon: ({ size }: {
7
+ size: number;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shows simple template icon
3
+ *
4
+ * @public exported from `@promptbook/components`
5
+ */
6
+ export declare const TemplateIcon: ({ size }: {
7
+ size: number;
8
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -9,5 +9,6 @@ import { string_markdown } from '../../types/typeAliases';
9
9
  */
10
10
  export declare function humanizeAiText(aiText: string_markdown): string_markdown;
11
11
  /**
12
+ * TODO: [🧠] Maybe this should be exported from `@promptbook/utils` not `@promptbook/markdown-utils`
12
13
  * TODO: [πŸ…ΎοΈ] !!! Use this across the project where AI text is involved
13
14
  */
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.101.0-0`).
18
+ * It follows semantic versioning (e.g., `0.101.0-9`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/types",
3
- "version": "0.101.0-1",
3
+ "version": "0.101.0-10",
4
4
  "description": "Promptbook: Run AI apps in plain human language across multiple models and platforms",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -92,6 +92,6 @@
92
92
  },
93
93
  "typings": "./esm/typings/src/_packages/types.index.d.ts",
94
94
  "peerDependencies": {
95
- "@promptbook/core": "0.101.0-1"
95
+ "@promptbook/core": "0.101.0-10"
96
96
  }
97
97
  }