@zahidzorbaz/tudun 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/domain/dto/style-profile.d.ts +0 -57
- package/dist/domain/dto/style-profile.js +0 -2
- package/dist/domain/dto/style-profile.js.map +0 -1
- package/dist/domain/ports/style-analyzer.d.ts +0 -5
- package/dist/domain/ports/style-analyzer.js +0 -2
- package/dist/domain/ports/style-analyzer.js.map +0 -1
- package/dist/infrastructure/analysis/dictionaries.d.ts +0 -6
- package/dist/infrastructure/analysis/dictionaries.js +0 -66
- package/dist/infrastructure/analysis/dictionaries.js.map +0 -1
- package/dist/infrastructure/analysis/index.d.ts +0 -1
- package/dist/infrastructure/analysis/index.js +0 -2
- package/dist/infrastructure/analysis/index.js.map +0 -1
- package/dist/infrastructure/analysis/style-analyzer.service.d.ts +0 -21
- package/dist/infrastructure/analysis/style-analyzer.service.js +0 -456
- package/dist/infrastructure/analysis/style-analyzer.service.js.map +0 -1
- package/dist/interface/mcp/tools/analyze-conversation-style.d.ts +0 -3
- package/dist/interface/mcp/tools/analyze-conversation-style.js +0 -57
- package/dist/interface/mcp/tools/analyze-conversation-style.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export interface StyleProfile {
|
|
2
|
-
contactName: string;
|
|
3
|
-
contactNumber: string;
|
|
4
|
-
analyzedMessageCount: number;
|
|
5
|
-
confidence: number;
|
|
6
|
-
length: {
|
|
7
|
-
avgWordsPerMessage: number;
|
|
8
|
-
medianWords: number;
|
|
9
|
-
singleWordReplyRatio: number;
|
|
10
|
-
distribution: {
|
|
11
|
-
ultraShort: number;
|
|
12
|
-
short: number;
|
|
13
|
-
medium: number;
|
|
14
|
-
long: number;
|
|
15
|
-
paragraph: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
structure: {
|
|
19
|
-
multiBubbleRatio: number;
|
|
20
|
-
avgBurstSize: number;
|
|
21
|
-
};
|
|
22
|
-
language: {
|
|
23
|
-
abbreviationRate: number;
|
|
24
|
-
turkishCharRate: number;
|
|
25
|
-
codeSwitchRate: number;
|
|
26
|
-
commonBorrowings: string[];
|
|
27
|
-
repeatedLetterRate: number;
|
|
28
|
-
};
|
|
29
|
-
formality: {
|
|
30
|
-
compositeScore: number;
|
|
31
|
-
capitalizationScore: number;
|
|
32
|
-
punctuationScore: number;
|
|
33
|
-
noPunctuationRate: number;
|
|
34
|
-
};
|
|
35
|
-
emoji: {
|
|
36
|
-
emojiRate: number;
|
|
37
|
-
emojiMessageRatio: number;
|
|
38
|
-
topEmojis: string[];
|
|
39
|
-
emojiOnlyMessageRatio: number;
|
|
40
|
-
};
|
|
41
|
-
timing: {
|
|
42
|
-
medianResponseTimeSec: number;
|
|
43
|
-
activeHours: number[];
|
|
44
|
-
peakHour: number;
|
|
45
|
-
};
|
|
46
|
-
patterns: {
|
|
47
|
-
greetingStyle: string;
|
|
48
|
-
greetingExamples: string[];
|
|
49
|
-
closingStyle: string;
|
|
50
|
-
closingExamples: string[];
|
|
51
|
-
ackStyle: string;
|
|
52
|
-
ackExamples: string[];
|
|
53
|
-
signatureWords: string[];
|
|
54
|
-
};
|
|
55
|
-
exampleMessages: string[];
|
|
56
|
-
writingInstructions: string;
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-profile.js","sourceRoot":"","sources":["../../../src/domain/dto/style-profile.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-analyzer.js","sourceRoot":"","sources":["../../../src/domain/ports/style-analyzer.ts"],"names":[],"mappings":""}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const ABBREVIATIONS: Set<string>;
|
|
2
|
-
export declare const GREETING_PATTERNS: RegExp[];
|
|
3
|
-
export declare const CLOSING_PATTERNS: RegExp[];
|
|
4
|
-
export declare const ACK_PATTERNS: RegExp[];
|
|
5
|
-
export declare const ENGLISH_BORROWS: Set<string>;
|
|
6
|
-
export declare const STOP_WORDS: Set<string>;
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Türkçe WhatsApp kısaltmaları
|
|
2
|
-
export const ABBREVIATIONS = new Set([
|
|
3
|
-
'slm', 'mrb', 'mrh', 'nbr', 'naber', 'nblr', 'tmm', 'tm', 'tşk', 'tsk',
|
|
4
|
-
'grskz', 'grsr', 'hg', 'hb', 'hgld', 'sa', 'as', 'aeo',
|
|
5
|
-
'ins', 'mslm', 'knk', 'krdş', 'krd', 'abi', 'ab', 'abla', 'abl',
|
|
6
|
-
'hll', 'eyv', 'eyw', 'sgn', 'bb', 'ii', 'kk', 'ok', 'okey', 'oki',
|
|
7
|
-
'dc', 'evt', 'hyr', 'blm', 'grm', 'glcm', 'gldm', 'gdrm',
|
|
8
|
-
'pki', 'pk', 'bi', 'bdk', 'yok', 'var', 'he', 'hee', 'heh',
|
|
9
|
-
'sjsj', 'asjd', 'kdkd', 'haha', 'hihi', 'lol',
|
|
10
|
-
'iig', 'ig', 'gnyd', 'gnydn', 'iyi', 'kib', 'hoşçkl',
|
|
11
|
-
'sne', 'bnce', 'bence', 'aslnda', 'ztn', 'btn', 'bskt',
|
|
12
|
-
'tabi', 'tabii', 'olr', 'olmz', 'bilm', 'bilmm', 'grcrz',
|
|
13
|
-
'ypcm', 'yprm', 'yaprm', 'gtrm', 'gtrcrm', 'alcm', 'alcrm',
|
|
14
|
-
]);
|
|
15
|
-
// Selamlama kalıpları (mesaj başında kontrol edilir)
|
|
16
|
-
export const GREETING_PATTERNS = [
|
|
17
|
-
/^(merhaba|selam|mrb|slm|hey|heyy+)\b/i,
|
|
18
|
-
/^(gunaydin|günaydın|gnyd|gnydn)\b/i,
|
|
19
|
-
/^(iyi\s*(aksamlar|akşamlar))\b/i,
|
|
20
|
-
/^(sa|selamun?\s*aleykum|selamünaleyküm)\b/i,
|
|
21
|
-
/^(naber|nbr|nblr|ne\s*haber|nasilsin|nasılsın)\b/i,
|
|
22
|
-
/^(hg|hosgeldin|hoşgeldin)\b/i,
|
|
23
|
-
];
|
|
24
|
-
// Kapanış kalıpları (mesaj başında kontrol edilir)
|
|
25
|
-
export const CLOSING_PATTERNS = [
|
|
26
|
-
/^(gorusuruz|görüşürüz|grskz|grsr)\b/i,
|
|
27
|
-
/^(bb|bye|byebye|bay\s*bay)\b/i,
|
|
28
|
-
/^(hoscakal|hoşçakal|hoşçkl)\b/i,
|
|
29
|
-
/^(iyi\s*geceler|iig|ig)\b/i,
|
|
30
|
-
/^(kib|kendine\s*iyi\s*bak)\b/i,
|
|
31
|
-
/^(hayirli\s*geceler|hayırlı\s*geceler)\b/i,
|
|
32
|
-
/^(iyi\s*gunler|iyi\s*günler)\b/i,
|
|
33
|
-
];
|
|
34
|
-
// Onay kalıpları
|
|
35
|
-
export const ACK_PATTERNS = [
|
|
36
|
-
/^(tamam|tmm|tm)\b/i,
|
|
37
|
-
/^(ok|okey|oki|okay)\b/i,
|
|
38
|
-
/^(anladim|anladım|anldm)\b/i,
|
|
39
|
-
/^(evet|evt|he|hee|heh)\b/i,
|
|
40
|
-
/^(olur|olr|tabii?|tabi)\b/i,
|
|
41
|
-
/^(peki|pk|pki)\b/i,
|
|
42
|
-
/^(dogru|doğru)\b/i,
|
|
43
|
-
/^(aynen|ayn)\b/i,
|
|
44
|
-
/^(harika|süper|super|muhteşem|muhtesem)\b/i,
|
|
45
|
-
];
|
|
46
|
-
// Yaygın İngilizce ödünç kelimeler (code-switch tespiti için)
|
|
47
|
-
export const ENGLISH_BORROWS = new Set([
|
|
48
|
-
'meeting', 'deadline', 'update', 'cancel', 'call', 'mail', 'email',
|
|
49
|
-
'sorry', 'thanks', 'thank', 'please', 'check', 'share', 'link',
|
|
50
|
-
'plan', 'team', 'group', 'chat', 'message', 'online', 'offline',
|
|
51
|
-
'ready', 'done', 'wait', 'send', 'forward', 'delete', 'edit',
|
|
52
|
-
'join', 'leave', 'start', 'stop', 'open', 'close', 'fix', 'bug',
|
|
53
|
-
'test', 'push', 'pull', 'merge', 'deploy', 'build', 'run',
|
|
54
|
-
'cool', 'nice', 'great', 'perfect', 'awesome', 'love', 'like',
|
|
55
|
-
'bro', 'dude', 'man', 'guys', 'btw', 'fyi', 'asap', 'lol',
|
|
56
|
-
]);
|
|
57
|
-
// Türkçe stop words (signatureWords hesaplamasında filtrelenir)
|
|
58
|
-
export const STOP_WORDS = new Set([
|
|
59
|
-
'bir', 'bu', 'şu', 'o', 've', 'ile', 'de', 'da', 'mi', 'mu', 'mı', 'mü',
|
|
60
|
-
'ben', 'sen', 'biz', 'siz', 'ne', 'nasıl', 'neden', 'nere', 'kim',
|
|
61
|
-
'ama', 'fakat', 'ancak', 'veya', 'ya', 'ki', 'için', 'gibi', 'kadar',
|
|
62
|
-
'daha', 'çok', 'en', 'her', 'hiç', 'var', 'yok', 'olan', 'olur',
|
|
63
|
-
'ise', 'diğer', 'öyle', 'böyle', 'şöyle', 'sonra', 'önce', 'şimdi',
|
|
64
|
-
'zaman', 'yani', 'hani', 'işte', 'evet', 'hayır', 'tamam', 'iyi',
|
|
65
|
-
]);
|
|
66
|
-
//# sourceMappingURL=dictionaries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionaries.js","sourceRoot":"","sources":["../../../src/infrastructure/analysis/dictionaries.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IACnC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK;IACtE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK;IACtD,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,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,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO;IACpE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM;IAC/D,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO;IAClE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK;CACjE,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { StyleAnalyzerService } from './style-analyzer.service.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infrastructure/analysis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { IStyleAnalyzer } from '../../domain/ports/style-analyzer.js';
|
|
2
|
-
import type { WhatsAppMessage } from '../../domain/dto/whatsapp.js';
|
|
3
|
-
import type { StyleProfile } from '../../domain/dto/style-profile.js';
|
|
4
|
-
export declare class StyleAnalyzerService implements IStyleAnalyzer {
|
|
5
|
-
analyze(contactName: string, contactNumber: string, messages: WhatsAppMessage[]): StyleProfile;
|
|
6
|
-
private analyzeLength;
|
|
7
|
-
private analyzeStructure;
|
|
8
|
-
private analyzeLanguage;
|
|
9
|
-
private analyzeFormality;
|
|
10
|
-
private analyzeEmoji;
|
|
11
|
-
private analyzeTiming;
|
|
12
|
-
private analyzePatterns;
|
|
13
|
-
private selectExamples;
|
|
14
|
-
private calculateConfidence;
|
|
15
|
-
private generateInstructions;
|
|
16
|
-
private buildMinimalProfile;
|
|
17
|
-
private getWords;
|
|
18
|
-
private countWords;
|
|
19
|
-
private mean;
|
|
20
|
-
private median;
|
|
21
|
-
}
|
|
@@ -1,456 +0,0 @@
|
|
|
1
|
-
import { ABBREVIATIONS, GREETING_PATTERNS, CLOSING_PATTERNS, ACK_PATTERNS, ENGLISH_BORROWS, STOP_WORDS, } from './dictionaries.js';
|
|
2
|
-
const EMOJI_REGEX = /\p{Emoji_Presentation}|\p{Extended_Pictographic}/gu;
|
|
3
|
-
const TR_SPECIAL_CHARS = /[çğıöşüÇĞİÖŞÜ]/g;
|
|
4
|
-
const TR_DROPPABLE_CHARS = /[cgiosuCGIOSU]/g;
|
|
5
|
-
const REPEATED_LETTER_REGEX = /(.)\1{2,}/;
|
|
6
|
-
const PUNCTUATION_END = /[.!?;:…]$/;
|
|
7
|
-
const BURST_THRESHOLD_SEC = 60;
|
|
8
|
-
export class StyleAnalyzerService {
|
|
9
|
-
analyze(contactName, contactNumber, messages) {
|
|
10
|
-
// Sadece kullanıcının (fromMe) mesajlarını analiz et
|
|
11
|
-
const myMessages = messages
|
|
12
|
-
.filter((m) => m.fromMe && m.body.trim().length > 0)
|
|
13
|
-
.sort((a, b) => a.timestamp - b.timestamp);
|
|
14
|
-
if (myMessages.length < 5) {
|
|
15
|
-
return this.buildMinimalProfile(contactName, contactNumber, myMessages);
|
|
16
|
-
}
|
|
17
|
-
const length = this.analyzeLength(myMessages);
|
|
18
|
-
const structure = this.analyzeStructure(myMessages);
|
|
19
|
-
const language = this.analyzeLanguage(myMessages);
|
|
20
|
-
const formality = this.analyzeFormality(myMessages);
|
|
21
|
-
const emoji = this.analyzeEmoji(myMessages);
|
|
22
|
-
const timing = this.analyzeTiming(messages);
|
|
23
|
-
const patterns = this.analyzePatterns(myMessages, messages);
|
|
24
|
-
const exampleMessages = this.selectExamples(myMessages);
|
|
25
|
-
const confidence = this.calculateConfidence(myMessages.length);
|
|
26
|
-
const writingInstructions = this.generateInstructions(contactName, length, structure, language, formality, emoji, patterns);
|
|
27
|
-
return {
|
|
28
|
-
contactName,
|
|
29
|
-
contactNumber,
|
|
30
|
-
analyzedMessageCount: myMessages.length,
|
|
31
|
-
confidence,
|
|
32
|
-
length,
|
|
33
|
-
structure,
|
|
34
|
-
language,
|
|
35
|
-
formality,
|
|
36
|
-
emoji,
|
|
37
|
-
timing,
|
|
38
|
-
patterns,
|
|
39
|
-
exampleMessages,
|
|
40
|
-
writingInstructions,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
// ── Length Metrics ──────────────────────────────────────
|
|
44
|
-
analyzeLength(msgs) {
|
|
45
|
-
const wordCounts = msgs.map((m) => this.countWords(m.body));
|
|
46
|
-
const sorted = [...wordCounts].sort((a, b) => a - b);
|
|
47
|
-
const total = msgs.length;
|
|
48
|
-
return {
|
|
49
|
-
avgWordsPerMessage: this.mean(wordCounts),
|
|
50
|
-
medianWords: this.median(sorted),
|
|
51
|
-
singleWordReplyRatio: wordCounts.filter((w) => w <= 1).length / total,
|
|
52
|
-
distribution: {
|
|
53
|
-
ultraShort: wordCounts.filter((w) => w >= 1 && w <= 3).length / total,
|
|
54
|
-
short: wordCounts.filter((w) => w >= 4 && w <= 10).length / total,
|
|
55
|
-
medium: wordCounts.filter((w) => w >= 11 && w <= 30).length / total,
|
|
56
|
-
long: wordCounts.filter((w) => w >= 31 && w <= 80).length / total,
|
|
57
|
-
paragraph: wordCounts.filter((w) => w > 80).length / total,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
// ── Structure Metrics ──────────────────────────────────
|
|
62
|
-
analyzeStructure(msgs) {
|
|
63
|
-
let bursts = 0;
|
|
64
|
-
let totalBurstMessages = 0;
|
|
65
|
-
let currentBurstSize = 1;
|
|
66
|
-
let inBurst = false;
|
|
67
|
-
for (let i = 1; i < msgs.length; i++) {
|
|
68
|
-
const gap = msgs[i].timestamp - msgs[i - 1].timestamp;
|
|
69
|
-
if (gap < BURST_THRESHOLD_SEC) {
|
|
70
|
-
currentBurstSize++;
|
|
71
|
-
if (!inBurst) {
|
|
72
|
-
inBurst = true;
|
|
73
|
-
bursts++;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
if (inBurst) {
|
|
78
|
-
totalBurstMessages += currentBurstSize;
|
|
79
|
-
currentBurstSize = 1;
|
|
80
|
-
inBurst = false;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (inBurst)
|
|
85
|
-
totalBurstMessages += currentBurstSize;
|
|
86
|
-
const totalTurns = msgs.length;
|
|
87
|
-
return {
|
|
88
|
-
multiBubbleRatio: totalTurns > 0 ? bursts / totalTurns : 0,
|
|
89
|
-
avgBurstSize: bursts > 0 ? totalBurstMessages / bursts : 1,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
// ── Language Metrics ───────────────────────────────────
|
|
93
|
-
analyzeLanguage(msgs) {
|
|
94
|
-
const allWords = msgs.flatMap((m) => this.getWords(m.body));
|
|
95
|
-
const allText = msgs.map((m) => m.body).join(' ');
|
|
96
|
-
const totalWords = allWords.length || 1;
|
|
97
|
-
// Kısaltma oranı
|
|
98
|
-
const abbrCount = allWords.filter((w) => ABBREVIATIONS.has(w.toLowerCase())).length;
|
|
99
|
-
// Türkçe karakter kullanımı
|
|
100
|
-
const trChars = (allText.match(TR_SPECIAL_CHARS) || []).length;
|
|
101
|
-
const droppable = (allText.match(TR_DROPPABLE_CHARS) || []).length;
|
|
102
|
-
const turkishCharRate = trChars + droppable > 0 ? trChars / (trChars + droppable) : 0.5;
|
|
103
|
-
// Code-switching
|
|
104
|
-
const enWords = allWords.filter((w) => ENGLISH_BORROWS.has(w.toLowerCase()));
|
|
105
|
-
const borrowCounts = new Map();
|
|
106
|
-
for (const w of enWords) {
|
|
107
|
-
const lower = w.toLowerCase();
|
|
108
|
-
borrowCounts.set(lower, (borrowCounts.get(lower) || 0) + 1);
|
|
109
|
-
}
|
|
110
|
-
const commonBorrowings = [...borrowCounts.entries()]
|
|
111
|
-
.sort((a, b) => b[1] - a[1])
|
|
112
|
-
.slice(0, 10)
|
|
113
|
-
.map(([word]) => word);
|
|
114
|
-
// Harf tekrarı
|
|
115
|
-
const repeatedMsgs = msgs.filter((m) => REPEATED_LETTER_REGEX.test(m.body));
|
|
116
|
-
return {
|
|
117
|
-
abbreviationRate: abbrCount / totalWords,
|
|
118
|
-
turkishCharRate: Math.round(turkishCharRate * 100) / 100,
|
|
119
|
-
codeSwitchRate: enWords.length / totalWords,
|
|
120
|
-
commonBorrowings,
|
|
121
|
-
repeatedLetterRate: repeatedMsgs.length / msgs.length,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
// ── Formality Metrics ──────────────────────────────────
|
|
125
|
-
analyzeFormality(msgs) {
|
|
126
|
-
const total = msgs.length || 1;
|
|
127
|
-
// Büyük harfle başlayan mesaj oranı
|
|
128
|
-
const capsStart = msgs.filter((m) => /^[A-ZÇĞİÖŞÜ]/.test(m.body.trim())).length;
|
|
129
|
-
// Noktalama ile biten mesaj oranı
|
|
130
|
-
const punctEnd = msgs.filter((m) => PUNCTUATION_END.test(m.body.trim())).length;
|
|
131
|
-
// Noktalama olmayan mesaj oranı
|
|
132
|
-
const noPunct = msgs.filter((m) => !/[.!?,;:…]/.test(m.body)).length;
|
|
133
|
-
const capitalizationScore = capsStart / total;
|
|
134
|
-
const punctuationScore = punctEnd / total;
|
|
135
|
-
const noPunctuationRate = noPunct / total;
|
|
136
|
-
// Composite: yüksek caps + yüksek punct = formel
|
|
137
|
-
const compositeScore = (capitalizationScore * 0.4 + punctuationScore * 0.6);
|
|
138
|
-
return {
|
|
139
|
-
compositeScore: Math.round(compositeScore * 100) / 100,
|
|
140
|
-
capitalizationScore: Math.round(capitalizationScore * 100) / 100,
|
|
141
|
-
punctuationScore: Math.round(punctuationScore * 100) / 100,
|
|
142
|
-
noPunctuationRate: Math.round(noPunctuationRate * 100) / 100,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
// ── Emoji Metrics ──────────────────────────────────────
|
|
146
|
-
analyzeEmoji(msgs) {
|
|
147
|
-
const emojiMap = new Map();
|
|
148
|
-
let totalEmojis = 0;
|
|
149
|
-
let messagesWithEmoji = 0;
|
|
150
|
-
let emojiOnlyMessages = 0;
|
|
151
|
-
const total = msgs.length || 1;
|
|
152
|
-
for (const msg of msgs) {
|
|
153
|
-
const emojis = msg.body.match(EMOJI_REGEX) || [];
|
|
154
|
-
if (emojis.length > 0)
|
|
155
|
-
messagesWithEmoji++;
|
|
156
|
-
if (msg.body.replace(EMOJI_REGEX, '').trim() === '')
|
|
157
|
-
emojiOnlyMessages++;
|
|
158
|
-
totalEmojis += emojis.length;
|
|
159
|
-
for (const e of emojis) {
|
|
160
|
-
emojiMap.set(e, (emojiMap.get(e) || 0) + 1);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
const topEmojis = [...emojiMap.entries()]
|
|
164
|
-
.sort((a, b) => b[1] - a[1])
|
|
165
|
-
.slice(0, 10)
|
|
166
|
-
.map(([emoji]) => emoji);
|
|
167
|
-
return {
|
|
168
|
-
emojiRate: Math.round((totalEmojis / total) * 100) / 100,
|
|
169
|
-
emojiMessageRatio: Math.round((messagesWithEmoji / total) * 100) / 100,
|
|
170
|
-
topEmojis,
|
|
171
|
-
emojiOnlyMessageRatio: Math.round((emojiOnlyMessages / total) * 100) / 100,
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
// ── Timing Metrics ─────────────────────────────────────
|
|
175
|
-
analyzeTiming(allMessages) {
|
|
176
|
-
const sorted = [...allMessages].sort((a, b) => a.timestamp - b.timestamp);
|
|
177
|
-
const responseTimes = [];
|
|
178
|
-
const hourCounts = new Array(24).fill(0);
|
|
179
|
-
for (let i = 1; i < sorted.length; i++) {
|
|
180
|
-
const prev = sorted[i - 1];
|
|
181
|
-
const curr = sorted[i];
|
|
182
|
-
// Yanıt süresi: karşıdan mesaj → benim mesajım
|
|
183
|
-
if (!prev.fromMe && curr.fromMe) {
|
|
184
|
-
const gap = curr.timestamp - prev.timestamp;
|
|
185
|
-
if (gap > 0 && gap < 86400) { // 24 saatten kısa
|
|
186
|
-
responseTimes.push(gap);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
// Saat dağılımı (sadece kendi mesajlarım)
|
|
190
|
-
if (curr.fromMe) {
|
|
191
|
-
const hour = new Date(curr.timestamp * 1000).getHours();
|
|
192
|
-
hourCounts[hour]++;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const sortedTimes = [...responseTimes].sort((a, b) => a - b);
|
|
196
|
-
const medianResponse = sortedTimes.length > 0 ? this.median(sortedTimes) : 0;
|
|
197
|
-
// En aktif 5 saat
|
|
198
|
-
const hourEntries = hourCounts
|
|
199
|
-
.map((count, hour) => ({ hour, count }))
|
|
200
|
-
.sort((a, b) => b.count - a.count);
|
|
201
|
-
const activeHours = hourEntries.slice(0, 5).map((e) => e.hour);
|
|
202
|
-
const peakHour = hourEntries[0]?.hour ?? 12;
|
|
203
|
-
return {
|
|
204
|
-
medianResponseTimeSec: Math.round(medianResponse),
|
|
205
|
-
activeHours,
|
|
206
|
-
peakHour,
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
// ── Pattern Metrics ────────────────────────────────────
|
|
210
|
-
analyzePatterns(myMsgs, allMsgs) {
|
|
211
|
-
const greetingExamples = [];
|
|
212
|
-
const closingExamples = [];
|
|
213
|
-
const ackExamples = [];
|
|
214
|
-
for (const msg of myMsgs) {
|
|
215
|
-
const text = msg.body.trim();
|
|
216
|
-
const lower = text.toLowerCase();
|
|
217
|
-
for (const pattern of GREETING_PATTERNS) {
|
|
218
|
-
if (pattern.test(lower) && !greetingExamples.includes(text)) {
|
|
219
|
-
greetingExamples.push(text);
|
|
220
|
-
break;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
for (const pattern of CLOSING_PATTERNS) {
|
|
224
|
-
if (pattern.test(lower) && !closingExamples.includes(text)) {
|
|
225
|
-
closingExamples.push(text);
|
|
226
|
-
break;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
for (const pattern of ACK_PATTERNS) {
|
|
230
|
-
if (pattern.test(lower) && !ackExamples.includes(text)) {
|
|
231
|
-
ackExamples.push(text);
|
|
232
|
-
break;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
// Greeting style
|
|
237
|
-
const greetingStyle = greetingExamples.length === 0
|
|
238
|
-
? 'none'
|
|
239
|
-
: greetingExamples.some((g) => /merhaba|iyi\s*(günler|akşamlar)/i.test(g))
|
|
240
|
-
? 'formal'
|
|
241
|
-
: greetingExamples.some((g) => /canım|aşkım|tatlım/i.test(g))
|
|
242
|
-
? 'affectionate'
|
|
243
|
-
: 'casual';
|
|
244
|
-
// Closing style
|
|
245
|
-
const closingStyle = closingExamples.length === 0
|
|
246
|
-
? 'none'
|
|
247
|
-
: closingExamples.some((g) => /iyi\s*günler|teşekkürler/i.test(g))
|
|
248
|
-
? 'formal'
|
|
249
|
-
: closingExamples.some((g) => /öpüyorum|canım/i.test(g))
|
|
250
|
-
? 'affectionate'
|
|
251
|
-
: 'casual';
|
|
252
|
-
// Ack style
|
|
253
|
-
const ackStyle = ackExamples.length === 0
|
|
254
|
-
? 'standard'
|
|
255
|
-
: ackExamples.some((a) => /^(ok|tmm|tm|he|hee)$/i.test(a))
|
|
256
|
-
? 'minimal'
|
|
257
|
-
: ackExamples.some((a) => /harika|süper|muhteşem/i.test(a))
|
|
258
|
-
? 'enthusiastic'
|
|
259
|
-
: 'standard';
|
|
260
|
-
// Signature words (sık kullanılan, stop word olmayan)
|
|
261
|
-
const wordFreq = new Map();
|
|
262
|
-
for (const msg of myMsgs) {
|
|
263
|
-
for (const word of this.getWords(msg.body)) {
|
|
264
|
-
const lower = word.toLowerCase();
|
|
265
|
-
if (lower.length < 3)
|
|
266
|
-
continue;
|
|
267
|
-
if (STOP_WORDS.has(lower))
|
|
268
|
-
continue;
|
|
269
|
-
if (ABBREVIATIONS.has(lower))
|
|
270
|
-
continue;
|
|
271
|
-
wordFreq.set(lower, (wordFreq.get(lower) || 0) + 1);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const signatureWords = [...wordFreq.entries()]
|
|
275
|
-
.filter(([, count]) => count >= 3)
|
|
276
|
-
.sort((a, b) => b[1] - a[1])
|
|
277
|
-
.slice(0, 10)
|
|
278
|
-
.map(([word]) => word);
|
|
279
|
-
return {
|
|
280
|
-
greetingStyle,
|
|
281
|
-
greetingExamples: greetingExamples.slice(0, 5),
|
|
282
|
-
closingStyle,
|
|
283
|
-
closingExamples: closingExamples.slice(0, 5),
|
|
284
|
-
ackStyle,
|
|
285
|
-
ackExamples: ackExamples.slice(0, 5),
|
|
286
|
-
signatureWords,
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
// ── Example Messages ───────────────────────────────────
|
|
290
|
-
selectExamples(msgs) {
|
|
291
|
-
const examples = [];
|
|
292
|
-
const categories = [
|
|
293
|
-
{ name: 'kisa', filter: (m) => this.countWords(m.body) <= 3 && this.countWords(m.body) >= 1 },
|
|
294
|
-
{ name: 'orta', filter: (m) => this.countWords(m.body) >= 5 && this.countWords(m.body) <= 15 },
|
|
295
|
-
{ name: 'uzun', filter: (m) => this.countWords(m.body) >= 16 },
|
|
296
|
-
{ name: 'emoji', filter: (m) => EMOJI_REGEX.test(m.body) },
|
|
297
|
-
{ name: 'soru', filter: (m) => m.body.includes('?') },
|
|
298
|
-
];
|
|
299
|
-
for (const cat of categories) {
|
|
300
|
-
const matching = msgs.filter(cat.filter);
|
|
301
|
-
if (matching.length > 0) {
|
|
302
|
-
// Rastgele bir örnek seç
|
|
303
|
-
const idx = Math.floor(matching.length / 2);
|
|
304
|
-
const text = matching[idx].body.trim();
|
|
305
|
-
if (!examples.includes(text) && text.length <= 200) {
|
|
306
|
-
examples.push(text);
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
// Genel örnekler ekle (toplam 10'a kadar)
|
|
311
|
-
const step = Math.max(1, Math.floor(msgs.length / 5));
|
|
312
|
-
for (let i = 0; i < msgs.length && examples.length < 10; i += step) {
|
|
313
|
-
const text = msgs[i].body.trim();
|
|
314
|
-
if (!examples.includes(text) && text.length > 0 && text.length <= 200) {
|
|
315
|
-
examples.push(text);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return examples;
|
|
319
|
-
}
|
|
320
|
-
// ── Confidence ─────────────────────────────────────────
|
|
321
|
-
calculateConfidence(totalMessages) {
|
|
322
|
-
// 50 mesaj = 0.3, 200 = 0.5, 500 = 0.7, 1000+ = 0.85+
|
|
323
|
-
const conf = Math.min(totalMessages / 1000, 0.95);
|
|
324
|
-
return Math.round(Math.max(conf, 0.1) * 100) / 100;
|
|
325
|
-
}
|
|
326
|
-
// ── Writing Instructions ───────────────────────────────
|
|
327
|
-
generateInstructions(contactName, length, structure, language, formality, emoji, patterns) {
|
|
328
|
-
const lines = [`${contactName} ile yazisirken su kurallara uy:`];
|
|
329
|
-
// Uzunluk
|
|
330
|
-
if (length.avgWordsPerMessage < 5) {
|
|
331
|
-
lines.push(`- Cok kisa mesajlar yaz (ortalama ${Math.round(length.avgWordsPerMessage)} kelime)`);
|
|
332
|
-
}
|
|
333
|
-
else if (length.avgWordsPerMessage < 15) {
|
|
334
|
-
lines.push(`- Orta uzunlukta mesajlar yaz (ortalama ${Math.round(length.avgWordsPerMessage)} kelime)`);
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
lines.push(`- Detayli mesajlar yaz (ortalama ${Math.round(length.avgWordsPerMessage)} kelime)`);
|
|
338
|
-
}
|
|
339
|
-
// Multi-bubble
|
|
340
|
-
if (structure.multiBubbleRatio > 0.3) {
|
|
341
|
-
lines.push(`- Art arda kisa balonlar halinde yaz (burst: ${Math.round(structure.avgBurstSize)} mesaj)`);
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
lines.push('- Tek mesajda toparla, art arda balon atma');
|
|
345
|
-
}
|
|
346
|
-
// Kısaltma
|
|
347
|
-
if (language.abbreviationRate > 0.1) {
|
|
348
|
-
lines.push('- Turkce kisaltmalar kullan: tmm, slm, nbr gibi');
|
|
349
|
-
}
|
|
350
|
-
else {
|
|
351
|
-
lines.push('- Kelimeleri tam yaz, kisaltma kullanma');
|
|
352
|
-
}
|
|
353
|
-
// Türkçe karakter
|
|
354
|
-
if (language.turkishCharRate < 0.3) {
|
|
355
|
-
lines.push('- Turkce ozel karakterleri KULLANMA (c,g,i,o,s,u yaz)');
|
|
356
|
-
}
|
|
357
|
-
else if (language.turkishCharRate > 0.7) {
|
|
358
|
-
lines.push('- Turkce ozel karakterleri kullan (ç,ğ,ı,ö,ş,ü)');
|
|
359
|
-
}
|
|
360
|
-
// Emoji
|
|
361
|
-
if (emoji.emojiRate > 1) {
|
|
362
|
-
lines.push(`- Bol emoji kullan (mesaj basina ~${Math.round(emoji.emojiRate)} emoji). Favoriler: ${emoji.topEmojis.slice(0, 5).join(' ')}`);
|
|
363
|
-
}
|
|
364
|
-
else if (emoji.emojiRate > 0.3) {
|
|
365
|
-
lines.push(`- Ara sira emoji kullan. Favoriler: ${emoji.topEmojis.slice(0, 3).join(' ')}`);
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
lines.push('- Emoji kullanma veya cok az kullan');
|
|
369
|
-
}
|
|
370
|
-
// Formality
|
|
371
|
-
if (formality.compositeScore < 0.2) {
|
|
372
|
-
lines.push('- Cok informal yaz: buyuk harf ve noktalama kullanma');
|
|
373
|
-
}
|
|
374
|
-
else if (formality.compositeScore > 0.6) {
|
|
375
|
-
lines.push('- Resmi yaz: cumle basinda buyuk harf, sonunda noktalama kullan');
|
|
376
|
-
}
|
|
377
|
-
// Code-switch
|
|
378
|
-
if (language.codeSwitchRate > 0.05 && language.commonBorrowings.length > 0) {
|
|
379
|
-
lines.push(`- Ingilizce kelimeler karistir: ${language.commonBorrowings.slice(0, 5).join(', ')}`);
|
|
380
|
-
}
|
|
381
|
-
// Selamlama
|
|
382
|
-
if (patterns.greetingExamples.length > 0) {
|
|
383
|
-
lines.push(`- Selamlama: "${patterns.greetingExamples[0]}" tarzinda`);
|
|
384
|
-
}
|
|
385
|
-
// Kapanış
|
|
386
|
-
if (patterns.closingExamples.length > 0) {
|
|
387
|
-
lines.push(`- Vedalasma: "${patterns.closingExamples[0]}" tarzinda`);
|
|
388
|
-
}
|
|
389
|
-
// Onay
|
|
390
|
-
if (patterns.ackExamples.length > 0) {
|
|
391
|
-
lines.push(`- Onay: "${patterns.ackExamples[0]}" tarzinda`);
|
|
392
|
-
}
|
|
393
|
-
// Signature words
|
|
394
|
-
if (patterns.signatureWords.length > 0) {
|
|
395
|
-
lines.push(`- Su kelimeleri sik kullan: ${patterns.signatureWords.slice(0, 5).join(', ')}`);
|
|
396
|
-
}
|
|
397
|
-
// Tekrarlı harf
|
|
398
|
-
if (language.repeatedLetterRate > 0.05) {
|
|
399
|
-
lines.push('- Vurgu icin harf tekrarla: "hayirrrr", "eveeet" gibi');
|
|
400
|
-
}
|
|
401
|
-
return lines.join('\n');
|
|
402
|
-
}
|
|
403
|
-
// ── Minimal Profile ────────────────────────────────────
|
|
404
|
-
buildMinimalProfile(contactName, contactNumber, msgs) {
|
|
405
|
-
return {
|
|
406
|
-
contactName,
|
|
407
|
-
contactNumber,
|
|
408
|
-
analyzedMessageCount: msgs.length,
|
|
409
|
-
confidence: 0.1,
|
|
410
|
-
length: {
|
|
411
|
-
avgWordsPerMessage: 0,
|
|
412
|
-
medianWords: 0,
|
|
413
|
-
singleWordReplyRatio: 0,
|
|
414
|
-
distribution: { ultraShort: 0, short: 0, medium: 0, long: 0, paragraph: 0 },
|
|
415
|
-
},
|
|
416
|
-
structure: { multiBubbleRatio: 0, avgBurstSize: 1 },
|
|
417
|
-
language: {
|
|
418
|
-
abbreviationRate: 0, turkishCharRate: 0.5, codeSwitchRate: 0,
|
|
419
|
-
commonBorrowings: [], repeatedLetterRate: 0,
|
|
420
|
-
},
|
|
421
|
-
formality: { compositeScore: 0.5, capitalizationScore: 0.5, punctuationScore: 0.5, noPunctuationRate: 0.5 },
|
|
422
|
-
emoji: { emojiRate: 0, emojiMessageRatio: 0, topEmojis: [], emojiOnlyMessageRatio: 0 },
|
|
423
|
-
timing: { medianResponseTimeSec: 0, activeHours: [], peakHour: 12 },
|
|
424
|
-
patterns: {
|
|
425
|
-
greetingStyle: 'none', greetingExamples: [],
|
|
426
|
-
closingStyle: 'none', closingExamples: [],
|
|
427
|
-
ackStyle: 'standard', ackExamples: [],
|
|
428
|
-
signatureWords: [],
|
|
429
|
-
},
|
|
430
|
-
exampleMessages: msgs.slice(0, 3).map((m) => m.body),
|
|
431
|
-
writingInstructions: `${contactName} ile konusma gecmisi yetersiz (${msgs.length} mesaj). Dogal ve samimi bir ton kullan.`,
|
|
432
|
-
};
|
|
433
|
-
}
|
|
434
|
-
// ── Helpers ────────────────────────────────────────────
|
|
435
|
-
getWords(text) {
|
|
436
|
-
return text.split(/\s+/).filter((w) => w.length > 0);
|
|
437
|
-
}
|
|
438
|
-
countWords(text) {
|
|
439
|
-
return this.getWords(text).length;
|
|
440
|
-
}
|
|
441
|
-
mean(arr) {
|
|
442
|
-
if (arr.length === 0)
|
|
443
|
-
return 0;
|
|
444
|
-
const sum = arr.reduce((a, b) => a + b, 0);
|
|
445
|
-
return Math.round((sum / arr.length) * 100) / 100;
|
|
446
|
-
}
|
|
447
|
-
median(sorted) {
|
|
448
|
-
if (sorted.length === 0)
|
|
449
|
-
return 0;
|
|
450
|
-
const mid = Math.floor(sorted.length / 2);
|
|
451
|
-
return sorted.length % 2 !== 0
|
|
452
|
-
? sorted[mid]
|
|
453
|
-
: Math.round((sorted[mid - 1] + sorted[mid]) / 2);
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
//# sourceMappingURL=style-analyzer.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-analyzer.service.js","sourceRoot":"","sources":["../../../src/infrastructure/analysis/style-analyzer.service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ConversationStyleTool(server, deps) {
|
|
3
|
-
server.tool('analyze_conversation_style', 'Belirli bir kisinin WhatsApp yazisma stilini analiz eder. Diyalog baslatmadan once kullanilmali. Mesaj gecmisini ceker ve dil, uzunluk, emoji, selamlasma kaliplari gibi metrikleri cikarir. Sonuc olarak stil profili ve yazim talimatlari doner.', {
|
|
4
|
-
chat_id: z.string().describe("Hedef kisinin sohbet ID'si (orn: 905551234567@c.us)"),
|
|
5
|
-
message_limit: z.number().optional().describe('Analiz edilecek mesaj sayisi (varsayilan: 100, max: 500)'),
|
|
6
|
-
}, async ({ chat_id, message_limit }) => {
|
|
7
|
-
try {
|
|
8
|
-
const limit = Math.min(message_limit ?? 100, 500);
|
|
9
|
-
const messages = await deps.whatsappService.getMessages(chat_id, limit);
|
|
10
|
-
if (messages.length < 5) {
|
|
11
|
-
return {
|
|
12
|
-
content: [{
|
|
13
|
-
type: 'text',
|
|
14
|
-
text: 'Yeterli mesaj bulunamadi (min 5 mesaj gerekli). Daha fazla mesaj gecmisi olan bir sohbet secin.',
|
|
15
|
-
}],
|
|
16
|
-
isError: true,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
const contactNumber = chat_id.replace(/@.*$/, '');
|
|
20
|
-
// İlk gelen mesajdan isim çıkar
|
|
21
|
-
const incomingMsg = messages.find((m) => !m.fromMe);
|
|
22
|
-
const contactName = incomingMsg?.from ?? contactNumber;
|
|
23
|
-
const profile = deps.styleAnalyzer.analyze(contactName, contactNumber, messages);
|
|
24
|
-
const output = [
|
|
25
|
-
`## Stil Profili: ${profile.contactName}`,
|
|
26
|
-
`Analiz edilen mesaj: ${profile.analyzedMessageCount} | Guven: ${(profile.confidence * 100).toFixed(0)}%`,
|
|
27
|
-
'',
|
|
28
|
-
'### Yazim Talimatlari',
|
|
29
|
-
profile.writingInstructions,
|
|
30
|
-
'',
|
|
31
|
-
'### Ornek Mesajlar (Few-shot)',
|
|
32
|
-
...profile.exampleMessages.map((m, i) => `${i + 1}. "${m}"`),
|
|
33
|
-
'',
|
|
34
|
-
'### Detayli Metrikler',
|
|
35
|
-
`Uzunluk: ort ${profile.length.avgWordsPerMessage} kelime, medyan ${profile.length.medianWords}`,
|
|
36
|
-
`Tek kelime orani: ${(profile.length.singleWordReplyRatio * 100).toFixed(0)}%`,
|
|
37
|
-
`Multi-bubble: ${(profile.structure.multiBubbleRatio * 100).toFixed(0)}% (ort ${profile.structure.avgBurstSize.toFixed(1)} mesaj/burst)`,
|
|
38
|
-
`Kisaltma orani: ${(profile.language.abbreviationRate * 100).toFixed(0)}%`,
|
|
39
|
-
`Turkce karakter: ${(profile.language.turkishCharRate * 100).toFixed(0)}%`,
|
|
40
|
-
`Code-switch: ${(profile.language.codeSwitchRate * 100).toFixed(0)}%`,
|
|
41
|
-
`Emoji: mesaj basina ${profile.emoji.emojiRate} | ${profile.emoji.topEmojis.slice(0, 5).join(' ')}`,
|
|
42
|
-
`Resmiyet: ${(profile.formality.compositeScore * 100).toFixed(0)}%`,
|
|
43
|
-
`Yanit suresi (medyan): ${profile.timing.medianResponseTimeSec}sn`,
|
|
44
|
-
`Aktif saatler: ${profile.timing.activeHours.join(', ')}`,
|
|
45
|
-
`Imza kelimeleri: ${profile.patterns.signatureWords.join(', ') || 'yok'}`,
|
|
46
|
-
].join('\n');
|
|
47
|
-
return { content: [{ type: 'text', text: output }] };
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
return {
|
|
51
|
-
content: [{ type: 'text', text: `Stil analizi basarisiz: ${error.message}` }],
|
|
52
|
-
isError: true,
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=analyze-conversation-style.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-conversation-style.js","sourceRoot":"","sources":["../../../../src/interface/mcp/tools/analyze-conversation-style.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CA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