genai-lite 0.4.2 → 0.5.0
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 +399 -22
- package/dist/adapters/image/ElectronDiffusionAdapter.d.ts +10 -0
- package/dist/adapters/image/ElectronDiffusionAdapter.js +11 -0
- package/dist/adapters/image/GenaiElectronImageAdapter.d.ts +69 -0
- package/dist/adapters/image/GenaiElectronImageAdapter.js +273 -0
- package/dist/adapters/image/MockImageAdapter.d.ts +23 -0
- package/dist/adapters/image/MockImageAdapter.js +55 -0
- package/dist/adapters/image/OpenAIImageAdapter.d.ts +62 -0
- package/dist/adapters/image/OpenAIImageAdapter.js +303 -0
- package/dist/config/image-presets.json +194 -0
- package/dist/config/llm-presets.json +326 -0
- package/dist/image/ImageService.d.ts +53 -0
- package/dist/image/ImageService.js +199 -0
- package/dist/image/config.d.ts +48 -0
- package/dist/image/config.js +221 -0
- package/dist/image/services/ImageAdapterRegistry.d.ts +61 -0
- package/dist/image/services/ImageAdapterRegistry.js +95 -0
- package/dist/image/services/ImageModelResolver.d.ts +26 -0
- package/dist/image/services/ImageModelResolver.js +98 -0
- package/dist/image/services/ImagePresetManager.d.ts +27 -0
- package/dist/image/services/ImagePresetManager.js +52 -0
- package/dist/image/services/ImageRequestValidator.d.ts +37 -0
- package/dist/image/services/ImageRequestValidator.js +133 -0
- package/dist/image/services/ImageSettingsResolver.d.ts +25 -0
- package/dist/image/services/ImageSettingsResolver.js +76 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +7 -1
- package/dist/llm/LLMService.d.ts +3 -4
- package/dist/llm/LLMService.js +17 -7
- package/dist/llm/clients/AnthropicClientAdapter.js +2 -2
- package/dist/llm/clients/GeminiClientAdapter.js +2 -2
- package/dist/llm/clients/LlamaCppClientAdapter.d.ts +20 -2
- package/dist/llm/clients/LlamaCppClientAdapter.js +91 -11
- package/dist/llm/clients/LlamaCppServerClient.d.ts +36 -0
- package/dist/llm/clients/LlamaCppServerClient.js +25 -0
- package/dist/llm/clients/OpenAIClientAdapter.js +2 -2
- package/dist/llm/config.d.ts +43 -2
- package/dist/llm/config.js +171 -32
- package/dist/llm/services/ModelResolver.d.ts +8 -4
- package/dist/llm/services/ModelResolver.js +22 -5
- package/dist/providers/fromEnvironment.d.ts +5 -1
- package/dist/providers/fromEnvironment.js +29 -4
- package/dist/shared/adapters/errorUtils.d.ts +26 -0
- package/dist/shared/adapters/errorUtils.js +107 -0
- package/dist/shared/services/AdapterRegistry.d.ts +89 -0
- package/dist/shared/services/AdapterRegistry.js +144 -0
- package/dist/shared/services/PresetManager.d.ts +33 -0
- package/dist/shared/services/PresetManager.js +56 -0
- package/dist/types/image.d.ts +399 -0
- package/dist/types/image.js +8 -0
- package/dist/types.d.ts +6 -0
- package/package.json +1 -1
- package/src/config/presets.json +0 -327
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for image generation API
|
|
3
|
+
*
|
|
4
|
+
* This module contains all types for the ImageService and image generation adapters.
|
|
5
|
+
* Based on the design specification in docs/dev/2025-10-22-genai-lite-image-api-design.md
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Image provider ID type - represents a unique identifier for an image generation provider
|
|
9
|
+
*/
|
|
10
|
+
export type ImageProviderId = string;
|
|
11
|
+
/**
|
|
12
|
+
* MIME types supported for generated images
|
|
13
|
+
*/
|
|
14
|
+
export type ImageMimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
15
|
+
/**
|
|
16
|
+
* Response format options for image data
|
|
17
|
+
*/
|
|
18
|
+
export type ImageResponseFormat = 'b64_json' | 'url' | 'buffer';
|
|
19
|
+
/**
|
|
20
|
+
* Image quality settings
|
|
21
|
+
* - 'auto', 'high', 'medium', 'low': gpt-image-1 models
|
|
22
|
+
* - 'hd', 'standard': dall-e-3
|
|
23
|
+
* - 'standard': dall-e-2
|
|
24
|
+
*/
|
|
25
|
+
export type ImageQuality = 'auto' | 'high' | 'medium' | 'low' | 'hd' | 'standard';
|
|
26
|
+
/**
|
|
27
|
+
* Image style settings (OpenAI-style)
|
|
28
|
+
*/
|
|
29
|
+
export type ImageStyle = 'vivid' | 'natural';
|
|
30
|
+
/**
|
|
31
|
+
* Supported diffusion samplers
|
|
32
|
+
*/
|
|
33
|
+
export type DiffusionSampler = 'euler_a' | 'euler' | 'heun' | 'dpm2' | 'dpm++2s_a' | 'dpm++2m' | 'dpm++2mv2' | 'lcm';
|
|
34
|
+
/**
|
|
35
|
+
* Progress stage during image generation
|
|
36
|
+
*/
|
|
37
|
+
export type ImageProgressStage = 'loading' | 'diffusion' | 'decoding';
|
|
38
|
+
/**
|
|
39
|
+
* Callback function for receiving progress updates during image generation
|
|
40
|
+
*/
|
|
41
|
+
export type ImageProgressCallback = (progress: {
|
|
42
|
+
stage: ImageProgressStage;
|
|
43
|
+
currentStep: number;
|
|
44
|
+
totalSteps: number;
|
|
45
|
+
percentage?: number;
|
|
46
|
+
}) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Diffusion-specific settings for local/stable-diffusion providers
|
|
49
|
+
* Note: Image dimensions (width/height) are in the base settings, not here
|
|
50
|
+
*/
|
|
51
|
+
export interface DiffusionSettings {
|
|
52
|
+
/** Negative prompt to guide what should NOT be in the image */
|
|
53
|
+
negativePrompt?: string;
|
|
54
|
+
/** Number of diffusion steps (default: 20) */
|
|
55
|
+
steps?: number;
|
|
56
|
+
/** CFG scale for prompt adherence (default: 7.5) */
|
|
57
|
+
cfgScale?: number;
|
|
58
|
+
/** Random seed for reproducibility */
|
|
59
|
+
seed?: number;
|
|
60
|
+
/** Sampling algorithm to use */
|
|
61
|
+
sampler?: DiffusionSampler;
|
|
62
|
+
/** Optional callback for receiving progress updates */
|
|
63
|
+
onProgress?: ImageProgressCallback;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* OpenAI-specific settings for gpt-image-1 models
|
|
67
|
+
* These settings are only supported by gpt-image-1 and gpt-image-1-mini models
|
|
68
|
+
*/
|
|
69
|
+
export interface OpenAISpecificSettings {
|
|
70
|
+
/**
|
|
71
|
+
* Image output format (gpt-image-1 models only)
|
|
72
|
+
* Determines the format of the generated image file.
|
|
73
|
+
* For dall-e-2/dall-e-3, use the top-level responseFormat instead.
|
|
74
|
+
*/
|
|
75
|
+
outputFormat?: 'png' | 'jpeg' | 'webp';
|
|
76
|
+
/**
|
|
77
|
+
* Background transparency control (gpt-image-1 models only)
|
|
78
|
+
* - 'transparent': Image will have a transparent background (requires PNG or WebP format)
|
|
79
|
+
* - 'opaque': Image will have an opaque background
|
|
80
|
+
* - 'auto': Model automatically determines the best background (default)
|
|
81
|
+
*/
|
|
82
|
+
background?: 'transparent' | 'opaque' | 'auto';
|
|
83
|
+
/**
|
|
84
|
+
* Content moderation level (gpt-image-1 models only)
|
|
85
|
+
* - 'auto': Standard moderation (default)
|
|
86
|
+
* - 'low': Less restrictive content filtering
|
|
87
|
+
*/
|
|
88
|
+
moderation?: 'low' | 'auto';
|
|
89
|
+
/**
|
|
90
|
+
* Compression level for JPEG and WebP formats (gpt-image-1 models only)
|
|
91
|
+
* Value must be between 0-100, where 100 is highest quality/least compression.
|
|
92
|
+
* Only applies when outputFormat is 'jpeg' or 'webp'.
|
|
93
|
+
*/
|
|
94
|
+
outputCompression?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Settings for image generation requests
|
|
98
|
+
*/
|
|
99
|
+
export interface ImageGenerationSettings {
|
|
100
|
+
/** Image width in pixels */
|
|
101
|
+
width?: number;
|
|
102
|
+
/** Image height in pixels */
|
|
103
|
+
height?: number;
|
|
104
|
+
/** Response format for image data */
|
|
105
|
+
responseFormat?: ImageResponseFormat;
|
|
106
|
+
/** Quality level for generation (OpenAI-style) */
|
|
107
|
+
quality?: ImageQuality;
|
|
108
|
+
/** Style directive for generation (OpenAI-style) */
|
|
109
|
+
style?: ImageStyle;
|
|
110
|
+
/** End-user identifier for tracking/abuse prevention */
|
|
111
|
+
user?: string;
|
|
112
|
+
/** Number of images to generate (alias for count parameter) */
|
|
113
|
+
n?: number;
|
|
114
|
+
/** Diffusion-specific settings (for stable-diffusion providers) */
|
|
115
|
+
diffusion?: DiffusionSettings;
|
|
116
|
+
/** OpenAI-specific settings (for gpt-image-1 models) */
|
|
117
|
+
openai?: OpenAISpecificSettings;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Resolved image generation settings with all defaults applied
|
|
121
|
+
*/
|
|
122
|
+
export interface ResolvedImageGenerationSettings {
|
|
123
|
+
/** Image width in pixels (resolved, required) */
|
|
124
|
+
width: number;
|
|
125
|
+
/** Image height in pixels (resolved, required) */
|
|
126
|
+
height: number;
|
|
127
|
+
/** Response format for image data (resolved) */
|
|
128
|
+
responseFormat: ImageResponseFormat;
|
|
129
|
+
/** Quality level for generation (resolved) */
|
|
130
|
+
quality: ImageQuality;
|
|
131
|
+
/** Style directive for generation (resolved) */
|
|
132
|
+
style: ImageStyle;
|
|
133
|
+
/** End-user identifier for tracking/abuse prevention */
|
|
134
|
+
user?: string;
|
|
135
|
+
/** Number of images to generate */
|
|
136
|
+
n?: number;
|
|
137
|
+
/** Diffusion-specific settings with resolved defaults */
|
|
138
|
+
diffusion?: DiffusionSettings & {
|
|
139
|
+
steps: number;
|
|
140
|
+
cfgScale: number;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Usage metadata from image generation
|
|
145
|
+
*/
|
|
146
|
+
export interface ImageUsage {
|
|
147
|
+
/** Cost in USD or provider-specific units */
|
|
148
|
+
cost?: number;
|
|
149
|
+
/** Input tokens consumed (for providers that bill by tokens) */
|
|
150
|
+
inputTokens?: number;
|
|
151
|
+
/** Output tokens consumed (for providers that bill by tokens) */
|
|
152
|
+
outputTokens?: number;
|
|
153
|
+
/** Credits consumed (for diffusion credit systems) */
|
|
154
|
+
credits?: number;
|
|
155
|
+
/** Generation time in milliseconds */
|
|
156
|
+
timeTaken?: number;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* A single generated image with metadata
|
|
160
|
+
*/
|
|
161
|
+
export interface GeneratedImage {
|
|
162
|
+
/** Index of this image in the batch */
|
|
163
|
+
index: number;
|
|
164
|
+
/** MIME type of the image data */
|
|
165
|
+
mimeType: ImageMimeType;
|
|
166
|
+
/** Binary image data */
|
|
167
|
+
data: Buffer;
|
|
168
|
+
/** Base64-encoded image (if requested via responseFormat) */
|
|
169
|
+
b64Json?: string;
|
|
170
|
+
/** Hosted URL to the image (for providers that host images) */
|
|
171
|
+
url?: string;
|
|
172
|
+
/** Effective prompt used (after any provider transformations) */
|
|
173
|
+
prompt?: string;
|
|
174
|
+
/** Random seed used for generation (when available) */
|
|
175
|
+
seed?: number | string;
|
|
176
|
+
/** Image width in pixels */
|
|
177
|
+
width?: number;
|
|
178
|
+
/** Image height in pixels */
|
|
179
|
+
height?: number;
|
|
180
|
+
/** Provider-specific metadata */
|
|
181
|
+
metadata?: Record<string, unknown>;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Base request structure for image generation
|
|
185
|
+
*/
|
|
186
|
+
export interface ImageGenerationRequestBase {
|
|
187
|
+
/** Provider ID to use for generation */
|
|
188
|
+
providerId: ImageProviderId;
|
|
189
|
+
/** Model ID to use for generation */
|
|
190
|
+
modelId: string;
|
|
191
|
+
/** Text prompt describing the desired image */
|
|
192
|
+
prompt: string;
|
|
193
|
+
/** Optional preset ID to use for default settings */
|
|
194
|
+
presetId?: string;
|
|
195
|
+
/** Optional settings to customize generation */
|
|
196
|
+
settings?: ImageGenerationSettings;
|
|
197
|
+
/** Optional metadata for tracking/logging */
|
|
198
|
+
metadata?: Record<string, unknown>;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Full request structure for image generation including count parameter
|
|
202
|
+
*/
|
|
203
|
+
export interface ImageGenerationRequest extends ImageGenerationRequestBase {
|
|
204
|
+
/** Number of images to generate (default: 1) */
|
|
205
|
+
count?: number;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Extended request structure that supports preset IDs
|
|
209
|
+
*/
|
|
210
|
+
export interface ImageGenerationRequestWithPreset extends Omit<ImageGenerationRequest, 'providerId' | 'modelId'> {
|
|
211
|
+
/** Provider ID (required if not using presetId) */
|
|
212
|
+
providerId?: ImageProviderId;
|
|
213
|
+
/** Model ID (required if not using presetId) */
|
|
214
|
+
modelId?: string;
|
|
215
|
+
/** Preset ID (alternative to providerId/modelId) */
|
|
216
|
+
presetId?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Successful response from image generation
|
|
220
|
+
*/
|
|
221
|
+
export interface ImageGenerationResponse {
|
|
222
|
+
/** Response type discriminator */
|
|
223
|
+
object: 'image.result';
|
|
224
|
+
/** Unix timestamp of when the generation completed */
|
|
225
|
+
created: number;
|
|
226
|
+
/** Provider ID that generated the images */
|
|
227
|
+
providerId: ImageProviderId;
|
|
228
|
+
/** Model ID that generated the images */
|
|
229
|
+
modelId: string;
|
|
230
|
+
/** Array of generated images */
|
|
231
|
+
data: GeneratedImage[];
|
|
232
|
+
/** Optional usage/billing metadata */
|
|
233
|
+
usage?: ImageUsage;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Error response from image generation operations
|
|
237
|
+
*/
|
|
238
|
+
export interface ImageFailureResponse {
|
|
239
|
+
/** Response type discriminator */
|
|
240
|
+
object: 'error';
|
|
241
|
+
/** Provider ID that attempted generation */
|
|
242
|
+
providerId: ImageProviderId;
|
|
243
|
+
/** Model ID that was requested (if available) */
|
|
244
|
+
modelId?: string;
|
|
245
|
+
/** Error details */
|
|
246
|
+
error: {
|
|
247
|
+
/** Error message */
|
|
248
|
+
message: string;
|
|
249
|
+
/** Error code */
|
|
250
|
+
code?: string | number;
|
|
251
|
+
/** Error type (authentication_error, rate_limit_error, etc.) */
|
|
252
|
+
type?: string;
|
|
253
|
+
/** Parameter that caused the error (if applicable) */
|
|
254
|
+
param?: string;
|
|
255
|
+
/** Original provider error (for debugging) */
|
|
256
|
+
providerError?: any;
|
|
257
|
+
};
|
|
258
|
+
/** Partial response if generation started but didn't complete */
|
|
259
|
+
partialResponse?: Omit<ImageGenerationResponse, 'object'>;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Capabilities of an image provider
|
|
263
|
+
*/
|
|
264
|
+
export interface ImageProviderCapabilities {
|
|
265
|
+
/** Whether provider can generate multiple images in one request */
|
|
266
|
+
supportsMultipleImages: boolean;
|
|
267
|
+
/** Whether provider can return base64-encoded images */
|
|
268
|
+
supportsB64Json: boolean;
|
|
269
|
+
/** Whether provider returns hosted URLs for images */
|
|
270
|
+
supportsHostedUrls: boolean;
|
|
271
|
+
/** Whether provider supports progress event callbacks */
|
|
272
|
+
supportsProgressEvents: boolean;
|
|
273
|
+
/** Whether provider supports negative prompts */
|
|
274
|
+
supportsNegativePrompt: boolean;
|
|
275
|
+
/** Default model ID when not specified */
|
|
276
|
+
defaultModelId: string;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Information about a specific image generation model
|
|
280
|
+
*/
|
|
281
|
+
export interface ImageModelInfo {
|
|
282
|
+
/** Unique identifier for the model */
|
|
283
|
+
id: string;
|
|
284
|
+
/** Provider that offers this model */
|
|
285
|
+
providerId: ImageProviderId;
|
|
286
|
+
/** Human-readable display name */
|
|
287
|
+
displayName: string;
|
|
288
|
+
/** Optional description of the model's capabilities */
|
|
289
|
+
description?: string;
|
|
290
|
+
/** Default settings for this model */
|
|
291
|
+
defaultSettings?: ImageGenerationSettings;
|
|
292
|
+
/** Capabilities of this model */
|
|
293
|
+
capabilities: ImageProviderCapabilities;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Information about an image provider
|
|
297
|
+
*/
|
|
298
|
+
export interface ImageProviderInfo {
|
|
299
|
+
/** Unique identifier for the provider */
|
|
300
|
+
id: ImageProviderId;
|
|
301
|
+
/** Human-readable display name */
|
|
302
|
+
displayName: string;
|
|
303
|
+
/** Optional description of the provider */
|
|
304
|
+
description?: string;
|
|
305
|
+
/** Provider capabilities */
|
|
306
|
+
capabilities: ImageProviderCapabilities;
|
|
307
|
+
/** Available models from this provider */
|
|
308
|
+
models?: ImageModelInfo[];
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Preset configuration for image generation
|
|
312
|
+
*/
|
|
313
|
+
export interface ImagePreset {
|
|
314
|
+
/** Unique identifier for the preset */
|
|
315
|
+
id: string;
|
|
316
|
+
/** Human-readable display name */
|
|
317
|
+
displayName: string;
|
|
318
|
+
/** Optional description of the preset's intended use case */
|
|
319
|
+
description?: string;
|
|
320
|
+
/** Provider to use */
|
|
321
|
+
providerId: ImageProviderId;
|
|
322
|
+
/** Model to use */
|
|
323
|
+
modelId: string;
|
|
324
|
+
/** Optional prompt prefix to prepend to all prompts */
|
|
325
|
+
promptPrefix?: string;
|
|
326
|
+
/** Default settings for this preset */
|
|
327
|
+
settings?: ImageGenerationSettings;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Configuration for the image provider adapter
|
|
331
|
+
*/
|
|
332
|
+
export interface ImageProviderAdapterConfig {
|
|
333
|
+
/** Base URL for the provider API */
|
|
334
|
+
baseURL?: string;
|
|
335
|
+
/** Request timeout in milliseconds */
|
|
336
|
+
timeout?: number;
|
|
337
|
+
/** Whether to check health before requests */
|
|
338
|
+
checkHealth?: boolean;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Interface that all image provider adapters must implement
|
|
342
|
+
*/
|
|
343
|
+
export interface ImageProviderAdapter {
|
|
344
|
+
/** Unique identifier for this adapter */
|
|
345
|
+
readonly id: ImageProviderId;
|
|
346
|
+
/** Capabilities supported by this adapter */
|
|
347
|
+
readonly supports: ImageProviderCapabilities;
|
|
348
|
+
/**
|
|
349
|
+
* Generate images using this provider
|
|
350
|
+
*
|
|
351
|
+
* @param config - Generation configuration
|
|
352
|
+
* @returns Promise resolving to successful response or throwing an error
|
|
353
|
+
*/
|
|
354
|
+
generate(config: {
|
|
355
|
+
request: ImageGenerationRequest;
|
|
356
|
+
resolvedPrompt: string;
|
|
357
|
+
settings: ResolvedImageGenerationSettings;
|
|
358
|
+
apiKey: string | null;
|
|
359
|
+
}): Promise<ImageGenerationResponse>;
|
|
360
|
+
/**
|
|
361
|
+
* Optional method to get available models from this provider
|
|
362
|
+
*
|
|
363
|
+
* @returns Promise resolving to array of available models
|
|
364
|
+
*/
|
|
365
|
+
getModels?(): Promise<ImageModelInfo[]>;
|
|
366
|
+
/**
|
|
367
|
+
* Optional method to validate API key format before making requests
|
|
368
|
+
*
|
|
369
|
+
* @param apiKey - The API key to validate
|
|
370
|
+
* @returns True if the key format appears valid for this provider
|
|
371
|
+
*/
|
|
372
|
+
validateApiKey?(apiKey: string): boolean;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Mode for handling presets when initializing ImageService
|
|
376
|
+
*/
|
|
377
|
+
export type PresetMode = 'extend' | 'replace';
|
|
378
|
+
/**
|
|
379
|
+
* Options for initializing ImageService
|
|
380
|
+
*/
|
|
381
|
+
export interface ImageServiceOptions {
|
|
382
|
+
/** Custom presets to use */
|
|
383
|
+
presets?: ImagePreset[];
|
|
384
|
+
/** How to handle custom presets (extend defaults or replace them) */
|
|
385
|
+
presetMode?: PresetMode;
|
|
386
|
+
/** Custom provider adapters to register */
|
|
387
|
+
adapters?: Record<ImageProviderId, ImageProviderAdapter>;
|
|
388
|
+
/** Override default base URLs per provider */
|
|
389
|
+
baseUrls?: Record<ImageProviderId, string>;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Result from createPrompt utility
|
|
393
|
+
*/
|
|
394
|
+
export interface CreatePromptResult {
|
|
395
|
+
/** Rendered prompt text */
|
|
396
|
+
prompt: string;
|
|
397
|
+
/** Resolved settings from preset and template */
|
|
398
|
+
settings?: ImageGenerationSettings;
|
|
399
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Type definitions for image generation API
|
|
4
|
+
*
|
|
5
|
+
* This module contains all types for the ImageService and image generation adapters.
|
|
6
|
+
* Based on the design specification in docs/dev/2025-10-22-genai-lite-image-api-design.md
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/types.d.ts
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
1
|
export type ApiKeyProvider = (providerId: string) => Promise<string | null>;
|
|
2
|
+
/**
|
|
3
|
+
* Defines how custom presets interact with the default presets.
|
|
4
|
+
* 'replace': Use only the custom presets provided. The default set is ignored.
|
|
5
|
+
* 'extend': Use the default presets, and add/override them with the custom presets. This is the default behavior.
|
|
6
|
+
*/
|
|
7
|
+
export type PresetMode = 'replace' | 'extend';
|