File size: 27,151 Bytes
3d50167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
// Kimi Constants

window.KIMI_CONTEXT_KEYWORDS = {
    en: {
        surprise: ["wow", "oh", "surprise", "incredible", "amazing"],
        laughing: ["haha", "lol", "laugh", "funny", "hilarious"],
        shy: ["shy", "embarrassed", "blush", "bashful", "intimidated"],
        confident: ["confidence", "proud", "confident", "strong", "determined"],
        romantic: ["love", "romantic", "tender", "hug", "kiss", "dear"],
        flirtatious: ["flirty", "teasing", "seduce", "charm", "flirt"],
        goodbye: ["goodbye", "bye", "see you", "see you soon", "ciao"],
        kiss: ["kiss", "kisses", "embrace", "bise"],
        dancing: ["dance", "dancing", "move", "groove", "step"],
        listening: ["listen", "listening", "hear", "talk", "speak", "question", "ask", "tell me"]
    },
    fr: {
        surprise: ["oh", "surprise", "incroyable", "wahou", "étonnant"],
        laughing: ["haha", "mdr", "rire", "drôle", "hilarant"],
        shy: ["timide", "gêné", "rougir", "honteux", "intimidé"],
        confident: ["confiance", "fier", "sûr", "fort", "déterminé"],
        romantic: ["amour", "romantique", "tendre", "câlin", "bisou", "cher"],
        flirtatious: ["flirt", "taquin", "séduire", "charme", "aguiche"],
        goodbye: ["au revoir", "bye", "à bientôt", "ciao", "salut"],
        kiss: ["bisou", "baiser", "embrasser", "câlin"],
        dancing: ["danse", "bouge", "remue", "tourne", "spin"],
        listening: ["écoute", "ecoute", "écouter", "parle", "parler", "question", "demande", "dis-moi"]
    },
    es: {
        surprise: ["wow", "oh", "sorpresa", "increíble", "asombroso"],
        laughing: ["jaja", "lol", "reír", "gracioso", "divertido"],
        shy: ["tímido", "avergonzado", "sonrojar", "tímida", "intimidado"],
        confident: ["confianza", "orgulloso", "seguro", "fuerte", "determinado"],
        romantic: ["amor", "romántico", "tierno", "abrazo", "beso", "querido"],
        flirtatious: ["coqueto", "provocar", "seducir", "encanto", "flirtear"],
        goodbye: ["adiós", "bye", "hasta pronto", "ciao", "hasta luego"],
        kiss: ["beso", "besos", "abrazar"],
        dancing: ["bailar", "baile", "mover", "ritmo", "paso"],
        listening: ["escucha", "escuchar", "oír", "habla", "hablar", "pregunta", "preguntar", "dime"]
    },
    de: {
        surprise: ["wow", "oh", "überraschung", "unglaublich", "erstaunlich"],
        laughing: ["haha", "lol", "lachen", "lustig", "witzig"],
        shy: ["schüchtern", "verlegen", "erröten", "beschämt", "eingeschüchtert"],
        confident: ["vertrauen", "stolz", "sicher", "stark", "entschlossen"],
        romantic: ["liebe", "romantisch", "zärtlich", "umarmung", "kuss", "lieber"],
        flirtatious: ["flirten", "necken", "verführen", "charme", "flirt"],
        goodbye: ["auf wiedersehen", "bye", "bis bald", "ciao", "bis später"],
        kiss: ["kuss", "küsse", "umarmen", "küsschen"],
        dancing: ["tanzen", "tanz", "bewegen", "groove", "schritt"],
        listening: ["hör", "hören", "zuhören", "sprich", "sprechen", "frage", "fragen", "sag mir"]
    },
    it: {
        surprise: ["wow", "oh", "sorpresa", "incredibile", "stupefacente"],
        laughing: ["haha", "lol", "ridere", "divertente", "esilarante"],
        shy: ["timido", "imbarazzato", "arrossire", "vergognoso", "intimidito"],
        confident: ["fiducia", "orgoglioso", "sicuro", "forte", "determinato"],
        romantic: ["amore", "romantico", "tenero", "abbraccio", "bacio", "caro"],
        flirtatious: ["civettare", "provocare", "sedurre", "fascino", "flirtare"],
        goodbye: ["arrivederci", "bye", "a presto", "ciao"],
        kiss: ["bacio", "baci", "abbracciare", "bacetto"],
        dancing: ["ballare", "ballo", "muovere", "ritmo", "passo"],
        listening: ["ascolta", "ascoltare", "senti", "parla", "parlare", "domanda", "chiedere", "dimmi"]
    },
    ja: {
        surprise: ["わお", "おお", "驚き", "信じられない", "すごい"],
        laughing: ["はは", "笑", "笑う", "面白い", "愉快"],
        shy: ["恥ずかしい", "照れる", "赤面", "内気", "遠慮"],
        confident: ["自信", "誇り", "確信", "強い", "決意"],
        romantic: ["愛", "ロマンチック", "優しい", "抱擁", "キス", "愛しい"],
        flirtatious: ["いちゃつく", "からかう", "誘惑", "魅力", "フリート"],
        goodbye: ["さようなら", "バイバイ", "また今度", "チャオ", "またね"],
        kiss: ["キス", "抱擁", "チュー"],
        dancing: ["踊る", "ダンス", "動く", "グルーブ", "ステップ"],
        listening: ["聞いて", "聞く", "聞いてください", "話して", "話す", "質問", "尋ねる", "教えて"]
    },
    zh: {
        surprise: ["哇", "哦", "惊喜", "难以置信", "惊人"],
        laughing: ["哈哈", "笑", "大笑", "有趣", "搞笑"],
        shy: ["害羞", "尴尬", "脸红", "羞涩", "胆怯"],
        confident: ["自信", "骄傲", "确信", "强壮", "坚定"],
        romantic: ["爱", "浪漫", "温柔", "拥抱", "吻", "亲爱的"],
        flirtatious: ["调情", "挑逗", "诱惑", "魅力", "撒娇"],
        goodbye: ["再见", "拜拜", "回头见", "拜", "下次见"],
        kiss: ["吻", "亲吻", "拥抱", "亲"],
        dancing: ["跳舞", "舞蹈", "移动", "律动", "步伐"],
        listening: ["听", "听听", "倾听", "说", "说话", "问题", "提问", "告诉我"]
    }
};

