@quilltap/plugin-types 1.15.0 → 1.16.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/dist/index.d.mts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { UniversalTool } from './llm/index.mjs';
2
2
  export { AnthropicToolDefinition, AttachmentResults, CacheUsage, EmbeddingOptions, EmbeddingProvider, EmbeddingResult, FileAttachment, GeneratedImage, GoogleToolDefinition, ImageGenParams, ImageGenProvider, ImageGenResponse, JSONSchemaDefinition, LLMMessage, LLMParams, LLMProvider, LLMResponse, LocalEmbeddingProvider, LocalEmbeddingProviderState, ModelMetadata, ModelWarning, ModelWarningLevel, OpenAIToolDefinition, ResponseFormat, StreamChunk, TokenUsage, ToolCall, ToolCallRequest, ToolFormatOptions, ToolResult, isLocalEmbeddingProvider } from './llm/index.mjs';
3
- export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, f as ImageStyleInfo, g as InstalledPluginInfo, L as LLMProviderPlugin, M as MessageFormatSupport, h as ModelInfo, P as PluginAuthor, i as PluginCapability, j as PluginCategory, k as PluginCompatibility, l as PluginIconData, m as PluginManifest, n as PluginPermissions, o as PluginStatus, p as ProviderCapabilities, q as ProviderConfig, r as ProviderConfigRequirements, s as ProviderMetadata, t as ProviderPluginExport, R as RoleplayTemplateConfig, u as RoleplayTemplateMetadata, v as RoleplayTemplatePlugin, w as RoleplayTemplatePluginExport, S as SearchOutput, x as SearchProviderConfig, y as SearchProviderConfigRequirements, z as SearchProviderMetadata, B as SearchProviderPlugin, D as SearchProviderPluginExport, G as SearchResult, H as Spacing, J as SubsystemOverrides, T as ThemeMetadata, K as ThemePlugin, N as ThemePluginExport, O as ThemeTokens, Q as ToolFormatType, U as Typography } from './index-BmwJBg_D.mjs';
4
- import { Readable } from 'stream';
3
+ export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, f as ImageStyleInfo, g as InstalledPluginInfo, L as LLMProviderPlugin, M as MessageFormatSupport, h as ModelInfo, i as ModerationCategoryResult, j as ModerationProviderConfigRequirements, k as ModerationProviderMetadata, l as ModerationProviderPlugin, m as ModerationProviderPluginExport, n as ModerationResult, P as PluginAuthor, o as PluginCapability, p as PluginCategory, q as PluginCompatibility, r as PluginIconData, s as PluginManifest, t as PluginPermissions, u as PluginStatus, v as ProviderCapabilities, w as ProviderConfig, x as ProviderConfigRequirements, y as ProviderMetadata, z as ProviderPluginExport, R as RoleplayTemplateConfig, B as RoleplayTemplateMetadata, D as RoleplayTemplatePlugin, G as RoleplayTemplatePluginExport, S as SearchOutput, H as SearchProviderConfig, J as SearchProviderConfigRequirements, K as SearchProviderMetadata, N as SearchProviderPlugin, O as SearchProviderPluginExport, Q as SearchResult, T as Spacing, U as SubsystemOverrides, V as ThemeMetadata, W as ThemePlugin, X as ThemePluginExport, Y as ThemeTokens, Z as ToolFormatType, _ as Typography } from './index-BGXq7dpd.mjs';
5
4
  export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.mjs';
6
5
 
