@aigencydev/cli 0.3.9 → 0.4.0

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
@@ -3,50 +3,32 @@
3
3
  Terminalden yapay zeka destekli kod üretimi, dosya yönetimi ve proje otomasyonu.
4
4
  AIGENCY hesabınla bağlanır, projende çalışır, kodu senin onayınla yazar.
5
5
 
6
- ```
7
- ┌──────────────────────────────────────────┐
8
- │ ✦ AIGENCY CLI v0.3.0 │
9
- │ ● default · AIGENCY Pro · my-app │
10
- │ │
11
- │ ▸ Sana nasıl yardımcı olabilirim? │
12
- └──────────────────────────────────────────┘
13
- ```
6
+ > **Önemli:** AIGENCY CLI mevcut web ve mobil AIGENCY hizmetlerini etkilemez. Ayrı bir API namespace (`/api/cli/*`) kullanır, mevcut `/api/v1`, `/api/v2` ve `/api/mobile` endpoint'leri değişmez.
14
7
 
15
8
  ---
16
9
 
17
10
  ## Kurulum
18
11
 
19
- **npm ile (önerilen)**
20
12
  ```bash
21
13
  npm install -g @aigencydev/cli
22
14
  ```
23
15
 
24
- **macOS / Linux shell installer**
25
- ```bash
26
- curl -fsSL https://aigency.dev/cli/install.sh | bash
27
- ```
28
-
29
- **Windows — PowerShell**
30
- ```powershell
31
- irm https://aigency.dev/cli/install.ps1 | iex
32
- ```
33
-
34
- > **Not:** Node.js 18.18 veya üzeri gerekir. `node --version` ile kontrol edebilirsin.
16
+ > Node.js 18.18 veya üzeri gerekir. `node --version` ile kontrol edebilirsiniz.
35
17
 
36
18
  ---
37
19
 
38
20
  ## Hızlı Başlangıç
39
21
 
