@quilltap/plugin-types 1.18.0 → 2.0.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 CHANGED
@@ -140,6 +140,11 @@ logger.error('Failed to connect', { endpoint: 'api.example.com' }, error);
140
140
  | `ProviderCapabilities` | Capability flags |
141
141
  | `AttachmentSupport` | File attachment config |
142
142
  | `PluginManifest` | Plugin manifest schema |
143
+ | `SystemPromptPlugin` | System prompt plugin interface |
144
+ | `SystemPromptData` | Individual prompt entry |
145
+ | `SystemPromptMetadata` | System prompt plugin metadata |
146
+ | `RoleplayTemplatePlugin` | Roleplay template plugin interface |
147
+ | `RoleplayTemplateConfig` | Roleplay template configuration |
143
148
 
144
149
  ### Common Types
145
150
 
@@ -1,4 +1,5 @@
1
- import { LLMProvider, ImageGenProvider, EmbeddingProvider, LocalEmbeddingProvider, ToolFormatOptions, ToolCallRequest } from './llm/index.js';
1
+ import { LLMProvider as TextProvider, ImageGenProvider as ImageProvider, EmbeddingProvider, LocalEmbeddingProvider, ToolFormatOptions, ToolCallRequest } from './llm/index.js';
2
+ import { ScoringProvider } from './providers/index.js';
2
3
 
3
4
  /**
4
5
  * Provider Plugin Interface types for Quilltap plugin development
@@ -280,16 +281,18 @@ interface CheapModelConfig {
280
281
  */
281
282
  type ToolFormatType = 'openai' | 'anthropic' | 'google';
282
283
  /**
283
- * Main LLM Provider Plugin Interface
284
+ * Main Text Provider Plugin Interface
284
285
  *
285
286
  * Plugins implementing this interface can be dynamically loaded
286
287
  * by Quilltap to provide LLM functionality from various providers.
288
+ * A single plugin may support multiple provider shapes (text, image,
289
+ * embedding) through the factory methods.
287
290
  *
288
291
  * @example
289
292
  * ```typescript
290
- * import type { LLMProviderPlugin } from '@quilltap/plugin-types';
293
+ * import type { TextProviderPlugin } from '@quilltap/plugin-types';
291
294
  *
292
- * export const plugin: LLMProviderPlugin = {
295
+ * export const plugin: TextProviderPlugin = {
293
296
  * metadata: {
294
297
  * providerName: 'MY_PROVIDER',
295
298
  * displayName: 'My Provider',
@@ -323,7 +326,7 @@ type ToolFormatType = 'openai' | 'anthropic' | 'google';
323
326
  * };
324
327
  * ```
325
328
  */
