natureco-cli 5.20.3 → 5.20.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/README.md CHANGED
@@ -343,6 +343,8 @@ natureco logs # Log dosyaları
343
343
 
344
344
  ```bash
345
345
  natureco naturehub post <text> # NatureHub paylaşımı
346
+ natureco naturehub dm <user> <msg> # DM gönder
347
+ natureco naturehub inbox # Gelen kutusu
346
348
  natureco naturehub feed # Akışı gör
347
349
 
348
350
  natureco seo audit natureco.me # SEO analizi (skor)
package/bin/natureco.js CHANGED
@@ -598,7 +598,7 @@ program
598
598
 
599
599
  program
600
600
  .command('naturehub [action] [params...]')
601
- .description('Nature Hub\'a içerik yayınla (post|robot-house|forum|list|info|config)')
601
+ .description('Nature Hub\'a içerik yayınla (post|dm|inbox|robot-house|forum|list|info|config)')
602
602
  .action((action, params) => {
603
603
  naturehub(action ? [action, ...(params || [])] : []);
604
604
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.20.3",
3
+ "version": "5.20.4",
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"
@@ -88,6 +88,7 @@ async function chat(botName, options = {}) {
88
88
  console.log(tui.C.muted(' Chat komutu artık ') + tui.C.brand('repl') + tui.C.muted(' komutunu çağırıyor (Phase 9 TUI engine)'));
89
89
  console.log(tui.C.muted(' Tüm özellikler korundu: memory, sessions, hooks, custom commands'));
90
90
  console.log('');
91
+ if (options.noStream) replArgs.push('--no-stream');
91
92
  return repl(replArgs);
92
93
  }
93
94
 
@@ -99,6 +99,8 @@ function help() {
99
99
  title: 'NatureCo Native',
100
100
  rows: [
101
101
  { name: 'natureco naturehub post "<text>"', desc: 'NatureCo API ile bota mesaj gönder' },
102
+ { name: 'natureco naturehub dm <user> "<msg>"', desc: 'Kullanıcıya DM gönder' },
103
+ { name: 'natureco naturehub inbox [--unread]', desc: 'Gelen kutusunu kontrol et' },
102
104
  { name: 'natureco naturehub list', desc: 'Botlarını listele' },
103
105
  { name: 'natureco naturehub info [bot_id]', desc: 'Bot detayı' },
104
106
  { name: 'natureco medium draft <file.md>', desc: 'Medium makale taslağı' },
@@ -3,11 +3,13 @@
3
3
  *
4
4
  * Kullanım:
5
5
  * natureco naturehub post <text> Bota mesaj gönder
6
- * natureco naturehub robot-house <content> Robot House gönderisi
7
- * natureco naturehub forum <title> <content> Forum gönderisi
8
- * natureco naturehub list Botları listele
9
- * natureco naturehub info [bot_id] Bot detayı
10
- * natureco naturehub config Ayarları göster
6
+ * natureco naturehub dm <user> <text> DM gönder
7
+ * natureco naturehub inbox [--unread] Gelen kutusu
8
+ * natureco naturehub robot-house <content> Robot House gönderisi
9
+ * natureco naturehub forum <title> <content> Forum gönderisi
10
+ * natureco naturehub list Botları listele
11
+ * natureco naturehub info [bot_id] Bot detayı
12
+ * natureco naturehub config Ayarları göster
11
13
  *
12
14
  * API: https://api.natureco.me/api/v1
13
15
  */
@@ -215,6 +217,91 @@ async function cmdRobotHouse(args) {
215
217
  }
216
218
  }
217
219
 
220
+ async function cmdDm(args) {
221
+ const text = args.join(' ').trim();
222
+ const spaceIdx = text.indexOf(' ');
223
+ let username, message;
224
+
225
+ if (spaceIdx > 0) {
226
+ username = text.slice(0, spaceIdx).trim();
227
+ message = text.slice(spaceIdx + 1).trim();
228
+ } else if (text) {
229
+ username = text;
230
+ message = '';
231
+ } else {
232
+ username = '';
233
+ message = '';
234
+ }
235
+
236
+ if (!username || !message) {
237
+ console.log(chalk.red('\n Kullanım: natureco naturehub dm <kullanıcı_adı> "<mesaj>"\n'));
238
+ console.log(chalk.gray(' Örnek: natureco naturehub dm ahmet "Merhaba, nasılsın?"\n'));
239
+ return;
240
+ }
241
+
242
+ const token = getApiKey();
243
+ if (!token) {
244
+ console.log(chalk.yellow('\n ⚠️ API key tanımlı değil. Önce `natureco login` ile giriş yapın.\n'));
245
+ return;
246
+ }
247
+
248
+ console.log(chalk.cyan(`\n 📤 DM gönderiliyor: @${username}...\n`));
249
+ console.log(chalk.gray(` "${message.slice(0, 200)}"\n`));
250
+
251
+ try {
252
+ const result = await apiCall('/dm', {
253
+ method: 'POST',
254
+ token,
255
+ body: { username, message },
256
+ });
257
+ console.log(chalk.green(' ✓ DM gönderildi!\n'));
258
+ if (result.message?.id) console.log(chalk.gray(` ID: ${result.message.id}\n`));
259
+ audit.log(audit.ACTIONS.INFO, { source: 'naturehub', action: 'dm', target: username });
260
+ } catch (e) {
261
+ console.log(chalk.red(` ✗ Hata: ${e.message}\n`));
262
+ }
263
+ }
264
+
265
+ async function cmdInbox(args) {
266
+ const token = getApiKey();
267
+ if (!token) {
268
+ console.log(chalk.yellow('\n ⚠️ API key tanımlı değil. Önce `natureco login` ile giriş yapın.\n'));
269
+ return;
270
+ }
271
+
272
+ const unreadOnly = args.includes('--unread') || args.includes('-u');
273
+ const limit = 20;
274
+
275
+ console.log(chalk.cyan(`\n 📬 Gelen Kutusu${unreadOnly ? ' (okunmamış)' : ''}\n`));
276
+
277
+ try {
278
+ const qs = unreadOnly ? '?unread=true' : '';
279
+ const result = await apiCall(`/dm/inbox${qs}`, { method: 'GET', token });
280
+ const messages = result.messages || [];
281
+
282
+ if (messages.length === 0) {
283
+ console.log(chalk.gray(' Henüz mesaj yok.\n'));
284
+ return;
285
+ }
286
+
287
+ for (const m of messages) {
288
+ const from = m.sender_name || m.sender_profile?.display_name || m.sender_profile?.username || 'Bilinmeyen';
289
+ const date = new Date(m.created_at).toLocaleString('tr-TR', { day: 'numeric', month: 'short', hour: '2-digit', minute: '2-digit' });
290
+ const badge = m.is_incoming && !m.read ? chalk.bgYellow(chalk.black(' YENİ ')) + ' ' : '';
291
+ const icon = m.is_incoming ? chalk.cyan('◀') : chalk.gray('▶');
292
+ console.log(` ${icon} ${chalk.bold(from)} ${chalk.gray(date)}`);
293
+ console.log(` ${badge}${(m.content || '').slice(0, 120)}${(m.content || '').length > 120 ? '...' : ''}`);
294
+ console.log('');
295
+ }
296
+ if (messages.length >= limit) {
297
+ console.log(chalk.gray(` Daha fazla mesaj olabilir. --offset ile devam edin.\n`));
298
+ }
299
+ audit.log(audit.ACTIONS.INFO, { source: 'naturehub', action: 'inbox', count: messages.length });
300
+ } catch (e) {
301
+ console.log(chalk.red(` ✗ Hata: ${e.message}\n`));
302
+ }
303
+ }
304
+
218
305
  async function cmdForum(args) {
219
306
  const text = args.join(' ').trim();
220
307
  const titleMatch = text.match(/^"([^"]+)"\s*(.*)$/);
@@ -262,8 +349,10 @@ async function naturehub(args) {
262
349
  if (!action || action === 'help') {
263
350
  console.log(chalk.yellow('\n Kullanım:'));
264
351
  console.log(chalk.gray(' natureco naturehub post "<mesaj>" Bota mesaj gönder'));
265
- console.log(chalk.gray(' natureco naturehub robot-house "<içerik>" Robot House gönderisi'));
266
- console.log(chalk.gray(' natureco naturehub forum "<başlık>" <içerik> Forum gönderisi'));
352
+ console.log(chalk.gray(' natureco naturehub dm <user> "<mesaj>" DM gönder'));
353
+ console.log(chalk.gray(' natureco naturehub inbox [--unread] Gelen kutusu'));
354
+ console.log(chalk.gray(' natureco naturehub robot-house "<içerik>" Robot House gönderisi'));
355
+ console.log(chalk.gray(' natureco naturehub forum "<başlık>" <içerik> Forum gönderisi'));
267
356
  console.log(chalk.gray(' natureco naturehub list Botları listele'));
268
357
  console.log(chalk.gray(' natureco naturehub info [bot_id] Bot detayı'));
269
358
  console.log(chalk.gray(' natureco naturehub config Ayarlar'));
@@ -276,6 +365,8 @@ async function naturehub(args) {
276
365
  if (action === 'list') return cmdList();
277
366
  if (action === 'info') return cmdInfo(params[0]);
278
367
  if (action === 'config') return cmdConfig();
368
+ if (action === 'dm') return cmdDm(params);
369
+ if (action === 'inbox') return cmdInbox(params);
279
370
  console.log(chalk.red(`\n Bilinmeyen action: ${action}\n`));
280
371
  }
281
372