Commit Graph

381 Commits

Author SHA1 Message Date
Claude c35e39c445 Integrate character state tracking system into main extension
This commit fully integrates the character tracking system into the
RPG Companion extension. Now 100% ready to use with zero manual work.

Changes to index.js:
- Added imports for character state modules
- Created event wrapper functions for:
  - onGenerationStarted (injects character tracking prompt)
  - onMessageReceived (parses and applies state updates)
  - onCharacterChanged (loads character state from chat)
- Added persistence functions (save/load to chat metadata)
- Modified event registration to use wrapper functions
- Added character state display initialization

Changes to template.html:
- Added #rpg-character-state-container for UI display

SYSTEM NOW FULLY FUNCTIONAL:
 LLM receives character state before generation
 LLM updates character state in responses
 States automatically parse and apply
 UI displays character emotions, physical stats, relationships
 State persists between sessions in chat metadata
 100% copy-paste ready - no manual integration needed

To use:
1. Files are already in place
2. System works automatically
3. Check console for [Character Tracking] logs
4. See character state in RPG panel
2025-12-05 04:52:01 +00:00
Claude 0440159089 Add comprehensive character state tracking system for {{char}}
This implements a complete Katherine RPG-based character state tracking
system that tracks the AI character ({{char}}) instead of the user.

Features:
- 40+ primary personality traits (dominance, honesty, empathy, etc.)
- 70+ secondary emotional states (happy, horny, anxious, playful, etc.)
- Physical stats tracking (energy, hunger, arousal, health, pain, etc.)
- Relationship tracking per-NPC (trust, love, attraction, thoughts, etc.)
- Clothing/outfit dynamic tracking
- Internal thoughts and contextual awareness
- LLM-driven automatic state updates based on responses
- Full UI rendering with tabbed interface

New Files:
- src/core/characterState.js (528 lines) - Core state data structure
- src/systems/generation/characterPromptBuilder.js (407 lines) - LLM prompts
- src/systems/generation/characterParser.js (456 lines) - Response parsing
- src/systems/rendering/characterStateRenderer.js (401 lines) - UI rendering
- CHARACTER_TRACKING_README.md - Complete documentation
- INTEGRATION_EXAMPLE.js - Step-by-step integration guide
- IMPLEMENTATION_SUMMARY.md - System overview and deliverables

System tracks 150+ individual stats per character with full LLM integration
for contextual, realistic character simulation.

All code is production-ready and copy-paste complete.
2025-12-05 04:39:53 +00:00
devsorcer 2d5b3c4c5b Add files via upload 2025-12-05 09:57:31 +05:30
Spicy Marinara 628d8ee7a4 Merge pull request #56 from IDeathByte/main
Fix for character card
2025-12-04 09:29:11 +01:00
IDeathByte 23a4e77b0a Fix for character card
Fixing the issue, when card data makes unreadable, when LLM generates more than 2 strings for appearance

