@promptbook/types 0.101.0-2 → 0.101.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ npm i ptbk
|
|
|
47
47
|
npm i -D @promptbook/types
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
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
|
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
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
|
-
-
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
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
|
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
-
|
|
110
|
-
-
|
|
111
|
-
-
|
|
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
|
-
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
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
|
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
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
|
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
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
|
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
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
|
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
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
|
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
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
|
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
-
|
|
192
|
-
-
|
|
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
|
-
|
|
196
|
-
-
|
|
197
|
-
-
|
|
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
|
-
|
|
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
|
---
|
|
@@ -119,4 +119,24 @@ export type ChatProps = {
|
|
|
119
119
|
* Keys should match ChatMessage.from values (e.g., 'USER', 'AGENT_{id}', etc.)
|
|
120
120
|
*/
|
|
121
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>;
|
|
122
142
|
};
|
|
@@ -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-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.101.0-2`).
|
|
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-
|
|
3
|
+
"version": "0.101.0-3",
|
|
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-
|
|
95
|
+
"@promptbook/core": "0.101.0-3"
|
|
96
96
|
}
|
|
97
97
|
}
|