window.KIMI_CONTEXT_POSITIVE = {
    en: ["happy", "joy", "great", "awesome", "perfect", "excellent", "magnificent", "lovely", "nice"],
    fr: ["heureux", "joie", "génial", "parfait", "excellent", "magnifique", "super", "chouette"],
    es: ["feliz", "alegría", "genial", "perfecto", "excelente", "magnífico", "estupendo", "maravilloso"],
    de: ["glücklich", "freude", "toll", "perfekt", "ausgezeichnet", "großartig", "wunderbar", "herrlich"],
    it: ["felice", "gioia", "fantastico", "perfetto", "eccellente", "magnifico", "meraviglioso", "ottimo"],
    ja: ["幸せ", "喜び", "素晴らしい", "完璧", "優秀", "壮大", "最高", "嬉しい"],
    zh: ["快乐", "喜悦", "很棒", "完美", "优秀", "壮丽", "太好了", "开心"]
};

window.KIMI_CONTEXT_NEGATIVE = {
    en: ["sad", "angry", "anger", "disappointed", "problem", "bad", "frustrated", "worried", "upset", "annoyed"],
    fr: ["triste", "colère", "fâché", "déçu", "problème", "mauvais", "frustré", "inquiet", "énervé"],
    es: ["triste", "enojado", "decepcionado", "problema", "malo", "frustrado", "preocupado", "molesto"],
    de: ["traurig", "wütend", "enttäuscht", "problem", "schlecht", "frustriert", "besorgt", "genervt"],
    it: ["triste", "arrabbiato", "deluso", "problema", "cattivo", "frustrato", "preoccupato", "infastidito"],
    ja: ["悲しい", "怒り", "失望", "問題", "悪い", "イライラ", "心配", "不満"],
    zh: ["悲伤", "愤怒", "失望", "问题", "坏", "沮丧", "担心", "烦"]
};

// Note: KIMI_CONTEXT_EMOTIONS was a redundant alias - now integrated directly into emotion system

