@quilltap/plugin-types 2.1.0 → 2.2.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/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.2.0] - 2026-04-09
9
+
10
+ ### Removed
11
+
12
+ - **Breaking:** Removed `ROLEPLAY_TEMPLATE` from `PluginCapability` type — roleplay templates are now native first-class entities in Quilltap v4.2.0
13
+ - Removed roleplay template type re-exports from `@quilltap/plugin-types/plugins` barrel
14
+ - Types in `./plugins/roleplay-template` are preserved but deprecated — import directly if backward compat is needed
15
+
8
16
  ## [1.15.1] - 2026-02-23
9
17
 
10
18
  ### Removed
package/README.md CHANGED
@@ -143,9 +143,6 @@ logger.error('Failed to connect', { endpoint: 'api.example.com' }, error);
143
143
  | `SystemPromptPlugin` | System prompt plugin interface |
144
144
  | `SystemPromptData` | Individual prompt entry |
145
145
  | `SystemPromptMetadata` | System prompt plugin metadata |
146
- | `RoleplayTemplatePlugin` | Roleplay template plugin interface |
147
- | `RoleplayTemplateConfig` | Roleplay template configuration |
148
-
149
146
  ### Common Types
150
147
 
151
148
  | Type | Description |
@@ -598,7 +598,7 @@ interface ScoringProviderPluginExport {
598
598
  /**
599
599
  * Plugin capability types
600
600
  */
601
- type PluginCapability = 'LLM_PROVIDER' | 'AUTH_PROVIDER' | 'THEME' | 'ROLEPLAY_TEMPLATE' | 'TOOL_PROVIDER' | 'SEARCH_PROVIDER' | 'MODERATION_PROVIDER' | 'SYSTEM_PROMPT' | 'UTILITY';
601
+ type PluginCapability = 'LLM_PROVIDER' | 'AUTH_PROVIDER' | 'THEME' | 'TOOL_PROVIDER' | 'SEARCH_PROVIDER' | 'MODERATION_PROVIDER' | 'SYSTEM_PROMPT' | 'UTILITY';
602
602
  /**
603
603
  * Plugin category
604
604
  */
@@ -1196,282 +1196,6 @@ interface ThemePluginExport {
1196
1196
  plugin: ThemePlugin;
1197
1197
  }
1198
1198
 
1199
- /**
1200
- * Roleplay Template Plugin Interface types for Quilltap plugin development
1201
- *
1202
- * @module @quilltap/plugin-types/plugins/roleplay-template
1203
- */
1204
- /**
1205
- * Configuration for an annotation button in the formatting toolbar.
1206
- *
1207
- * Annotation buttons allow users to insert roleplay formatting
1208
- * (e.g., narration brackets, OOC markers) with a single click.
1209
- */
1210
- interface AnnotationButton {
1211
- /** Full name displayed in tooltip (e.g., "Narration", "Internal Monologue") */
1212
- label: string;
1213
- /** Abbreviated label displayed on button (e.g., "Nar", "Int", "OOC") */
1214
- abbrev: string;
1215
- /** Opening delimiter (e.g., "[", "*", "{{") */
1216
- prefix: string;
1217
- /** Closing delimiter (e.g., "]", "*", "}}") - empty string for line-end delimiters */
1218
- suffix: string;
1219
- }
1220
- /**
1221
- * A pattern for styling roleplay text in message content.
1222
- *
1223
- * Rendering patterns define how to match and style specific text patterns
1224
- * in AI responses (e.g., narration, OOC comments, internal monologue).
1225
- *
1226
- * @example
1227
- * ```typescript
1228
- * // Match *narration* with single asterisks
1229
- * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' }
1230
- *
1231
- * // Match ((OOC comments)) with double parentheses
1232
- * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' }
1233
- *
1234
- * // Match // OOC at start of line (multiline mode)
1235
- * { pattern: '^// .+$', className: 'qt-chat-ooc', flags: 'm' }
1236
- * ```
1237
- */
1238
- interface RenderingPattern {
1239
- /** Regex pattern as a string (converted to RegExp at runtime) */
1240
- pattern: string;
1241
- /**
1242
- * CSS class to apply to matched text.
1243
- * Standard classes: qt-chat-dialogue, qt-chat-narration, qt-chat-ooc, qt-chat-inner-monologue
1244
- */
1245
- className: string;
1246
- /** Optional regex flags (e.g., 'm' for multiline). Default: none */
1247
- flags?: string;
1248
- }
1249
- /**
1250
- * Configuration for detecting dialogue at the paragraph level.
1251
- *
1252
- * When dialogue contains markdown formatting (like **bold**), the text gets split
1253
- * into multiple children and inline regex patterns can't match. Paragraph-level
1254
- * detection checks if the entire paragraph starts and ends with quote characters.
1255
- *
1256
- * @example
1257
- * ```typescript
1258
- * // Standard dialogue with straight and curly quotes
1259
- * {
1260
- * openingChars: ['"', '"'],
1261
- * closingChars: ['"', '"'],
1262
- * className: 'qt-chat-dialogue'
1263
- * }
1264
- * ```
1265
- */
1266
- interface DialogueDetection {
1267
- /** Opening quote characters to detect (e.g., ['"', '"']) */
1268
- openingChars: string[];
1269
- /** Closing quote characters to detect (e.g., ['"', '"']) */
1270
- closingChars: string[];
1271
- /** CSS class to apply to dialogue paragraphs */
1272
- className: string;
1273
- }
1274
- /**
1275
- * Narration delimiters define how narration/action text is marked in roleplay output.
1276
- * Required for all roleplay templates.
1277
- *
1278
- * - A single string means the same character is used for opening and closing (e.g., '*')
1279
- * - A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']'])
1280
- *
1281
- * @example
1282
- * ```typescript
1283
- * // Single asterisk for both open and close
1284
- * narrationDelimiters: '*'
1285
- *
1286
- * // Square brackets with different open/close
1287
- * narrationDelimiters: ['[', ']']
1288
- * ```
1289
- */
1290
- type NarrationDelimiters = string | [string, string];
1291
- /**
1292
- * Configuration for a single roleplay template
1293
- *
1294
- * A roleplay template defines a formatting protocol for AI responses,
1295
- * such as how dialogue, actions, thoughts, and OOC comments should be formatted.
1296
- */
1297
- interface RoleplayTemplateConfig {
1298
- /** Display name for the template */
1299
- name: string;
1300
- /** Optional description explaining the template's formatting style */
1301
- description?: string;
1302
- /**
1303
- * The system prompt that defines the formatting rules.
1304
- * This is prepended to character system prompts when the template is active.
1305
- */
1306
- systemPrompt: string;
1307
- /** Tags for categorization and searchability */
1308
- tags?: string[];
1309
- /**
1310
- * Annotation buttons for the formatting toolbar.
1311
- * Defines which formatting options are available when document editing mode is enabled.
1312
- *
1313
- * @example
1314
- * ```typescript
1315
- * annotationButtons: [
1316
- * { label: 'Narration', abbrev: 'Nar', prefix: '[', suffix: ']' },
1317
- * { label: 'Internal Monologue', abbrev: 'Int', prefix: '{', suffix: '}' },
1318
- * { label: 'Out of Character', abbrev: 'OOC', prefix: '// ', suffix: '' },
1319
- * ]
1320
- * ```
1321
- */
1322
- annotationButtons?: AnnotationButton[];
1323
- /**
1324
- * Patterns for styling roleplay text in message content.
1325
- * These patterns are matched against text nodes and wrapped in styled spans.
1326
- *
1327
- * @example
1328
- * ```typescript
1329
- * renderingPatterns: [
1330
- * // Match *narration* with single asterisks
1331
- * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' },
1332
- * // Match ((OOC)) with double parentheses
1333
- * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' },
1334
- * ]
1335
- * ```
1336
- */
1337
- renderingPatterns?: RenderingPattern[];
1338
- /**
1339
- * Optional dialogue detection for paragraph-level styling.
1340
- * When dialogue contains markdown formatting, inline patterns can't match.
1341
- * This detects paragraphs that start/end with quote characters.
1342
- *
1343
- * @example
1344
- * ```typescript
1345
- * dialogueDetection: {
1346
- * openingChars: ['"', '"'],
1347
- * closingChars: ['"', '"'],
1348
- * className: 'qt-chat-dialogue'
1349
- * }
1350
- * ```
1351
- */
1352
- dialogueDetection?: DialogueDetection;
1353
- /**
1354
- * Narration delimiters — required for all templates.
1355
- * Defines how narration/action text is delimited in the template's formatting.
1356
- *
1357
- * A single string means the same delimiter is used for opening and closing (e.g., '*').
1358
- * A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']']).
1359
- *
1360
- * @example
1361
- * ```typescript
1362
- * // Standard: *narration*
1363
- * narrationDelimiters: '*'
1364
- *
1365
- * // Quilltap RP: [narration]
1366
- * narrationDelimiters: ['[', ']']
1367
- * ```
1368
- */
1369
- narrationDelimiters: NarrationDelimiters;
1370
- }
1371
- /**
1372
- * Metadata for a roleplay template plugin
1373
- */
1374
- interface RoleplayTemplateMetadata {
1375
- /**
1376
- * Unique template identifier (lowercase, hyphens allowed)
1377
- * This is typically derived from the plugin name
1378
- */
1379
- templateId: string;
1380
- /** Human-readable display name */
1381
- displayName: string;
1382
- /** Template description */
1383
- description?: string;
1384
- /** Template author */
1385
- author?: string | {
1386
- name: string;
1387
- email?: string;
1388
- url?: string;
1389
- };
1390
- /** Template tags for categorization */
1391
- tags?: string[];
1392
- /** Template version */
1393
- version?: string;
1394
- }
1395
- /**
1396
- * Main Roleplay Template Plugin Interface
1397
- *
1398
- * Plugins implementing this interface can be dynamically loaded
1399
- * by Quilltap to provide custom roleplay formatting templates.
1400
- *
1401
- * A plugin can provide one or more templates. Each template defines
1402
- * a unique formatting protocol for AI responses.
1403
- *
1404
- * @example
1405
- * ```typescript
1406
- * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
1407
- *
1408
- * export const plugin: RoleplayTemplatePlugin = {
1409
- * metadata: {
1410
- * templateId: 'my-rp-format',
1411
- * displayName: 'My RP Format',
1412
- * description: 'A custom roleplay formatting style',
1413
- * tags: ['custom', 'roleplay'],
1414
- * },
1415
- * templates: [
1416
- * {
1417
- * name: 'My RP Format',
1418
- * description: 'Custom formatting with specific syntax',
1419
- * systemPrompt: `[FORMATTING INSTRUCTIONS]
1420
- * 1. Dialogue: Use quotation marks
1421
- * 2. Actions: Use asterisks *like this*
1422
- * ...`,
1423
- * tags: ['custom'],
1424
- * },
1425
- * ],
1426
- * };
1427
- * ```
1428
- *
1429
- * @example
1430
- * ```typescript
1431
- * // Plugin with multiple templates
1432
- * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
1433
- *
1434
- * export const plugin: RoleplayTemplatePlugin = {
1435
- * metadata: {
1436
- * templateId: 'format-pack',
1437
- * displayName: 'RP Format Pack',
1438
- * description: 'A collection of roleplay formats',
1439
- * },
1440
- * templates: [
1441
- * {
1442
- * name: 'Screenplay',
1443
- * systemPrompt: '...',
1444
- * },
1445
- * {
1446
- * name: 'Novel',
1447
- * systemPrompt: '...',
1448
- * },
1449
- * ],
1450
- * };
1451
- * ```
1452
- */
1453
- interface RoleplayTemplatePlugin {
1454
- /** Plugin metadata for UI display and identification */
1455
- metadata: RoleplayTemplateMetadata;
1456
- /**
1457
- * One or more roleplay templates provided by this plugin.
1458
- * Each template has its own name, description, and system prompt.
1459
- */
1460
- templates: RoleplayTemplateConfig[];
1461
- /**
1462
- * Optional initialization function
1463
- * Called when the plugin is loaded
1464
- */
1465
- initialize?: () => void | Promise<void>;
1466
- }
1467
- /**
1468
- * Standard export type for roleplay template plugins
1469
- */
1470
- interface RoleplayTemplatePluginExport {
1471
- /** The roleplay template plugin instance */
1472
- plugin: RoleplayTemplatePlugin;
1473
- }
1474
-
1475
1199
  /**
1476
1200
  * Search Provider Plugin types for Quilltap plugin development
1477
1201
  *
@@ -1736,4 +1460,4 @@ interface ModerationProviderPluginExport {
1736
1460
  moderationPlugin: ModerationProviderPlugin;
1737
1461
  }
1738
1462
 
1739
- export type { ThemeMetadata 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, NarrationDelimiters as N, SearchOutput as O, PluginAuthor as P, SearchProviderConfig as Q, RoleplayTemplateConfig as R, ScoringProviderConfigRequirements as S, SearchProviderConfigRequirements as T, SearchProviderMetadata as U, SearchProviderPlugin as V, SearchProviderPluginExport as W, SearchResult as X, Spacing as Y, SubsystemOverrides as Z, TextProviderPlugin as _, ColorPalette as a, ThemePlugin as a0, ThemePluginExport as a1, ThemeTokens as a2, ToolFormatType as a3, Typography as a4, AnnotationButton as a5, DialogueDetection as a6, ModerationProviderConfig as a7, RenderingPattern as a8, 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 };
1463
+ export type { Typography as $, AttachmentSupport as A, ScoringProviderMetadata as B, CheapModelConfig as C, ScoringProviderPlugin as D, Effects as E, FontDefinition as F, ScoringProviderPluginExport as G, SearchOutput as H, IconProps as I, SearchProviderConfig as J, SearchProviderConfigRequirements as K, LLMProviderPlugin as L, MessageFormatSupport as M, SearchProviderMetadata as N, SearchProviderPlugin as O, PluginAuthor as P, SearchProviderPluginExport as Q, SearchResult as R, ScoringProviderConfigRequirements as S, Spacing as T, SubsystemOverrides as U, TextProviderPlugin as V, ThemeMetadata as W, ThemePlugin as X, ThemePluginExport as Y, ThemeTokens as Z, ToolFormatType as _, ColorPalette as a, ModerationProviderConfig as a0, 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 };
@@ -598,7 +598,7 @@ interface ScoringProviderPluginExport {
598
598
  /**
599
599
  * Plugin capability types
600
600
  */
601
- type PluginCapability = 'LLM_PROVIDER' | 'AUTH_PROVIDER' | 'THEME' | 'ROLEPLAY_TEMPLATE' | 'TOOL_PROVIDER' | 'SEARCH_PROVIDER' | 'MODERATION_PROVIDER' | 'SYSTEM_PROMPT' | 'UTILITY';
601
+ type PluginCapability = 'LLM_PROVIDER' | 'AUTH_PROVIDER' | 'THEME' | 'TOOL_PROVIDER' | 'SEARCH_PROVIDER' | 'MODERATION_PROVIDER' | 'SYSTEM_PROMPT' | 'UTILITY';
602
602
  /**
603
603
  * Plugin category
604
604
  */
@@ -1196,282 +1196,6 @@ interface ThemePluginExport {
1196
1196
  plugin: ThemePlugin;
1197
1197
  }
1198
1198
 
1199
- /**
1200
- * Roleplay Template Plugin Interface types for Quilltap plugin development
1201
- *
1202
- * @module @quilltap/plugin-types/plugins/roleplay-template
1203
- */
1204
- /**
1205
- * Configuration for an annotation button in the formatting toolbar.
1206
- *
1207
- * Annotation buttons allow users to insert roleplay formatting
1208
- * (e.g., narration brackets, OOC markers) with a single click.
1209
- */
1210
- interface AnnotationButton {
1211
- /** Full name displayed in tooltip (e.g., "Narration", "Internal Monologue") */
1212
- label: string;
1213
- /** Abbreviated label displayed on button (e.g., "Nar", "Int", "OOC") */
1214
- abbrev: string;
1215
- /** Opening delimiter (e.g., "[", "*", "{{") */
1216
- prefix: string;
1217
- /** Closing delimiter (e.g., "]", "*", "}}") - empty string for line-end delimiters */
1218
- suffix: string;
1219
- }
1220
- /**
1221
- * A pattern for styling roleplay text in message content.
1222
- *
1223
- * Rendering patterns define how to match and style specific text patterns
1224
- * in AI responses (e.g., narration, OOC comments, internal monologue).
1225
- *
1226
- * @example
1227
- * ```typescript
1228
- * // Match *narration* with single asterisks
1229
- * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' }
1230
- *
1231
- * // Match ((OOC comments)) with double parentheses
1232
- * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' }
1233
- *
1234
- * // Match // OOC at start of line (multiline mode)
1235
- * { pattern: '^// .+$', className: 'qt-chat-ooc', flags: 'm' }
1236
- * ```
1237
- */
1238
- interface RenderingPattern {
1239
- /** Regex pattern as a string (converted to RegExp at runtime) */
1240
- pattern: string;
1241
- /**
1242
- * CSS class to apply to matched text.
1243
- * Standard classes: qt-chat-dialogue, qt-chat-narration, qt-chat-ooc, qt-chat-inner-monologue
1244
- */
1245
- className: string;
1246
- /** Optional regex flags (e.g., 'm' for multiline). Default: none */
1247
- flags?: string;
1248
- }
1249
- /**
1250
- * Configuration for detecting dialogue at the paragraph level.
1251
- *
1252
- * When dialogue contains markdown formatting (like **bold**), the text gets split
1253
- * into multiple children and inline regex patterns can't match. Paragraph-level
1254
- * detection checks if the entire paragraph starts and ends with quote characters.
1255
- *
1256
- * @example
1257
- * ```typescript
1258
- * // Standard dialogue with straight and curly quotes
1259
- * {
1260
- * openingChars: ['"', '"'],
1261
- * closingChars: ['"', '"'],
1262
- * className: 'qt-chat-dialogue'
1263
- * }
1264
- * ```
1265
- */
1266
- interface DialogueDetection {
1267
- /** Opening quote characters to detect (e.g., ['"', '"']) */
1268
- openingChars: string[];
1269
- /** Closing quote characters to detect (e.g., ['"', '"']) */
1270
- closingChars: string[];
1271
- /** CSS class to apply to dialogue paragraphs */
1272
- className: string;
1273
- }
1274
- /**
1275
- * Narration delimiters define how narration/action text is marked in roleplay output.
1276
- * Required for all roleplay templates.
1277
- *
1278
- * - A single string means the same character is used for opening and closing (e.g., '*')
1279
- * - A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']'])
1280
- *
1281
- * @example
1282
- * ```typescript
1283
- * // Single asterisk for both open and close
1284
- * narrationDelimiters: '*'
1285
- *
1286
- * // Square brackets with different open/close
1287
- * narrationDelimiters: ['[', ']']
1288
- * ```
1289
- */
1290
- type NarrationDelimiters = string | [string, string];
1291
- /**
1292
- * Configuration for a single roleplay template
1293
- *
1294
- * A roleplay template defines a formatting protocol for AI responses,
1295
- * such as how dialogue, actions, thoughts, and OOC comments should be formatted.
1296
- */
1297
- interface RoleplayTemplateConfig {
1298
- /** Display name for the template */
1299
- name: string;
1300
- /** Optional description explaining the template's formatting style */
1301
- description?: string;
1302
- /**
1303
- * The system prompt that defines the formatting rules.
1304
- * This is prepended to character system prompts when the template is active.
1305
- */
1306
- systemPrompt: string;
1307
- /** Tags for categorization and searchability */
1308
- tags?: string[];
1309
- /**
1310
- * Annotation buttons for the formatting toolbar.
1311
- * Defines which formatting options are available when document editing mode is enabled.
1312
- *
1313
- * @example
1314
- * ```typescript
1315
- * annotationButtons: [
1316
- * { label: 'Narration', abbrev: 'Nar', prefix: '[', suffix: ']' },
1317
- * { label: 'Internal Monologue', abbrev: 'Int', prefix: '{', suffix: '}' },
1318
- * { label: 'Out of Character', abbrev: 'OOC', prefix: '// ', suffix: '' },
1319
- * ]
1320
- * ```
1321
- */
1322
- annotationButtons?: AnnotationButton[];
1323
- /**
1324
- * Patterns for styling roleplay text in message content.
1325
- * These patterns are matched against text nodes and wrapped in styled spans.
1326
- *
1327
- * @example
1328
- * ```typescript
1329
- * renderingPatterns: [
1330
- * // Match *narration* with single asterisks
1331
- * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' },
1332
- * // Match ((OOC)) with double parentheses
1333
- * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' },
1334
- * ]
1335
- * ```
1336
- */
1337
- renderingPatterns?: RenderingPattern[];
1338
- /**
1339
- * Optional dialogue detection for paragraph-level styling.
1340
- * When dialogue contains markdown formatting, inline patterns can't match.
1341
- * This detects paragraphs that start/end with quote characters.
1342
- *
1343
- * @example
1344
- * ```typescript
1345
- * dialogueDetection: {
1346
- * openingChars: ['"', '"'],
1347
- * closingChars: ['"', '"'],
1348
- * className: 'qt-chat-dialogue'
1349
- * }
1350
- * ```
1351
- */
1352
- dialogueDetection?: DialogueDetection;
1353
- /**
1354
- * Narration delimiters — required for all templates.
1355
- * Defines how narration/action text is delimited in the template's formatting.
1356
- *
1357
- * A single string means the same delimiter is used for opening and closing (e.g., '*').
1358
- * A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']']).
1359
- *
1360
- * @example
1361
- * ```typescript
1362
- * // Standard: *narration*
1363
- * narrationDelimiters: '*'
1364
- *
1365
- * // Quilltap RP: [narration]
1366
- * narrationDelimiters: ['[', ']']
1367
- * ```
1368
- */
1369
- narrationDelimiters: NarrationDelimiters;
1370
- }
1371
- /**
1372
- * Metadata for a roleplay template plugin
1373
- */
1374
- interface RoleplayTemplateMetadata {
1375
- /**
1376
- * Unique template identifier (lowercase, hyphens allowed)
1377
- * This is typically derived from the plugin name
1378
- */
1379
- templateId: string;
1380
- /** Human-readable display name */
1381
- displayName: string;
1382
- /** Template description */
1383
- description?: string;
1384
- /** Template author */
1385
- author?: string | {
1386
- name: string;
1387
- email?: string;
1388
- url?: string;
1389
- };
1390
- /** Template tags for categorization */
1391
- tags?: string[];
1392
- /** Template version */
1393
- version?: string;
1394
- }
1395
- /**
1396
- * Main Roleplay Template Plugin Interface
1397
- *
1398
- * Plugins implementing this interface can be dynamically loaded
1399
- * by Quilltap to provide custom roleplay formatting templates.
1400
- *
1401
- * A plugin can provide one or more templates. Each template defines
1402
- * a unique formatting protocol for AI responses.
1403
- *
1404
- * @example
1405
- * ```typescript
1406
- * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
1407
- *
1408
- * export const plugin: RoleplayTemplatePlugin = {
1409
- * metadata: {
1410
- * templateId: 'my-rp-format',
1411
- * displayName: 'My RP Format',
1412
- * description: 'A custom roleplay formatting style',
1413
- * tags: ['custom', 'roleplay'],
1414
- * },
1415
- * templates: [
1416
- * {
1417
- * name: 'My RP Format',
1418
- * description: 'Custom formatting with specific syntax',
1419
- * systemPrompt: `[FORMATTING INSTRUCTIONS]
1420
- * 1. Dialogue: Use quotation marks
1421
- * 2. Actions: Use asterisks *like this*
1422
- * ...`,
1423
- * tags: ['custom'],
1424
- * },
1425
- * ],
1426
- * };
1427
- * ```
1428
- *
1429
- * @example
1430
- * ```typescript
1431
- * // Plugin with multiple templates
1432
- * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
1433
- *
1434
- * export const plugin: RoleplayTemplatePlugin = {
1435
- * metadata: {
1436
- * templateId: 'format-pack',
1437
- * displayName: 'RP Format Pack',
1438
- * description: 'A collection of roleplay formats',
1439
- * },
1440
- * templates: [
1441
- * {
1442
- * name: 'Screenplay',
1443
- * systemPrompt: '...',
1444
- * },
1445
- * {
1446
- * name: 'Novel',
1447
- * systemPrompt: '...',
1448
- * },
1449
- * ],
1450
- * };
1451
- * ```
1452
- */
1453
- interface RoleplayTemplatePlugin {
1454
- /** Plugin metadata for UI display and identification */
1455
- metadata: RoleplayTemplateMetadata;
1456
- /**
1457
- * One or more roleplay templates provided by this plugin.
1458
- * Each template has its own name, description, and system prompt.
1459
- */
1460
- templates: RoleplayTemplateConfig[];
1461
- /**
1462
- * Optional initialization function
1463
- * Called when the plugin is loaded
1464
- */
1465
- initialize?: () => void | Promise<void>;
1466
- }
1467
- /**
1468
- * Standard export type for roleplay template plugins
1469
- */
1470
- interface RoleplayTemplatePluginExport {
1471
- /** The roleplay template plugin instance */
1472
- plugin: RoleplayTemplatePlugin;
1473
- }
1474
-
1475
1199
  /**
1476
1200
  * Search Provider Plugin types for Quilltap plugin development
1477
1201
  *
@@ -1736,4 +1460,4 @@ interface ModerationProviderPluginExport {
1736
1460
  moderationPlugin: ModerationProviderPlugin;
1737
1461
  }
1738
1462
 
1739
- export type { ThemeMetadata 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, NarrationDelimiters as N, SearchOutput as O, PluginAuthor as P, SearchProviderConfig as Q, RoleplayTemplateConfig as R, ScoringProviderConfigRequirements as S, SearchProviderConfigRequirements as T, SearchProviderMetadata as U, SearchProviderPlugin as V, SearchProviderPluginExport as W, SearchResult as X, Spacing as Y, SubsystemOverrides as Z, TextProviderPlugin as _, ColorPalette as a, ThemePlugin as a0, ThemePluginExport as a1, ThemeTokens as a2, ToolFormatType as a3, Typography as a4, AnnotationButton as a5, DialogueDetection as a6, ModerationProviderConfig as a7, RenderingPattern as a8, 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 };
1463
+ export type { Typography as $, AttachmentSupport as A, ScoringProviderMetadata as B, CheapModelConfig as C, ScoringProviderPlugin as D, Effects as E, FontDefinition as F, ScoringProviderPluginExport as G, SearchOutput as H, IconProps as I, SearchProviderConfig as J, SearchProviderConfigRequirements as K, LLMProviderPlugin as L, MessageFormatSupport as M, SearchProviderMetadata as N, SearchProviderPlugin as O, PluginAuthor as P, SearchProviderPluginExport as Q, SearchResult as R, ScoringProviderConfigRequirements as S, Spacing as T, SubsystemOverrides as U, TextProviderPlugin as V, ThemeMetadata as W, ThemePlugin as X, ThemePluginExport as Y, ThemeTokens as Z, ToolFormatType as _, ColorPalette as a, ModerationProviderConfig as a0, 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,9 +1,290 @@
1
1
  import { UniversalTool } from './llm/index.mjs';
2
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
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, N as NarrationDelimiters, 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, O as SearchOutput, Q as SearchProviderConfig, T as SearchProviderConfigRequirements, U as SearchProviderMetadata, V as SearchProviderPlugin, W as SearchProviderPluginExport, X as SearchResult, Y as Spacing, Z as SubsystemOverrides, _ as TextProviderPlugin, $ as ThemeMetadata, a0 as ThemePlugin, a1 as ThemePluginExport, a2 as ThemeTokens, a3 as ToolFormatType, a4 as Typography } from './index-BcrOjfYG.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, S as ScoringProviderConfigRequirements, B as ScoringProviderMetadata, D as ScoringProviderPlugin, G as ScoringProviderPluginExport, H as SearchOutput, J as SearchProviderConfig, K as SearchProviderConfigRequirements, N as SearchProviderMetadata, O as SearchProviderPlugin, Q as SearchProviderPluginExport, R as SearchResult, T as Spacing, U as SubsystemOverrides, V as TextProviderPlugin, W as ThemeMetadata, X as ThemePlugin, Y as ThemePluginExport, Z as ThemeTokens, _ as ToolFormatType, $ as Typography } from './index-BiFtkKWr.mjs';
5
5
  export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.mjs';
6
6
 
7
+ /**
8
+ * Roleplay Template Plugin Interface types for Quilltap plugin development
9
+ *
10
+ * @deprecated The ROLEPLAY_TEMPLATE plugin capability was removed in Quilltap v4.2.0.
11
+ * Roleplay templates are now native first-class entities managed through the Settings UI.
12
+ * These types are preserved for backward compatibility with existing third-party plugins
13
+ * but will be removed in a future major version.
14
+ *
15
+ * @module @quilltap/plugin-types/plugins/roleplay-template
16
+ */
17
+ /**
18
+ * Configuration for an annotation button in the formatting toolbar.
19
+ *
20
+ * Annotation buttons allow users to insert roleplay formatting
21
+ * (e.g., narration brackets, OOC markers) with a single click.
22
+ */
23
+ interface AnnotationButton {
24
+ /** Full name displayed in tooltip (e.g., "Narration", "Internal Monologue") */
25
+ label: string;
26
+ /** Abbreviated label displayed on button (e.g., "Nar", "Int", "OOC") */
27
+ abbrev: string;
28
+ /** Opening delimiter (e.g., "[", "*", "{{") */
29
+ prefix: string;
30
+ /** Closing delimiter (e.g., "]", "*", "}}") - empty string for line-end delimiters */
31
+ suffix: string;
32
+ }
33
+ /**
34
+ * A pattern for styling roleplay text in message content.
35
+ *
36
+ * Rendering patterns define how to match and style specific text patterns
37
+ * in AI responses (e.g., narration, OOC comments, internal monologue).
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // Match *narration* with single asterisks
42
+ * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' }
43
+ *
44
+ * // Match ((OOC comments)) with double parentheses
45
+ * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' }
46
+ *
47
+ * // Match // OOC at start of line (multiline mode)
48
+ * { pattern: '^// .+$', className: 'qt-chat-ooc', flags: 'm' }
49
+ * ```
50
+ */
51
+ interface RenderingPattern {
52
+ /** Regex pattern as a string (converted to RegExp at runtime) */
53
+ pattern: string;
54
+ /**
55
+ * CSS class to apply to matched text.
56
+ * Standard classes: qt-chat-dialogue, qt-chat-narration, qt-chat-ooc, qt-chat-inner-monologue
57
+ */
58
+ className: string;
59
+ /** Optional regex flags (e.g., 'm' for multiline). Default: none */
60
+ flags?: string;
61
+ }
62
+ /**
63
+ * Configuration for detecting dialogue at the paragraph level.
64
+ *
65
+ * When dialogue contains markdown formatting (like **bold**), the text gets split
66
+ * into multiple children and inline regex patterns can't match. Paragraph-level
67
+ * detection checks if the entire paragraph starts and ends with quote characters.
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * // Standard dialogue with straight and curly quotes
72
+ * {
73
+ * openingChars: ['"', '"'],
74
+ * closingChars: ['"', '"'],
75
+ * className: 'qt-chat-dialogue'
76
+ * }
77
+ * ```
78
+ */
79
+ interface DialogueDetection {
80
+ /** Opening quote characters to detect (e.g., ['"', '"']) */
81
+ openingChars: string[];
82
+ /** Closing quote characters to detect (e.g., ['"', '"']) */
83
+ closingChars: string[];
84
+ /** CSS class to apply to dialogue paragraphs */
85
+ className: string;
86
+ }
87
+ /**
88
+ * Narration delimiters define how narration/action text is marked in roleplay output.
89
+ * Required for all roleplay templates.
90
+ *
91
+ * - A single string means the same character is used for opening and closing (e.g., '*')
92
+ * - A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']'])
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * // Single asterisk for both open and close
97
+ * narrationDelimiters: '*'
98
+ *
99
+ * // Square brackets with different open/close
100
+ * narrationDelimiters: ['[', ']']
101
+ * ```
102
+ */
103
+ type NarrationDelimiters = string | [string, string];
104
+ /**
105
+ * Configuration for a single roleplay template
106
+ *
107
+ * A roleplay template defines a formatting protocol for AI responses,
108
+ * such as how dialogue, actions, thoughts, and OOC comments should be formatted.
109
+ */
110
+ interface RoleplayTemplateConfig {
111
+ /** Display name for the template */
112
+ name: string;
113
+ /** Optional description explaining the template's formatting style */
114
+ description?: string;
115
+ /**
116
+ * The system prompt that defines the formatting rules.
117
+ * This is prepended to character system prompts when the template is active.
118
+ */
119
+ systemPrompt: string;
120
+ /** Tags for categorization and searchability */
121
+ tags?: string[];
122
+ /**
123
+ * Annotation buttons for the formatting toolbar.
124
+ * Defines which formatting options are available when document editing mode is enabled.
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * annotationButtons: [
129
+ * { label: 'Narration', abbrev: 'Nar', prefix: '[', suffix: ']' },
130
+ * { label: 'Internal Monologue', abbrev: 'Int', prefix: '{', suffix: '}' },
131
+ * { label: 'Out of Character', abbrev: 'OOC', prefix: '// ', suffix: '' },
132
+ * ]
133
+ * ```
134
+ */
135
+ annotationButtons?: AnnotationButton[];
136
+ /**
137
+ * Patterns for styling roleplay text in message content.
138
+ * These patterns are matched against text nodes and wrapped in styled spans.
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * renderingPatterns: [
143
+ * // Match *narration* with single asterisks
144
+ * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' },
145
+ * // Match ((OOC)) with double parentheses
146
+ * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' },
147
+ * ]
148
+ * ```
149
+ */
150
+ renderingPatterns?: RenderingPattern[];
151
+ /**
152
+ * Optional dialogue detection for paragraph-level styling.
153
+ * When dialogue contains markdown formatting, inline patterns can't match.
154
+ * This detects paragraphs that start/end with quote characters.
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * dialogueDetection: {
159
+ * openingChars: ['"', '"'],
160
+ * closingChars: ['"', '"'],
161
+ * className: 'qt-chat-dialogue'
162
+ * }
163
+ * ```
164
+ */
165
+ dialogueDetection?: DialogueDetection;
166
+ /**
167
+ * Narration delimiters — required for all templates.
168
+ * Defines how narration/action text is delimited in the template's formatting.
169
+ *
170
+ * A single string means the same delimiter is used for opening and closing (e.g., '*').
171
+ * A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']']).
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * // Standard: *narration*
176
+ * narrationDelimiters: '*'
177
+ *
178
+ * // Quilltap RP: [narration]
179
+ * narrationDelimiters: ['[', ']']
180
+ * ```
181
+ */
182
+ narrationDelimiters: NarrationDelimiters;
183
+ }
184
+ /**
185
+ * Metadata for a roleplay template plugin
186
+ */
187
+ interface RoleplayTemplateMetadata {
188
+ /**
189
+ * Unique template identifier (lowercase, hyphens allowed)
190
+ * This is typically derived from the plugin name
191
+ */
192
+ templateId: string;
193
+ /** Human-readable display name */
194
+ displayName: string;
195
+ /** Template description */
196
+ description?: string;
197
+ /** Template author */
198
+ author?: string | {
199
+ name: string;
200
+ email?: string;
201
+ url?: string;
202
+ };
203
+ /** Template tags for categorization */
204
+ tags?: string[];
205
+ /** Template version */
206
+ version?: string;
207
+ }
208
+ /**
209
+ * Main Roleplay Template Plugin Interface
210
+ *
211
+ * Plugins implementing this interface can be dynamically loaded
212
+ * by Quilltap to provide custom roleplay formatting templates.
213
+ *
214
+ * A plugin can provide one or more templates. Each template defines
215
+ * a unique formatting protocol for AI responses.
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
220
+ *
221
+ * export const plugin: RoleplayTemplatePlugin = {
222
+ * metadata: {
223
+ * templateId: 'my-rp-format',
224
+ * displayName: 'My RP Format',
225
+ * description: 'A custom roleplay formatting style',
226
+ * tags: ['custom', 'roleplay'],
227
+ * },
228
+ * templates: [
229
+ * {
230
+ * name: 'My RP Format',
231
+ * description: 'Custom formatting with specific syntax',
232
+ * systemPrompt: `[FORMATTING INSTRUCTIONS]
233
+ * 1. Dialogue: Use quotation marks
234
+ * 2. Actions: Use asterisks *like this*
235
+ * ...`,
236
+ * tags: ['custom'],
237
+ * },
238
+ * ],
239
+ * };
240
+ * ```
241
+ *
242
+ * @example
243
+ * ```typescript
244
+ * // Plugin with multiple templates
245
+ * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
246
+ *
247
+ * export const plugin: RoleplayTemplatePlugin = {
248
+ * metadata: {
249
+ * templateId: 'format-pack',
250
+ * displayName: 'RP Format Pack',
251
+ * description: 'A collection of roleplay formats',
252
+ * },
253
+ * templates: [
254
+ * {
255
+ * name: 'Screenplay',
256
+ * systemPrompt: '...',
257
+ * },
258
+ * {
259
+ * name: 'Novel',
260
+ * systemPrompt: '...',
261
+ * },
262
+ * ],
263
+ * };
264
+ * ```
265
+ */
266
+ interface RoleplayTemplatePlugin {
267
+ /** Plugin metadata for UI display and identification */
268
+ metadata: RoleplayTemplateMetadata;
269
+ /**
270
+ * One or more roleplay templates provided by this plugin.
271
+ * Each template has its own name, description, and system prompt.
272
+ */
273
+ templates: RoleplayTemplateConfig[];
274
+ /**
275
+ * Optional initialization function
276
+ * Called when the plugin is loaded
277
+ */
278
+ initialize?: () => void | Promise<void>;
279
+ }
280
+ /**
281
+ * Standard export type for roleplay template plugins
282
+ */
283
+ interface RoleplayTemplatePluginExport {
284
+ /** The roleplay template plugin instance */
285
+ plugin: RoleplayTemplatePlugin;
286
+ }
287
+
7
288
  /**
8
289
  * System Prompt Plugin Interface types for Quilltap plugin development
9
290
  *
@@ -373,4 +654,4 @@ interface ToolPluginExport {
373
654
  */
374
655
  declare const PLUGIN_TYPES_VERSION = "2.0.0";
375
656
 
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 };
657
+ export { type NarrationDelimiters, PLUGIN_TYPES_VERSION, type RoleplayTemplateConfig, type RoleplayTemplateMetadata, type RoleplayTemplatePlugin, type RoleplayTemplatePluginExport, 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,9 +1,290 @@
1
1
  import { UniversalTool } from './llm/index.js';
2
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
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, N as NarrationDelimiters, 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, O as SearchOutput, Q as SearchProviderConfig, T as SearchProviderConfigRequirements, U as SearchProviderMetadata, V as SearchProviderPlugin, W as SearchProviderPluginExport, X as SearchResult, Y as Spacing, Z as SubsystemOverrides, _ as TextProviderPlugin, $ as ThemeMetadata, a0 as ThemePlugin, a1 as ThemePluginExport, a2 as ThemeTokens, a3 as ToolFormatType, a4 as Typography } from './index-DS_4gWcN.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, S as ScoringProviderConfigRequirements, B as ScoringProviderMetadata, D as ScoringProviderPlugin, G as ScoringProviderPluginExport, H as SearchOutput, J as SearchProviderConfig, K as SearchProviderConfigRequirements, N as SearchProviderMetadata, O as SearchProviderPlugin, Q as SearchProviderPluginExport, R as SearchResult, T as Spacing, U as SubsystemOverrides, V as TextProviderPlugin, W as ThemeMetadata, X as ThemePlugin, Y as ThemePluginExport, Z as ThemeTokens, _ as ToolFormatType, $ as Typography } from './index-DNgmDKd5.js';
5
5
  export { ApiKeyError, AttachmentError, ConfigurationError, LogContext, LogLevel, ModelNotFoundError, PluginError, PluginLogger, ProviderApiError, RateLimitError, ToolExecutionError, createConsoleLogger, createNoopLogger } from './common/index.js';
