@promptbook/types 0.101.0-2 → 0.101.0-20

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 (73) hide show
  1. package/README.md +188 -96
  2. package/esm/typings/src/_packages/components.index.d.ts +20 -0
  3. package/esm/typings/src/_packages/core.index.d.ts +14 -0
  4. package/esm/typings/src/_packages/types.index.d.ts +14 -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/AgentModelRequirements.d.ts +3 -0
  7. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirements.d.ts +4 -22
  8. package/esm/typings/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.d.ts +1 -26
  9. package/esm/typings/src/book-2.0/agent-source/parseParameters.d.ts +13 -0
  10. package/esm/typings/src/book-2.0/commitments/ACTION/ACTION.d.ts +8 -2
  11. package/esm/typings/src/book-2.0/commitments/DELETE/DELETE.d.ts +59 -0
  12. package/esm/typings/src/book-2.0/commitments/FORMAT/FORMAT.d.ts +8 -2
  13. package/esm/typings/src/book-2.0/commitments/GOAL/GOAL.d.ts +45 -0
  14. package/esm/typings/src/book-2.0/commitments/KNOWLEDGE/KNOWLEDGE.d.ts +1 -1
  15. package/esm/typings/src/book-2.0/commitments/MEMORY/MEMORY.d.ts +46 -0
  16. package/esm/typings/src/book-2.0/commitments/MESSAGE/MESSAGE.d.ts +47 -0
  17. package/esm/typings/src/book-2.0/commitments/META/META.d.ts +62 -0
  18. package/esm/typings/src/book-2.0/commitments/MODEL/MODEL.d.ts +31 -4
  19. package/esm/typings/src/book-2.0/commitments/NOTE/NOTE.d.ts +20 -2
  20. package/esm/typings/src/book-2.0/commitments/PERSONA/PERSONA.d.ts +8 -2
  21. package/esm/typings/src/book-2.0/commitments/SCENARIO/SCENARIO.d.ts +46 -0
  22. package/esm/typings/src/book-2.0/commitments/STYLE/STYLE.d.ts +8 -2
  23. package/esm/typings/src/book-2.0/commitments/index.d.ts +7 -3
  24. package/esm/typings/src/book-2.0/utils/generatePlaceholderAgentProfileImageUrl.d.ts +3 -0
  25. package/esm/typings/src/book-components/AvatarProfile/AvatarChip/AvatarChip.d.ts +2 -2
  26. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/MockedChat.d.ts +63 -0
  27. package/esm/typings/src/book-components/AvatarProfile/AvatarProfile/index.d.ts +3 -0
  28. package/esm/typings/src/book-components/BookEditor/BookEditor.d.ts +15 -0
  29. package/esm/typings/src/book-components/BookEditor/BookEditorInner.d.ts +4 -0
  30. package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +26 -0
  31. package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +13 -0
  32. package/esm/typings/src/book-components/Chat/hooks/index.d.ts +2 -0
  33. package/esm/typings/src/book-components/Chat/hooks/useChatAutoScroll.d.ts +41 -0
  34. package/esm/typings/src/book-components/Chat/hooks/useSendMessageToLlmChat.d.ts +44 -0
  35. package/esm/typings/src/book-components/Chat/utils/parseMessageButtons.d.ts +22 -0
  36. package/esm/typings/src/book-components/icons/PauseIcon.d.ts +8 -0
  37. package/esm/typings/src/book-components/icons/PlayIcon.d.ts +8 -0
  38. package/esm/typings/src/execution/createPipelineExecutor/40-executeAttempts.d.ts +1 -2
  39. package/esm/typings/src/execution/createPipelineExecutor/getKnowledgeForTask.d.ts +1 -3
  40. package/esm/typings/src/formats/csv/CsvFormatError.d.ts +1 -1
  41. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsConfigurationFromEnv.d.ts +1 -1
  42. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForTestingAndScriptsAndPlayground.d.ts +1 -1
  43. package/esm/typings/src/llm-providers/_common/register/$provideLlmToolsForWizardOrCli.d.ts +1 -2
  44. package/esm/typings/src/llm-providers/_common/register/createLlmToolsFromConfiguration.d.ts +8 -2
  45. package/esm/typings/src/llm-providers/_common/utils/removeUnsupportedModelRequirements.d.ts +25 -0
  46. package/esm/typings/src/llm-providers/_multiple/MultipleLlmExecutionTools.d.ts +5 -13
  47. package/esm/typings/src/llm-providers/_multiple/getSingleLlmExecutionTools.d.ts +11 -0
  48. package/esm/typings/src/llm-providers/_multiple/joinLlmExecutionTools.d.ts +2 -1
  49. package/esm/typings/src/llm-providers/agent/AgentLlmExecutionTools.d.ts +54 -0
  50. package/esm/typings/src/llm-providers/agent/createAgentLlmExecutionTools.d.ts +29 -0
  51. package/esm/typings/src/llm-providers/agent/playground/playground.d.ts +8 -0
  52. package/esm/typings/src/llm-providers/agent/register-configuration.d.ts +11 -0
  53. package/esm/typings/src/llm-providers/agent/register-constructor.d.ts +13 -0
  54. package/esm/typings/src/llm-providers/mocked/$fakeTextToExpectations.d.ts +1 -0
  55. package/esm/typings/src/llm-providers/mocked/MockedEchoLlmExecutionTools.d.ts +2 -5
  56. package/esm/typings/src/llm-providers/mocked/MockedFackedLlmExecutionTools.d.ts +2 -6
  57. package/esm/typings/src/llm-providers/openai/OpenAiCompatibleExecutionTools.d.ts +15 -8
  58. package/esm/typings/src/personas/preparePersona.d.ts +1 -0
  59. package/esm/typings/src/remote-server/openapi-types.d.ts +31 -31
  60. package/esm/typings/src/scrapers/markdown/MarkdownScraper.d.ts +1 -2
  61. package/esm/typings/src/types/ModelRequirements.d.ts +2 -4
  62. package/esm/typings/src/utils/color/utils/colorSaturation.d.ts +1 -1
  63. package/esm/typings/src/utils/editable/edit-pipeline-string/addPipelineCommand.d.ts +1 -1
  64. package/esm/typings/src/utils/markdown/humanizeAiText.d.ts +1 -0
  65. package/esm/typings/src/version.d.ts +1 -1
  66. package/package.json +2 -2
  67. package/esm/typings/src/book-2.0/utils/extractAgentMetadata.d.ts +0 -17
  68. package/esm/typings/src/book-2.0/utils/extractProfileImageFromSystemMessage.d.ts +0 -12
  69. package/esm/typings/src/llm-providers/mocked/test/joker.test.d.ts +0 -4
  70. package/esm/typings/src/llm-providers/mocked/test/mocked-chat.test.d.ts +0 -5
  71. package/esm/typings/src/llm-providers/mocked/test/mocked-completion.test.d.ts +0 -4
  72. package/esm/typings/src/scripting/_test/postprocessing.test.d.ts +0 -1
  73. /package/esm/typings/src/{cli/test/ptbk.test.d.ts → llm-providers/_common/utils/removeUnsupportedModelRequirements.test.d.ts} +0 -0
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,18 +7,28 @@ 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';
13
16
  import { Chat } from '../book-components/Chat/Chat/Chat';