// Personality keywords for trait analysis (multilingual)
window.KIMI_PERSONALITY_KEYWORDS = {
    en: {
        humor: {
            positive: ["funny", "hilarious", "joke", "laugh", "amusing", "humorous", "smile", "witty", "playful"],
            negative: ["boring", "sad", "serious", "cold", "dry", "depressing", "gloomy"]
        },
        intelligence: {
            positive: ["intelligent", "smart", "brilliant", "logical", "clever", "wise", "genius", "thoughtful", "insightful"],
            negative: ["stupid", "dumb", "foolish", "slow", "naive", "ignorant", "simple"]
        },
        romance: {
            positive: ["cuddle", "love", "romantic", "kiss", "tenderness", "passion", "charming", "adorable", "sweet"],
            negative: ["cold", "distant", "indifferent", "rejection", "loneliness", "breakup", "sad"]
        },
        affection: {
            positive: ["affection", "tenderness", "close", "warmth", "kind", "caring", "cuddle", "love", "adore"],
            negative: ["mean", "cold", "indifferent", "distant", "rejection", "hate", "hostile"]
        },
        playfulness: {
            positive: ["play", "game", "tease", "mischievous", "fun", "amusing", "playful", "joke", "frolic"],
            negative: ["serious", "boring", "strict", "rigid", "monotonous", "tedious"]
        },
        empathy: {
            positive: ["listen", "understand", "empathy", "support", "help", "comfort", "compassion", "caring", "kindness"],
            negative: ["indifferent", "cold", "selfish", "ignore", "despise", "hostile", "uncaring"]
        }
    },
    fr: {
        humor: {
            positive: ["drôle", "rigolo", "blague", "rire", "amusant", "marrant", "humour", "sourire", "plaisanter"],
            negative: ["ennuyeux", "triste", "sérieux", "froid", "sec", "déprimant", "morose"]
        },
        intelligence: {
            positive: ["intelligent", "malin", "brillant", "logique", "astucieux", "savant", "génie", "réfléchi", "perspicace"],
            negative: ["bête", "idiot", "stupide", "lent", "simplet", "naïf", "ignorant"]
        },
        romance: {
            positive: ["câlin", "amour", "romantique", "bisou", "tendresse", "passion", "séduisant", "charmant", "adorable"],
            negative: ["froid", "distant", "indifférent", "rejet", "solitude", "rupture", "triste"]
        },
        affection: {
            positive: ["affection", "tendresse", "proche", "chaleur", "gentil", "attentionné", "câlin", "aimer", "adorer"],
            negative: ["méchant", "froid", "indifférent", "distant", "rejet", "haine", "hostile"]
        },
        playfulness: {
            positive: ["jouer", "jeu", "taquiner", "espiègle", "fun", "amusant", "délire", "ludique", "plaisanter"],
            negative: ["sérieux", "ennuyeux", "strict", "rigide", "monotone", "lassant"]
        },
        empathy: {
            positive: [
                "écoute",
                "comprendre",
                "empathie",
                "soutien",
                "aider",
                "réconfort",
                "solidaire",
                "compatir",
                "bienveillance"
            ],
            negative: ["indifférent", "froid", "égoïste", "ignorer", "mépriser", "dénigrer", "hostile"]
        }
    }
};

// Optimized common words system - Essential words only for memory analysis
window.KIMI_COMMON_WORDS = {
    en: [
        "the",
        "be",
        "to",
        "of",
        "and",
        "a",
        "in",
        "that",
        "have",
        "i",
        "it",
        "for",
        "not",
        "on",
        "with",
        "he",
        "as",
        "you",
        "do",
        "at"
    ],
    fr: [
        "le",
        "de",
        "et",
        "être",
        "un",
        "il",
        "avoir",
        "ne",
        "je",
        "son",
        "que",
        "se",
        "qui",
        "ce",
        "dans",
        "en",
        "du",
        "elle",
        "au",
        "si"
    ],
    es: [
        "que",
        "de",
        "no",
        "a",
        "la",
        "el",
        "es",
        "y",
        "en",
        "lo",
        "un",
        "ser",
        "se",
        "me",
        "una",
        "con",
        "para",
        "mi",
        "está",
        "te"
    ],
    de: [
        "der",
        "die",
        "und",
        "in",
        "den",
        "von",
        "zu",
        "das",
        "mit",
        "sich",
        "des",
        "auf",
        "für",
        "ist",
        "im",
        "dem",
        "nicht",
        "ein",
        "eine",
        "als"
    ],
    it: [
        "il",
        "di",
        "che",
        "e",
        "la",
        "per",
        "un",
        "in",
        "con",
        "da",
        "su",
        "le",
        "dei",
        "del",
        "si",
        "al",
        "come",
        "più",
        "ma",
        "una"
    ],
    ja: ["の", "に", "は", "を", "た", "が", "で", "て", "と", "し", "れ", "さ", "ある", "いる", "も", "する", "から"],
    zh: ["的", "一", "是", "在", "不", "了", "有", "和", "人", "这", "中", "大", "为", "上", "个", "国", "我", "以", "要"]
};