326
- interface LLMProviderPlugin {
329
+ interface TextProviderPlugin {
327
330
  /** Provider metadata for UI display and identification */
328
331
  metadata: ProviderMetadata;
329
332
  /** Configuration requirements for this provider */
@@ -333,16 +336,16 @@ interface LLMProviderPlugin {
333
336
  /** File attachment support information */
334
337
  attachmentSupport: AttachmentSupport;
335
338
  /**
336
- * Factory method to create an LLMProvider instance
339
+ * Factory method to create a TextProvider instance
337
340
  * @param baseUrl Optional base URL for the provider
338
341
  */
339
- createProvider: (baseUrl?: string) => LLMProvider;
342
+ createProvider: (baseUrl?: string) => TextProvider;
340
343
  /**
341
- * Factory method to create an ImageGenProvider instance (optional)
344
+ * Factory method to create an ImageProvider instance (optional)
342
345
  * Only required if capabilities.imageGeneration is true
343
346
  * @param baseUrl Optional base URL for the provider
344
347
  */
345
- createImageProvider?: (baseUrl?: string) => ImageGenProvider;
348
+ createImageProvider?: (baseUrl?: string) => ImageProvider;
346
349
  /**
347
350
  * Factory method to create an embedding provider (optional)
348
351
  * Only required if capabilities.embeddings is true
@@ -475,12 +478,116 @@ interface LLMProviderPlugin {
475
478
  */
476
479
  defaultContextWindow?: number;
477
480
  }
481
+ /**
482
+ * @deprecated Use `TextProviderPlugin` instead. This alias is kept for backward compatibility.
483
+ */
484
+ type LLMProviderPlugin = TextProviderPlugin;
478
485
  /**
479
486
  * Standard export type for provider plugins
480
487
  */
481
488
  interface ProviderPluginExport {
482
489
  /** The provider plugin instance */
483
- plugin: LLMProviderPlugin;
490
+ plugin: TextProviderPlugin;
491
+ }
492
+
493
+ /**
494
+ * Scoring Provider Plugin types for Quilltap plugin development
495
+ *
496
+ * Defines the interfaces and types needed to create pluggable content
497
+ * scoring backends as Quilltap plugins. Scoring providers handle
498
+ * moderation, reranking, and classification tasks.
499
+ *
500
+ * @module @quilltap/plugin-types/plugins/scoring-provider
501
+ */
502
+
503
+ /**
504
+ * Scoring provider metadata for UI display and identification
505
+ */
506
+ interface ScoringProviderMetadata {
507
+ /** Internal identifier for the scoring provider (e.g., 'OPENAI') */
508
+ providerName: string;
509
+ /** Human-readable display name for UI (e.g., 'OpenAI Moderation') */
510
+ displayName: string;
511
+ /** Short description of the scoring provider */
512
+ description: string;
513
+ /** Short abbreviation for icon display (e.g., 'OAI') */
514
+ abbreviation: string;
515
+ /** Tailwind CSS color classes for UI styling */
516
+ colors: {
517
+ /** Background color class (e.g., 'bg-green-100') */
518
+ bg: string;
519
+ /** Text color class (e.g., 'text-green-800') */
520
+ text: string;
521
+ /** Icon color class (e.g., 'text-green-600') */
522
+ icon: string;
523
+ };
524
+ }
525
+ /**
526
+ * Configuration requirements for a scoring provider
527
+ */
528
+ interface ScoringProviderConfigRequirements {
529
+ /** Whether this scoring provider requires an API key */
530
+ requiresApiKey: boolean;
531
+ /** Label text for API key input field */
532
+ apiKeyLabel?: string;
533
+ /** Whether this scoring provider requires a custom base URL */
534
+ requiresBaseUrl: boolean;
535
+ /** Default value for base URL (if applicable) */
536
+ baseUrlDefault?: string;
537
+ }
538
+ /**
539
+ * Main Scoring Provider Plugin Interface
540
+ *
541
+ * Plugins implementing this interface provide scoring backends
542
+ * for Quilltap. The most common use case is content moderation
543
+ * via the Concierge system, but the interface supports reranking
544
+ * and classification tasks as well.
545
+ *
546
+ * @example
547
+ * ```typescript
548
+ * import type { ScoringProviderPlugin } from '@quilltap/plugin-types';
549
+ *
550
+ * export const scoringPlugin: ScoringProviderPlugin = {
551
+ * metadata: {
552
+ * providerName: 'OPENAI',
553
+ * displayName: 'OpenAI Moderation',
554
+ * description: 'Free content moderation via OpenAI moderation endpoint',
555
+ * abbreviation: 'OAI',
556
+ * colors: { bg: 'bg-green-100', text: 'text-green-800', icon: 'text-green-600' },
557
+ * },
558
+ * config: {
559
+ * requiresApiKey: true,
560
+ * apiKeyLabel: 'OpenAI API Key',
561
+ * requiresBaseUrl: false,
562
+ * },
563
+ * createProvider: () => new OpenAIModerationScoringProvider(),
564
+ * };
565
+ * ```
566
+ */
567
+ interface ScoringProviderPlugin {
568
+ /** Scoring provider metadata for UI display and identification */
569
+ metadata: ScoringProviderMetadata;
570
+ /** Configuration requirements for this scoring provider */
571
+ config: ScoringProviderConfigRequirements;
572
+ /**
573
+ * Factory method to create a ScoringProvider instance
574
+ */
575
+ createProvider: () => ScoringProvider;
576
+ /**
577
+ * Validate an API key for this scoring provider (optional)
578
+ *
579
+ * @param apiKey The API key to validate
580
+ * @param baseUrl Optional base URL
581
+ * @returns Promise resolving to true if valid, false otherwise
582
+ */
583
+ validateApiKey?: (apiKey: string, baseUrl?: string) => Promise<boolean>;
584
+ }
585
+ /**
586
+ * Standard export type for scoring provider plugins
587
+ */
588
+ interface ScoringProviderPluginExport {
589
+ /** The scoring provider plugin instance */
590
+ scoringPlugin: ScoringProviderPlugin;
484
591
  }
485
592
 
486
593
  /**
@@ -1493,13 +1600,18 @@ interface SearchProviderPluginExport {
1493
1600
  /**
1494
1601
  * Moderation Provider Plugin types for Quilltap plugin development
1495
1602
  *
1496
- * Defines the interfaces and types needed to create pluggable content
1497
- * moderation backends as Quilltap plugins (e.g., OpenAI moderation endpoint).
1603
+ * @deprecated Use ScoringProviderPlugin from './scoring-provider' instead.
1604
+ * This module is kept for backward compatibility. The moderation-specific
1605
+ * types map directly to the generalized scoring types:
1606
+ *
1607
+ * - ModerationProviderPlugin -> ScoringProviderPlugin
1608
+ * - ModerationResult -> ScoringResult
1609
+ * - ModerationCategoryResult -> CategoryScore
1498
1610
  *
1499
1611
  * @module @quilltap/plugin-types/plugins/moderation-provider
1500
1612
  */
1501
1613
  /**
1502
- * Moderation provider metadata for UI display and identification
1614
+ * @deprecated Use ScoringProviderMetadata instead
1503
1615
  */
1504
1616
  interface ModerationProviderMetadata {
1505
1617
  /** Internal identifier for the moderation provider (e.g., 'OPENAI') */
@@ -1521,7 +1633,7 @@ interface ModerationProviderMetadata {
1521
1633
  };
1522
1634
  }
1523
1635
  /**
1524
- * Configuration requirements for a moderation provider
1636
+ * @deprecated Use ScoringProviderConfigRequirements instead
1525
1637
  */
1526
1638
  interface ModerationProviderConfigRequirements {
1527
1639
  /** Whether this moderation provider requires an API key */
@@ -1534,10 +1646,7 @@ interface ModerationProviderConfigRequirements {
1534
1646
  baseUrlDefault?: string;
1535
1647
  }
1536
1648
  /**
1537
- * A single moderation category result
1538
- *
1539
- * Categories are provider-specific (e.g., OpenAI returns 'hate', 'sexual',
1540
- * 'violence', etc.; other providers may return different categories).
1649
+ * @deprecated Use CategoryScore from providers/scoring instead
1541
1650
  */
1542
1651
  interface ModerationCategoryResult {
1543
1652
  /** Category name as returned by the provider (e.g., 'sexual', 'violence', 'hate') */
@@ -1548,11 +1657,7 @@ interface ModerationCategoryResult {
1548
1657
  score: number;
1549
1658
  }
1550
1659
  /**
1551
- * Result from a moderation provider's content classification
1552
- *
1553
- * This is the generic result type returned by all moderation providers.
1554
- * The categories array contains provider-specific category names and scores.
1555
- * The consuming system (the Concierge) maps these to its own category structure.
1660
+ * @deprecated Use ScoringResult from providers/scoring instead
1556
1661
  */
1557
1662
  interface ModerationResult {
1558
1663
  /** Whether the content was flagged by the moderation provider */
@@ -1561,35 +1666,10 @@ interface ModerationResult {
1561
1666
  categories: ModerationCategoryResult[];
1562
1667
  }
1563
1668
  /**
1564
- * Main Moderation Provider Plugin Interface
1565
- *
1566
- * Plugins implementing this interface provide content moderation backends
1567
- * for Quilltap's Concierge system. The moderation provider is used
1568
- * as an alternative to the Cheap LLM classification approach.
1569
- *
1570
- * @example
1571
- * ```typescript
1572
- * import type { ModerationProviderPlugin } from '@quilltap/plugin-types';
1669
+ * @deprecated Use ScoringProviderPlugin instead.
1573
1670
  *
1574
- * export const moderationPlugin: ModerationProviderPlugin = {
1575
- * metadata: {
1576
- * providerName: 'OPENAI',
1577
- * displayName: 'OpenAI Moderation',
1578
- * description: 'Free content moderation via OpenAI moderation endpoint',
1579
- * abbreviation: 'OAI',
1580
- * colors: { bg: 'bg-green-100', text: 'text-green-800', icon: 'text-green-600' },
1581
- * },
1582
- * config: {
1583
- * requiresApiKey: true,
1584
- * apiKeyLabel: 'OpenAI API Key',
1585
- * requiresBaseUrl: false,
1586
- * },
1587
- * moderate: async (content, apiKey) => {
1588
- * // ... call moderation API ...
1589
- * return { flagged: false, categories: [] };
1590
- * },
1591
- * };
1592
- * ```
1671
+ * Legacy moderation provider plugin interface. New plugins should implement
1672
+ * ScoringProviderPlugin with a ScoringProvider that handles task: 'moderation'.
1593
1673
  */
1594
1674
  interface ModerationProviderPlugin {
1595
1675
  /** Moderation provider metadata for UI display and identification */
@@ -1608,9 +1688,6 @@ interface ModerationProviderPlugin {
1608
1688
  /**
1609
1689
  * Validate an API key for this moderation provider (optional)
1610
1690
  *
1611
- * Should test the API key by making a minimal API call to verify
1612
- * that it is valid and has proper permissions.
1613
- *
1614
1691
  * @param apiKey The API key to validate
1615
1692
  * @param baseUrl Optional base URL for the moderation API
1616
1693
  * @returns Promise resolving to true if valid, false otherwise
@@ -1618,11 +1695,11 @@ interface ModerationProviderPlugin {
1618
1695
  validateApiKey?: (apiKey: string, baseUrl?: string) => Promise<boolean>;
1619
1696
  }
1620
1697
  /**
1621
- * Standard export type for moderation provider plugins
1698
+ * @deprecated Use ScoringProviderPluginExport instead
1622
1699
  */
1623
1700
  interface ModerationProviderPluginExport {
1624
1701
  /** The moderation provider plugin instance */
1625
1702
  moderationPlugin: ModerationProviderPlugin;
1626
1703
  }
1627
1704
 
1628
- export type { AnnotationButton as $, AttachmentSupport as A, RoleplayTemplateMetadata as B, CheapModelConfig as C, RoleplayTemplatePlugin as D, Effects as E, FontDefinition as F, RoleplayTemplatePluginExport as G, SearchProviderConfig as H, IconProps as I, SearchProviderConfigRequirements as J, SearchProviderMetadata as K, LLMProviderPlugin as L, MessageFormatSupport as M, SearchProviderPlugin as N, SearchProviderPluginExport as O, PluginAuthor as P, SearchResult as Q, RoleplayTemplateConfig as R, SearchOutput as S, Spacing as T, SubsystemOverrides as U, ThemeMetadata as V, ThemePlugin as W, ThemePluginExport as X, ThemeTokens as Y, ToolFormatType as Z, Typography as _, ColorPalette as a, DialogueDetection as a0, ModerationProviderConfig as a1, RenderingPattern as a2, EmbeddedFont as b, EmbeddingModelInfo as c, ImageGenerationModelInfo as d, ImageProviderConstraints as e, ImageStyleInfo as f, InstalledPluginInfo as g, ModelInfo as h, ModerationCategoryResult as i, ModerationProviderConfigRequirements as j, ModerationProviderMetadata as k, ModerationProviderPlugin as l, ModerationProviderPluginExport as m, ModerationResult as n, PluginCapability as o, PluginCategory as p, PluginCompatibility as q, PluginIconData as r, PluginManifest as s, PluginPermissions as t, PluginStatus as u, ProviderCapabilities as v, ProviderConfig as w, ProviderConfigRequirements as x, ProviderMetadata as y, ProviderPluginExport as z };
1705
+ export type { ThemePlugin as $, AttachmentSupport as A, RoleplayTemplateMetadata as B, CheapModelConfig as C, RoleplayTemplatePlugin as D, Effects as E, FontDefinition as F, RoleplayTemplatePluginExport as G, ScoringProviderMetadata as H, IconProps as I, ScoringProviderPlugin as J, ScoringProviderPluginExport as K, LLMProviderPlugin as L, MessageFormatSupport as M, SearchOutput as N, SearchProviderConfig as O, PluginAuthor as P, SearchProviderConfigRequirements as Q, RoleplayTemplateConfig as R, ScoringProviderConfigRequirements as S, SearchProviderMetadata as T, SearchProviderPlugin as U, SearchProviderPluginExport as V, SearchResult as W, Spacing as X, SubsystemOverrides as Y, TextProviderPlugin as Z, ThemeMetadata as _, ColorPalette as a, ThemePluginExport as a0, ThemeTokens as a1, ToolFormatType as a2, Typography as a3, AnnotationButton as a4, DialogueDetection as a5, ModerationProviderConfig as a6, RenderingPattern as a7, EmbeddedFont as b, EmbeddingModelInfo as c, ImageGenerationModelInfo as d, ImageProviderConstraints as e, ImageStyleInfo as f, InstalledPluginInfo as g, ModelInfo as h, ModerationCategoryResult as i, ModerationProviderConfigRequirements as j, ModerationProviderMetadata as k, ModerationProviderPlugin as l, ModerationProviderPluginExport as m, ModerationResult as n, PluginCapability as o, PluginCategory as p, PluginCompatibility as q, PluginIconData as r, PluginManifest as s, PluginPermissions as t, PluginStatus as u, ProviderCapabilities as v, ProviderConfig as w, ProviderConfigRequirements as x, ProviderMetadata as y, ProviderPluginExport as z };
@@ -1,4 +1,5 @@
1
- import { LLMProvider, ImageGenProvider, EmbeddingProvider, LocalEmbeddingProvider, ToolFormatOptions, ToolCallRequest } from './llm/index.mjs';
1
+ import { LLMProvider as TextProvider, ImageGenProvider as ImageProvider, EmbeddingProvider, LocalEmbeddingProvider, ToolFormatOptions, ToolCallRequest } from './llm/index.mjs';
2
+ import { ScoringProvider } from './providers/index.mjs';
2
3
 
3
4
  /**
4
5
  * Provider Plugin Interface types for Quilltap plugin development
@@ -280,16 +281,18 @@ interface CheapModelConfig {
280
281
  */
281
282
  type ToolFormatType = 'openai' | 'anthropic' | 'google';
282
283
  /**
283
- * Main LLM Provider Plugin Interface
284
+ * Main Text Provider Plugin Interface
284
285
  *
285
286
  * Plugins implementing this interface can be dynamically loaded
286
287
  * by Quilltap to provide LLM functionality from various providers.
288
+ * A single plugin may support multiple provider shapes (text, image,
289
+ * embedding) through the factory methods.
287
290
  *
288
291
  * @example
289
292
  * ```typescript
290
- * import type { LLMProviderPlugin } from '@quilltap/plugin-types';
293
+ * import type { TextProviderPlugin } from '@quilltap/plugin-types';
291
294
  *
292
- * export const plugin: LLMProviderPlugin = {
295
+ * export const plugin: TextProviderPlugin = {
293
296
  * metadata: {
294
297
  * providerName: 'MY_PROVIDER',
295
298
  * displayName: 'My Provider',
@@ -323,7 +326,7 @@ type ToolFormatType = 'openai' | 'anthropic' | 'google';
323
326
  * };
324
327
  * ```
325
328
  */
326
- interface LLMProviderPlugin {
329
+ interface TextProviderPlugin {
327
330
  /** Provider metadata for UI display and identification */
328
331
  metadata: ProviderMetadata;
329
332
  /** Configuration requirements for this provider */
@@ -333,16 +336,16 @@ interface LLMProviderPlugin {
333
336
  /** File attachment support information */
334
337
  attachmentSupport: AttachmentSupport;
335
338
  /**
336
- * Factory method to create an LLMProvider instance
339
+ * Factory method to create a TextProvider instance
337
340
  * @param baseUrl Optional base URL for the provider
338
341
  */
339
- createProvider: (baseUrl?: string) => LLMProvider;
342
+ createProvider: (baseUrl?: string) => TextProvider;
340
343
  /**
341
- * Factory method to create an ImageGenProvider instance (optional)
344
+ * Factory method to create an ImageProvider instance (optional)
342
345
  * Only required if capabilities.imageGeneration is true
343
346
  * @param baseUrl Optional base URL for the provider
344
347
  */
345
- createImageProvider?: (baseUrl?: string) => ImageGenProvider;
348
+ createImageProvider?: (baseUrl?: string) => ImageProvider;
346
349
  /**
347
350
  * Factory method to create an embedding provider (optional)
348
351
  * Only required if capabilities.embeddings is true
@@ -475,12 +478,116 @@ interface LLMProviderPlugin {
475
478
  */
476
479
  defaultContextWindow?: number;
477
480
  }
481
+ /**
482
+ * @deprecated Use `TextProviderPlugin` instead. This alias is kept for backward compatibility.
483
+ */
484
+ type LLMProviderPlugin = TextProviderPlugin;
478
485
  /**
479
486
  * Standard export type for provider plugins
480
487
  */
481
488
  interface ProviderPluginExport {
482
489
  /** The provider plugin instance */
483
- plugin: LLMProviderPlugin;
490
+ plugin: TextProviderPlugin;
491
+ }
492
+
493
+ /**
494
+ * Scoring Provider Plugin types for Quilltap plugin development
495
+ *
496
+ * Defines the interfaces and types needed to create pluggable content
497
+ * scoring backends as Quilltap plugins. Scoring providers handle
498
+ * moderation, reranking, and classification tasks.
499
+ *
500
+ * @module @quilltap/plugin-types/plugins/scoring-provider
501
+ */
502
+
503
+ /**
504
+ * Scoring provider metadata for UI display and identification
505
+ */
506
+ interface ScoringProviderMetadata {
507
+ /** Internal identifier for the scoring provider (e.g., 'OPENAI') */
508
+ providerName: string;
509
+ /** Human-readable display name for UI (e.g., 'OpenAI Moderation') */
510
+ displayName: string;
511
+ /** Short description of the scoring provider */
512
+ description: string;
513
+ /** Short abbreviation for icon display (e.g., 'OAI') */
514
+ abbreviation: string;
515
+ /** Tailwind CSS color classes for UI styling */
516
+ colors: {
517
+ /** Background color class (e.g., 'bg-green-100') */
518
+ bg: string;
519
+ /** Text color class (e.g., 'text-green-800') */
520
+ text: string;
521
+ /** Icon color class (e.g., 'text-green-600') */
522
+ icon: string;
523
+ };
524
+ }
525
+ /**
526
+ * Configuration requirements for a scoring provider
527
+ */
528
+ interface ScoringProviderConfigRequirements {
529
+ /** Whether this scoring provider requires an API key */
530
+ requiresApiKey: boolean;
531
+ /** Label text for API key input field */
532
+ apiKeyLabel?: string;
533
+ /** Whether this scoring provider requires a custom base URL */
534
+ requiresBaseUrl: boolean;
535
+ /** Default value for base URL (if applicable) */
536
+ baseUrlDefault?: string;
537
+ }
538
+ /**
539
+ * Main Scoring Provider Plugin Interface
540
+ *
541
+ * Plugins implementing this interface provide scoring backends
542
+ * for Quilltap. The most common use case is content moderation
543
+ * via the Concierge system, but the interface supports reranking
544
+ * and classification tasks as well.
545
+ *
546
+ * @example
547
+ * ```typescript
548
+ * import type { ScoringProviderPlugin } from '@quilltap/plugin-types';
549
+ *
550
+ * export const scoringPlugin: ScoringProviderPlugin = {
551
+ * metadata: {
552
+ * providerName: 'OPENAI',
553
+ * displayName: 'OpenAI Moderation',
554
+ * description: 'Free content moderation via OpenAI moderation endpoint',
555
+ * abbreviation: 'OAI',
556
+ * colors: { bg: 'bg-green-100', text: 'text-green-800', icon: 'text-green-600' },
557
+ * },
558
+ * config: {
559
+ * requiresApiKey: true,
560
+ * apiKeyLabel: 'OpenAI API Key',
561
+ * requiresBaseUrl: false,
562
+ * },
563
+ * createProvider: () => new OpenAIModerationScoringProvider(),
564
+ * };
565
+ * ```
566
+ */
567
+ interface ScoringProviderPlugin {
568
+ /** Scoring provider metadata for UI display and identification */
569
+ metadata: ScoringProviderMetadata;
570
+ /** Configuration requirements for this scoring provider */
571
+ config: ScoringProviderConfigRequirements;
572
+ /**
573
+ * Factory method to create a ScoringProvider instance
574
+ */
575
+ createProvider: () => ScoringProvider;
576
+ /**
577
+ * Validate an API key for this scoring provider (optional)
578
+ *
579
+ * @param apiKey The API key to validate
580
+ * @param baseUrl Optional base URL
581
+ * @returns Promise resolving to true if valid, false otherwise
582
+ */
583
+ validateApiKey?: (apiKey: string, baseUrl?: string) => Promise<boolean>;
584
+ }
585
+ /**
586
+ * Standard export type for scoring provider plugins
587
+ */
588
+ interface ScoringProviderPluginExport {
589
+ /** The scoring provider plugin instance */
590
+ scoringPlugin: ScoringProviderPlugin;
484
591
  }
485
592
 
486
593
  /**
@@ -1493,13 +1600,18 @@ interface SearchProviderPluginExport {
1493
1600
  /**
1494
1601
  * Moderation Provider Plugin types for Quilltap plugin development
1495
1602
  *
1496
- * Defines the interfaces and types needed to create pluggable content
1497
- * moderation backends as Quilltap plugins (e.g., OpenAI moderation endpoint).
1603
+ * @deprecated Use ScoringProviderPlugin from './scoring-provider' instead.
1604
+ * This module is kept for backward compatibility. The moderation-specific
1605
+ * types map directly to the generalized scoring types:
1606
+ *
1607
+ * - ModerationProviderPlugin -> ScoringProviderPlugin
1608
+ * - ModerationResult -> ScoringResult
1609
+ * - ModerationCategoryResult -> CategoryScore
1498
1610
  *
1499
1611
  * @module @quilltap/plugin-types/plugins/moderation-provider
1500
1612
  */
1501
1613
  /**
1502
- * Moderation provider metadata for UI display and identification
1614
+ * @deprecated Use ScoringProviderMetadata instead
1503
1615
  */
1504
1616
  interface ModerationProviderMetadata {
1505
1617
  /** Internal identifier for the moderation provider (e.g., 'OPENAI') */
@@ -1521,7 +1633,7 @@ interface ModerationProviderMetadata {
1521
1633
  };
1522
1634
  }
1523
1635
  /**
1524
- * Configuration requirements for a moderation provider
1636
+ * @deprecated Use ScoringProviderConfigRequirements instead
1525
1637
  */
1526
1638
  interface ModerationProviderConfigRequirements {
1527
1639
  /** Whether this moderation provider requires an API key */
@@ -1534,10 +1646,7 @@ interface ModerationProviderConfigRequirements {
1534
1646
  baseUrlDefault?: string;
1535
1647
  }
1536
1648
  /**
1537
- * A single moderation category result
1538
- *
1539
- * Categories are provider-specific (e.g., OpenAI returns 'hate', 'sexual',
1540
- * 'violence', etc.; other providers may return different categories).
1649
+ * @deprecated Use CategoryScore from providers/scoring instead
1541
1650
  */
1542
1651
  interface ModerationCategoryResult {
1543
1652
  /** Category name as returned by the provider (e.g., 'sexual', 'violence', 'hate') */
@@ -1548,11 +1657,7 @@ interface ModerationCategoryResult {
1548
1657
  score: number;
1549
1658
  }
1550
1659
  /**
1551
- * Result from a moderation provider's content classification
1552
- *
1553
- * This is the generic result type returned by all moderation providers.
1554
- * The categories array contains provider-specific category names and scores.
1555
- * The consuming system (the Concierge) maps these to its own category structure.
1660
+ * @deprecated Use ScoringResult from providers/scoring instead
1556
1661
  */
1557
1662
  interface ModerationResult {
1558
1663
  /** Whether the content was flagged by the moderation provider */
@@ -1561,35 +1666,10 @@ interface ModerationResult {
1561
1666
  categories: ModerationCategoryResult[];
1562
1667
  }
1563
1668
  /**
1564
- * Main Moderation Provider Plugin Interface
1565
- *
1566
- * Plugins implementing this interface provide content moderation backends
1567
- * for Quilltap's Concierge system. The moderation provider is used
1568
- * as an alternative to the Cheap LLM classification approach.
1569
- *
1570
- * @example
1571
- * ```typescript
1572
- * import type { ModerationProviderPlugin } from '@quilltap/plugin-types';
1669
+ * @deprecated Use ScoringProviderPlugin instead.
1573
1670
  *
1574
- * export const moderationPlugin: ModerationProviderPlugin = {
1575
- * metadata: {
1576
- * providerName: 'OPENAI',
1577
- * displayName: 'OpenAI Moderation',
1578
- * description: 'Free content moderation via OpenAI moderation endpoint',
1579
- * abbreviation: 'OAI',
1580
- * colors: { bg: 'bg-green-100', text: 'text-green-800', icon: 'text-green-600' },
1581
- * },
1582
- * config: {
1583
- * requiresApiKey: true,
1584
- * apiKeyLabel: 'OpenAI API Key',
1585
- * requiresBaseUrl: false,
1586
- * },
1587
- * moderate: async (content, apiKey) => {
1588
- * // ... call moderation API ...
1589
- * return { flagged: false, categories: [] };
1590
- * },
1591
- * };
1592
- * ```
1671
+ * Legacy moderation provider plugin interface. New plugins should implement
1672
+ * ScoringProviderPlugin with a ScoringProvider that handles task: 'moderation'.
1593
1673
  */
1594
1674
  interface ModerationProviderPlugin {
1595
1675
  /** Moderation provider metadata for UI display and identification */
@@ -1608,9 +1688,6 @@ interface ModerationProviderPlugin {
1608
1688
  /**
1609
1689
  * Validate an API key for this moderation provider (optional)
1610
1690
  *
1611
- * Should test the API key by making a minimal API call to verify
1612
- * that it is valid and has proper permissions.
1613
- *
1614
1691
  * @param apiKey The API key to validate
1615
1692
  * @param baseUrl Optional base URL for the moderation API
1616
1693
  * @returns Promise resolving to true if valid, false otherwise
@@ -1618,11 +1695,11 @@ interface ModerationProviderPlugin {
1618
1695
  validateApiKey?: (apiKey: string, baseUrl?: string) => Promise<boolean>;
1619
1696
  }
1620
1697
  /**
1621
- * Standard export type for moderation provider plugins
1698
+ * @deprecated Use ScoringProviderPluginExport instead
1622
1699
  */
1623
1700
  interface ModerationProviderPluginExport {
1624
1701
  /** The moderation provider plugin instance */
1625
1702
  moderationPlugin: ModerationProviderPlugin;
1626
1703
  }
1627
1704
 
1628
- export type { AnnotationButton as $, AttachmentSupport as A, RoleplayTemplateMetadata as B, CheapModelConfig as C, RoleplayTemplatePlugin as D, Effects as E, FontDefinition as F, RoleplayTemplatePluginExport as G, SearchProviderConfig as H, IconProps as I, SearchProviderConfigRequirements as J, SearchProviderMetadata as K, LLMProviderPlugin as L, MessageFormatSupport as M, SearchProviderPlugin as N, SearchProviderPluginExport as O, PluginAuthor as P, SearchResult as Q, RoleplayTemplateConfig as R, SearchOutput as S, Spacing as T, SubsystemOverrides as U, ThemeMetadata as V, ThemePlugin as W, ThemePluginExport as X, ThemeTokens as Y, ToolFormatType as Z, Typography as _, ColorPalette as a, DialogueDetection as a0, ModerationProviderConfig as a1, RenderingPattern as a2, EmbeddedFont as b, EmbeddingModelInfo as c, ImageGenerationModelInfo as d, ImageProviderConstraints as e, ImageStyleInfo as f, InstalledPluginInfo as g, ModelInfo as h, ModerationCategoryResult as i, ModerationProviderConfigRequirements as j, ModerationProviderMetadata as k, ModerationProviderPlugin as l, ModerationProviderPluginExport as m, ModerationResult as n, PluginCapability as o, PluginCategory as p, PluginCompatibility as q, PluginIconData as r, PluginManifest as s, PluginPermissions as t, PluginStatus as u, ProviderCapabilities as v, ProviderConfig as w, ProviderConfigRequirements as x, ProviderMetadata as y, ProviderPluginExport as z };
1705
+ export type { ThemePlugin as $, AttachmentSupport as A, RoleplayTemplateMetadata as B, CheapModelConfig as C, RoleplayTemplatePlugin as D, Effects as E, FontDefinition as F, RoleplayTemplatePluginExport as G, ScoringProviderMetadata as H, IconProps as I, ScoringProviderPlugin as J, ScoringProviderPluginExport as K, LLMProviderPlugin as L, MessageFormatSupport as M, SearchOutput as N, SearchProviderConfig as O, PluginAuthor as P, SearchProviderConfigRequirements as Q, RoleplayTemplateConfig as R, ScoringProviderConfigRequirements as S, SearchProviderMetadata as T, SearchProviderPlugin as U, SearchProviderPluginExport as V, SearchResult as W, Spacing as X, SubsystemOverrides as Y, TextProviderPlugin as Z, ThemeMetadata as _, ColorPalette as a, ThemePluginExport as a0, ThemeTokens as a1, ToolFormatType as a2, Typography as a3, AnnotationButton as a4, DialogueDetection as a5, ModerationProviderConfig as a6, RenderingPattern as a7, EmbeddedFont as b, EmbeddingModelInfo as c, ImageGenerationModelInfo as d, ImageProviderConstraints as e, ImageStyleInfo as f, InstalledPluginInfo as g, ModelInfo as h, ModerationCategoryResult as i, ModerationProviderConfigRequirements as j, ModerationProviderMetadata as k, ModerationProviderPlugin as l, ModerationProviderPluginExport as m, ModerationResult as n, PluginCapability as o, PluginCategory as p, PluginCompatibility as q, PluginIconData as r, PluginManifest as s, PluginPermissions as t, PluginStatus as u, ProviderCapabilities as v, ProviderConfig as w, ProviderConfigRequirements as x, ProviderMetadata as y, ProviderPluginExport as z };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { UniversalTool } from './llm/index.mjs';
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, 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-QQUNtK0j.mjs';
2
+ export { AnthropicToolDefinition, AttachmentResults, CacheUsage, EmbeddingOptions, EmbeddingProvider, EmbeddingResult, FileAttachment, GeneratedImage, GoogleToolDefinition, ImageGenParams, ImageGenProvider, ImageGenResponse, ImageGenProvider as ImageProvider, JSONSchemaDefinition, LLMMessage, LLMParams, LLMProvider, LLMResponse, LocalEmbeddingProvider, LocalEmbeddingProviderState, ModelMetadata, ModelWarning, ModelWarningLevel, OpenAIToolDefinition, ResponseFormat, StreamChunk, LLMProvider as TextProvider, TokenUsage, ToolCall, ToolCallRequest, ToolFormatOptions, ToolResult, isLocalEmbeddingProvider } from './llm/index.mjs';
3
+ export { CategoryScore, ScoringInput, ScoringProvider, ScoringResult, ScoringTask } from './providers/index.mjs';
4
+ 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 ScoringProviderConfigRequirements, H as ScoringProviderMetadata, J as ScoringProviderPlugin, K as ScoringProviderPluginExport, N as SearchOutput, O as SearchProviderConfig, Q as SearchProviderConfigRequirements, T as SearchProviderMetadata, U as SearchProviderPlugin, V as SearchProviderPluginExport, W as SearchResult, X as Spacing, Y as SubsystemOverrides, Z as TextProviderPlugin, _ as ThemeMetadata, $ as ThemePlugin, a0 as ThemePluginExport, a1 as ThemeTokens, a2 as ToolFormatType, a3 as Typography } from './index-DtW7izgw.mjs';
4
5
  export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.mjs';
5
6
 
6
7
  /**
@@ -370,6 +371,6 @@ interface ToolPluginExport {
370
371
  * Version of the plugin-types package.
371
372
  * Can be used at runtime to check compatibility.
372
373
  */
373
- declare const PLUGIN_TYPES_VERSION = "1.18.0";
374
+ declare const PLUGIN_TYPES_VERSION = "2.0.0";
374
375
 
375
376
  export { PLUGIN_TYPES_VERSION, type SystemPromptData, type SystemPromptMetadata, type SystemPromptPlugin, type SystemPromptPluginExport, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { UniversalTool } from './llm/index.js';
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, 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-FCJXfnL_.js';
2
+ export { AnthropicToolDefinition, AttachmentResults, CacheUsage, EmbeddingOptions, EmbeddingProvider, EmbeddingResult, FileAttachment, GeneratedImage, GoogleToolDefinition, ImageGenParams, ImageGenProvider, ImageGenResponse, ImageGenProvider as ImageProvider, JSONSchemaDefinition, LLMMessage, LLMParams, LLMProvider, LLMResponse, LocalEmbeddingProvider, LocalEmbeddingProviderState, ModelMetadata, ModelWarning, ModelWarningLevel, OpenAIToolDefinition, ResponseFormat, StreamChunk, LLMProvider as TextProvider, TokenUsage, ToolCall, ToolCallRequest, ToolFormatOptions, ToolResult, isLocalEmbeddingProvider } from './llm/index.js';
3
+ export { CategoryScore, ScoringInput, ScoringProvider, ScoringResult, ScoringTask } from './providers/index.js';
4
+ 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 ScoringProviderConfigRequirements, H as ScoringProviderMetadata, J as ScoringProviderPlugin, K as ScoringProviderPluginExport, N as SearchOutput, O as SearchProviderConfig, Q as SearchProviderConfigRequirements, T as SearchProviderMetadata, U as SearchProviderPlugin, V as SearchProviderPluginExport, W as SearchResult, X as Spacing, Y as SubsystemOverrides, Z as TextProviderPlugin, _ as ThemeMetadata, $ as ThemePlugin, a0 as ThemePluginExport, a1 as ThemeTokens, a2 as ToolFormatType, a3 as Typography } from './index-BXJLgAuZ.js';
4
5
  export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.js';
5
6
 
6
7
  /**
@@ -370,6 +371,6 @@ interface ToolPluginExport {
370
371
  * Version of the plugin-types package.
371
372
  * Can be used at runtime to check compatibility.
372
373
  */
373
- declare const PLUGIN_TYPES_VERSION = "1.18.0";
374
+ declare const PLUGIN_TYPES_VERSION = "2.0.0";
374
375
 
375
376
  export { PLUGIN_TYPES_VERSION, type SystemPromptData, type SystemPromptMetadata, type SystemPromptPlugin, type SystemPromptPluginExport, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };