natureco-cli 5.6.22 → 5.6.24

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.6.22",
3
+ "version": "5.6.24",
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"
@@ -74,6 +74,7 @@
74
74
  "node-telegram-bot-api": "^0.67.0",
75
75
  "openai": "^6.44.0",
76
76
  "pino": "^8.21.0",
77
+ "qrcode": "^1.5.4",
77
78
  "qrcode-terminal": "^0.12.0",
78
79
  "semver": "^7.8.1",
79
80
  "twilio": "^6.0.2",
@@ -1,6 +1,7 @@
1
1
  const chalk = require('chalk');
2
2
  const inquirer = require('../utils/inquirer-wrapper');
3
3
  const qrcode = require('qrcode-terminal');
4
+ const QRCode = require('qrcode');
4
5
  const fs = require('fs');
5
6
  const path = require('path');
6
7
  const os = require('os');
@@ -108,7 +109,22 @@ async function startWhatsAppConnection(sessionDir, botId, selectedBot, config) {
108
109
 
109
110
  // Display QR code in terminal
110
111
  qrcode.generate(qr, { small: true });
111
-
112
+
113
+ // v5.6.24: QR'i PNG olarak da kaydet, browserda ac
114
+ try {
115
+ const qrPngPath = path.join(sessionDir, 'qr.png');
116
+ await QRCode.toFile(qrPngPath, qr, {
117
+ type: 'png',
118
+ width: 600,
119
+ margin: 4,
120
+ color: { dark: '#000000', light: '#FFFFFF' }
121
+ });
122
+ console.log(chalk.green('\n📸 QR PNG kaydedildi: ' + qrPngPath));
123
+ console.log(chalk.cyan('🔗 Browserda acmak icin: open ' + qrPngPath));
124
+ } catch (e) {
125
+ // Sessizce gec, terminal QR yeterli
126
+ }
127
+
112
128
  console.log('');
113
129
  console.log(chalk.gray('1. WhatsApp\'ı açın'));
114
130
  console.log(chalk.gray('2. Ayarlar > Bağlı Cihazlar > Cihaz Bağla'));
package/src/tools/git.js CHANGED
@@ -18,8 +18,8 @@ module.exports = {
18
18
  },
19
19
 
20
20
  execute({ operation, args = '', message = '' }) {
21
- // v5.6.22: Git repo otomatik bul - cwd'de yoksa ust dizinleri kontrol et
22
- const cwd = this._findGitRepo();
21
+ // v5.6.22: Git repo otomatik bul - this baglami kayboldugu icin module-level helper kullan
22
+ const cwd = findGitRepo();
23
23
  try {
24
24
  let cmd;
25
25
  switch (operation) {
@@ -88,3 +88,49 @@ module.exports = {
88
88
  return process.cwd();
89
89
  }
90
90
  };
91
+
92
+
93
+ /**
94
+ * Git repo bul - cwd'de yoksa ~/Projects ve parent dizinleri tara
95
+ */
96
+ function findGitRepo() {
97
+ const fs = require('fs');
98
+ const path = require('path');
99
+ const os = require('os');
100
+
101
+ if (fs.existsSync(path.join(process.cwd(), '.git'))) {
102
+ return process.cwd();
103
+ }
104
+
105
+ const home = os.homedir();
106
+ const candidates = [
107
+ path.join(home, 'Projects', 'natureco-cli'),
108
+ path.join(home, 'Projects'),
109
+ path.join(home, 'projects'),
110
+ path.join(home, 'code'),
111
+ path.join(home, 'dev'),
112
+ path.join(home, 'src'),
113
+ ];
114
+
115
+ for (const dir of candidates) {
116
+ try {
117
+ if (fs.existsSync(path.join(dir, '.git'))) {
118
+ return dir;
119
+ }
120
+ } catch {}
121
+ }
122
+
123
+ let current = process.cwd();
124
+ for (let i = 0; i < 5; i++) {
125
+ const parent = path.dirname(current);
126
+ if (parent === current) break;
127
+ try {
128
+ if (fs.existsSync(path.join(parent, '.git'))) {
129
+ return parent;
130
+ }
131
+ } catch {}
132
+ current = parent;
133
+ }
134
+
135
+ return process.cwd();
136
+ }