vantuz 3.4.2 → 3.5.1
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/.env.example +21 -0
- package/.openclaw/completions/openclaw.bash +227 -0
- package/.openclaw/completions/openclaw.fish +1552 -0
- package/.openclaw/completions/openclaw.ps1 +1966 -0
- package/.openclaw/completions/openclaw.zsh +3571 -0
- package/.openclaw/gateway.cmd +10 -0
- package/.openclaw/identity/device.json +7 -0
- package/.openclaw/openclaw.json +40 -0
- package/.windsurf/workflows/vantuz-dev.md +31 -0
- package/DOCS_TR.md +80 -0
- package/LICENSE +45 -45
- package/README.md +52 -21
- 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/n11docs.md +1680 -0
- package/nodes/warehouse.js +238 -238
- package/onboard.js +1 -1
- package/openclawdocs.md +3 -0
- 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/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
- package/workspace/AGENTS.md +73 -0
- package/workspace/BRAND.md +29 -0
- package/workspace/SOUL.md +72 -0
- package/workspace/team/DECISIONS.md +3 -0
- package/workspace/team/GOALS.md +3 -0
- package/workspace/team/PROJECT_STATUS.md +3 -0
- package/workspace/team/agents/dev/SOUL.md +12 -0
- package/workspace/team/agents/josh/SOUL.md +12 -0
- package/workspace/team/agents/marketing/SOUL.md +12 -0
- package/workspace/team/agents/milo/SOUL.md +12 -0
- package/vantuz-3.3.4.tgz +0 -0
|
@@ -1,168 +1,168 @@
|
|
|
1
|
-
// core/marketplace-adapter.js
|
|
2
|
-
// Formal MarketplaceAdapter Interface for Vantuz OS V2
|
|
3
|
-
// Validates that any platform plugin implements required methods.
|
|
4
|
-
|
|
5
|
-
import { log } from './ai-provider.js';
|
|
6
|
-
|
|
7
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
8
|
-
// REQUIRED METHODS DEFINITION
|
|
9
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
10
|
-
|
|
11
|
-
const REQUIRED_METHODS = [
|
|
12
|
-
'testConnection', // () => Promise<boolean>
|
|
13
|
-
'isConnected', // () => boolean
|
|
14
|
-
'getProducts', // (params) => Promise<{success, data}>
|
|
15
|
-
'getOrders', // (params) => Promise<{success, data}>
|
|
16
|
-
'updateStock', // (barcode, qty) => Promise<{success}>
|
|
17
|
-
'updatePrice', // (barcode, price) => Promise<{success}>
|
|
18
|
-
];
|
|
19
|
-
|
|
20
|
-
const OPTIONAL_METHODS = [
|
|
21
|
-
'getCompetitorPrices', // (barcode) => Promise<{success, data: [{seller, price, stock}]}>
|
|
22
|
-
'getCategories', // () => Promise<{success, data}>
|
|
23
|
-
'getReviews', // (productId) => Promise<{success, data}>
|
|
24
|
-
'getProductByBarcode', // (barcode) => Promise<{success, data}>
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
28
|
-
// ADAPTER VALIDATOR
|
|
29
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Validate that a platform adapter implements all required methods.
|
|
33
|
-
* @param {string} name - Platform name (e.g., 'trendyol')
|
|
34
|
-
* @param {object} adapter - Adapter instance or export object
|
|
35
|
-
* @returns {{ valid: boolean, missing: string[] }}
|
|
36
|
-
*/
|
|
37
|
-
export function validateAdapter(name, adapter) {
|
|
38
|
-
const missing = [];
|
|
39
|
-
|
|
40
|
-
for (const method of REQUIRED_METHODS) {
|
|
41
|
-
if (typeof adapter[method] !== 'function') {
|
|
42
|
-
missing.push(method);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const valid = missing.length === 0;
|
|
47
|
-
|
|
48
|
-
if (!valid) {
|
|
49
|
-
log('ERROR', `Adapter "${name}" eksik metodlar`, { missing });
|
|
50
|
-
} else {
|
|
51
|
-
log('INFO', `Adapter "${name}" geçerli ✓`);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return { valid, missing };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Check which optional capabilities an adapter supports.
|
|
59
|
-
* @param {object} adapter
|
|
60
|
-
* @returns {string[]} List of supported optional method names.
|
|
61
|
-
*/
|
|
62
|
-
export function getAdapterCapabilities(adapter) {
|
|
63
|
-
return OPTIONAL_METHODS.filter(m => typeof adapter[m] === 'function');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
67
|
-
// ADAPTER REGISTRY (Dynamic Plugin System)
|
|
68
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
69
|
-
|
|
70
|
-
class AdapterRegistry {
|
|
71
|
-
constructor() {
|
|
72
|
-
this.adapters = new Map(); // name -> { adapter, capabilities, valid }
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Register a platform adapter.
|
|
77
|
-
* @param {string} name - Platform name.
|
|
78
|
-
* @param {object} adapter - Adapter instance or factory export.
|
|
79
|
-
*/
|
|
80
|
-
register(name, adapter) {
|
|
81
|
-
const { valid, missing } = validateAdapter(name, adapter);
|
|
82
|
-
|
|
83
|
-
if (!valid) {
|
|
84
|
-
log('WARN', `Adapter "${name}" kayıtlı ama eksik metodları var`, { missing });
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const capabilities = getAdapterCapabilities(adapter);
|
|
88
|
-
|
|
89
|
-
this.adapters.set(name.toLowerCase(), {
|
|
90
|
-
adapter,
|
|
91
|
-
capabilities,
|
|
92
|
-
valid,
|
|
93
|
-
missing,
|
|
94
|
-
registeredAt: new Date().toISOString()
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
log('INFO', `Adapter registered: ${name}`, { capabilities, valid });
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Get a registered adapter by name.
|
|
102
|
-
*/
|
|
103
|
-
get(name) {
|
|
104
|
-
const entry = this.adapters.get(name.toLowerCase());
|
|
105
|
-
return entry?.adapter || null;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* List all registered adapters with their status.
|
|
110
|
-
*/
|
|
111
|
-
list() {
|
|
112
|
-
const result = [];
|
|
113
|
-
for (const [name, entry] of this.adapters) {
|
|
114
|
-
result.push({
|
|
115
|
-
name,
|
|
116
|
-
valid: entry.valid,
|
|
117
|
-
capabilities: entry.capabilities,
|
|
118
|
-
connected: entry.adapter.isConnected?.() || false,
|
|
119
|
-
missing: entry.missing
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return result;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Get all connected and valid adapters.
|
|
127
|
-
*/
|
|
128
|
-
getActive() {
|
|
129
|
-
return this.list().filter(a => a.valid && a.connected);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Execute a method across all active adapters.
|
|
134
|
-
* @param {string} method - Method name.
|
|
135
|
-
* @param {...any} args - Arguments.
|
|
136
|
-
* @returns {Promise<Map<string, any>>} Results keyed by platform name.
|
|
137
|
-
*/
|
|
138
|
-
async broadcast(method, ...args) {
|
|
139
|
-
const results = new Map();
|
|
140
|
-
const active = this.getActive();
|
|
141
|
-
|
|
142
|
-
for (const entry of active) {
|
|
143
|
-
const adapter = this.get(entry.name);
|
|
144
|
-
if (typeof adapter[method] === 'function') {
|
|
145
|
-
try {
|
|
146
|
-
results.set(entry.name, await adapter[method](...args));
|
|
147
|
-
} catch (e) {
|
|
148
|
-
results.set(entry.name, { success: false, error: e.message });
|
|
149
|
-
log('ERROR', `Broadcast ${method} failed on ${entry.name}`, { error: e.message });
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return results;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Singleton
|
|
159
|
-
let registryInstance = null;
|
|
160
|
-
|
|
161
|
-
export function getAdapterRegistry() {
|
|
162
|
-
if (!registryInstance) {
|
|
163
|
-
registryInstance = new AdapterRegistry();
|
|
164
|
-
}
|
|
165
|
-
return registryInstance;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export default AdapterRegistry;
|
|
1
|
+
// core/marketplace-adapter.js
|
|
2
|
+
// Formal MarketplaceAdapter Interface for Vantuz OS V2
|
|
3
|
+
// Validates that any platform plugin implements required methods.
|
|
4
|
+
|
|
5
|
+
import { log } from './ai-provider.js';
|
|
6
|
+
|
|
7
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
8
|
+
// REQUIRED METHODS DEFINITION
|
|
9
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
10
|
+
|
|
11
|
+
const REQUIRED_METHODS = [
|
|
12
|
+
'testConnection', // () => Promise<boolean>
|
|
13
|
+
'isConnected', // () => boolean
|
|
14
|
+
'getProducts', // (params) => Promise<{success, data}>
|
|
15
|
+
'getOrders', // (params) => Promise<{success, data}>
|
|
16
|
+
'updateStock', // (barcode, qty) => Promise<{success}>
|
|
17
|
+
'updatePrice', // (barcode, price) => Promise<{success}>
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const OPTIONAL_METHODS = [
|
|
21
|
+
'getCompetitorPrices', // (barcode) => Promise<{success, data: [{seller, price, stock}]}>
|
|
22
|
+
'getCategories', // () => Promise<{success, data}>
|
|
23
|
+
'getReviews', // (productId) => Promise<{success, data}>
|
|
24
|
+
'getProductByBarcode', // (barcode) => Promise<{success, data}>
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
28
|
+
// ADAPTER VALIDATOR
|
|
29
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Validate that a platform adapter implements all required methods.
|
|
33
|
+
* @param {string} name - Platform name (e.g., 'trendyol')
|
|
34
|
+
* @param {object} adapter - Adapter instance or export object
|
|
35
|
+
* @returns {{ valid: boolean, missing: string[] }}
|
|
36
|
+
*/
|
|
37
|
+
export function validateAdapter(name, adapter) {
|
|
38
|
+
const missing = [];
|
|
39
|
+
|
|
40
|
+
for (const method of REQUIRED_METHODS) {
|
|
41
|
+
if (typeof adapter[method] !== 'function') {
|
|
42
|
+
missing.push(method);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const valid = missing.length === 0;
|
|
47
|
+
|
|
48
|
+
if (!valid) {
|
|
49
|
+
log('ERROR', `Adapter "${name}" eksik metodlar`, { missing });
|
|
50
|
+
} else {
|
|
51
|
+
log('INFO', `Adapter "${name}" geçerli ✓`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return { valid, missing };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check which optional capabilities an adapter supports.
|
|
59
|
+
* @param {object} adapter
|
|
60
|
+
* @returns {string[]} List of supported optional method names.
|
|
61
|
+
*/
|
|
62
|
+
export function getAdapterCapabilities(adapter) {
|
|
63
|
+
return OPTIONAL_METHODS.filter(m => typeof adapter[m] === 'function');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
67
|
+
// ADAPTER REGISTRY (Dynamic Plugin System)
|
|
68
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
69
|
+
|
|
70
|
+
class AdapterRegistry {
|
|
71
|
+
constructor() {
|
|
72
|
+
this.adapters = new Map(); // name -> { adapter, capabilities, valid }
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Register a platform adapter.
|
|
77
|
+
* @param {string} name - Platform name.
|
|
78
|
+
* @param {object} adapter - Adapter instance or factory export.
|
|
79
|
+
*/
|
|
80
|
+
register(name, adapter) {
|
|
81
|
+
const { valid, missing } = validateAdapter(name, adapter);
|
|
82
|
+
|
|
83
|
+
if (!valid) {
|
|
84
|
+
log('WARN', `Adapter "${name}" kayıtlı ama eksik metodları var`, { missing });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const capabilities = getAdapterCapabilities(adapter);
|
|
88
|
+
|
|
89
|
+
this.adapters.set(name.toLowerCase(), {
|
|
90
|
+
adapter,
|
|
91
|
+
capabilities,
|
|
92
|
+
valid,
|
|
93
|
+
missing,
|
|
94
|
+
registeredAt: new Date().toISOString()
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
log('INFO', `Adapter registered: ${name}`, { capabilities, valid });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Get a registered adapter by name.
|
|
102
|
+
*/
|
|
103
|
+
get(name) {
|
|
104
|
+
const entry = this.adapters.get(name.toLowerCase());
|
|
105
|
+
return entry?.adapter || null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* List all registered adapters with their status.
|
|
110
|
+
*/
|
|
111
|
+
list() {
|
|
112
|
+
const result = [];
|
|
113
|
+
for (const [name, entry] of this.adapters) {
|
|
114
|
+
result.push({
|
|
115
|
+
name,
|
|
116
|
+
valid: entry.valid,
|
|
117
|
+
capabilities: entry.capabilities,
|
|
118
|
+
connected: entry.adapter.isConnected?.() || false,
|
|
119
|
+
missing: entry.missing
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Get all connected and valid adapters.
|
|
127
|
+
*/
|
|
128
|
+
getActive() {
|
|
129
|
+
return this.list().filter(a => a.valid && a.connected);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Execute a method across all active adapters.
|
|
134
|
+
* @param {string} method - Method name.
|
|
135
|
+
* @param {...any} args - Arguments.
|
|
136
|
+
* @returns {Promise<Map<string, any>>} Results keyed by platform name.
|
|
137
|
+
*/
|
|
138
|
+
async broadcast(method, ...args) {
|
|
139
|
+
const results = new Map();
|
|
140
|
+
const active = this.getActive();
|
|
141
|
+
|
|
142
|
+
for (const entry of active) {
|
|
143
|
+
const adapter = this.get(entry.name);
|
|
144
|
+
if (typeof adapter[method] === 'function') {
|
|
145
|
+
try {
|
|
146
|
+
results.set(entry.name, await adapter[method](...args));
|
|
147
|
+
} catch (e) {
|
|
148
|
+
results.set(entry.name, { success: false, error: e.message });
|
|
149
|
+
log('ERROR', `Broadcast ${method} failed on ${entry.name}`, { error: e.message });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return results;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Singleton
|
|
159
|
+
let registryInstance = null;
|
|
160
|
+
|
|
161
|
+
export function getAdapterRegistry() {
|
|
162
|
+
if (!registryInstance) {
|
|
163
|
+
registryInstance = new AdapterRegistry();
|
|
164
|
+
}
|
|
165
|
+
return registryInstance;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export default AdapterRegistry;
|