Make it scrollable
2025-12-04 13:05:04 +05:00
Spicy_Marinara 32c2543605 Respect showInventory toggle in prompt generation 2025-12-01 11:46:57 +01:00
Spicy Marinara 968aedc537 Merge pull request #52 from lilminzyu/i18n/zh-tw
Add Chinese (Traditional) i18n support
2025-12-01 11:31:44 +01:00
Mingyu f38bddec62 The processing of the Separate button was missing and has been added. Dynamic update logic centralized 2025-11-26 21:46:59 +08:00
Mingyu 691586ce2f Merge branch 'SpicyMarinara:main' into i18n/zh-tw 2025-11-26 15:51:12 +08:00
Mingyu d486c9e924 mobile done 2025-11-26 07:49:59 +00:00
Spicy_Marinara 0c5b55b190 Add character card info in separate mode with muted filtering and scrollable Past Events 2025-11-25 12:40:28 +01:00
Mingyu 6759f514f3 pc all done 2025-11-24 22:38:56 +08:00
Mingyu 79f99a40c6 RPG Companion index [done] 2025-11-24 19:48:34 +08:00
Mingyu ab33604ea0 Edit Trackers Pop-up window [done] 2025-11-24 17:40:07 +08:00
Mingyu 0f0a4dceeb RPG Companion Settings Pop-up window [done] 2025-11-24 17:37:38 +08:00
Mingyu 8ef4e4ba6d first try i18n base ok 2025-11-24 17:35:41 +08:00
Spicy_Marinara 950d83fc18 Update promptBuilder.js 2025-11-23 19:59:27 +01:00
Spicy Marinara 5e05dee0e8 Merge pull request #50 from chungchan-dev/fix/mobile-layout
fix: some mobile layout
2025-11-23 13:40:09 +01:00
Spicy_Marinara 67df7034eb Add custom HTML prompt editor, skills blur handler, and include skills in separate mode 2025-11-22 23:36:39 +01:00
Chanho Chung eef547b0fa fix: mobile layout of rpg-skills-section font size 2025-11-22 23:35:30 +09:00
Chanho Chung fed4e2d095 fix: mobile layout of rpg-skills-section and rpg-classic-stat 2025-11-22 23:27:45 +09:00
Chanho Chung 02f080cc98 fix: mobile layout of rpg-mobile-tabs, rpg-info-content, rpg-character-card 2025-11-22 23:09:54 +09:00
Chanho Chung 00265ba905 fix: mobile layout of rpg-info-box 2025-11-22 11:14:14 +09:00
Spicy_Marinara c3624c240f Exclude attributes from separate tracker generation requests 2025-11-21 00:01:44 +01:00
Spicy_Marinara 76c7e3cd9c Update HTML prompt wording and improve together mode swipe handling 2025-11-20 22:59:31 +01:00
Spicy_Marinara 2b45dc8fae Add stat change guidelines, attributes toggle, skills editing, and improved character parsing
- Add temporal awareness and stat decay rules to prompt (0-5% per message)
- Add 'Always Include Attributes' toggle in tracker editor
- Fix skills section editing (was not saving customFields)
- Improve Present Characters parser to handle malformed formats (mid-line chars, extra blank lines)
- All changes work in both together/separate generation modes
2025-11-18 15:10:24 +01:00
Spicy_Marinara ed3eac54fc Update promptBuilder.js 2025-11-16 00:06:32 +01:00
Spicy_Marinara c48b1dab46 Fix: Hide UI elements when extension disabled
- Skip UI initialization entirely when extension is disabled on page load
- Remove all UI elements (panel, buttons) from DOM when disabling extension
- Recreate full UI when re-enabling extension
- Hide mobile toggle button on desktop viewports (>1000px)
- Show/hide mobile toggle based on viewport size transitions
- Ensures clean state management for extension enable/disable
2025-11-13 23:30:44 +01:00
Spicy_Marinara bd891e39b0 Fix: Quests now properly scoped per-chat
Quests were bleeding through from other chats because loadChatData()
wasn't resetting them when switching to a chat without RPG data.

When loading a chat with no rpg_companion metadata, the function now
resets quests to empty state (main: 'None', optional: []) along with
other tracker data. This ensures each chat maintains its own quest
state independently.
2025-11-13 21:01:37 +01:00
Spicy Marinara dfbae54b48 Merge pull request #47 from amauragis/guided-generation-compat
Add a prompt injection suppresson feature for Guided Generations
2025-11-13 20:59:13 +01:00
Andy Mauragis dc37fd4a63 docs: Update README with guided generation compatibility info 2025-11-13 13:46:36 -05:00
Andy Mauragis 0ac85ad9fd feat: Add 'Skip Injections during Guided Generations' setting and UI 2025-11-13 13:46:36 -05:00
Andy Mauragis 407a45a25c feat: Add core suppression logic and integrate into prompt injector 2025-11-13 13:46:36 -05:00
Spicy_Marinara d658e337f6 Fix: Support multiple character variants in Present Characters panel
Fixed issues when AI generates multiple character variants (e.g.,
storyteller mode with 'Dottore (Prime)', 'Dottore (Beta)', etc.):

1. Escape quotes in character names to prevent HTML attribute breakage
   - Added escapeHtmlAttr() helper function
   - Prevents names like 'Marianna "Mari"' from breaking HTML

2. Restore avatar lookup for character variants
   - namesMatch() now strips parentheses and quotes from both sides
   - Allows 'Dottore (Prime)' to find 'Dottore' character card avatar
   - Each variant still gets its own card with separate attributes

3. Multiple characters now display correctly in panel
   - Each variant creates its own character object
   - Attributes (Details, Relationship, Stats, Thoughts) don't mix
   - All characters appear in the panel, not just the last one
