@quilltap/plugin-types 1.0.1 → 1.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/CHANGELOG.md +24 -2
- package/dist/index-BJ_sGB3K.d.mts +496 -0
- package/dist/index-yK-qJDls.d.ts +496 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugins/index.d.mts +3 -442
- package/dist/plugins/index.d.ts +3 -442
- package/package.json +1 -1
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,442 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Provider Plugin Interface types for Quilltap plugin development
|
|
6
|
-
*
|
|
7
|
-
* @module @quilltap/plugin-types/plugins/provider
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Provider metadata for UI display and identification
|
|
12
|
-
*/
|
|
13
|
-
interface ProviderMetadata {
|
|
14
|
-
/** Internal identifier for the provider (e.g., 'OPENAI', 'ANTHROPIC') */
|
|
15
|
-
providerName: string;
|
|
16
|
-
/** Human-readable display name for UI (e.g., 'OpenAI', 'Anthropic') */
|
|
17
|
-
displayName: string;
|
|
18
|
-
/** Short description of the provider */
|
|
19
|
-
description: string;
|
|
20
|
-
/** Short abbreviation for icon display (e.g., 'OAI', 'ANT') */
|
|
21
|
-
abbreviation: string;
|
|
22
|
-
/** Tailwind CSS color classes for UI styling */
|
|
23
|
-
colors: {
|
|
24
|
-
/** Background color class (e.g., 'bg-green-100') */
|
|
25
|
-
bg: string;
|
|
26
|
-
/** Text color class (e.g., 'text-green-800') */
|
|
27
|
-
text: string;
|
|
28
|
-
/** Icon color class (e.g., 'text-green-600') */
|
|
29
|
-
icon: string;
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Configuration requirements for the provider
|
|
34
|
-
*/
|
|
35
|
-
interface ProviderConfigRequirements {
|
|
36
|
-
/** Whether this provider requires an API key */
|
|
37
|
-
requiresApiKey: boolean;
|
|
38
|
-
/** Whether this provider requires a custom base URL */
|
|
39
|
-
requiresBaseUrl: boolean;
|
|
40
|
-
/** Label text for API key input field */
|
|
41
|
-
apiKeyLabel?: string;
|
|
42
|
-
/** Label text for base URL input field */
|
|
43
|
-
baseUrlLabel?: string;
|
|
44
|
-
/** Placeholder text for base URL input */
|
|
45
|
-
baseUrlPlaceholder?: string;
|
|
46
|
-
/** Default value for base URL */
|
|
47
|
-
baseUrlDefault?: string;
|
|
48
|
-
/** Deprecated: use baseUrlDefault instead */
|
|
49
|
-
defaultBaseUrl?: string;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Provider capability flags
|
|
53
|
-
*/
|
|
54
|
-
interface ProviderCapabilities {
|
|
55
|
-
/** Whether the provider supports chat completions */
|
|
56
|
-
chat: boolean;
|
|
57
|
-
/** Whether the provider supports image generation */
|
|
58
|
-
imageGeneration: boolean;
|
|
59
|
-
/** Whether the provider supports text embeddings */
|
|
60
|
-
embeddings: boolean;
|
|
61
|
-
/** Whether the provider supports web search functionality */
|
|
62
|
-
webSearch: boolean;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Attachment/file support configuration
|
|
66
|
-
*/
|
|
67
|
-
interface AttachmentSupport {
|
|
68
|
-
/** Whether this provider supports file attachments */
|
|
69
|
-
supportsAttachments: boolean;
|
|
70
|
-
/** Array of MIME types supported for attachments */
|
|
71
|
-
supportedMimeTypes: string[];
|
|
72
|
-
/** Human-readable description of attachment support */
|
|
73
|
-
description: string;
|
|
74
|
-
/** Additional notes about attachment support or limitations */
|
|
75
|
-
notes?: string;
|
|
76
|
-
/** Maximum file size in bytes */
|
|
77
|
-
maxFileSize?: number;
|
|
78
|
-
/** Maximum number of files per request */
|
|
79
|
-
maxFiles?: number;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Information about a specific model
|
|
83
|
-
*/
|
|
84
|
-
interface ModelInfo {
|
|
85
|
-
/** Unique identifier for the model */
|
|
86
|
-
id: string;
|
|
87
|
-
/** Human-readable name of the model */
|
|
88
|
-
name: string;
|
|
89
|
-
/** Context window size (tokens) */
|
|
90
|
-
contextWindow?: number;
|
|
91
|
-
/** Maximum output tokens for this model */
|
|
92
|
-
maxOutputTokens?: number;
|
|
93
|
-
/** Whether this model supports image attachments */
|
|
94
|
-
supportsImages?: boolean;
|
|
95
|
-
/** Whether this model supports tool/function calling */
|
|
96
|
-
supportsTools?: boolean;
|
|
97
|
-
/** Description of the model */
|
|
98
|
-
description?: string;
|
|
99
|
-
/** Pricing information */
|
|
100
|
-
pricing?: {
|
|
101
|
-
/** Price per 1M input tokens */
|
|
102
|
-
input: number;
|
|
103
|
-
/** Price per 1M output tokens */
|
|
104
|
-
output: number;
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Information about an embedding model
|
|
109
|
-
*/
|
|
110
|
-
interface EmbeddingModelInfo {
|
|
111
|
-
/** Unique identifier for the embedding model */
|
|
112
|
-
id: string;
|
|
113
|
-
/** Human-readable name of the model */
|
|
114
|
-
name: string;
|
|
115
|
-
/** Dimensions of the embedding vector output */
|
|
116
|
-
dimensions?: number;
|
|
117
|
-
/** Description of the model's characteristics */
|
|
118
|
-
description?: string;
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* Information about an image generation model
|
|
122
|
-
*/
|
|
123
|
-
interface ImageGenerationModelInfo {
|
|
124
|
-
/** Unique identifier for the model */
|
|
125
|
-
id: string;
|
|
126
|
-
/** Human-readable name of the model */
|
|
127
|
-
name: string;
|
|
128
|
-
/** Supported aspect ratios (e.g., ['1:1', '16:9']) */
|
|
129
|
-
supportedAspectRatios?: string[];
|
|
130
|
-
/** Supported image sizes (e.g., ['1024x1024', '512x512']) */
|
|
131
|
-
supportedSizes?: string[];
|
|
132
|
-
/** Description of the model */
|
|
133
|
-
description?: string;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Constraints for image generation
|
|
137
|
-
*/
|
|
138
|
-
interface ImageProviderConstraints {
|
|
139
|
-
/** Maximum bytes allowed for image generation prompt */
|
|
140
|
-
maxPromptBytes?: number;
|
|
141
|
-
/** Warning message about prompt constraints */
|
|
142
|
-
promptConstraintWarning?: string;
|
|
143
|
-
/** Maximum images per request */
|
|
144
|
-
maxImagesPerRequest?: number;
|
|
145
|
-
/** Supported aspect ratios */
|
|
146
|
-
supportedAspectRatios?: string[];
|
|
147
|
-
/** Supported image sizes */
|
|
148
|
-
supportedSizes?: string[];
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Icon component props
|
|
152
|
-
*/
|
|
153
|
-
interface IconProps {
|
|
154
|
-
/** CSS class for styling */
|
|
155
|
-
className?: string;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Main LLM Provider Plugin Interface
|
|
159
|
-
*
|
|
160
|
-
* Plugins implementing this interface can be dynamically loaded
|
|
161
|
-
* by Quilltap to provide LLM functionality from various providers.
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* ```typescript
|
|
165
|
-
* import type { LLMProviderPlugin } from '@quilltap/plugin-types';
|
|
166
|
-
*
|
|
167
|
-
* export const plugin: LLMProviderPlugin = {
|
|
168
|
-
* metadata: {
|
|
169
|
-
* providerName: 'MY_PROVIDER',
|
|
170
|
-
* displayName: 'My Provider',
|
|
171
|
-
* description: 'Custom LLM provider',
|
|
172
|
-
* abbreviation: 'MYP',
|
|
173
|
-
* colors: { bg: 'bg-blue-100', text: 'text-blue-800', icon: 'text-blue-600' },
|
|
174
|
-
* },
|
|
175
|
-
* config: {
|
|
176
|
-
* requiresApiKey: true,
|
|
177
|
-
* requiresBaseUrl: false,
|
|
178
|
-
* apiKeyLabel: 'API Key',
|
|
179
|
-
* },
|
|
180
|
-
* capabilities: {
|
|
181
|
-
* chat: true,
|
|
182
|
-
* imageGeneration: false,
|
|
183
|
-
* embeddings: false,
|
|
184
|
-
* webSearch: false,
|
|
185
|
-
* },
|
|
186
|
-
* attachmentSupport: {
|
|
187
|
-
* supportsAttachments: false,
|
|
188
|
-
* supportedMimeTypes: [],
|
|
189
|
-
* description: 'No file attachments supported',
|
|
190
|
-
* },
|
|
191
|
-
* createProvider: () => new MyProvider(),
|
|
192
|
-
* getAvailableModels: async (apiKey) => [...],
|
|
193
|
-
* validateApiKey: async (apiKey) => {...},
|
|
194
|
-
* renderIcon: ({ className }) => <MyIcon className={className} />,
|
|
195
|
-
* };
|
|
196
|
-
* ```
|
|
197
|
-
*/
|
|
198
|
-
interface LLMProviderPlugin {
|
|
199
|
-
/** Provider metadata for UI display and identification */
|
|
200
|
-
metadata: ProviderMetadata;
|
|
201
|
-
/** Configuration requirements for this provider */
|
|
202
|
-
config: ProviderConfigRequirements;
|
|
203
|
-
/** Supported capabilities for this provider */
|
|
204
|
-
capabilities: ProviderCapabilities;
|
|
205
|
-
/** File attachment support information */
|
|
206
|
-
attachmentSupport: AttachmentSupport;
|
|
207
|
-
/**
|
|
208
|
-
* Factory method to create an LLMProvider instance
|
|
209
|
-
* @param baseUrl Optional base URL for the provider
|
|
210
|
-
*/
|
|
211
|
-
createProvider: (baseUrl?: string) => LLMProvider;
|
|
212
|
-
/**
|
|
213
|
-
* Factory method to create an ImageGenProvider instance (optional)
|
|
214
|
-
* Only required if capabilities.imageGeneration is true
|
|
215
|
-
* @param baseUrl Optional base URL for the provider
|
|
216
|
-
*/
|
|
217
|
-
createImageProvider?: (baseUrl?: string) => ImageGenProvider;
|
|
218
|
-
/**
|
|
219
|
-
* Factory method to create an embedding provider (optional)
|
|
220
|
-
* Only required if capabilities.embeddings is true
|
|
221
|
-
* @param baseUrl Optional base URL for the provider
|
|
222
|
-
*/
|
|
223
|
-
createEmbeddingProvider?: (baseUrl?: string) => unknown;
|
|
224
|
-
/**
|
|
225
|
-
* Get list of available models for this provider
|
|
226
|
-
* @param apiKey API key for authentication
|
|
227
|
-
* @param baseUrl Optional base URL
|
|
228
|
-
*/
|
|
229
|
-
getAvailableModels: (apiKey: string, baseUrl?: string) => Promise<string[]>;
|
|
230
|
-
/**
|
|
231
|
-
* Get static model information without API calls
|
|
232
|
-
*/
|
|
233
|
-
getModelInfo?: () => ModelInfo[];
|
|
234
|
-
/**
|
|
235
|
-
* Get embedding models supported by this provider
|
|
236
|
-
*/
|
|
237
|
-
getEmbeddingModels?: () => EmbeddingModelInfo[];
|
|
238
|
-
/**
|
|
239
|
-
* Get image generation models supported by this provider
|
|
240
|
-
*/
|
|
241
|
-
getImageGenerationModels?: () => ImageGenerationModelInfo[];
|
|
242
|
-
/**
|
|
243
|
-
* Validate an API key for this provider
|
|
244
|
-
* @param apiKey API key to validate
|
|
245
|
-
* @param baseUrl Optional base URL
|
|
246
|
-
*/
|
|
247
|
-
validateApiKey: (apiKey: string, baseUrl?: string) => Promise<boolean>;
|
|
248
|
-
/**
|
|
249
|
-
* Render the provider icon as a React component
|
|
250
|
-
* @param props Icon component props
|
|
251
|
-
*/
|
|
252
|
-
renderIcon: (props: IconProps) => ReactNode;
|
|
253
|
-
/**
|
|
254
|
-
* Convert universal tool format to provider-specific format (optional)
|
|
255
|
-
* @param tool Tools in OpenAI format or generic objects
|
|
256
|
-
* @param options Formatting options
|
|
257
|
-
*/
|
|
258
|
-
formatTools?: (tool: any, options?: ToolFormatOptions) => any;
|
|
259
|
-
/**
|
|
260
|
-
* Parse provider-specific tool calls from response (optional)
|
|
261
|
-
* @param response Raw API response
|
|
262
|
-
*/
|
|
263
|
-
parseToolCalls?: (response: any) => ToolCallRequest[];
|
|
264
|
-
/**
|
|
265
|
-
* Get image provider constraints (optional)
|
|
266
|
-
* Only applicable for providers with imageGeneration capability
|
|
267
|
-
*/
|
|
268
|
-
getImageProviderConstraints?: () => ImageProviderConstraints;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Standard export type for provider plugins
|
|
272
|
-
*/
|
|
273
|
-
interface ProviderPluginExport {
|
|
274
|
-
/** The provider plugin instance */
|
|
275
|
-
plugin: LLMProviderPlugin;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Plugin Manifest types for Quilltap plugin development
|
|
280
|
-
*
|
|
281
|
-
* @module @quilltap/plugin-types/plugins/manifest
|
|
282
|
-
*/
|
|
283
|
-
/**
|
|
284
|
-
* Plugin capability types
|
|
285
|
-
*/
|
|
286
|
-
type PluginCapability = 'LLM_PROVIDER' | 'AUTH_PROVIDER' | 'STORAGE_BACKEND' | 'THEME' | 'UTILITY';
|
|
287
|
-
/**
|
|
288
|
-
* Plugin category
|
|
289
|
-
*/
|
|
290
|
-
type PluginCategory = 'PROVIDER' | 'AUTH' | 'STORAGE' | 'UI' | 'UTILITY';
|
|
291
|
-
/**
|
|
292
|
-
* Plugin status
|
|
293
|
-
*/
|
|
294
|
-
type PluginStatus = 'STABLE' | 'BETA' | 'EXPERIMENTAL' | 'DEPRECATED';
|
|
295
|
-
/**
|
|
296
|
-
* Author information
|
|
297
|
-
*/
|
|
298
|
-
interface PluginAuthor {
|
|
299
|
-
/** Author name */
|
|
300
|
-
name: string;
|
|
301
|
-
/** Author email */
|
|
302
|
-
email?: string;
|
|
303
|
-
/** Author website or profile URL */
|
|
304
|
-
url?: string;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Compatibility requirements
|
|
308
|
-
*/
|
|
309
|
-
interface PluginCompatibility {
|
|
310
|
-
/** Minimum Quilltap version (semver range) */
|
|
311
|
-
quilltapVersion: string;
|
|
312
|
-
/** Minimum Node.js version (semver range) */
|
|
313
|
-
nodeVersion?: string;
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Provider-specific configuration (for LLM_PROVIDER plugins)
|
|
317
|
-
*/
|
|
318
|
-
interface ProviderConfig {
|
|
319
|
-
/** Internal provider name */
|
|
320
|
-
providerName: string;
|
|
321
|
-
/** Human-readable display name */
|
|
322
|
-
displayName: string;
|
|
323
|
-
/** Provider description */
|
|
324
|
-
description: string;
|
|
325
|
-
/** Short abbreviation */
|
|
326
|
-
abbreviation: string;
|
|
327
|
-
/** UI color configuration */
|
|
328
|
-
colors: {
|
|
329
|
-
bg: string;
|
|
330
|
-
text: string;
|
|
331
|
-
icon: string;
|
|
332
|
-
};
|
|
333
|
-
/** Whether the provider requires an API key */
|
|
334
|
-
requiresApiKey: boolean;
|
|
335
|
-
/** Whether the provider requires a base URL */
|
|
336
|
-
requiresBaseUrl: boolean;
|
|
337
|
-
/** Label for API key input */
|
|
338
|
-
apiKeyLabel?: string;
|
|
339
|
-
/** Provider capabilities */
|
|
340
|
-
capabilities: {
|
|
341
|
-
chat: boolean;
|
|
342
|
-
imageGeneration: boolean;
|
|
343
|
-
embeddings: boolean;
|
|
344
|
-
webSearch: boolean;
|
|
345
|
-
};
|
|
346
|
-
/** Attachment support configuration */
|
|
347
|
-
attachmentSupport: {
|
|
348
|
-
supported: boolean;
|
|
349
|
-
mimeTypes: string[];
|
|
350
|
-
description: string;
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Required permissions for the plugin
|
|
355
|
-
*/
|
|
356
|
-
interface PluginPermissions {
|
|
357
|
-
/** Network domains the plugin may access */
|
|
358
|
-
network?: string[];
|
|
359
|
-
/** Whether the plugin accesses user data */
|
|
360
|
-
userData?: boolean;
|
|
361
|
-
/** Whether the plugin accesses the database */
|
|
362
|
-
database?: boolean;
|
|
363
|
-
/** Whether the plugin accesses the file system */
|
|
364
|
-
fileSystem?: boolean;
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Plugin manifest schema
|
|
368
|
-
*
|
|
369
|
-
* This is the structure of the quilltap-manifest.json file
|
|
370
|
-
* that every Quilltap plugin must include.
|
|
371
|
-
*/
|
|
372
|
-
interface PluginManifest {
|
|
373
|
-
/** JSON schema reference */
|
|
374
|
-
$schema?: string;
|
|
375
|
-
/** Package name (must start with qtap-plugin-) */
|
|
376
|
-
name: string;
|
|
377
|
-
/** Human-readable title */
|
|
378
|
-
title: string;
|
|
379
|
-
/** Plugin description */
|
|
380
|
-
description: string;
|
|
381
|
-
/** Semantic version */
|
|
382
|
-
version: string;
|
|
383
|
-
/** Author information */
|
|
384
|
-
author: PluginAuthor;
|
|
385
|
-
/** License identifier (SPDX) */
|
|
386
|
-
license: string;
|
|
387
|
-
/** Compatibility requirements */
|
|
388
|
-
compatibility: PluginCompatibility;
|
|
389
|
-
/** Plugin capabilities */
|
|
390
|
-
capabilities: PluginCapability[];
|
|
391
|
-
/** Plugin category */
|
|
392
|
-
category: PluginCategory;
|
|
393
|
-
/** Main entry point (relative path) */
|
|
394
|
-
main: string;
|
|
395
|
-
/** Whether TypeScript source is available */
|
|
396
|
-
typescript?: boolean;
|
|
397
|
-
/** Frontend framework used */
|
|
398
|
-
frontend?: 'REACT' | 'NONE';
|
|
399
|
-
/** Styling approach used */
|
|
400
|
-
styling?: 'TAILWIND' | 'CSS' | 'NONE';
|
|
401
|
-
/** Whether to enable by default when installed */
|
|
402
|
-
enabledByDefault?: boolean;
|
|
403
|
-
/** Plugin status */
|
|
404
|
-
status: PluginStatus;
|
|
405
|
-
/** Search keywords */
|
|
406
|
-
keywords?: string[];
|
|
407
|
-
/** Provider-specific configuration (for LLM_PROVIDER plugins) */
|
|
408
|
-
providerConfig?: ProviderConfig;
|
|
409
|
-
/** Required permissions */
|
|
410
|
-
permissions?: PluginPermissions;
|
|
411
|
-
/** Repository URL */
|
|
412
|
-
repository?: string | {
|
|
413
|
-
type: string;
|
|
414
|
-
url: string;
|
|
415
|
-
directory?: string;
|
|
416
|
-
};
|
|
417
|
-
/** Homepage URL */
|
|
418
|
-
homepage?: string;
|
|
419
|
-
/** Bug tracker URL */
|
|
420
|
-
bugs?: string | {
|
|
421
|
-
url: string;
|
|
422
|
-
email?: string;
|
|
423
|
-
};
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Installed plugin metadata
|
|
427
|
-
* Extended manifest with installation-specific information
|
|
428
|
-
*/
|
|
429
|
-
interface InstalledPluginInfo extends PluginManifest {
|
|
430
|
-
/** Whether the plugin is currently enabled */
|
|
431
|
-
enabled: boolean;
|
|
432
|
-
/** Installation timestamp */
|
|
433
|
-
installedAt?: string;
|
|
434
|
-
/** Last update timestamp */
|
|
435
|
-
updatedAt?: string;
|
|
436
|
-
/** Installation scope */
|
|
437
|
-
scope?: 'site' | 'user';
|
|
438
|
-
/** Path to installed plugin */
|
|
439
|
-
installPath?: string;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
export type { AttachmentSupport, EmbeddingModelInfo, IconProps, ImageGenerationModelInfo, ImageProviderConstraints, InstalledPluginInfo, LLMProviderPlugin, ModelInfo, PluginAuthor, PluginCapability, PluginCategory, PluginCompatibility, PluginManifest, PluginPermissions, PluginStatus, ProviderCapabilities, ProviderConfig, ProviderConfigRequirements, ProviderMetadata, ProviderPluginExport };
|
|
1
|
+
export { A as AttachmentSupport, E as EmbeddingModelInfo, d as IconProps, I as ImageGenerationModelInfo, c as ImageProviderConstraints, o as InstalledPluginInfo, L as LLMProviderPlugin, M as ModelInfo, j as PluginAuthor, g as PluginCapability, h as PluginCategory, k as PluginCompatibility, n as PluginManifest, m as PluginPermissions, i as PluginStatus, b as ProviderCapabilities, l as ProviderConfig, a as ProviderConfigRequirements, P as ProviderMetadata, e as ProviderPluginExport } from '../index-yK-qJDls.js';
|
|
2
|
+
import 'react';
|
|
3
|
+
import '../llm/index.js';
|