# SillyBubble - Dynamic Chat Bubble Extension ## Extension Purpose - Creates dynamic chat bubble images from AI-provided text - Uses a tool function called by the AI to generate markdown image links - Properly URL-encodes the text parameter in the image URL ## Build & Test Commands - Extension Installation: Place in `extensions/` directory of SillyTavern - No build process needed - extension is JavaScript-based - Test in SillyTavern by verifying: - Tool registration with the AI - Proper URL encoding of parameters - Markdown image rendering in chat ## Code Style Guidelines ### Structure - Extension name: "SillyBubble" - Key files: `index.js` (tool registration), `manifest.json`, `style.css` ### Tool Implementation - Register tool function `generateChatBubbleImage` for AI function calling - Function should accept text input and return formatted markdown - Use `encodeURIComponent()` for proper URL parameter encoding - Return format: `![](image.php?q=encoded_text)` ### JavaScript Patterns - Use async/await for asynchronous operations - Rely on jQuery for DOM manipulation - Import required functions from SillyTavern's extensions.js - Register event handlers in jQuery ready function ### Extension Settings - Store settings in `extension_settings[extensionName]` - Allow configuration of image service URL - Support style parameters (e.g., bubble style, colors)