import { RoleplayTemplateMetadata, RoleplayTemplateConfig, NarrationDelimiters, RoleplayTemplatePlugin } from '@quilltap/plugin-types'; export { RoleplayTemplateConfig, RoleplayTemplateMetadata, RoleplayTemplatePlugin, RoleplayTemplatePluginExport } from '@quilltap/plugin-types'; /** * Roleplay Template Plugin Builder utilities * * Provides helper functions for creating and validating roleplay template plugins. * * @module @quilltap/plugin-utils/roleplay-templates */ /** * Options for creating a roleplay template plugin */ interface CreateRoleplayTemplatePluginOptions { /** Plugin metadata */ metadata: RoleplayTemplateMetadata; /** * One or more roleplay templates. * Pass a single template object or an array of templates. */ templates: RoleplayTemplateConfig | RoleplayTemplateConfig[]; /** * Optional initialization function. * Called when the plugin is loaded. */ initialize?: () => void | Promise; /** * Whether to enable debug logging. * Defaults to false. */ enableLogging?: boolean; } /** * Simplified options for plugins that provide a single template */ interface CreateSingleTemplatePluginOptions { /** Unique template identifier (lowercase, hyphens allowed) */ templateId: string; /** Human-readable display name */ displayName: string; /** Template description */ description?: string; /** * The system prompt that defines the formatting rules. * This is prepended to character system prompts when the template is active. */ systemPrompt: string; /** Template author */ author?: string | { name: string; email?: string; url?: string; }; /** Tags for categorization and searchability */ tags?: string[]; /** * Narration delimiters — required. * Single string (same open/close, e.g., '*') or [open, close] tuple (e.g., ['[', ']']). */ narrationDelimiters: NarrationDelimiters; /** Template version */ version?: string; /** * Optional initialization function. * Called when the plugin is loaded. */ initialize?: () => void | Promise; /** * Whether to enable debug logging. * Defaults to false. */ enableLogging?: boolean; } /** * Creates a roleplay template plugin with full control over metadata and templates. * * Use this when you want to provide multiple templates or have fine-grained * control over the plugin structure. * * @param options - Plugin configuration options * @returns A valid RoleplayTemplatePlugin instance * * @example * ```typescript * import { createRoleplayTemplatePlugin } from '@quilltap/plugin-utils'; * * export const plugin = createRoleplayTemplatePlugin({ * metadata: { * templateId: 'my-rp-format', * displayName: 'My RP Format', * description: 'A custom roleplay formatting style', * }, * templates: [ * { * name: 'My RP Format', * description: 'Custom formatting with specific syntax', * systemPrompt: '[FORMATTING INSTRUCTIONS]...', * tags: ['custom'], * }, * ], * }); * ``` */ declare function createRoleplayTemplatePlugin(options: CreateRoleplayTemplatePluginOptions): RoleplayTemplatePlugin; /** * Creates a simple roleplay template plugin with a single template. * * This is a convenience function for the common case of a plugin * that provides just one roleplay template. * * @param options - Simplified plugin configuration * @returns A valid RoleplayTemplatePlugin instance * * @example * ```typescript * import { createSingleTemplatePlugin } from '@quilltap/plugin-utils'; * * export const plugin = createSingleTemplatePlugin({ * templateId: 'quilltap-rp', * displayName: 'Quilltap RP', * description: 'Custom formatting with [actions], {thoughts}, and // OOC', * systemPrompt: `[FORMATTING INSTRUCTIONS] * 1. DIALOGUE: Write as bare text without quotes * 2. ACTIONS: Use [square brackets] * 3. THOUGHTS: Use {curly braces} * 4. OOC: Use // prefix`, * tags: ['quilltap', 'custom'], * }); * ``` */ declare function createSingleTemplatePlugin(options: CreateSingleTemplatePluginOptions): RoleplayTemplatePlugin; /** * Validates a roleplay template configuration * * @param template - The template configuration to validate * @returns True if valid, throws Error if invalid */ declare function validateTemplateConfig(template: RoleplayTemplateConfig): boolean; /** * Validates a complete roleplay template plugin * * @param plugin - The plugin to validate * @returns True if valid, throws Error if invalid */ declare function validateRoleplayTemplatePlugin(plugin: RoleplayTemplatePlugin): boolean; export { type CreateRoleplayTemplatePluginOptions, type CreateSingleTemplatePluginOptions, createRoleplayTemplatePlugin, createSingleTemplatePlugin, validateRoleplayTemplatePlugin, validateTemplateConfig };