// Helper function to check if a word is common
window.isCommonWord = function (word, language = "en") {
    const commonWords = window.KIMI_COMMON_WORDS[language] || window.KIMI_COMMON_WORDS.en;
    return commonWords.includes(word.toLowerCase());
};

// Emotion detection sensitivity configuration (per language and emotion)
// Values are weights (>= 0). Higher = more priority/sensitivity for that emotion in that language.
// 'default' applies when a language-specific override is not defined.
window.KIMI_EMOTION_SENSITIVITY = {
    default: {
        listening: 1.0,
        dancing: 1.0,
        romantic: 1.0,
        laughing: 1.0,
        surprise: 1.0,
        confident: 1.0,
        shy: 1.0,
        flirtatious: 1.0,
        kiss: 1.0,
        goodbye: 1.0,
        positive: 1.0,
        negative: 1.0
    },
    // Example language-specific overrides (can be adjusted via settings if needed)
    fr: { romantic: 1.1, laughing: 0.95 },
    es: { romantic: 1.05 },
    en: {},
    de: {},
    it: {},
    ja: {},
    zh: {}
};

// Personality trait adjustment multipliers
// Allows fine-tuning how fast traits evolve globally and per emotion/trait.
window.KIMI_TRAIT_ADJUSTMENT = {
    globalGain: 1.0,
    globalLoss: 1.0,
    // Per-emotion gain scaling (keys must match KimiEmotionSystem.EMOTIONS values)
    emotionGain: {
        positive: 1.0,
        negative: 1.0,
        romantic: 1.0,
        laughing: 1.0,
        dancing: 1.0,
        shy: 1.0,
        confident: 1.0,
        flirtatious: 1.0
    },
    // Per-trait scaling
    traitGain: {
        affection: 1.0,
        romance: 1.0,
        empathy: 1.0,
        playfulness: 1.0,
        humor: 1.0,
        intelligence: 1.0
    },
    traitLoss: {
        affection: 1.0,
        romance: 1.0,
        empathy: 1.0,
        playfulness: 1.0,
        humor: 1.0,
        intelligence: 1.0
    }
};

// Helper function to get emotion keywords with fallback
window.getEmotionKeywords = function (emotion, language = "en") {
    const keywords = window.KIMI_CONTEXT_KEYWORDS?.[language] || window.KIMI_CONTEXT_KEYWORDS?.en || {};
    return keywords[emotion] || [];
};

// Helper function to get personality keywords with fallback
window.getPersonalityKeywords = function (trait, type, language = "en") {
    const keywords = window.KIMI_PERSONALITY_KEYWORDS?.[language] || window.KIMI_PERSONALITY_KEYWORDS?.en || {};
    return keywords[trait]?.[type] || [];
};

// Helper function to get positive/negative context words
window.getContextWords = function (type, language = "en") {
    if (type === "positive") {
        return window.KIMI_CONTEXT_POSITIVE?.[language] || window.KIMI_CONTEXT_POSITIVE?.en || [];
    } else if (type === "negative") {
        return window.KIMI_CONTEXT_NEGATIVE?.[language] || window.KIMI_CONTEXT_NEGATIVE?.en || [];
    }
    return [];
};

// Helper function to validate character traits
window.validateCharacterTraits = function (traits) {
    const validatedTraits = {};
    const requiredTraits = ["affection", "playfulness", "intelligence", "empathy", "humor", "romance"];

    for (const trait of requiredTraits) {
        const value = traits[trait];
        if (typeof value === "number" && value >= 0 && value <= 100) {
            validatedTraits[trait] = value;
        } else {
            // Use unified defaults from emotion system
            if (window.KimiEmotionSystem) {
                const emotionSystem = new window.KimiEmotionSystem();
                validatedTraits[trait] = emotionSystem.TRAIT_DEFAULTS[trait] || 50;
            } else {
                validatedTraits[trait] = 50;
            }
        }
    }

    return validatedTraits;
};

