natureco-cli 5.6.27 → 5.6.28
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/src/commands/imessage.js +47 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natureco-cli",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.28",
|
|
4
4
|
"description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"natureco": "bin/natureco.js"
|
package/src/commands/imessage.js
CHANGED
|
@@ -12,8 +12,10 @@ async function imessage(action, recipient, message) {
|
|
|
12
12
|
if (action === 'status') return statusImessage();
|
|
13
13
|
if (action === 'probe') return probeImessage();
|
|
14
14
|
if (action === 'send') return sendMessage(recipient, message);
|
|
15
|
+
if (action === 'allow') return allowNumber(recipient);
|
|
16
|
+
if (action === 'disallow') return disallowNumber(recipient);
|
|
15
17
|
console.log(chalk.red('\n❌ Unknown action\n'));
|
|
16
|
-
console.log(chalk.gray('Available actions: connect, disconnect, status, probe, send\n'));
|
|
18
|
+
console.log(chalk.gray('Available actions: connect, disconnect, status, probe, send, allow, disallow\n'));
|
|
17
19
|
process.exit(1);
|
|
18
20
|
}
|
|
19
21
|
|
|
@@ -22,6 +24,50 @@ async function imessage(action, recipient, message) {
|
|
|
22
24
|
* @param {string} recipient - Telefon numarası veya Apple ID email
|
|
23
25
|
* @param {string} message - Mesaj metni
|
|
24
26
|
*/
|
|
27
|
+
/**
|
|
28
|
+
* v5.6.27: Allow/Disallow numara
|
|
29
|
+
*/
|
|
30
|
+
async function allowNumber(number) {
|
|
31
|
+
const config = getConfig();
|
|
32
|
+
if (!config.imessageCliPath) {
|
|
33
|
+
console.log(chalk.red('\n❌ iMessage bağlı değil.\n'));
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
if (!number) {
|
|
37
|
+
console.log(chalk.red('\n❌ Numara belirtilmedi\n'));
|
|
38
|
+
console.log(chalk.gray('Kullanım: natureco imessage allow <numara|email>\n'));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const allowList = config.imessageAllowedNumbers || [];
|
|
43
|
+
if (!allowList.includes(number)) {
|
|
44
|
+
allowList.push(number);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// DM politikasini 'allowlist' yap
|
|
48
|
+
config.imessageDmPolicy = 'allowlist';
|
|
49
|
+
config.imessageAllowedNumbers = allowList;
|
|
50
|
+
saveConfig(config);
|
|
51
|
+
|
|
52
|
+
console.log(chalk.green(`\n✅ İzin verildi: ${number}`));
|
|
53
|
+
console.log(chalk.gray(`Toplam izinli: ${allowList.length}`));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function disallowNumber(number) {
|
|
57
|
+
const config = getConfig();
|
|
58
|
+
if (!number) {
|
|
59
|
+
console.log(chalk.red('\n❌ Numara belirtilmedi\n'));
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const allowList = config.imessageAllowedNumbers || [];
|
|
64
|
+
const newList = allowList.filter(n => n !== number);
|
|
65
|
+
config.imessageAllowedNumbers = newList;
|
|
66
|
+
saveConfig(config);
|
|
67
|
+
|
|
68
|
+
console.log(chalk.green(`\n✅ İzin kaldırıldı: ${number}`));
|
|
69
|
+
}
|
|
70
|
+
|
|
25
71
|
async function sendMessage(recipient, message) {
|
|
26
72
|
const config = getConfig();
|
|
27
73
|
|