vantuz 3.4.2 → 3.5.0
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/LICENSE +45 -45
- package/admin-keygen.js +51 -0
- package/cli.js +685 -585
- package/config.js +733 -733
- package/core/agent-loop.js +190 -190
- package/core/ai-provider.js +298 -261
- package/core/automation.js +523 -523
- package/core/brand-analyst.js +101 -0
- package/core/channels.js +167 -167
- package/core/dashboard.js +230 -230
- package/core/database.js +135 -37
- package/core/eia-monitor.js +3 -1
- package/core/engine.js +648 -636
- package/core/gateway.js +447 -447
- package/core/learning.js +214 -214
- package/core/license.js +113 -0
- package/core/marketplace-adapter.js +168 -168
- package/core/memory.js +190 -190
- package/core/migrations/001-initial-schema.sql +1 -1
- package/core/queue.js +120 -120
- package/core/self-healer.js +314 -314
- package/core/unified-product.js +214 -214
- package/core/vision-service.js +113 -113
- package/index.js +217 -174
- package/modules/crm/sentiment-crm.js +231 -231
- package/modules/healer/listing-healer.js +201 -201
- package/modules/oracle/predictor.js +214 -214
- package/modules/researcher/agent.js +169 -169
- package/modules/team/agents/base.js +92 -92
- package/modules/team/agents/dev.js +33 -33
- package/modules/team/agents/josh.js +40 -40
- package/modules/team/agents/marketing.js +33 -33
- package/modules/team/agents/milo.js +36 -36
- package/modules/team/index.js +78 -78
- package/modules/team/shared-memory.js +87 -87
- package/modules/war-room/competitor-tracker.js +250 -250
- package/modules/war-room/pricing-engine.js +308 -308
- package/nodes/warehouse.js +238 -238
- package/onboard.js +1 -1
- package/package.json +7 -5
- package/platforms/pttavm.js +14 -14
- package/plugins/vantuz/index.js +528 -528
- package/plugins/vantuz/memory/hippocampus.js +465 -465
- package/plugins/vantuz/package.json +20 -20
- package/plugins/vantuz/platforms/_template.js +118 -118
- package/plugins/vantuz/platforms/amazon.js +236 -236
- package/plugins/vantuz/platforms/ciceksepeti.js +166 -166
- package/plugins/vantuz/platforms/hepsiburada.js +180 -180
- package/plugins/vantuz/platforms/index.js +165 -165
- package/plugins/vantuz/platforms/n11.js +229 -229
- package/plugins/vantuz/platforms/pazarama.js +154 -154
- package/plugins/vantuz/platforms/pttavm.js +127 -127
- package/plugins/vantuz/platforms/trendyol.js +326 -326
- package/plugins/vantuz/services/alerts.js +253 -253
- package/plugins/vantuz/services/license.js +34 -34
- package/plugins/vantuz/services/scheduler.js +232 -232
- package/plugins/vantuz/tools/analytics.js +152 -152
- package/plugins/vantuz/tools/crossborder.js +187 -187
- package/plugins/vantuz/tools/nl-parser.js +211 -211
- package/plugins/vantuz/tools/product.js +110 -110
- package/plugins/vantuz/tools/quick-report.js +175 -175
- package/plugins/vantuz/tools/repricer.js +314 -314
- package/plugins/vantuz/tools/sentiment.js +115 -115
- package/plugins/vantuz/tools/vision.js +257 -257
- package/private.pem +28 -0
- package/public.pem +9 -0
- package/server/app.js +260 -260
- package/server/public/index.html +514 -514
- package/start.bat +33 -33
- package/vantuz.sqlite +0 -0
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 🧠 Sentiment AI Tool
|
|
3
|
-
* Müşteri yorumlarını analiz et ve aksiyon öner
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export const sentimentTool = {
|
|
7
|
-
name: 'sentiment',
|
|
8
|
-
|
|
9
|
-
async execute(params, context) {
|
|
10
|
-
const { api, memory, license } = context;
|
|
11
|
-
const { productId, platform = 'all', period = '30d' } = params;
|
|
12
|
-
|
|
13
|
-
if (!license.hasFeature('sentiment')) {
|
|
14
|
-
return { success: false, error: 'Sentiment AI için lisans gerekli.' };
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Yorumları topla
|
|
18
|
-
const reviews = await this._fetchReviews(productId, platform, period, api);
|
|
19
|
-
|
|
20
|
-
if (reviews.length === 0) {
|
|
21
|
-
return { success: true, message: 'Analiz edilecek yorum bulunamadı.' };
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// AI ile analiz
|
|
25
|
-
const analysis = await this._analyzeReviews(reviews, api);
|
|
26
|
-
|
|
27
|
-
// Hafızaya kaydet
|
|
28
|
-
await memory.remember('insight', {
|
|
29
|
-
type: 'sentiment_analysis',
|
|
30
|
-
productId,
|
|
31
|
-
platform,
|
|
32
|
-
analysis
|
|
33
|
-
}, { productId, platform });
|
|
34
|
-
|
|
35
|
-
// Ürün bağlamını güncelle
|
|
36
|
-
await memory.updateProductContext(productId, {
|
|
37
|
-
customerSentiment: {
|
|
38
|
-
positive: analysis.positiveRatio,
|
|
39
|
-
negative: analysis.negativeRatio,
|
|
40
|
-
neutral: analysis.neutralRatio,
|
|
41
|
-
topComplaints: analysis.topComplaints,
|
|
42
|
-
lastAnalyzed: new Date()
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
success: true,
|
|
48
|
-
summary: {
|
|
49
|
-
totalReviews: reviews.length,
|
|
50
|
-
period,
|
|
51
|
-
platform
|
|
52
|
-
},
|
|
53
|
-
sentiment: {
|
|
54
|
-
positive: `${Math.round(analysis.positiveRatio * 100)}%`,
|
|
55
|
-
negative: `${Math.round(analysis.negativeRatio * 100)}%`,
|
|
56
|
-
neutral: `${Math.round(analysis.neutralRatio * 100)}%`,
|
|
57
|
-
averageRating: analysis.averageRating
|
|
58
|
-
},
|
|
59
|
-
insights: {
|
|
60
|
-
topComplaints: analysis.topComplaints,
|
|
61
|
-
topPraises: analysis.topPraises,
|
|
62
|
-
keywords: analysis.keywords
|
|
63
|
-
},
|
|
64
|
-
recommendations: analysis.recommendations,
|
|
65
|
-
suggestedResponses: analysis.suggestedResponses
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
async _fetchReviews(productId, platform, period, api) {
|
|
70
|
-
// TODO: Platform API'lerinden yorum çekme
|
|
71
|
-
// Mock data
|
|
72
|
-
return [
|
|
73
|
-
{ rating: 5, text: 'Harika ürün, çok memnunum!', date: new Date() },
|
|
74
|
-
{ rating: 4, text: 'Güzel ama kargo biraz geç geldi.', date: new Date() },
|
|
75
|
-
{ rating: 2, text: 'Kumaş kalitesi beklenenden düşük.', date: new Date() },
|
|
76
|
-
{ rating: 1, text: 'Beden tablosu yanlış, iade ettim.', date: new Date() },
|
|
77
|
-
{ rating: 5, text: 'Fiyat performans oranı çok iyi.', date: new Date() }
|
|
78
|
-
];
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
async _analyzeReviews(reviews, api) {
|
|
82
|
-
const positive = reviews.filter(r => r.rating >= 4).length;
|
|
83
|
-
const negative = reviews.filter(r => r.rating <= 2).length;
|
|
84
|
-
const neutral = reviews.filter(r => r.rating === 3).length;
|
|
85
|
-
const total = reviews.length;
|
|
86
|
-
const avgRating = reviews.reduce((sum, r) => sum + r.rating, 0) / total;
|
|
87
|
-
|
|
88
|
-
// TODO: Gerçek NLP analizi için AI kullan
|
|
89
|
-
return {
|
|
90
|
-
positiveRatio: positive / total,
|
|
91
|
-
negativeRatio: negative / total,
|
|
92
|
-
neutralRatio: neutral / total,
|
|
93
|
-
averageRating: avgRating.toFixed(1),
|
|
94
|
-
topComplaints: [
|
|
95
|
-
{ issue: 'Kumaş kalitesi', count: 3, severity: 'high' },
|
|
96
|
-
{ issue: 'Beden tablosu', count: 2, severity: 'medium' },
|
|
97
|
-
{ issue: 'Kargo gecikmesi', count: 1, severity: 'low' }
|
|
98
|
-
],
|
|
99
|
-
topPraises: [
|
|
100
|
-
{ aspect: 'Fiyat performans', count: 5 },
|
|
101
|
-
{ aspect: 'Tasarım', count: 3 }
|
|
102
|
-
],
|
|
103
|
-
keywords: ['kalite', 'fiyat', 'kargo', 'beden', 'güzel'],
|
|
104
|
-
recommendations: [
|
|
105
|
-
'⚠️ Kumaş kalitesi şikayeti yüksek. Tedarikçi ile görüşün.',
|
|
106
|
-
'📏 Beden tablosunu güncelleyin veya detaylı ölçüler ekleyin.',
|
|
107
|
-
'📦 Kargo süresini ürün açıklamasında belirtin.'
|
|
108
|
-
],
|
|
109
|
-
suggestedResponses: {
|
|
110
|
-
negative: 'Yaşadığınız sorun için özür dileriz. Sizinle iletişime geçip sorunu çözmek istiyoruz. Lütfen sipariş numaranızla bize ulaşın.',
|
|
111
|
-
positive: 'Güzel yorumunuz için teşekkür ederiz! 🙏 Sizi mutlu etmek en büyük motivasyonumuz.'
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* 🧠 Sentiment AI Tool
|
|
3
|
+
* Müşteri yorumlarını analiz et ve aksiyon öner
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const sentimentTool = {
|
|
7
|
+
name: 'sentiment',
|
|
8
|
+
|
|
9
|
+
async execute(params, context) {
|
|
10
|
+
const { api, memory, license } = context;
|
|
11
|
+
const { productId, platform = 'all', period = '30d' } = params;
|
|
12
|
+
|
|
13
|
+
if (!license.hasFeature('sentiment')) {
|
|
14
|
+
return { success: false, error: 'Sentiment AI için lisans gerekli.' };
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Yorumları topla
|
|
18
|
+
const reviews = await this._fetchReviews(productId, platform, period, api);
|
|
19
|
+
|
|
20
|
+
if (reviews.length === 0) {
|
|
21
|
+
return { success: true, message: 'Analiz edilecek yorum bulunamadı.' };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// AI ile analiz
|
|
25
|
+
const analysis = await this._analyzeReviews(reviews, api);
|
|
26
|
+
|
|
27
|
+
// Hafızaya kaydet
|
|
28
|
+
await memory.remember('insight', {
|
|
29
|
+
type: 'sentiment_analysis',
|
|
30
|
+
productId,
|
|
31
|
+
platform,
|
|
32
|
+
analysis
|
|
33
|
+
}, { productId, platform });
|
|
34
|
+
|
|
35
|
+
// Ürün bağlamını güncelle
|
|
36
|
+
await memory.updateProductContext(productId, {
|
|
37
|
+
customerSentiment: {
|
|
38
|
+
positive: analysis.positiveRatio,
|
|
39
|
+
negative: analysis.negativeRatio,
|
|
40
|
+
neutral: analysis.neutralRatio,
|
|
41
|
+
topComplaints: analysis.topComplaints,
|
|
42
|
+
lastAnalyzed: new Date()
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
summary: {
|
|
49
|
+
totalReviews: reviews.length,
|
|
50
|
+
period,
|
|
51
|
+
platform
|
|
52
|
+
},
|
|
53
|
+
sentiment: {
|
|
54
|
+
positive: `${Math.round(analysis.positiveRatio * 100)}%`,
|
|
55
|
+
negative: `${Math.round(analysis.negativeRatio * 100)}%`,
|
|
56
|
+
neutral: `${Math.round(analysis.neutralRatio * 100)}%`,
|
|
57
|
+
averageRating: analysis.averageRating
|
|
58
|
+
},
|
|
59
|
+
insights: {
|
|
60
|
+
topComplaints: analysis.topComplaints,
|
|
61
|
+
topPraises: analysis.topPraises,
|
|
62
|
+
keywords: analysis.keywords
|
|
63
|
+
},
|
|
64
|
+
recommendations: analysis.recommendations,
|
|
65
|
+
suggestedResponses: analysis.suggestedResponses
|
|
66
|
+
};
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
async _fetchReviews(productId, platform, period, api) {
|
|
70
|
+
// TODO: Platform API'lerinden yorum çekme
|
|
71
|
+
// Mock data
|
|
72
|
+
return [
|
|
73
|
+
{ rating: 5, text: 'Harika ürün, çok memnunum!', date: new Date() },
|
|
74
|
+
{ rating: 4, text: 'Güzel ama kargo biraz geç geldi.', date: new Date() },
|
|
75
|
+
{ rating: 2, text: 'Kumaş kalitesi beklenenden düşük.', date: new Date() },
|
|
76
|
+
{ rating: 1, text: 'Beden tablosu yanlış, iade ettim.', date: new Date() },
|
|
77
|
+
{ rating: 5, text: 'Fiyat performans oranı çok iyi.', date: new Date() }
|
|
78
|
+
];
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
async _analyzeReviews(reviews, api) {
|
|
82
|
+
const positive = reviews.filter(r => r.rating >= 4).length;
|
|
83
|
+
const negative = reviews.filter(r => r.rating <= 2).length;
|
|
84
|
+
const neutral = reviews.filter(r => r.rating === 3).length;
|
|
85
|
+
const total = reviews.length;
|
|
86
|
+
const avgRating = reviews.reduce((sum, r) => sum + r.rating, 0) / total;
|
|
87
|
+
|
|
88
|
+
// TODO: Gerçek NLP analizi için AI kullan
|
|
89
|
+
return {
|
|
90
|
+
positiveRatio: positive / total,
|
|
91
|
+
negativeRatio: negative / total,
|
|
92
|
+
neutralRatio: neutral / total,
|
|
93
|
+
averageRating: avgRating.toFixed(1),
|
|
94
|
+
topComplaints: [
|
|
95
|
+
{ issue: 'Kumaş kalitesi', count: 3, severity: 'high' },
|
|
96
|
+
{ issue: 'Beden tablosu', count: 2, severity: 'medium' },
|
|
97
|
+
{ issue: 'Kargo gecikmesi', count: 1, severity: 'low' }
|
|
98
|
+
],
|
|
99
|
+
topPraises: [
|
|
100
|
+
{ aspect: 'Fiyat performans', count: 5 },
|
|
101
|
+
{ aspect: 'Tasarım', count: 3 }
|
|
102
|
+
],
|
|
103
|
+
keywords: ['kalite', 'fiyat', 'kargo', 'beden', 'güzel'],
|
|
104
|
+
recommendations: [
|
|
105
|
+
'⚠️ Kumaş kalitesi şikayeti yüksek. Tedarikçi ile görüşün.',
|
|
106
|
+
'📏 Beden tablosunu güncelleyin veya detaylı ölçüler ekleyin.',
|
|
107
|
+
'📦 Kargo süresini ürün açıklamasında belirtin.'
|
|
108
|
+
],
|
|
109
|
+
suggestedResponses: {
|
|
110
|
+
negative: 'Yaşadığınız sorun için özür dileriz. Sizinle iletişime geçip sorunu çözmek istiyoruz. Lütfen sipariş numaranızla bize ulaşın.',
|
|
111
|
+
positive: 'Güzel yorumunuz için teşekkür ederiz! 🙏 Sizi mutlu etmek en büyük motivasyonumuz.'
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|