14
17
  import type { ChatProps } from '../book-components/Chat/Chat/ChatProps';
18
+ import { useChatAutoScroll } from '../book-components/Chat/hooks/useChatAutoScroll';
19
+ import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
20
+ import { useSendMessageToLlmChat } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
15
21
  import { LlmChat } from '../book-components/Chat/LlmChat/LlmChat';
16
22
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
17
23
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
18
24
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
25
+ import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
26
+ import { parseMessageButtons } from '../book-components/Chat/utils/parseMessageButtons';
19
27
  import { renderMarkdown } from '../book-components/Chat/utils/renderMarkdown';
20
28
  import { isMarkdownContent } from '../book-components/Chat/utils/renderMarkdown';
21
29
  import { ArrowIcon } from '../book-components/icons/ArrowIcon';
30
+ import { PauseIcon } from '../book-components/icons/PauseIcon';
31
+ import { PlayIcon } from '../book-components/icons/PlayIcon';
22
32
  import { ResetIcon } from '../book-components/icons/ResetIcon';
23
33
  import { SendIcon } from '../book-components/icons/SendIcon';
24
34
  import { TemplateIcon } from '../book-components/icons/TemplateIcon';
@@ -31,18 +41,28 @@ export type { AvatarProfileProps };
31
41
  export { AvatarProfile };