40
22
  ```bash
41
- # 1) Hesabına bağlan (tarayıcı açılır)
23
+ # 1) Hesabınıza bağlanın (tarayıcı açılır)
42
24
  aigency login
43
25
 
44
- # 2) Bir proje dizinine gir ve .aigency/ iskeletini oluştur
26
+ # 2) Proje dizinine girin ve .aigency/ iskeletini oluşturun
45
27
  cd ~/projects/my-app
46
28
  aigency init
47
29
 
48
- # 3) Ajanla konuşmaya başla
49
- aigency "bana bir Next.js CV sitesi oluştur, Apple tarzı"
30
+ # 3) Ajanla konuşmaya başlayın
31
+ aigency "bana bir Next.js CV sitesi oluştur"
50
32
 
51
33
  # ya da interaktif modda
52
34
  aigency
@@ -58,32 +40,31 @@ aigency
58
40
 
59
41
  | Komut | Açıklama |
60
42
  |---|---|
61
- | `aigency` | İnteraktif sohbet modu (varsayılan) |
43
+ | `aigency` | İnteraktif sohbet modu |
62
44
  | `aigency "<prompt>"` | Tek seferlik prompt çalıştır |
63
- | `aigency login` | AIGENCY hesabına OAuth ile bağlan |
64
- | `aigency logout` | Oturumu kapat, yerel token'ları sil |
65
- | `aigency init` | Mevcut dizinde `.aigency/` yapısını kur |
45
+ | `aigency login` | AIGENCY hesabına bağlan |
46
+ | `aigency logout` | Oturumu kapat |
47
+ | `aigency init` | Mevcut dizinde `.aigency/` kur |
66
48
  | `aigency usage` | Aylık token kullanımını göster |
67
- | `aigency update` | En son sürümü kontrol et |
68
- | `aigency help` | Komut yardımı |
49
+ | `aigency update` | Sürüm kontrolü |
50
+ | `aigency help` | Yardım |
69
51
  | `aigency --version` | Sürümü göster |
70
-
71
- **Flag'ler:**
72
- - `--mode <default\|plan\|accept_edits\|auto>` — başlangıç izin modu
73
- - `--model <pro\|max>` — AIGENCY paket seviyesi
52
+ | `aigency --mode plan` | Plan modunda başlat (dry-run) |
53
+ | `aigency --mode accept_edits` | Düzenlemeleri otomatik kabul |
74
54
 
75
55
  ---
76
56
 
77
- ## İzin Modları
57
+ ## Slash Komutları
78
58
 
79
- | Mod | Davranış |
59
+ | Komut | İşlev |
80
60
  |---|---|
81
- | `default` | Dosya okuma otomatik, yazma ve komut için onay sorulur |
82
- | `plan` | Dry-run hiçbir şey yazılmaz, sadece yapılacakların planı gösterilir |
83
- | `accept_edits` | Dosya yazma otomatik, shell komutları hâlâ onay ister |
84
- | `auto` | Sınıflandırıcı destekli tam otomatik (yalnızca **Max** tier) |
85
-
86
- Mod'u çalışırken değiştirmek için **Shift+Tab** bas.
61
+ | `/help` | Komut listesi |
62
+ | `/clear` | Sohbet geçmişini temizle |
63
+ | `/mode [mod]` | İzin modunu değiştir veya göster |
64
+ | `/cost` | Bu oturumda kullanılan token |
65
+ | `/undo` | Son dosya düzenlemesini geri al |
66
+ | `/continue` | Kaldığın yerden devam et |
67
+ | `/exit` | Çıkış |
87
68
 
88
69
  ---
89
70
 
@@ -91,109 +72,75 @@ Mod'u çalışırken değiştirmek için **Shift+Tab** bas.
91
72
 
92
73
  | Tuş | İşlev |
93
74
  |---|---|
94
- | `Shift+Tab` | İzin modlarını döngüle (default → plan → accept_edits → auto) |
95
- | `ESC` | Aktif ajan işlemini iptal et |
75
+ | `Shift+Tab` | İzin modlarını döngüle |
76
+ | `ESC` | Aktif işlemi iptal et |
96
77
  | `Ctrl+C` | Çalışıyorsa iptal, boştaysa çıkış |
97
- | `/` | Slash komut başlat |
98
78
 
99
79
  ---
100
80
 
101
- ## Slash Komutları
81
+ ## İzin Modları
102
82
 
103
- | Komut | İşlev |
83
+ | Mod | Davranış |
104
84
  |---|---|
105
- | `/help` | Komut listesi |
106
- | `/clear` | Sohbet geçmişini ve onay cache'ini temizle |
107
- | `/mode [default\|plan\|accept_edits\|auto]` | Modu değiştir veya göster |
108
- | `/cost` | Bu oturumda kullanılan token sayısı |
109
- | `/undo` | Son dosya düzenlemesini geri al (checkpoint'ten) |
110
- | `/exit` veya `/quit` | Çıkış |
85
+ | `default` | Okuma otomatik, yazma ve komut için onay sorulur |
86
+ | `plan` | Dry-run hiçbir şey yazılmaz, sadece plan gösterilir |
87
+ | `accept_edits` | Dosya yazma otomatik, komutlar onay ister |
88
+ | `auto` | Tam otomatik (yalnızca Max paket) |
111
89
 
112
90
  ---
113
91
 
114
- ## Araçlar (Ajanın Kullanabildiği Tool'lar)
92
+ ## Araçlar
115
93
 
116
- Ajan projenizde aşağıdaki işlemleri yapabilir (izin modunuza göre onay ister):
94
+ Ajan projenizde aşağıdaki işlemleri yapabilir:
117
95
 
118
- **Dosya sistemi**
119
- - `read_file` — Dosya içeriği okur
120
- - `list_files` — Dizin listeler (gitignore'a saygı duyar)
121
- - `search_files` — Regex ile içerik arar
122
- - `write_file` — Yeni dosya yazar veya tamamen değiştirir
123
- - `edit_file` — Mevcut dosyada cerrahi değişiklik yapar
96
+ **Dosya sistemi:** `read_file` · `list_files` · `search_files` · `write_file` · `edit_file` · `edit_file_multi`
124
97
 
125
- **Shell**
126
- - `bash_execute` — İnteraktif olmayan shell komutu çalıştırır (5 dk timeout, canlı çıktı akışı)
98
+ **Shell:** `bash_execute` — interaktif olmayan komutlar, 5 dk timeout, canlı çıktı
127
99
 
128
- **Hafıza (kalıcı, makineye özel)**
129
- - `save_memory` — Önemli bilgiyi oturumlar arası sakla
130
- - `read_memory` — Detay hafıza dosyasını oku
131
- - `delete_memory` — Artık geçerli olmayan bilgiyi sil
100
+ **Doğrulama:** `verify_project` — proje sağlık kontrolü (package.json, scripts, node_modules)
132
101
 
133
- **Görev planlama**
134
- - `write_tasks` — Büyük görevleri adımlara böl, ilerlemeyi canlı göster
135
- - `read_tasks` — Mevcut görev listesini oku
102
+ **Hafıza:** `save_memory` · `read_memory` · `delete_memory` — oturumlar arası kalıcı
136
103
 
137
- **Sandbox:** `.git/`, `.env*`, `~/.ssh/`, `node_modules/`, `.next/` gibi hassas yollar
138
- otomatik reddedilir. `sudo`, `rm -rf /`, `curl | sh` gibi tehlikeli komutlar
139
- engellenir.
104
+ **Görev planlama:** `write_tasks` · `read_tasks` canlı ilerleme göstergesi
105
+
106
+ **Self-check:** `assert_done` — görev tamamlama doğrulaması
107
+
108
+ **Güvenlik:** `.git/`, `.env*`, `~/.ssh/`, `node_modules/` yazma yasak. `sudo`, `rm -rf /`, `curl | sh` otomatik engellenir.
140
109
 
141
110
  ---
142
111
 
143
- ## Proje Yapılandırması (`.aigency/`)
112
+ ## Proje Yapılandırması
144
113
 
145
- `aigency init` çalıştırdığında projenizde aşağıdaki yapı oluşturulur:
114
+ `aigency init` ile projenizde oluşturulur:
146
115
 
147
116
  ```