6
6
 
7
+ /**
8
+ * Roleplay Template Plugin Interface types for Quilltap plugin development
9
+ *
10
+ * @deprecated The ROLEPLAY_TEMPLATE plugin capability was removed in Quilltap v4.2.0.
11
+ * Roleplay templates are now native first-class entities managed through the Settings UI.
12
+ * These types are preserved for backward compatibility with existing third-party plugins
13
+ * but will be removed in a future major version.
14
+ *
15
+ * @module @quilltap/plugin-types/plugins/roleplay-template
16
+ */
17
+ /**
18
+ * Configuration for an annotation button in the formatting toolbar.
19
+ *
20
+ * Annotation buttons allow users to insert roleplay formatting
21
+ * (e.g., narration brackets, OOC markers) with a single click.
22
+ */
23
+ interface AnnotationButton {
24
+ /** Full name displayed in tooltip (e.g., "Narration", "Internal Monologue") */
25
+ label: string;
26
+ /** Abbreviated label displayed on button (e.g., "Nar", "Int", "OOC") */
27
+ abbrev: string;
28
+ /** Opening delimiter (e.g., "[", "*", "{{") */
29
+ prefix: string;
30
+ /** Closing delimiter (e.g., "]", "*", "}}") - empty string for line-end delimiters */
31
+ suffix: string;
32
+ }
33
+ /**
34
+ * A pattern for styling roleplay text in message content.
35
+ *
36
+ * Rendering patterns define how to match and style specific text patterns
37
+ * in AI responses (e.g., narration, OOC comments, internal monologue).
38
+ *
39
+ * @example
40
+ * ```typescript
41
+ * // Match *narration* with single asterisks
42
+ * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' }
43
+ *
44
+ * // Match ((OOC comments)) with double parentheses
45
+ * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' }
46
+ *
47
+ * // Match // OOC at start of line (multiline mode)
48
+ * { pattern: '^// .+$', className: 'qt-chat-ooc', flags: 'm' }
49
+ * ```
50
+ */
51
+ interface RenderingPattern {
52
+ /** Regex pattern as a string (converted to RegExp at runtime) */
53
+ pattern: string;
54
+ /**
55
+ * CSS class to apply to matched text.
56
+ * Standard classes: qt-chat-dialogue, qt-chat-narration, qt-chat-ooc, qt-chat-inner-monologue
57
+ */
58
+ className: string;
59
+ /** Optional regex flags (e.g., 'm' for multiline). Default: none */
60
+ flags?: string;
61
+ }
62
+ /**
63
+ * Configuration for detecting dialogue at the paragraph level.
64
+ *
65
+ * When dialogue contains markdown formatting (like **bold**), the text gets split
66
+ * into multiple children and inline regex patterns can't match. Paragraph-level
67
+ * detection checks if the entire paragraph starts and ends with quote characters.
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * // Standard dialogue with straight and curly quotes
72
+ * {
73
+ * openingChars: ['"', '"'],
74
+ * closingChars: ['"', '"'],
75
+ * className: 'qt-chat-dialogue'
76
+ * }
77
+ * ```
78
+ */
79
+ interface DialogueDetection {
80
+ /** Opening quote characters to detect (e.g., ['"', '"']) */
81
+ openingChars: string[];
82
+ /** Closing quote characters to detect (e.g., ['"', '"']) */
83
+ closingChars: string[];
84
+ /** CSS class to apply to dialogue paragraphs */
85
+ className: string;
86
+ }
87
+ /**
88
+ * Narration delimiters define how narration/action text is marked in roleplay output.
89
+ * Required for all roleplay templates.
90
+ *
91
+ * - A single string means the same character is used for opening and closing (e.g., '*')
92
+ * - A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']'])
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * // Single asterisk for both open and close
97
+ * narrationDelimiters: '*'
98
+ *
99
+ * // Square brackets with different open/close
100
+ * narrationDelimiters: ['[', ']']
101
+ * ```
102
+ */
103
+ type NarrationDelimiters = string | [string, string];
104
+ /**
105
+ * Configuration for a single roleplay template
106
+ *
107
+ * A roleplay template defines a formatting protocol for AI responses,
108
+ * such as how dialogue, actions, thoughts, and OOC comments should be formatted.
109
+ */
110
+ interface RoleplayTemplateConfig {
111
+ /** Display name for the template */
112
+ name: string;
113
+ /** Optional description explaining the template's formatting style */
114
+ description?: string;
115
+ /**
116
+ * The system prompt that defines the formatting rules.
117
+ * This is prepended to character system prompts when the template is active.
118
+ */
119
+ systemPrompt: string;
120
+ /** Tags for categorization and searchability */
121
+ tags?: string[];
122
+ /**
123
+ * Annotation buttons for the formatting toolbar.
124
+ * Defines which formatting options are available when document editing mode is enabled.
125
+ *
126
+ * @example
127
+ * ```typescript
128
+ * annotationButtons: [
129
+ * { label: 'Narration', abbrev: 'Nar', prefix: '[', suffix: ']' },
130
+ * { label: 'Internal Monologue', abbrev: 'Int', prefix: '{', suffix: '}' },
131
+ * { label: 'Out of Character', abbrev: 'OOC', prefix: '// ', suffix: '' },
132
+ * ]
133
+ * ```
134
+ */
135
+ annotationButtons?: AnnotationButton[];
136
+ /**
137
+ * Patterns for styling roleplay text in message content.
138
+ * These patterns are matched against text nodes and wrapped in styled spans.
139
+ *
140
+ * @example
141
+ * ```typescript
142
+ * renderingPatterns: [
143
+ * // Match *narration* with single asterisks
144
+ * { pattern: '(?<!\\*)\\*[^*]+\\*(?!\\*)', className: 'qt-chat-narration' },
145
+ * // Match ((OOC)) with double parentheses
146
+ * { pattern: '\\(\\([^)]+\\)\\)', className: 'qt-chat-ooc' },
147
+ * ]
148
+ * ```
149
+ */
150
+ renderingPatterns?: RenderingPattern[];
151
+ /**
152
+ * Optional dialogue detection for paragraph-level styling.
153
+ * When dialogue contains markdown formatting, inline patterns can't match.
154
+ * This detects paragraphs that start/end with quote characters.
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * dialogueDetection: {
159
+ * openingChars: ['"', '"'],
160
+ * closingChars: ['"', '"'],
161
+ * className: 'qt-chat-dialogue'
162
+ * }
163
+ * ```
164
+ */
165
+ dialogueDetection?: DialogueDetection;
166
+ /**
167
+ * Narration delimiters — required for all templates.
168
+ * Defines how narration/action text is delimited in the template's formatting.
169
+ *
170
+ * A single string means the same delimiter is used for opening and closing (e.g., '*').
171
+ * A tuple of two strings means different opening and closing delimiters (e.g., ['[', ']']).
172
+ *
173
+ * @example
174
+ * ```typescript
175
+ * // Standard: *narration*
176
+ * narrationDelimiters: '*'
177
+ *
178
+ * // Quilltap RP: [narration]
179
+ * narrationDelimiters: ['[', ']']
180
+ * ```
181
+ */
182
+ narrationDelimiters: NarrationDelimiters;
183
+ }
184
+ /**
185
+ * Metadata for a roleplay template plugin
186
+ */
187
+ interface RoleplayTemplateMetadata {
188
+ /**
189
+ * Unique template identifier (lowercase, hyphens allowed)
190
+ * This is typically derived from the plugin name
191
+ */
192
+ templateId: string;
193
+ /** Human-readable display name */
194
+ displayName: string;
195
+ /** Template description */
196
+ description?: string;
197
+ /** Template author */
198
+ author?: string | {
199
+ name: string;
200
+ email?: string;
201
+ url?: string;
202
+ };
203
+ /** Template tags for categorization */
204
+ tags?: string[];
205
+ /** Template version */
206
+ version?: string;
207
+ }
208
+ /**
209
+ * Main Roleplay Template Plugin Interface
210
+ *
211
+ * Plugins implementing this interface can be dynamically loaded
212
+ * by Quilltap to provide custom roleplay formatting templates.
213
+ *
214
+ * A plugin can provide one or more templates. Each template defines
215
+ * a unique formatting protocol for AI responses.
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
220
+ *
221
+ * export const plugin: RoleplayTemplatePlugin = {
222
+ * metadata: {
223
+ * templateId: 'my-rp-format',
224
+ * displayName: 'My RP Format',
225
+ * description: 'A custom roleplay formatting style',
226
+ * tags: ['custom', 'roleplay'],
227
+ * },
228
+ * templates: [
229
+ * {
230
+ * name: 'My RP Format',
231
+ * description: 'Custom formatting with specific syntax',
232
+ * systemPrompt: `[FORMATTING INSTRUCTIONS]
233
+ * 1. Dialogue: Use quotation marks
234
+ * 2. Actions: Use asterisks *like this*
235
+ * ...`,
236
+ * tags: ['custom'],
237
+ * },
238
+ * ],
239
+ * };
240
+ * ```
241
+ *
242
+ * @example
243
+ * ```typescript
244
+ * // Plugin with multiple templates
245
+ * import type { RoleplayTemplatePlugin } from '@quilltap/plugin-types';
246
+ *
247
+ * export const plugin: RoleplayTemplatePlugin = {
248
+ * metadata: {
249
+ * templateId: 'format-pack',
250
+ * displayName: 'RP Format Pack',
251
+ * description: 'A collection of roleplay formats',
252
+ * },
253
+ * templates: [
254
+ * {
255
+ * name: 'Screenplay',
256
+ * systemPrompt: '...',
257
+ * },
258
+ * {
259
+ * name: 'Novel',
260
+ * systemPrompt: '...',
261
+ * },
262
+ * ],
263
+ * };
264
+ * ```
265
+ */
266
+ interface RoleplayTemplatePlugin {
267
+ /** Plugin metadata for UI display and identification */
268
+ metadata: RoleplayTemplateMetadata;
269
+ /**
270
+ * One or more roleplay templates provided by this plugin.
271
+ * Each template has its own name, description, and system prompt.
272
+ */
273
+ templates: RoleplayTemplateConfig[];
274
+ /**
275
+ * Optional initialization function
276
+ * Called when the plugin is loaded
277
+ */
278
+ initialize?: () => void | Promise<void>;
279
+ }
280
+ /**
281
+ * Standard export type for roleplay template plugins
282
+ */
283
+ interface RoleplayTemplatePluginExport {
284
+ /** The roleplay template plugin instance */
285
+ plugin: RoleplayTemplatePlugin;
286
+ }
287
+
7
288
  /**
8
289
  * System Prompt Plugin Interface types for Quilltap plugin development
9
290
  *
@@ -373,4 +654,4 @@ interface ToolPluginExport {
373
654
  */