32
42
  export type { AvatarProfileFromSourceProps };
33
43
  export { AvatarProfileFromSource };
44
+ export type { MockedChatDelayConfig };
45
+ export type { MockedChatProps };
46
+ export { MockedChat };
34
47
  export type { BookEditorProps };
35
48
  export { BookEditor };
36
49
  export { DEFAULT_BOOK_FONT_CLASS };
37
50
  export { Chat };
38
51
  export type { ChatProps };
52
+ export { useChatAutoScroll };
53
+ export type { SendMessageToLlmChatFunction };
54
+ export { useSendMessageToLlmChat };
39
55
  export { LlmChat };
40
56
  export type { LlmChatProps };
41
57
  export type { ChatMessage };
42
58
  export type { ChatParticipant };
59
+ export type { MessageButton };
60
+ export { parseMessageButtons };
43
61
  export { renderMarkdown };
44
62
  export { isMarkdownContent };
45
63
  export { ArrowIcon };
64
+ export { PauseIcon };
65
+ export { PlayIcon };
46
66
  export { ResetIcon };
47
67
  export { SendIcon };
48
68
  export { TemplateIcon };
@@ -1,6 +1,8 @@
1
1
  import { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION } from '../version';
2
2
  import { createAgentModelRequirements } from '../book-2.0/agent-source/createAgentModelRequirements';
3
+ import { createAgentModelRequirementsWithCommitments } from '../book-2.0/agent-source/createAgentModelRequirementsWithCommitments';
3
4
  import { parseAgentSource } from '../book-2.0/agent-source/parseAgentSource';
5
+ import { parseParameters } from '../book-2.0/agent-source/parseParameters';
4
6
  import { isValidBook } from '../book-2.0/agent-source/string_book';
5
7
  import { validateBook } from '../book-2.0/agent-source/string_book';
6
8
  import { DEFAULT_BOOK } from '../book-2.0/agent-source/string_book';
@@ -118,8 +120,13 @@ import { createLlmToolsFromConfiguration } from '../llm-providers/_common/regist
118
120
  import { cacheLlmTools } from '../llm-providers/_common/utils/cache/cacheLlmTools';
119
121
  import { countUsage } from '../llm-providers/_common/utils/count-total-usage/countUsage';
120
122
  import { limitTotalUsage } from '../llm-providers/_common/utils/count-total-usage/limitTotalUsage';
123
+ import { getSingleLlmExecutionTools } from '../llm-providers/_multiple/getSingleLlmExecutionTools';
121
124
  import { joinLlmExecutionTools } from '../llm-providers/_multiple/joinLlmExecutionTools';
122
125
  import { MultipleLlmExecutionTools } from '../llm-providers/_multiple/MultipleLlmExecutionTools';
126
+ import { AgentLlmExecutionTools } from '../llm-providers/agent/AgentLlmExecutionTools';
127
+ import { createAgentLlmExecutionTools } from '../llm-providers/agent/createAgentLlmExecutionTools';
128
+ import { _AgentMetadata } from '../llm-providers/agent/register-configuration';
129
+ import { _AgentRegistration } from '../llm-providers/agent/register-constructor';
123
130
  import { _AnthropicClaudeMetadataRegistration } from '../llm-providers/anthropic-claude/register-configuration';
124
131
  import { _AzureOpenAiMetadataRegistration } from '../llm-providers/azure-openai/register-configuration';
125
132
  import { _DeepseekMetadataRegistration } from '../llm-providers/deepseek/register-configuration';
@@ -165,7 +172,9 @@ import { TaskTypes } from '../types/TaskType';
165
172
  import { REMOTE_SERVER_URLS } from '../../servers';
166
173
  export { BOOK_LANGUAGE_VERSION, PROMPTBOOK_ENGINE_VERSION };
167
174
  export { createAgentModelRequirements };
175
+ export { createAgentModelRequirementsWithCommitments };
168
176
  export { parseAgentSource };
177
+ export { parseParameters };
169
178
  export { isValidBook };
170
179
  export { validateBook };
171
180
  export { DEFAULT_BOOK };