148
- <proje>/.aigency/
149
- ├── AIGENCY.md # Proje talimatları (ajan her oturum başında okur)
150
- ├── PROGRESS.md # İlerleme takibi (opsiyonel)
151
- ├── settings.json # İzin modu, allow/deny listeleri
152
- ├── settings.local.json # Kişisel override (gitignored)
153
- ├── rules/ # Path-scoped kurallar
154
- │ └── example.md
155
- ├── hooks/ # PreToolUse/PostToolUse script'leri
156
- │ ├── hooks.json
157
- │ └── README.md
158
- ├── logs/ # Günlük JSONL logları (gitignored)
117
+ .aigency/
118
+ ├── AIGENCY.md # Proje talimatları (her oturumda okunur)
119
+ ├── settings.json # İzin modu, allow/deny listeleri
120
+ ├── rules/ # Dosya bazlı kurallar
121
+ ├── hooks/ # PreToolUse/PostToolUse script'leri
159
122
  └── .gitignore
160
123
  ```
161
124
 
162
- **AIGENCY.md** en önemli dosyadırprojenizin teknoloji yığını, kodlama kuralları,
163
- stil tercihleri ve "dokunulmaması gereken yerler"i buraya yazın. Ajan her oturum
164
- başında bu dosyayı okur ve yazdığı kod bunlarla hizalanır.
125
+ **AIGENCY.md** projenizin kurallarını tanımlar — teknoloji yığını, kodlama standartları, dokunulmaması gereken yerler.
165
126
 
166
127
  ---
167
128
 
168
- ## Kalıcı Hafıza ve Oturum Verileri
169
-
170
- AIGENCY CLI, **makineye özel** veriler için kullanıcının home dizininde ayrı
171
- bir alan kullanır:
129
+ ## Kalıcı Veriler
172
130
 
173
131
  ```
174
132
  ~/.aigency/