374
655
  declare const PLUGIN_TYPES_VERSION = "2.0.0";
375
656
 
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 };
657
+ export { type NarrationDelimiters, PLUGIN_TYPES_VERSION, type RoleplayTemplateConfig, type RoleplayTemplateMetadata, type RoleplayTemplatePlugin, type RoleplayTemplatePluginExport, type SystemPromptData, type SystemPromptMetadata, type SystemPromptPlugin, type SystemPromptPluginExport, type ToolExecutionContext, type ToolExecutionResult, type ToolHierarchyInfo, type ToolMetadata, type ToolPlugin, type ToolPluginExport, UniversalTool };
@@ -1,3 +1,3 @@
1
- export { a5 as AnnotationButton, A as AttachmentSupport, a as ColorPalette, a6 as DialogueDetection, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, g as InstalledPluginInfo, L as LLMProviderPlugin, h as ModelInfo, i as ModerationCategoryResult, a7 as ModerationProviderConfig, j as ModerationProviderConfigRequirements, k as ModerationProviderMetadata, l as ModerationProviderPlugin, m as ModerationProviderPluginExport, n as ModerationResult, N as NarrationDelimiters, P as PluginAuthor, o as PluginCapability, p as PluginCategory, q as PluginCompatibility, s as PluginManifest, t as PluginPermissions, u as PluginStatus, v as ProviderCapabilities, w as ProviderConfig, x as ProviderConfigRequirements, y as ProviderMetadata, z as ProviderPluginExport, a8 as RenderingPattern, R as RoleplayTemplateConfig, B as RoleplayTemplateMetadata, D as RoleplayTemplatePlugin, G as RoleplayTemplatePluginExport, S as ScoringProviderConfigRequirements, H as ScoringProviderMetadata, J as ScoringProviderPlugin, K as ScoringProviderPluginExport, O as SearchOutput, Q as SearchProviderConfig, T as SearchProviderConfigRequirements, U as SearchProviderMetadata, V as SearchProviderPlugin, W as SearchProviderPluginExport, X as SearchResult, Y as Spacing, _ as TextProviderPlugin, $ as ThemeMetadata, a0 as ThemePlugin, a1 as ThemePluginExport, a2 as ThemeTokens, a4 as Typography } from '../index-BcrOjfYG.mjs';
1
+ export { A as AttachmentSupport, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, g as InstalledPluginInfo, L as LLMProviderPlugin, h as ModelInfo, i as ModerationCategoryResult, a0 as ModerationProviderConfig, 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, s as PluginManifest, t as PluginPermissions, u as PluginStatus, v as ProviderCapabilities, w as ProviderConfig, x as ProviderConfigRequirements, y as ProviderMetadata, z as ProviderPluginExport, S as ScoringProviderConfigRequirements, B as ScoringProviderMetadata, D as ScoringProviderPlugin, G as ScoringProviderPluginExport, H as SearchOutput, J as SearchProviderConfig, K as SearchProviderConfigRequirements, N as SearchProviderMetadata, O as SearchProviderPlugin, Q as SearchProviderPluginExport, R as SearchResult, T as Spacing, V as TextProviderPlugin, W as ThemeMetadata, X as ThemePlugin, Y as ThemePluginExport, Z as ThemeTokens, $ as Typography } from '../index-BiFtkKWr.mjs';
2
2
  import '../llm/index.mjs';