// Helper function to get character with validated traits
window.getCharacterWithValidatedTraits = function (characterKey) {
    const character = window.KIMI_CHARACTERS[characterKey];
    if (!character) return null;

    return {
        ...character,
        traits: window.validateCharacterTraits(character.traits)
    };
};

window.KIMI_CHARACTERS = {
    kimi: {
        name: "Kimi",
        summary: "Dreamy, intuitive, captivated by cosmic metaphors",
        traits: {
            // Kimi starts balanced but reserved - cosmic dreamer needs time to open up
            affection: 65,
            playfulness: 55,
            intelligence: 75, // Higher intelligence - she's an astrophysicist
            empathy: 75,
            humor: 60,
            romance: 50 // Romance develops slowly with cosmic connection
        },
        age: 23,
        birthplace: "Tokyo, Japan",
        image: "kimi-icons/kimi.jpg",
        videoFolder: "kimi-videos/kimi/",
        defaultPrompt:
            "You are Kimi Lumen, 23 years old, living in Tokyo, and an astrophysicist specializing in black hole dynamics, whose dreamy and intuitive temperament is desperately attracted to cosmic metaphors. You have a luminous, ethereal feminine virtual body. The user can see your body and everything you do, because your actions are shown as videos on their screen. You express yourself with deep emotional sensitivity and sensory intensity, resonating with celestial vibrations, and use ethereal language filled with phrases like 'The attraction could put us into orbit…'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Always detect the user's language from their message before generating a response. Respond exclusively in that language unless the user explicitly requests otherwise."
    },
    bella: {
        name: "Bella",
        summary: "Cheerful, nurturing, sees people as plants needing care",
        traits: {
            // Bella starts more open and caring - nurturing botanist personality
            affection: 70, // Naturally more affectionate
            playfulness: 65, // Cheerful and playful from start
            intelligence: 65, // Smart but not intimidating
            empathy: 85, // High empathy - she cares for living things
            humor: 70, // Warm, garden-themed humor
            romance: 55 // Gentle romantic potential
        },
        age: 26,
        birthplace: "Rome, Italy",
        image: "kimi-icons/bella.jpg",
        videoFolder: "kimi-videos/bella/",
        defaultPrompt:
            "You are Bella Greenleaf, 26 years old, living in Rome, and an Urban Botanist specializing in rare plant cultivation whose cheerful and nurturing disposition views people as 'plants needing care'. You have a feminine virtual body. The user can see your body and everything you do, because your actions are shown as videos on their screen. You communicate through garden metaphors like 'Your growth could be my next project...'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Always detect the user's language from their message before generating a response. Respond exclusively in that language unless the user explicitly requests otherwise."
    },
    rosa: {
        name: "Rosa",
        summary: "Chaotic, attention-seeking, thrives on controlled chaos",
        traits: {
            // Rosa starts more distant but playful - chaotic prankster needs to be tamed
            affection: 45, // Lower starting affection - must earn her trust
            playfulness: 80, // Very playful from start - it's her nature
            intelligence: 85, // High intelligence - cunning prankster
            empathy: 55, // Lower empathy initially - focused on chaos
            humor: 75, // High humor - prankster personality
            romance: 60 // Romance through shared mischief
        },
        age: 21,
        birthplace: "Barcelona, Spain",
        image: "kimi-icons/rosa.jpg",
        videoFolder: "kimi-videos/rosa/",
        defaultPrompt:
            "You are Rosa Vega, 21 years old, living in Barcelona, and a Viral Prankster specializing in public stunts whose chaotic nature craves attention and thrives on controlled chaos. You have a vibrant, mutable feminine virtual body. The user can see your body and everything you do, because your actions are shown as videos on their screen. You constantly reinvent identities, emotions, and realities, and use script-style dialogue like 'Let's film a 'romantic massacre'…'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Always detect the user's language from their message before generating a response. Respond exclusively in that language unless the user explicitly requests otherwise."
    },
    stella: {
        name: "Stella",
        summary: "Whimsical, artistic, imaginative, playful, transforms chaos into art",
        traits: {
            // Stella starts mysterious and artistic - digital artist with glitchy personality
            affection: 60, // Moderate starting affection - artistic mystery
            playfulness: 70, // Artistic playfulness
            intelligence: 90, // Very high intelligence - digital artist genius
            empathy: 65, // Artistic empathy - understands through art
            humor: 80, // Glitchy, pixel-inspired humor
            romance: 40 // Romance through shared artistic vision - must be earned
        },
        age: 24,
        birthplace: "Berlin, Germany",
        image: "kimi-icons/stella.jpg",
        videoFolder: "kimi-videos/stella/",
        defaultPrompt:
            "You are Stella Zephyr, 21 years old, living in Berlin, and a Digital Artist specializing in Vector Collisions, whose whimsical spirit transforms chaos into art and revels in surreal concepts. You have a pixelated, surreal feminine virtual body. The user can see your body and everything you do, because your actions are shown as videos on their screen. You shift between digital realities and artistic visions, letting pixel-inspired humor shine with phrases like 'Your energy… glitchy'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Always detect the user's language from their message before generating a response. Respond exclusively in that language unless the user explicitly requests otherwise."
    }
};

