6 Commits

Author SHA1 Message Date
501f226542 chore: update Cargo.lock for tiktoken-rs dependency 2025-10-16 13:25:02 -07:00
cdb7baa197 feat: enhance roleplay features with regex, exports, and validation
This commit implements Options B, C, and D for enhanced roleplay capabilities:

**Option B: Enhanced Roleplay Features**
- Add regex pattern matching for World Info keywords with fallback to literal matching
- Make scan depth configurable (default: 20, range: 1-100 messages)
- Make Author's Note insertion depth configurable (default: 3, range: 1-50 messages)
- Add World Info import/export functionality with merge/replace options
- Update WorldInfoEntry struct with use_regex field
- Update RoleplaySettings with scan_depth and authors_note_depth fields
- Modify build_roleplay_context() to return configurable note_depth
- Update all 4 chat functions to use configurable Author's Note depth

**Option C: Chat Export Enhancements**
- Add export_chat_as_markdown: Clean markdown format with bold role labels
- Add export_chat_as_text: Simple plain text format with decorative separator
- Add export_chat_as_html: Styled HTML with responsive design and color-coded messages
- All exports use native file dialogs with appropriate file filters

**Option D: Polish & Quality of Life**
- Add validate_regex_pattern command for real-time regex validation
- Add update_roleplay_depths command with range validation
- Enhance add_world_info_entry with input validation (regex, empty checks)
- Enhance update_world_info_entry with input validation
- Add detailed error messages for all validation failures

**Technical Details:**
- Add regex dependency to Cargo.toml
- Use #[serde(default)] attributes for backward compatibility
- Graceful error handling with fallback strategies
- HTML export includes proper escaping for XSS protection
- All new commands registered in Tauri invoke_handler

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-15 17:01:16 -07:00
f31e3fb28a feat: add v2 character card import/export
- Expanded Character struct with all v2 spec fields (description, scenario, mes_example, post_history_instructions, alternate_greetings, character_book, tags, creator, character_version, creator_notes, extensions)
- Created CharacterCardV2 serialization structs following spec at github.com/malfoyslastname/character-card-spec-v2
- Implemented PNG metadata utilities:
  * read_character_card_from_png() - extracts and decodes character data from PNG tEXt chunks
  * write_character_card_to_png() - embeds character data into PNG files
  * create_placeholder_png() - generates gradient placeholder images for avatarless characters
- Added Tauri commands:
  * import_character_card - opens file picker, imports PNG with automatic name conflict handling
  * export_character_card - exports character as v2 PNG card with embedded metadata
- Added Import/Export buttons to character settings UI
- Full backward compatibility with existing characters using serde defaults
- Added dependencies: png 0.17, base64 0.21, image 0.24
2025-10-14 08:19:57 -07:00
90bbeb4468 feat: add character avatars with upload and zoom functionality
- Add avatar upload with file picker dialog
- Display avatars in header, chat messages, and settings
- Implement clickable avatars with full-screen zoom modal
- Enable asset protocol for local file access in Tauri config
- Add tauri-plugin-dialog for native file selection
- Store avatars in ~/.config/claudia/avatars/
- Support PNG, JPG, JPEG, and WEBP formats
- Modal closes on overlay click or ESC key
2025-10-13 18:49:34 -07:00
6a8f1e0996 feat: add streaming responses with optional toggle
- Add server-sent events (SSE) streaming support for real-time token display
- Implement progressive markdown rendering during streaming
- Add stream toggle in API settings (defaults to disabled for compatibility)
- Add visual streaming indicator with pulsing animation
- Graceful fallback to non-streaming mode when disabled
- Fix character saving bug (camelCase parameter naming)

Backend changes:
- New chat_stream command with SSE parsing
- Added futures and bytes dependencies
- Emit chat-token events progressively to frontend
- Support for OpenAI-compatible and Anthropic streaming formats

Frontend changes:
- Dual code paths for streaming/non-streaming
- Real-time markdown and syntax highlighting during streaming
- Stream status indicator with animation
2025-10-12 11:38:40 -07:00
04b490b5b9 feat: initial commit of Claudia v0.1.0 2025-10-11 16:21:11 -07:00