7
6
  /**
@@ -255,315 +254,6 @@ interface ToolPluginExport {
255
254
  plugin: ToolPlugin;
256
255
  }
257
256
 
258
- /**
259
- * File Storage Plugin types for Quilltap plugin development
260
- *
261
- * Defines the interfaces and types needed to create custom file storage
262
- * backend providers as Quilltap plugins.
263
- *
264
- * @module @quilltap/plugin-types/plugins/file-storage
265
- */
266
-
267
- /**
268
- * Describes what features a storage backend supports
269
- */
270
- interface FileBackendCapabilities {
271
- /** Whether the backend supports presigned URLs for direct access */
272
- presignedUrls: boolean;
273
- /** Whether the backend supports public URLs (no authentication required) */
274
- publicUrls: boolean;
275
- /** Whether the backend supports streaming uploads */
276
- streamingUpload: boolean;
277
- /** Whether the backend supports streaming downloads */
278
- streamingDownload: boolean;
279
- /** Whether the backend supports copying files between locations */
280
- copy: boolean;
281
- /** Whether the backend supports listing files in a prefix/directory */
282
- list: boolean;
283
- /** Whether the backend supports retrieving file metadata */
284
- metadata: boolean;
285
- }
286
- /**
287
- * Metadata about a file storage backend
288
- */
289
- interface FileBackendMetadata {
290
- /** Unique identifier for this provider */
291
- providerId: string;
292
- /** Human-readable display name for UI */
293
- displayName: string;
294
- /** Description of the storage backend */
295
- description: string;
296
- /** Capabilities supported by this backend */
297
- capabilities: FileBackendCapabilities;
298
- }
299
- /**
300
- * Metadata about a stored file
301
- */
302
- interface FileMetadata {
303
- /** Size in bytes */
304
- size: number;
305
- /** MIME type */
306
- contentType: string;
307
- /** Last modified timestamp */
308
- lastModified: Date;
309
- }
310
- /**
311
- * Interface for a file storage backend implementation
312
- *
313
- * Plugins implementing this interface can provide custom storage backends
314
- * such as S3, Google Cloud Storage, Azure Blob Storage, etc.
315
- */
316
- interface FileStorageBackend {
317
- /**
318
- * Get metadata about this storage backend
319
- *
320
- * @returns Backend metadata including capabilities
321
- */
322
- getMetadata(): FileBackendMetadata;
323
- /**
324
- * Test the connection to the storage backend
325
- *
326
- * Verifies that the backend is properly configured and accessible.
327
- * This is called during plugin initialization and setup verification.
328
- *
329
- * @returns Promise resolving to connection test result
330
- */
331
- testConnection(): Promise<{
332
- success: boolean;
333
- message: string;
334
- latencyMs?: number;
335
- }>;
336
- /**
337
- * Upload a file to storage
338
- *
339
- * @param key The storage key/path for the file
340
- * @param body The file content as Buffer or Readable stream
341
- * @param contentType MIME type of the file
342
- * @param metadata Optional custom metadata to store with the file
343
- */
344
- upload(key: string, body: Buffer | Readable, contentType: string, metadata?: Record<string, string>): Promise<void>;
345
- /**
346
- * Download a file from storage
347
- *
348
- * @param key The storage key/path of the file
349
- * @returns Promise resolving to the file content as Buffer
350
- */
351
- download(key: string): Promise<Buffer>;
352
- /**
353
- * Delete a file from storage
354
- *
355
- * @param key The storage key/path of the file
356
- */
357
- delete(key: string): Promise<void>;
358
- /**
359
- * Check if a file exists in storage
360
- *
361
- * @param key The storage key/path to check
362
- * @returns Promise resolving to true if file exists, false otherwise
363
- */
364
- exists(key: string): Promise<boolean>;
365
- /**
366
- * Get a URL that can be used to access the file through the application proxy
367
- *
368
- * This is the primary URL used by Quilltap to serve files to users.
369
- * It should point back to the Quilltap application, not directly to the
370
- * storage provider.
371
- *
372
- * @param key The storage key/path of the file
373
- * @returns The proxy URL for accessing the file
374
- */
375
- getProxyUrl(key: string): string;
376
- /**
377
- * Copy a file from one location to another
378
- *
379
- * Only required if capabilities.copy is true
380
- *
381
- * @param sourceKey The source storage key/path
382
- * @param destinationKey The destination storage key/path
383
- */
384
- copy?(sourceKey: string, destinationKey: string): Promise<void>;
385
- /**
386
- * Get metadata about a stored file
387
- *
388
- * Only required if capabilities.metadata is true
389
- *
390
- * @param key The storage key/path of the file
391
- * @returns Promise resolving to file metadata or null if file doesn't exist
392
- */
393
- getFileMetadata?(key: string): Promise<FileMetadata | null>;
394
- /**
395
- * List files in a prefix/directory
396
- *
397
- * Only required if capabilities.list is true
398
- *
399
- * @param prefix The prefix or directory to list
400
- * @param maxKeys Optional maximum number of keys to return
401
- * @returns Promise resolving to array of keys
402
- */
403
- list?(prefix: string, maxKeys?: number): Promise<string[]>;
404
- /**
405
- * Get a presigned URL for direct access to the file
406
- *
407
- * The returned URL can be used by clients to access the file directly
408
- * without going through the Quilltap application, and will expire
409
- * after the specified time.
410
- *
411
- * Only required if capabilities.presignedUrls is true
412
- *
413
- * @param key The storage key/path of the file
414
- * @param expiresIn Expiration time in seconds (default 3600)
415
- * @returns Promise resolving to presigned URL
416
- */
417
- getPresignedUrl?(key: string, expiresIn?: number): Promise<string>;
418
- /**
419
- * Get a presigned URL for uploading a file directly
420
- *
421
- * The returned URL can be used by clients to upload a file directly
422
- * to storage without going through the Quilltap application.
423
- *
424
- * Only required if capabilities.presignedUrls is true
425
- *
426
- * @param key The storage key/path where the file will be stored
427
- * @param contentType The MIME type of the file being uploaded
428
- * @param expiresIn Expiration time in seconds (default 3600)
429
- * @returns Promise resolving to presigned upload URL
430
- */
431
- getPresignedUploadUrl?(key: string, contentType: string, expiresIn?: number): Promise<string>;
432
- /**
433
- * Get a public URL for the file
434
- *
435
- * The returned URL is permanent and requires no authentication.
436
- * Only call this if the file is intended to be publicly accessible.
437
- *
438
- * Only required if capabilities.publicUrls is true
439
- *
440
- * @param key The storage key/path of the file
441
- * @returns Promise resolving to public URL
442
- */
443
- getPublicUrl?(key: string): Promise<string>;
444
- }
445
- /**
446
- * Definition of a configuration field for a file storage plugin
447
- *
448
- * Used to generate the UI form for configuring the plugin.
449
- */
450
- interface FileStorageConfigField {
451
- /** Field name (used as key in config object) */
452
- name: string;
453
- /** Label displayed in the UI */
454
- label: string;
455
- /** Input type for this field */
456
- type: 'string' | 'number' | 'boolean' | 'secret';
457
- /** Whether this field is required */
458
- required: boolean;
459
- /** Description or help text for the field */
460
- description?: string;
461
- /** Default value for the field */
462
- defaultValue?: string | number | boolean;
463
- /** Placeholder text for input fields */
464
- placeholder?: string;
465
- }
466
- /**
467
- * File Storage Provider Plugin Interface
468
- *
469
- * Plugins implementing this interface can provide custom file storage backends
470
- * to Quilltap, enabling support for different storage providers.
471
- *
472
- * @example
473
- * ```typescript
474
- * import type { FileStorageProviderPlugin, FileStorageBackend } from '@quilltap/plugin-types';
475
- * import { S3Client } from '@aws-sdk/client-s3';
476
- *
477
- * const s3Plugin: FileStorageProviderPlugin = {
478
- * metadata: {
479
- * backendId: 's3',
480
- * displayName: 'Amazon S3',
481
- * description: 'Store files in Amazon S3',
482
- * },
483
- * configSchema: [
484
- * {
485
- * name: 'accessKeyId',
486
- * label: 'Access Key ID',
487
- * type: 'secret',
488
- * required: true,
489
- * },
490
- * // ... more fields
491
- * ],
492
- * createBackend: (config) => {
493
- * return new S3StorageBackend(config);
494
- * },
495
- * validateConfig: async (config) => {
496
- * // Validate configuration
497
- * return { valid: true };
498
- * },
499
- * };
500
- *
501
- * export const plugin = s3Plugin;
502
- * ```
503
- */
504
- interface FileStorageProviderPlugin {
505
- /**
506
- * Metadata identifying this plugin
507
- */
508
- metadata: {
509
- /** Unique identifier for the backend (e.g., 's3', 'gcs', 'azure') */
510
- backendId: string;
511
- /** Human-readable display name for UI */
512
- displayName: string;
513
- /** Description of what this plugin provides */
514
- description: string;
515
- };
516
- /**
517
- * Configuration schema for this plugin
518
- *
519
- * Defines the fields that users need to configure to use this storage backend.
520
- * Used to generate the configuration UI form.
521
- */
522
- configSchema: FileStorageConfigField[];
523
- /**
524
- * Create a backend instance with the given configuration
525
- *
526
- * @param config Configuration object from user input
527
- * @returns A new FileStorageBackend instance
528
- */
529
- createBackend(config: Record<string, unknown>): FileStorageBackend;
530
- /**
531
- * Validate plugin configuration
532
- *
533
- * Checks whether the provided configuration is valid for this plugin.
534
- * Can perform more thorough validation than what's possible with just
535
- * the config schema (e.g., connecting to the service to verify credentials).
536
- *
537
- * @param config Configuration object to validate
538
- * @returns Promise resolving to validation result
539
- */
540
- validateConfig(config: Record<string, unknown>): Promise<{
541
- valid: boolean;
542
- errors?: string[];
543
- }>;
544
- }
545
- /**
546
- * Standard export type for file storage plugins
547
- *
548
- * This is the expected export structure from file storage plugin modules.
549
- *
550
- * @example
551
- * ```typescript
552
- * // In plugin-s3/index.ts
553
- * export const plugin: FileStorageProviderPlugin = { ... };
554
- *
555
- * // Or with the export type:
556
- * const pluginExport: FileStoragePluginExport = {
557
- * plugin: { ... }
558
- * };
559
- * export default pluginExport;
560
- * ```
561
- */
562
- interface FileStoragePluginExport {
563
- /** The file storage plugin instance */
564
- plugin: FileStorageProviderPlugin;
565
- }
566
-
567
257
  /**
568
258
  * @quilltap/plugin-types
569
259
  *
@@ -581,6 +271,6 @@ interface FileStoragePluginExport {
581
271
  * Version of the plugin-types package.
582
272
  * Can be used at runtime to check compatibility.
583
273
  */