175
- ├── cli.json # Auth metadata
176
- ├── credentials.enc # AES-256-GCM şifreli token'lar
177
- ├── settings.json # Kullanıcı seviyesi ayarlar
178
- ├── AIGENCY.md # Tüm projelerde geçerli global talimatlar
179
- ├── cli.log # Rotating log (5 MB × 3 yedek)
180
- ├── cache/ # LLM response, hash cache
181
- ├── temp/ # Oturum scratch alanı
182
- └── projects/
183
- └── <proje-hash>/ # Git remote veya yola göre hash
184
- ├── memory/
185
- │ ├── MEMORY.md # Hafıza index'i
186
- │ ├── user_*.md # Kullanıcı hakkında
187
- │ ├── feedback_*.md # Davranış kuralları
188
- │ ├── project_*.md # Proje bağlamı
189
- │ └── reference_*.md # Harici kaynak pointer'ları
190
- ├── sessions/
191
- │ └── <id>.jsonl # Oturum transkriptleri
192
- └── checkpoints/ # Dosya edit snapshot'ları (undo için)
133
+ ├── cli.json # Auth metadata
134
+ ├── credentials.enc # Şifreli token'lar (AES-256-GCM)
135
+ ├── settings.json # Global ayarlar
136
+ ├── cli.log # Rotating log
137
+ └── projects/<hash>/
138
+ ├── memory/ # Kalıcı hafıza (MEMORY.md + topic dosyaları)
139
+ ├── sessions/ # Oturum transkriptleri (JSONL)
140
+ └── checkpoints/ # Dosya edit snapshot'ları (/undo için)
193
141
  ```
194
142
 
195
- Bu alan **git'e commit edilmez** ve senkronize de olmaz — her makinede ayrı.
196
- `.aigency/` (proje klasörü) ise git'e eklenebilir, takımla paylaşılır.
143
+ Makineye özel, git'e eklenmez.
197
144
 
198
145
  ---
199
146
 
@@ -201,80 +148,209 @@ Bu alan **git'e commit edilmez** ve senkronize de olmaz — her makinede ayrı.
201
148
 
202
149
  | Paket | Fiyat | Aylık Token | Ek Özellikler |
203
150
  |---|---|---|---|
204
- | **AIGENCY CLI Pro** | 1.500 ₺/ay | 100.000.000 | Standart |
205
- | **AIGENCY CLI Max** | 3.000 ₺/ay | 500.000.000 | Öncelikli kuyruk, Auto mode |
151
+ | **CLI Pro** | 1.500 ₺/ay | 100.000.000 | Standart |
152
+ | **CLI Max** | 3.000 ₺/ay | 500.000.000 | Öncelikli kuyruk, Auto mode |
206
153
 
207
- Paketleri [aigency.dev/developer/cli](https://aigency.dev/developer/cli) üzerinden
208
- yönetebilir, kullanımınızı canlı izleyebilirsiniz.
154
+ Paket yönetimi: [aigency.dev/developer/cli](https://aigency.dev/developer/cli)
209
155
 
210
156
  ---
211
157
 
212
158
  ## Yapılandırma
213
159
 
214
- ### Ortam değişkenleri
215
-
216
160
  | Değişken | Açıklama |
217
161
  |---|---|
218
- | `AIGENCY_CLI_API_URL` | API sunucu adresi (varsayılan `https://aigency.dev`) |
219
- | `AIGENCY_CLI_DEBUG` | `1` verilirse ayrıntılı debug log'lar |
220
-
221
- ### `.aigency/settings.json` Örneği
222
-
223
- ```json
224
- {
225
- "permissions": {
226
- "defaultMode": "default",
227
- "allow": [
228
- "Read(**/*)",
229
- "Bash(npm run *)",
230
- "Bash(git status)"
231
- ],
232
- "ask": [
233
- "Write(**/*)",
234
- "Edit(**/*)",
235
- "Bash(*)"
236
- ],
237
- "deny": [
238
- "Read(.env)",
239
- "Write(.git/**)",
240
- "Bash(rm -rf *)",
241
- "Bash(sudo *)"
242
- ]
243
- },
244
- "memory": {
245
- "enabled": true
246
- },
247
- "hooks": {
248
- "enabled": false
249
- }
250
- }
162
+ | `AIGENCY_CLI_API_URL` | API adresi (varsayılan: `https://aigency.dev`) |
163
+ | `AIGENCY_CLI_DEBUG` | `1` ile debug loglar |
164
+
165
+ ---
166
+
167
+ ## Destek
168
+
169
+ - [aigency.dev/developer/cli](https://aigency.dev/developer/cli) — Yönetim paneli
170
+ - [aigency.dev/forge](https://aigency.dev/forge) — Tanıtım ve SSS
171
+ - [aigency.dev/contact](https://aigency.dev/contact) — İletişim
172
+
173
+ ---
174
+
175
+ ## Lisans
176
+
177
+ Özel lisans — AIGENCY. Tüm hakları saklıdır.
178
+
179
+ ---
180
+
181
+ # AIGENCY CLI (English)
182
+
183
+ AI-powered code generation, file management and project automation from your terminal.
184
+ Connect with your AIGENCY account, work in your project, code is written with your approval.
185
+
186
+ > **Important:** AIGENCY CLI does not affect existing web and mobile AIGENCY services. It uses a separate API namespace (`/api/cli/*`), existing `/api/v1`, `/api/v2` and `/api/mobile` endpoints remain unchanged.
187
+
188
+ ---
189
+
190
+ ## Installation
191
+
192
+ ```bash
193
+ npm install -g @aigencydev/cli
251
194
  ```
252
195
 
196
+ > Requires Node.js 18.18 or higher.
197
+
253
198
  ---
254
199
 
255
- ## Geliştirme (Contributing)
200
+ ## Quick Start
256
201
 
257
202
  ```bash
258
- git clone https://github.com/aigencydev/cli.git
259
- cd cli
260
- npm install
261
-
262
- npm run dev -- help # tsx ile direkt çalıştır
263
- npm run typecheck # TypeScript tip kontrolü
264
- npm run test # Vitest
265
- npm run build # dist/ üret
203
+ # 1) Sign in (opens browser)
204
+ aigency login
205
+
206
+ # 2) Navigate to your project and create .aigency/ scaffold
207
+ cd ~/projects/my-app
208
+ aigency init
209
+
210
+ # 3) Start chatting with the agent
211
+ aigency "create a Next.js CV site for me"
212
+
213
+ # or interactive mode
214
+ aigency
266
215
  ```
267
216
 
268
217
  ---
269
218
 
270
- ## Destek
219
+ ## Commands
271
220
 
272
- - **Web**: [aigency.dev/developer/cli](https://aigency.dev/developer/cli)
273
- - **Tanıtım**: [aigency.dev/forge](https://aigency.dev/forge)
274
- - **Sorun / öneri**: [aigency.dev/contact](https://aigency.dev/contact)
221
+ | Command | Description |
222
+ |---|---|
223
+ | `aigency` | Interactive chat mode |
224
+ | `aigency "<prompt>"` | One-shot prompt |
225
+ | `aigency login` | Sign in to AIGENCY |
226
+ | `aigency logout` | Sign out |
227
+ | `aigency init` | Create `.aigency/` scaffold |
228
+ | `aigency usage` | Show monthly token usage |
229
+ | `aigency update` | Check for updates |
230
+ | `aigency help` | Help |
231
+ | `aigency --version` | Show version |
232
+ | `aigency --mode plan` | Start in plan mode (dry-run) |
275
233
 
276
234
  ---
277
235
 
278
- ## Lisans
236
+ ## Slash Commands
237
+
238
+ | Command | Action |
239
+ |---|---|
240
+ | `/help` | Command list |
241
+ | `/clear` | Clear chat history |
242
+ | `/mode [mode]` | Change or show permission mode |
243
+ | `/cost` | Tokens used this session |
244
+ | `/undo` | Revert last file edit |
245
+ | `/continue` | Resume from where you left off |
246
+ | `/exit` | Exit |
247
+
248
+ ---
249
+
250
+ ## Keyboard Shortcuts
251
+
252
+ | Key | Action |
253
+ |---|---|
254
+ | `Shift+Tab` | Cycle permission modes |
255
+ | `ESC` | Cancel active operation |
256
+ | `Ctrl+C` | Cancel if busy, exit if idle |
257
+
258
+ ---
259
+
260
+ ## Permission Modes
261
+
262
+ | Mode | Behavior |
263
+ |---|---|
264
+ | `default` | Reads automatic, writes and commands prompt for approval |
265
+ | `plan` | Dry-run — no writes, only shows the plan |
266
+ | `accept_edits` | Writes automatic, commands still require approval |
267
+ | `auto` | Full automation (Max tier only) |
268
+
269
+ ---
270
+
271
+ ## Tools
272
+
273
+ The agent can perform the following operations in your project:
274
+
275
+ **Filesystem:** `read_file` · `list_files` · `search_files` · `write_file` · `edit_file` · `edit_file_multi`
276
+
277
+ **Shell:** `bash_execute` — non-interactive commands, 5 min timeout, live output streaming
278
+
279
+ **Verification:** `verify_project` — project health check (package.json, scripts, node_modules)
280
+
281
+ **Memory:** `save_memory` · `read_memory` · `delete_memory` — persistent across sessions
282
+
283
+ **Task planning:** `write_tasks` · `read_tasks` — live progress indicator
284
+
285
+ **Self-check:** `assert_done` — task completion verification
286
+
287
+ **Security:** `.git/`, `.env*`, `~/.ssh/`, `node_modules/` are write-protected. `sudo`, `rm -rf /`, `curl | sh` are automatically blocked.
288
+
289
+ ---
290
+
291
+ ## Project Configuration
292
+
293
+ Created by `aigency init`:
294
+
295
+ ```
296
+ .aigency/
297
+ ├── AIGENCY.md # Project instructions (read every session)
298
+ ├── settings.json # Permission mode, allow/deny lists
299
+ ├── rules/ # Path-scoped rules
300
+ ├── hooks/ # PreToolUse/PostToolUse scripts
301
+ └── .gitignore
302
+ ```
303
+
304
+ **AIGENCY.md** defines your project rules — tech stack, coding standards, protected areas.
305
+
306
+ ---
307
+
308
+ ## Persistent Data
309
+
310
+ ```
311
+ ~/.aigency/
312
+ ├── cli.json # Auth metadata
313
+ ├── credentials.enc # Encrypted tokens (AES-256-GCM)
314
+ ├── settings.json # Global settings
315
+ ├── cli.log # Rotating log
316
+ └── projects/<hash>/
317
+ ├── memory/ # Persistent memory (MEMORY.md + topic files)
318
+ ├── sessions/ # Session transcripts (JSONL)
319
+ └── checkpoints/ # File edit snapshots (for /undo)
320
+ ```
321
+
322
+ Machine-local, never committed to git.
323
+
324
+ ---
325
+
326
+ ## Plans
327
+
328
+ | Plan | Price | Monthly Tokens | Extras |
329
+ |---|---|---|---|
330
+ | **CLI Pro** | 1,500 ₺/mo | 100,000,000 | Standard |
331
+ | **CLI Max** | 3,000 ₺/mo | 500,000,000 | Priority queue, Auto mode |
332
+
333
+ Manage plans at [aigency.dev/developer/cli](https://aigency.dev/developer/cli)
334
+
335
+ ---
336
+
337
+ ## Configuration
338
+
339
+ | Variable | Description |
340
+ |---|---|
341
+ | `AIGENCY_CLI_API_URL` | API address (default: `https://aigency.dev`) |
342
+ | `AIGENCY_CLI_DEBUG` | Set `1` for debug logs |
343
+
344
+ ---
345
+
346
+ ## Support
347
+
348
+ - [aigency.dev/developer/cli](https://aigency.dev/developer/cli) — Dashboard
349
+ - [aigency.dev/forge](https://aigency.dev/forge) — Product page & FAQ
350
+ - [aigency.dev/contact](https://aigency.dev/contact) — Contact
351
+
352
+ ---
353
+
354
+ ## License
279
355
 
280
- Özel — AIGENCY. Tüm hakları saklıdır.
356
+ Proprietary — AIGENCY. All rights reserved.
@@ -0,0 +1,23 @@
1
+ export function checkTokenBudget(sessionTokens, softWarningSent, assertDonePassed) {
2
+ const TOKEN_SOFT_LIMIT = 500_000;
3
+ const TOKEN_HARD_LIMIT = 800_000;
4
+ if (sessionTokens > TOKEN_HARD_LIMIT) {
5
+ return {
6
+ action: "hard_stop",
7
+ message: "Bu istek için token bütçesi aşıldı (800K). " +
8
+ "Çalışma durduruluyor — tamamlanmamış adımlar varsa yeni bir istekle devam edebilirsiniz.",
9
+ };
10
+ }
11
+ if (sessionTokens > TOKEN_SOFT_LIMIT && !assertDonePassed && !softWarningSent) {
12
+ return {
13
+ action: "soft_warn",
14
+ message: "DİKKAT: Bu istek için 500K token harcandı. Token bütçesi azalıyor. " +
15
+ "Kalan işleri öncelendir, gereksiz dosya okuma/yazma yapma. " +
16
+ "En kritik işleri bitir ve assert_done ile tamamla.",
17
+ };
18
+ }
19
+ return { action: "continue" };
20
+ }
21
+ export function shouldForceNoTools(toolName, success, gatePassed) {
22
+ return toolName === "assert_done" && success && gatePassed === true;
23
+ }
@@ -57,6 +57,22 @@ export const writeFileTool = async (params, ctx) => {
57
57
  catch {
58
58
  isNew = true;
59
59
  }
60
+ if (!isNew && existingContent === content) {
61
+ return {
62
+ success: false,
63
+ output: "",
64
+ error: "Dosya zaten güncel — içerik aynı, yazma yapılmadı.",
65
+ metadata: {
66
+ path: check.displayPath,
67
+ is_new: false,
68
+ noop: true,
69
+ bytes: content.length,
70
+ added: 0,
71
+ removed: 0,
72
+ },
73
+ duration: Date.now() - start,
74
+ };
75
+ }
60
76
  const diff = summarizeDiff(existingContent, content);
61
77
  const previewLines = isNew
62
78
  ? content.split(/\r?\n/).slice(0, 20).join("\n")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aigencydev/cli",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "AIGENCY CLI — terminalden yapay zeka destekli kod üretimi, dosya yönetimi ve proje otomasyonu.",
5
5
  "type": "module",
6
6
  "bin": {