3
3
  import '../providers/index.mjs';
@@ -1,3 +1,3 @@
1
- export { a5 as AnnotationButton, A as AttachmentSupport, a as ColorPalette, a6 as DialogueDetection, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, g as InstalledPluginInfo, L as LLMProviderPlugin, h as ModelInfo, i as ModerationCategoryResult, a7 as ModerationProviderConfig, j as ModerationProviderConfigRequirements, k as ModerationProviderMetadata, l as ModerationProviderPlugin, m as ModerationProviderPluginExport, n as ModerationResult, N as NarrationDelimiters, P as PluginAuthor, o as PluginCapability, p as PluginCategory, q as PluginCompatibility, s as PluginManifest, t as PluginPermissions, u as PluginStatus, v as ProviderCapabilities, w as ProviderConfig, x as ProviderConfigRequirements, y as ProviderMetadata, z as ProviderPluginExport, a8 as RenderingPattern, R as RoleplayTemplateConfig, B as RoleplayTemplateMetadata, D as RoleplayTemplatePlugin, G as RoleplayTemplatePluginExport, S as ScoringProviderConfigRequirements, H as ScoringProviderMetadata, J as ScoringProviderPlugin, K as ScoringProviderPluginExport, O as SearchOutput, Q as SearchProviderConfig, T as SearchProviderConfigRequirements, U as SearchProviderMetadata, V as SearchProviderPlugin, W as SearchProviderPluginExport, X as SearchResult, Y as Spacing, _ as TextProviderPlugin, $ as ThemeMetadata, a0 as ThemePlugin, a1 as ThemePluginExport, a2 as ThemeTokens, a4 as Typography } from '../index-DS_4gWcN.js';
1
+ export { A as AttachmentSupport, a as ColorPalette, E as Effects, b as EmbeddedFont, c as EmbeddingModelInfo, F as FontDefinition, I as IconProps, d as ImageGenerationModelInfo, e as ImageProviderConstraints, g as InstalledPluginInfo, L as LLMProviderPlugin, h as ModelInfo, i as ModerationCategoryResult, a0 as ModerationProviderConfig, 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, s as PluginManifest, t as PluginPermissions, u as PluginStatus, v as ProviderCapabilities, w as ProviderConfig, x as ProviderConfigRequirements, y as ProviderMetadata, z as ProviderPluginExport, S as ScoringProviderConfigRequirements, B as ScoringProviderMetadata, D as ScoringProviderPlugin, G as ScoringProviderPluginExport, H as SearchOutput, J as SearchProviderConfig, K as SearchProviderConfigRequirements, N as SearchProviderMetadata, O as SearchProviderPlugin, Q as SearchProviderPluginExport, R as SearchResult, T as Spacing, V as TextProviderPlugin, W as ThemeMetadata, X as ThemePlugin, Y as ThemePluginExport, Z as ThemeTokens, $ as Typography } from '../index-DNgmDKd5.js';
2
2
  import '../llm/index.js';
3
3
  import '../providers/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quilltap/plugin-types",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Type definitions for Quilltap plugin development",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",