584
- declare const PLUGIN_TYPES_VERSION = "1.14.0";
274
+ declare const PLUGIN_TYPES_VERSION = "1.16.0";
585
275
 
586
- export { type FileBackendCapabilities, type FileBackendMetadata, type FileMetadata, type FileStorageBackend, type FileStorageConfigField, type FileStoragePluginExport, type FileStorageProviderPlugin, PLUGIN_TYPES_VERSION, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
276
+ export { PLUGIN_TYPES_VERSION, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { UniversalTool } from './llm/index.js';
2
2
  export { AnthropicToolDefinition, AttachmentResults, CacheUsage, EmbeddingOptions, EmbeddingProvider, EmbeddingResult, FileAttachment, GeneratedImage, GoogleToolDefinition, ImageGenParams, ImageGenProvider, ImageGenResponse, JSONSchemaDefinition, LLMMessage, LLMParams, LLMProvider, LLMResponse, LocalEmbeddingProvider, LocalEmbeddingProviderState, ModelMetadata, ModelWarning, ModelWarningLevel, OpenAIToolDefinition, ResponseFormat, StreamChunk, TokenUsage, ToolCall, ToolCallRequest, ToolFormatOptions, ToolResult, isLocalEmbeddingProvider } from './llm/index.js';
3
- export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, f as ImageStyleInfo, g as InstalledPluginInfo, L as LLMProviderPlugin, M as MessageFormatSupport, h as ModelInfo, P as PluginAuthor, i as PluginCapability, j as PluginCategory, k as PluginCompatibility, l as PluginIconData, m as PluginManifest, n as PluginPermissions, o as PluginStatus, p as ProviderCapabilities, q as ProviderConfig, r as ProviderConfigRequirements, s as ProviderMetadata, t as ProviderPluginExport, R as RoleplayTemplateConfig, u as RoleplayTemplateMetadata, v as RoleplayTemplatePlugin, w as RoleplayTemplatePluginExport, S as SearchOutput, x as SearchProviderConfig, y as SearchProviderConfigRequirements, z as SearchProviderMetadata, B as SearchProviderPlugin, D as SearchProviderPluginExport, G as SearchResult, H as Spacing, J as SubsystemOverrides, T as ThemeMetadata, K as ThemePlugin, N as ThemePluginExport, O as ThemeTokens, Q as ToolFormatType, U as Typography } from './index-XZ8WkWjp.js';
4
- import { Readable } from 'stream';
3
+ export { A as AttachmentSupport, C as CheapModelConfig, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, f as ImageStyleInfo, g as InstalledPluginInfo, L as LLMProviderPlugin, M as MessageFormatSupport, h as ModelInfo, i as ModerationCategoryResult, j as ModerationProviderConfigRequirements, k as ModerationProviderMetadata, l as ModerationProviderPlugin, m as ModerationProviderPluginExport, n as ModerationResult, P as PluginAuthor, o as PluginCapability, p as PluginCategory, q as PluginCompatibility, r as PluginIconData, s as PluginManifest, t as PluginPermissions, u as PluginStatus, v as ProviderCapabilities, w as ProviderConfig, x as ProviderConfigRequirements, y as ProviderMetadata, z as ProviderPluginExport, R as RoleplayTemplateConfig, B as RoleplayTemplateMetadata, D as RoleplayTemplatePlugin, G as RoleplayTemplatePluginExport, S as SearchOutput, H as SearchProviderConfig, J as SearchProviderConfigRequirements, K as SearchProviderMetadata, N as SearchProviderPlugin, O as SearchProviderPluginExport, Q as SearchResult, T as Spacing, U as SubsystemOverrides, V as ThemeMetadata, W as ThemePlugin, X as ThemePluginExport, Y as ThemeTokens, Z as ToolFormatType, _ as Typography } from './index-CeYb2BY9.js';
5
4
  export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.js';
6
5
 
7
6
  /**
@@ -255,315 +254,6 @@ interface ToolPluginExport {
255
254
  plugin: ToolPlugin;
256
255
  }
257
256
 
258
- /**
259
- * File Storage Plugin types for Quilltap plugin development
260
- *
261
- * Defines the interfaces and types needed to create custom file storage
262
- * backend providers as Quilltap plugins.
263
- *
264
- * @module @quilltap/plugin-types/plugins/file-storage
265
- */
266
-
267
- /**
268
- * Describes what features a storage backend supports
269
- */
270
- interface FileBackendCapabilities {
271
- /** Whether the backend supports presigned URLs for direct access */
272
- presignedUrls: boolean;
273
- /** Whether the backend supports public URLs (no authentication required) */
274
- publicUrls: boolean;
275
- /** Whether the backend supports streaming uploads */
276
- streamingUpload: boolean;
277
- /** Whether the backend supports streaming downloads */
278
- streamingDownload: boolean;
279
- /** Whether the backend supports copying files between locations */
280
- copy: boolean;
281
- /** Whether the backend supports listing files in a prefix/directory */
282
- list: boolean;
283
- /** Whether the backend supports retrieving file metadata */
284
- metadata: boolean;
285
- }
286
- /**
287
- * Metadata about a file storage backend
288
- */
289
- interface FileBackendMetadata {
290
- /** Unique identifier for this provider */
291
- providerId: string;
292
- /** Human-readable display name for UI */
293
- displayName: string;
294
- /** Description of the storage backend */
295
- description: string;
296
- /** Capabilities supported by this backend */
297
- capabilities: FileBackendCapabilities;
298
- }
299
- /**
300
- * Metadata about a stored file
301
- */
302
- interface FileMetadata {
303
- /** Size in bytes */
304
- size: number;
305
- /** MIME type */
306
- contentType: string;
307
- /** Last modified timestamp */
308
- lastModified: Date;
309
- }
310
- /**
311
- * Interface for a file storage backend implementation
312
- *
313
- * Plugins implementing this interface can provide custom storage backends
314
- * such as S3, Google Cloud Storage, Azure Blob Storage, etc.
315
- */
316
- interface FileStorageBackend {
317
- /**
318
- * Get metadata about this storage backend
319
- *
320
- * @returns Backend metadata including capabilities
321
- */
322
- getMetadata(): FileBackendMetadata;
323
- /**
324
- * Test the connection to the storage backend
325
- *
326
- * Verifies that the backend is properly configured and accessible.
327
- * This is called during plugin initialization and setup verification.
328
- *
329
- * @returns Promise resolving to connection test result
330
- */
331
- testConnection(): Promise<{
332
- success: boolean;
333
- message: string;
334
- latencyMs?: number;
335
- }>;
336
- /**
337
- * Upload a file to storage
338
- *
339
- * @param key The storage key/path for the file
340
- * @param body The file content as Buffer or Readable stream
341
- * @param contentType MIME type of the file
342
- * @param metadata Optional custom metadata to store with the file
343
- */
344
- upload(key: string, body: Buffer | Readable, contentType: string, metadata?: Record<string, string>): Promise<void>;
345
- /**
346
- * Download a file from storage
347
- *
348
- * @param key The storage key/path of the file
349
- * @returns Promise resolving to the file content as Buffer
350
- */
351
- download(key: string): Promise<Buffer>;
352
- /**
353
- * Delete a file from storage
354
- *
355
- * @param key The storage key/path of the file
356
- */
357
- delete(key: string): Promise<void>;
358
- /**
359
- * Check if a file exists in storage
360
- *
361
- * @param key The storage key/path to check
362
- * @returns Promise resolving to true if file exists, false otherwise
363
- */
364
- exists(key: string): Promise<boolean>;
365
- /**
366
- * Get a URL that can be used to access the file through the application proxy
367
- *
368
- * This is the primary URL used by Quilltap to serve files to users.
369
- * It should point back to the Quilltap application, not directly to the
370
- * storage provider.
371
- *
372
- * @param key The storage key/path of the file
373
- * @returns The proxy URL for accessing the file
374
- */
375
- getProxyUrl(key: string): string;
376
- /**
377
- * Copy a file from one location to another
378
- *
379
- * Only required if capabilities.copy is true
380
- *
381
- * @param sourceKey The source storage key/path
382
- * @param destinationKey The destination storage key/path
383
- */
384
- copy?(sourceKey: string, destinationKey: string): Promise<void>;
385
- /**
386
- * Get metadata about a stored file
387
- *
388
- * Only required if capabilities.metadata is true
389
- *
390
- * @param key The storage key/path of the file
391
- * @returns Promise resolving to file metadata or null if file doesn't exist
392
- */
393
- getFileMetadata?(key: string): Promise<FileMetadata | null>;
394
- /**
395
- * List files in a prefix/directory
396
- *
397
- * Only required if capabilities.list is true
398
- *
399
- * @param prefix The prefix or directory to list
400
- * @param maxKeys Optional maximum number of keys to return
401
- * @returns Promise resolving to array of keys
402
- */
403
- list?(prefix: string, maxKeys?: number): Promise<string[]>;
404
- /**
405
- * Get a presigned URL for direct access to the file
406
- *
407
- * The returned URL can be used by clients to access the file directly
408
- * without going through the Quilltap application, and will expire
409
- * after the specified time.
410
- *
411
- * Only required if capabilities.presignedUrls is true
412
- *
413
- * @param key The storage key/path of the file
414
- * @param expiresIn Expiration time in seconds (default 3600)
415
- * @returns Promise resolving to presigned URL
416
- */
417
- getPresignedUrl?(key: string, expiresIn?: number): Promise<string>;
418
- /**
419
- * Get a presigned URL for uploading a file directly
420
- *
421
- * The returned URL can be used by clients to upload a file directly
422
- * to storage without going through the Quilltap application.
423
- *
424
- * Only required if capabilities.presignedUrls is true
425
- *
426
- * @param key The storage key/path where the file will be stored
427
- * @param contentType The MIME type of the file being uploaded
428
- * @param expiresIn Expiration time in seconds (default 3600)
429
- * @returns Promise resolving to presigned upload URL
430
- */
431
- getPresignedUploadUrl?(key: string, contentType: string, expiresIn?: number): Promise<string>;
432
- /**
433
- * Get a public URL for the file
434
- *
435
- * The returned URL is permanent and requires no authentication.
436
- * Only call this if the file is intended to be publicly accessible.
437
- *
438
- * Only required if capabilities.publicUrls is true
439
- *
440
- * @param key The storage key/path of the file
441
- * @returns Promise resolving to public URL
442
- */
443
- getPublicUrl?(key: string): Promise<string>;
444
- }
445
- /**
446
- * Definition of a configuration field for a file storage plugin
447
- *
448
- * Used to generate the UI form for configuring the plugin.
449
- */
450
- interface FileStorageConfigField {
451
- /** Field name (used as key in config object) */
452
- name: string;
453
- /** Label displayed in the UI */
454
- label: string;
455
- /** Input type for this field */
456
- type: 'string' | 'number' | 'boolean' | 'secret';
457
- /** Whether this field is required */
458
- required: boolean;
459
- /** Description or help text for the field */
460
- description?: string;
461
- /** Default value for the field */
462
- defaultValue?: string | number | boolean;
463
- /** Placeholder text for input fields */
464
- placeholder?: string;
465
- }
466
- /**
467
- * File Storage Provider Plugin Interface
468
- *
469
- * Plugins implementing this interface can provide custom file storage backends
470
- * to Quilltap, enabling support for different storage providers.
471
- *
472
- * @example
473
- * ```typescript
474
- * import type { FileStorageProviderPlugin, FileStorageBackend } from '@quilltap/plugin-types';
475
- * import { S3Client } from '@aws-sdk/client-s3';
476
- *
477
- * const s3Plugin: FileStorageProviderPlugin = {
478
- * metadata: {
479
- * backendId: 's3',
480
- * displayName: 'Amazon S3',
481
- * description: 'Store files in Amazon S3',
482
- * },
483
- * configSchema: [
484
- * {
485
- * name: 'accessKeyId',
486
- * label: 'Access Key ID',
487
- * type: 'secret',
488
- * required: true,
489
- * },
490
- * // ... more fields
491
- * ],
492
- * createBackend: (config) => {
493
- * return new S3StorageBackend(config);
494
- * },
495
- * validateConfig: async (config) => {
496
- * // Validate configuration
497
- * return { valid: true };
498
- * },
499
- * };
500
- *
501
- * export const plugin = s3Plugin;
502
- * ```
503
- */
504
- interface FileStorageProviderPlugin {
505
- /**
506
- * Metadata identifying this plugin
507
- */
508
- metadata: {
509
- /** Unique identifier for the backend (e.g., 's3', 'gcs', 'azure') */
510
- backendId: string;
511
- /** Human-readable display name for UI */
512
- displayName: string;
513
- /** Description of what this plugin provides */
514
- description: string;
515
- };
516
- /**
517
- * Configuration schema for this plugin
518
- *
519
- * Defines the fields that users need to configure to use this storage backend.
520
- * Used to generate the configuration UI form.
521
- */
522
- configSchema: FileStorageConfigField[];
523
- /**
524
- * Create a backend instance with the given configuration
525
- *
526
- * @param config Configuration object from user input
527
- * @returns A new FileStorageBackend instance
528
- */
529
- createBackend(config: Record<string, unknown>): FileStorageBackend;
530
- /**
531
- * Validate plugin configuration
532
- *
533
- * Checks whether the provided configuration is valid for this plugin.
534
- * Can perform more thorough validation than what's possible with just
535
- * the config schema (e.g., connecting to the service to verify credentials).
536
- *
537
- * @param config Configuration object to validate
538
- * @returns Promise resolving to validation result
539
- */
540
- validateConfig(config: Record<string, unknown>): Promise<{
541
- valid: boolean;
542
- errors?: string[];
543
- }>;
544
- }
545
- /**
546
- * Standard export type for file storage plugins
547
- *
548
- * This is the expected export structure from file storage plugin modules.
549
- *
550
- * @example
551
- * ```typescript
552
- * // In plugin-s3/index.ts
553
- * export const plugin: FileStorageProviderPlugin = { ... };
554
- *
555
- * // Or with the export type:
556
- * const pluginExport: FileStoragePluginExport = {
557
- * plugin: { ... }
558
- * };
559
- * export default pluginExport;
560
- * ```
561
- */
562
- interface FileStoragePluginExport {
563
- /** The file storage plugin instance */
564
- plugin: FileStorageProviderPlugin;
565
- }
566
-
567
257
  /**
568
258
  * @quilltap/plugin-types
569
259
  *
@@ -581,6 +271,6 @@ interface FileStoragePluginExport {
581
271
  * Version of the plugin-types package.
582
272
  * Can be used at runtime to check compatibility.
583
273
  */
584
- declare const PLUGIN_TYPES_VERSION = "1.14.0";
274
+ declare const PLUGIN_TYPES_VERSION = "1.16.0";
585
275
 
586
- export { type FileBackendCapabilities, type FileBackendMetadata, type FileMetadata, type FileStorageBackend, type FileStorageConfigField, type FileStoragePluginExport, type FileStorageProviderPlugin, PLUGIN_TYPES_VERSION, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
276
+ export { PLUGIN_TYPES_VERSION, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ function createNoopLogger() {
112
112
  }
113
113
 
114
114
  // src/index.ts
115
- var PLUGIN_TYPES_VERSION = "1.14.0";
115
+ var PLUGIN_TYPES_VERSION = "1.16.0";
116
116
 
117
117
  exports.ApiKeyError = ApiKeyError;
118
118
  exports.AttachmentError = AttachmentError;