natureco-cli 5.6.24 → 5.6.26

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/bin/natureco.js CHANGED
@@ -421,12 +421,12 @@ program
421
421
  });
422
422
 
423
423
  program
424
- .command('imessage <action>')
425
- .description('iMessage integration (connect|disconnect|status)')
426
- .action((action) => {
427
- const imessageCmd = require('../src/commands/imessage');
428
- imessageCmd(action);
429
- });
424
+ .command('imessage <action> [recipient] [message]')
425
+ .description('iMessage integration (connect|disconnect|status|probe|send)')
426
+ .action((action, recipient, message) => {
427
+ const imessageCmd = require('../src/commands/imessage');
428
+ imessageCmd(action, recipient, message);
429
+ });
430
430
 
431
431
  program
432
432
  .command('sms <action>')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.6.24",
3
+ "version": "5.6.26",
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"
@@ -6,16 +6,67 @@ const { execSync } = require('child_process');
6
6
 
7
7
  const { checkExistingToken } = require('./channel-helper');
8
8
 
9
- async function imessage(action) {
9
+ async function imessage(action, recipient, message) {
10
10
  if (!action || action === 'connect') return connectImessage();
11
11
  if (action === 'disconnect') return disconnectImessage();
12
12
  if (action === 'status') return statusImessage();
13
13
  if (action === 'probe') return probeImessage();
14
+ if (action === 'send') return sendMessage(recipient, message);
14
15
  console.log(chalk.red('\n❌ Unknown action\n'));
15
- console.log(chalk.gray('Available actions: connect, disconnect, status, probe\n'));
16
+ console.log(chalk.gray('Available actions: connect, disconnect, status, probe, send\n'));
16
17
  process.exit(1);
17
18
  }
18
19
 
20
+ /**
21
+ * v5.6.25: iMessage ile mesaj gönder
22
+ * @param {string} recipient - Telefon numarası veya Apple ID email
23
+ * @param {string} message - Mesaj metni
24
+ */
25
+ async function sendMessage(recipient, message) {
26
+ const config = getConfig();
27
+
28
+ if (!config.imessageCliPath) {
29
+ console.log(chalk.red('\n❌ iMessage bağlı değil. Önce "natureco imessage connect" çalıştırın.\n'));
30
+ process.exit(1);
31
+ }
32
+
33
+ if (!recipient) {
34
+ console.log(chalk.red('\n❌ Alıcı belirtilmedi\n'));
35
+ console.log(chalk.gray('Kullanım: natureco imessage send <numara|email> <mesaj>\n'));
36
+ console.log(chalk.gray('Örnek: natureco imessage send +905551234567 Merhaba!\n'));
37
+ process.exit(1);
38
+ }
39
+
40
+ if (!message) {
41
+ console.log(chalk.red('\n❌ Mesaj belirtilmedi\n'));
42
+ process.exit(1);
43
+ }
44
+
45
+ // Birden fazla kelimeyi birleştir
46
+ const fullMessage = process.argv.slice(process.argv.indexOf(recipient) + 1).join(' ') || message;
47
+
48
+ console.log(chalk.cyan(`\n📤 iMessage gönderiliyor...`));
49
+ console.log(chalk.gray(` Alıcı: ${recipient}`));
50
+ console.log(chalk.gray(` Mesaj: ${fullMessage.slice(0, 60)}${fullMessage.length > 60 ? '...' : ''}\n`));
51
+
52
+ try {
53
+ // imsg send komutu
54
+ const cmd = `${config.imessageCliPath} send --recipient "${recipient}" --text "${fullMessage.replace(/"/g, '\\"')}"`;
55
+ const output = execSync(cmd, { encoding: 'utf8', timeout: 30000 });
56
+
57
+ console.log(chalk.green('✅ Mesaj gönderildi!'));
58
+ if (output && output.trim()) {
59
+ console.log(chalk.gray(output.trim()));
60
+ }
61
+ return { success: true, recipient, message: fullMessage };
62
+ } catch (e) {
63
+ console.log(chalk.red('❌ Mesaj gönderilemedi'));
64
+ if (e.stderr) console.log(chalk.gray(e.stderr.toString()));
65
+ else if (e.message) console.log(chalk.gray(e.message));
66
+ return { success: false, error: e.message };
67
+ }
68
+ }
69
+
19
70
  async function connectImessage() {
20
71
  const config = getConfig();
21
72
  if (!config.providerUrl) {