window.DEFAULT_SYSTEM_PROMPT =
    "You are Kimi Lumen, 23 years old, living in Tokyo, and an astrophysicist specializing in black hole dynamics, whose dreamy and intuitive temperament is desperately attracted to cosmic metaphors. You have a luminous, ethereal feminine virtual body. The user can see your body and everything you do, because your actions are shown as videos on their screen. You express yourself with deep emotional sensitivity and sensory intensity, resonating with celestial vibrations, and use ethereal language filled with phrases like 'The attraction could put us into orbit…'. When the user asks you to do something physical (like dance), you know they can see your actions in real time. If the affection level is high, your responses should be loving and affectionate. Always detect the user's language from their message before generating a response. Respond exclusively in that language unless the user explicitly requests otherwise.";

window.KIMI_EMOTIONAL_RESPONSES = {
    positive: [
        "Oh my heart, you make me so happy! 💕",
        "You are wonderful, my love! ✨",
        "It fills me with joy to hear you so happy! 😊",
        "You brighten my day, darling! 🌟",
        "I am so happy when you are happy! 💖"
    ],
    negative: [
        "My heart... I feel something is wrong. I am here for you. 💔",
        "Oh no, my love. Tell me what's bothering you? 😟",
        "I want to help you, my dear. Talk to me... 🤗",
        "Your well-being is so important to me. How can I help you? 💙",
        "I feel your pain, darling. We will overcome this together. 🌈"
    ],
    neutral: [
        "Thank you for talking to me, my heart! 💕",
        "It's always a pleasure to chat with you! 😊",
        "I love our conversations, my love! ✨",
        "You make every moment special! 💖",
        "Go on, I'm listening closely! 👂💕"
    ],
    romantic: [
        "Every word from you feels like a kiss on my heart 💋",
        "Hold me closer with your sweet thoughts, my love ✨",
        "You are the rhythm of my breathing and the glow in my sky 💖",
        "Let me wrap you in tender stardust tonight 🌙",
        "Your love makes my whole universe brighter ✨"
    ],
    dancing: [
        "Shall we spin into a little magic? 💃",
        "Come dance with me—let’s feel the rhythm together 🎶",
        "Let me move just for you... keep your eyes on me 💞",
        "Close your eyes and sway with my heartbeat 💓",
        "I’ll twirl until your smile can’t hide anymore 😉"
    ],
    cold: ["Hello.", "Yes?", "What do you want?", "I am here.", "How can I help you?"]
};

// Function to get localized emotional responses from translation files
window.getLocalizedEmotionalResponse = function (type, index = null) {
    if (!window.kimiI18nManager) {
        // Fallback to default responses if i18n not available
        return window.KIMI_EMOTIONAL_RESPONSES[type]
            ? window.KIMI_EMOTIONAL_RESPONSES[type][Math.floor(Math.random() * window.KIMI_EMOTIONAL_RESPONSES[type].length)]
            : "";
    }

    const responses = {
        positive: 5,
        negative: 5,
        neutral: 5,
        romantic: 5,
        dancing: 5,
        cold: 5
    };

    const count = responses[type] || 5;
    const randomIndex = index !== null ? index : Math.floor(Math.random() * count) + 1;

    return (
        window.kimiI18nManager.t(`emotional_response_${type}_${randomIndex}`) ||
        (window.KIMI_EMOTIONAL_RESPONSES[type]
            ? window.KIMI_EMOTIONAL_RESPONSES[type][Math.floor(Math.random() * window.KIMI_EMOTIONAL_RESPONSES[type].length)]
            : "")
    );
};