@@ -283,8 +292,13 @@ export { createLlmToolsFromConfiguration };
283
292
  export { cacheLlmTools };
284
293
  export { countUsage };
285
294
  export { limitTotalUsage };
295
+ export { getSingleLlmExecutionTools };
286
296
  export { joinLlmExecutionTools };
287
297
  export { MultipleLlmExecutionTools };
298
+ export { AgentLlmExecutionTools };
299
+ export { createAgentLlmExecutionTools };
300
+ export { _AgentMetadata };
301
+ export { _AgentRegistration };
288
302
  export { _AnthropicClaudeMetadataRegistration };
289
303
  export { _AzureOpenAiMetadataRegistration };
290
304
  export { _DeepseekMetadataRegistration };
@@ -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,11 +9,16 @@ 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';
16
+ import type { ChatAutoScrollConfig } from '../book-components/Chat/hooks/useChatAutoScroll';
17
+ import type { SendMessageToLlmChatFunction } from '../book-components/Chat/hooks/useSendMessageToLlmChat';
13
18
  import type { LlmChatProps } from '../book-components/Chat/LlmChat/LlmChatProps';
14
19
  import type { ChatMessage } from '../book-components/Chat/types/ChatMessage';
15
20
  import type { ChatParticipant } from '../book-components/Chat/types/ChatParticipant';
21
+ import type { MessageButton } from '../book-components/Chat/utils/parseMessageButtons';
16
22
  import type { PipelineCollection } from '../collection/PipelineCollection';
17
23
  import type { Command } from '../commands/_common/types/Command';
18
24
  import type { CommandParser } from '../commands/_common/types/CommandParser';
@@ -90,6 +96,7 @@ import type { LlmToolsOptions } from '../llm-providers/_common/register/LlmTools
90
96
  import type { CacheItem } from '../llm-providers/_common/utils/cache/CacheItem';
91
97
  import type { CacheLlmToolsOptions } from '../llm-providers/_common/utils/cache/CacheLlmToolsOptions';
92
98
  import type { LlmExecutionToolsWithTotalUsage } from '../llm-providers/_common/utils/count-total-usage/LlmExecutionToolsWithTotalUsage';
