SillyBubble/CLAUDE.md
Sven Olderaan c4a1e493c9 Implement SillyBubble extension for dynamic chat bubble images
- Create extension for generating dynamic chat bubble images via markdown
- Add function that AI models can call to generate properly formatted markdown links
- Implement URL encoding for text parameters
- Add configurable settings for image service URL and bubble styles
- Include test functionality to preview generated bubble markdown

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-14 20:20:30 +01:00

37 lines
1.4 KiB
Markdown

# 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)