2025-11-13 16:18:35 +01:00
Spicy Marinara 172c8d6ab8 Merge pull request #45 from joenunezb/fix/render-chat-message-properly
fix: Render chat messages using updateMessageBlock
2025-11-13 13:26:13 +01:00
joenunezb c23c68fbc3 fix: Render chat messages using updateMessageBlock 2025-11-13 03:43:41 -08:00
Spicy_Marinara d4fc3ce1d8 Add 'Always Show Thought Bubble' setting - keeps thought bubble permanently expanded 2025-11-06 22:20:35 +01:00
Spicy Marinara 227eb4c31e Merge pull request #43 from SpicyMarinara/revert-36-feat/v2-widget-dashboard-system
Revert "feat: v2 widget dashboard system"
2025-11-06 20:06:40 +01:00
Spicy Marinara fd9adce068 Revert "feat: v2 widget dashboard system" 2025-11-06 20:06:26 +01:00
Spicy Marinara ba45e499e1 Merge pull request #42 from SpicyMarinara/revert-40-feat/responsive-dashboard-layout
Revert "feat: responsive dashboard layout"
2025-11-06 20:05:52 +01:00
Spicy Marinara 71727c0a50 Revert "feat: responsive dashboard layout" 2025-11-06 20:05:33 +01:00
Spicy Marinara a8d5a88438 Merge pull request #40 from paperboygold/feat/responsive-dashboard-layout
feat: responsive dashboard layout
2025-11-06 14:27:37 +01:00
Paperboy 705396a426 Merge branch 'main' into feat/responsive-dashboard-layout 2025-11-07 00:26:23 +11:00
Lucas 'Paperboy' Rose-Winters f8bad60ec1 refactor: display Refresh and Settings buttons on same line
- Move Refresh RPG Info button into rpg-settings-buttons-row
- Add rpg-btn-half class to both buttons for equal width distribution
- Conserves vertical space in the hamburger menu
- Buttons now display side-by-side with flex layout
2025-11-07 00:18:52 +11:00
Lucas 'Paperboy' Rose-Winters 206fe8a98c refactor: simplify Tracker Settings button tooltip
Shorten title from 'Tracker Settings - Customize fields, names, and AI instructions'
to just 'Tracker Settings' for cleaner UI.
2025-11-07 00:16:35 +11:00
Lucas 'Paperboy' Rose-Winters 8981a841fb fix: add missing styling for RPG attribute inputs
- Add .rpg-attr-name styling to match .rpg-stat-name
- Use SmartTheme colors instead of default white background
- Add focus state with highlight border
- Include .rpg-attr-toggle and .rpg-attr-remove in selectors

Fixes white background on RPG attribute text inputs (STR, DEX, etc.)
in the Tracker Editor modal.
2025-11-07 00:15:16 +11:00
Lucas 'Paperboy' Rose-Winters 643acb8142 fix: preserve Skills section in parser and improve button visibility
- Fix stripBrackets() removing Skills section header
  - Add structural header whitelist (Skills, Status, Inventory, etc.)
  - Implement smart look-ahead to detect content below labels
  - Previous logic incorrectly removed 'Skills:' when followed by category labels
- Add proper theming to category action buttons (.rpg-category-action)
  - Match styling of view toggle buttons
  - Use SmartTheme colors for better visibility
- Fix RPG attributes styling in Tracker Editor
  - Change background from --rpg-accent to --SmartThemeBlurTintColor
  - Update border to match other themed inputs

Resolves issue where skills with categories were all showing as 'Uncategorized'
due to the Skills section being truncated during parsing.
2025-11-07 00:13:34 +11:00
Lucas 'Paperboy' Rose-Winters 9f3ee18e4e debug: add code block extraction logging
Add detailed logging to trace Skills section through code block extraction.

New logs in parseResponse:
- Log each code block's content length
- Check if code block contains 'Skills:'
- If yes, show 200 chars of text around Skills section
- This runs BEFORE the content is categorized as userStats/infoBox/etc

This will show us:
1. Is Skills section in the extracted code block?
2. At what point does it get truncated?
3. Is it a code block extraction issue or later processing?

Related: Skills categorization debugging
2025-11-06 23:02:11 +11:00
Lucas 'Paperboy' Rose-Winters 53870857ef debug: add detailed logging to extractSkills function
Add verbose debug logging to trace why Skills section extraction is failing.

Logs added:
- Whether statsText is provided
- Text length and if it contains 'Skills:'
- Whether main regex matched
- If 'On Person:' exists (lookahead target)
- 200 chars of text around Skills section
- Whether simple format fallback matched
- Captured text length when successful

This will help diagnose why parser logs show 'Skills extraction failed'
even when Skills section clearly exists in the text.

Related: Skills categorization issue investigation
2025-11-06 22:57:59 +11:00
Lucas 'Paperboy' Rose-Winters cf993b2eaa debug: add comprehensive logging to skills parser
Add detailed console logging to trace how skills are being parsed and
categorized. This will help diagnose why skills are ending up in
"Uncategorized" instead of their proper categories.

Debug logs added:
- Log all lines extracted from skills section
- Log when category headers are detected
- Log when category arrays are created
- Log when skills are added to categories vs uncategorized
- Log ERROR when skill can't be added due to missing category array
- Log final skills data structure with category counts

Fallback behavior:
- If skill can't be added to its category (category array doesn't exist),
  fall back to uncategorized with ERROR log

To see logs:
- Enable Debug Mode in RPG Companion settings
- Check browser console during AI response parsing
- Look for "[RPG Parser]" prefix

Related: Skills categorization issue investigation
2025-11-06 22:52:02 +11:00