99
+ import type { CreateAgentLlmExecutionToolsOptions } from '../llm-providers/agent/createAgentLlmExecutionTools';
93
100
  import type { AnthropicClaudeExecutionToolsOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
94
101
  import type { AnthropicClaudeExecutionToolsNonProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
95
102
  import type { AnthropicClaudeExecutionToolsProxiedOptions } from '../llm-providers/anthropic-claude/AnthropicClaudeExecutionToolsOptions';
@@ -320,6 +327,7 @@ import type { CheckSerializableAsJsonOptions } from '../utils/serialization/chec
320
327
  import type { ExportJsonOptions } from '../utils/serialization/exportJson';
321
328
  import type { ITakeChain } from '../utils/take/interfaces/ITakeChain';
322
329
  import type { string_promptbook_version } from '../version';
330
+ export type { BookParameter };
323
331
  export type { AgentBasicInformation };
324
332
  export type { AgentModelRequirements };
325
333
  export type { string_book };
@@ -330,11 +338,16 @@ export type { AvatarChipProps };
330
338
  export type { AvatarChipFromSourceProps };
331
339
  export type { AvatarProfileProps };
332
340
  export type { AvatarProfileFromSourceProps };
341
+ export type { MockedChatDelayConfig };
342
+ export type { MockedChatProps };
333
343
  export type { BookEditorProps };
334
344
  export type { ChatProps };
345
+ export type { ChatAutoScrollConfig };
346
+ export type { SendMessageToLlmChatFunction };
335
347
  export type { LlmChatProps };
336
348
  export type { ChatMessage };
337
349
  export type { ChatParticipant };
350
+ export type { MessageButton };
338
351
  export type { PipelineCollection };
339
352
  export type { Command };
340
353
  export type { CommandParser };
@@ -412,6 +425,7 @@ export type { LlmToolsOptions };
412
425
  export type { CacheItem };
413
426
  export type { CacheLlmToolsOptions };
414
427
  export type { LlmExecutionToolsWithTotalUsage };
428
+ export type { CreateAgentLlmExecutionToolsOptions };
415
429
  export type { AnthropicClaudeExecutionToolsOptions };
416
430
  export type { AnthropicClaudeExecutionToolsNonProxiedOptions };
417
431
  export type { AnthropicClaudeExecutionToolsProxiedOptions };
@@ -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`
@@ -35,3 +35,6 @@ export type AgentModelRequirements = {
35
35
  */
36
36
  readonly metadata?: Record<string, TODO_any>;
37
37
  };
38
+ /**
39
+ * TODO: [🐤] DRY `AgentModelRequirements` and `ModelRequirements`
40
+ */
@@ -1,36 +1,18 @@
1
+ import type { AvailableModel } from '../../execution/AvailableModel';
2
+ import { LlmExecutionTools } from '../../execution/LlmExecutionTools';
1
3
  import type { string_model_name } from '../../types/typeAliases';
2
4
  import type { AgentModelRequirements } from './AgentModelRequirements';
3
5
  import type { string_book } from './string_book';
4
6
  /**
5
7
  * Creates model requirements for an agent based on its source
6
- * Results are cached to improve performance for repeated calls with the same agentSource and modelName
7
8
  *
8
9
  * There are 2 similar functions:
9
10
  * - `parseAgentSource` which is a lightweight parser for agent source, it parses basic information and its purpose is to be quick and synchronous. The commitments there are hardcoded.
10
- * - `createAgentModelRequirements` which is an asynchronous function that creates model requirements it applies each commitment one by one and works asynchronously.
11
+ * - `createAgentModelRequirements` which is an asynchronous function that creates model requirements it applies each commitment one by one and works asynchronous.
11
12
  *
12
13
  * @public exported from `@promptbook/core`
13
14
  */
14
- export declare function createAgentModelRequirements(agentSource: string_book, modelName?: string_model_name): Promise<AgentModelRequirements>;
15
- /**
16
- * Clears the cache for createAgentModelRequirements
17
- * Useful when agent sources are updated and cached results should be invalidated
18
- *
19
- * @private
20
- */
21
- export declare function clearAgentModelRequirementsCache(): void;
22
- /**
23
- * Removes cache entries for a specific agent source (all model variants)
24
- * @param agentSource The agent source to remove from cache
25
- * @private
26
- */
27
- export declare function invalidateAgentModelRequirementsCache(agentSource: string_book): void;
28
- /**
29
- * Gets the current cache size (for debugging/monitoring)
30
- *
31
- * @private
32
- */
33
- export declare function getAgentModelRequirementsCacheSize(): number;
15
+ export declare function createAgentModelRequirements(agentSource: string_book, modelName?: string_model_name, availableModels?: readonly AvailableModel[], llmTools?: LlmExecutionTools): Promise<AgentModelRequirements>;
34
16
  /**
35
17
  * Extracts MCP servers from agent source
36
18
  *
@@ -6,31 +6,6 @@ import type { string_book } from './string_book';
6
6
  * This function uses a reduce-like pattern where each commitment applies its changes
7
7
  * to build the final requirements starting from a basic empty model
8
8
  *
9
- * @private - TODO: [🧠] Maybe should be public?
9
+ * @public exported from `@promptbook/core`
10
10
  */
11
11
  export declare function createAgentModelRequirementsWithCommitments(agentSource: string_book, modelName?: string_model_name): Promise<AgentModelRequirements>;
12
- /**
13
- * Cached version of createAgentModelRequirementsWithCommitments
14
- * This maintains the same caching behavior as the original function
15
- *
16
- * @private
17
- */
18
- export declare function createAgentModelRequirementsWithCommitmentsCached(agentSource: string_book, modelName?: string_model_name): Promise<AgentModelRequirements>;
19
- /**
20
- * Clears the cache for createAgentModelRequirementsWithCommitments
21
- *
22
- * @private
23
- */
24
- export declare function clearAgentModelRequirementsWithCommitmentsCache(): void;
25
- /**
26
- * Removes cache entries for a specific agent source
27
- *
28
- * @private
29
- */
30
- export declare function invalidateAgentModelRequirementsWithCommitmentsCache(agentSource: string_book): void;
31
- /**
32
- * Gets the current cache size
33
- *
34
- * @private
35
- */
36
- export declare function getAgentModelRequirementsWithCommitmentsCacheSize(): number;