natureco-cli 2.22.0 → 2.22.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "2.22.0",
3
+ "version": "2.22.1",
4
4
  "description": "NatureCo AI Bot Terminal Interface",
5
5
  "main": "bin/natureco.js",
6
6
  "bin": {
@@ -197,9 +197,16 @@ async function startWhatsAppProvider(sessionDir, config) {
197
197
  const ownNumber = sock.user?.id?.split(':')[0].replace('@s.whatsapp.net', '') || 'unknown';
198
198
  console.log(chalk.cyan('[whatsapp]'), chalk.white(`Inbound message +${sender} -> +${ownNumber}`));
199
199
 
200
+ const trimmed = messageText.trim();
201
+ console.log(chalk.cyan('[whatsapp]'), chalk.gray(`msg: "${trimmed.slice(0, 80)}"`));
202
+
200
203
  // ── !code komutu — headless code agent ─────────────────────────────
201
- if (messageText.startsWith('!code ')) {
202
- const task = messageText.replace('!code ', '').trim();
204
+ if (trimmed.toLowerCase().startsWith('!code')) {
205
+ const task = trimmed.replace(/^!code\s*/i, '').trim();
206
+ if (!task) {
207
+ await sock.sendMessage(msg.key.remoteJid, { text: '⚙️ Kullanım: !code <görev>\nÖrnek: !code login sayfasına forgot password ekle' });
208
+ continue;
209
+ }
203
210
  console.log(chalk.cyan('[whatsapp]'), chalk.yellow(`!code komutu: ${task.slice(0, 60)}`));
204
211
 
205
212
  try {