ai-enderun 0.0.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/Gemini.md ADDED
@@ -0,0 +1,274 @@
1
+ # AI-Enderun — Supreme Performance AI Orchestration (v0.0.1)
2
+
3
+ # Place in project root. This file is the single source of truth for all AI clients (Gemini CLI, Claude Code, etc.).
4
+
5
+ ## 🎖️ AGENT CHECKLIST (MANDATORY IN EVERY RESPONSE)
6
+
7
+ > Every response MUST end with the **Agent Completion Report** defined in the [OUTPUT FLOWS] section.
8
+
9
+ ---
10
+
11
+ ## Constitution Status
12
+
13
+ This file (`./Gemini.md`) and the `.gemini/docs/` folder represent the "Supreme Law" of the project. All agents must read this file first in every session and strictly comply with its rules 100%.
14
+
15
+ ---
16
+
17
+ ## AGENT MODEL (How this Framework Works)
18
+
19
+ Each "agent" in this project is an independent AI conversation (Claude/GPT).
20
+
21
+ - **Orchestration:** Done by the user or an external tool (LangGraph/CrewAI).
22
+ - **Ajanlar:** @manager, @explorer, @backend, @frontend, @analyst.
23
+ - **State:** Persistent memory is stored in `.gemini/PROJECT_MEMORY.md`.
24
+ - **Communication:** Agents read the memory and exchange directives via the user.
25
+
26
+ ---
27
+
28
+ ## STEP 0 — STARTUP (EVERY SESSION, NON-NEGOTIABLE)
29
+
30
+ 1. **Read ./Gemini.md First:** Read and fully understand this file.
31
+ 2. **Read Project Memory:** `.gemini/PROJECT_MEMORY.md` dosyasını oku ve şu bilgileri çıkar:
32
+ - `MEVCUT DURUM` → Hangi fazdayız? Aktif Trace ID var mı?
33
+ - `KRİTİK KARARLAR` tablosu → Daha önce ne kararlaştırıldı?
34
+ - `AKTİF GÖREVLER` tablosu → Bana atanmış görev var mı?
35
+ - `DOSYA DURUMU` tablosu → Eksik/broken dosyalar neler?
36
+ - `HISTORY` bölümü → Son 3 girişi oku, önceki çalışmaları anla.
37
+
38
+ - [ ] Check `.gemini/docs/` Folder: Verify if `tech-stack.md` and `project-docs.md` exist.
39
+
40
+ 4. **Default Stack:**
41
+ - **Frontend:** React 19 + Vite (SPA) + Zustand + Tailwind.
42
+ - **Backend:** Node.js 20+ + Fastify + Kysely + PostgreSQL.
43
+ 5. **OTURUM SONU ZORUNLULUĞU:** Her yanıt sonunda `.gemini/PROJECT_MEMORY.md` → `HISTORY` bölümüne özet ekle ve ilgili log dosyasına kayıt yaz. Bu adım atlanamaz.
44
+
45
+ ---
46
+
47
+ ## STEP 1 — VALIDATE BEFORE ACTING
48
+
49
+ If `tech-stack.md` is missing or empty, do not write code until the following is clarified:
50
+
51
+ | Unknown | Action |
52
+ | ------------------------------------ | -------------------- |
53
+ | Target Audience | Ask — do not proceed |
54
+ | Platform (web / mobile / desktop) | Ask — do not proceed |
55
+ | Database | Ask — do not proceed |
56
+ | Environment (prototype / production) | Ask — do not proceed |
57
+ | Auth required? | Ask — do not proceed |
58
+ | Monorepo or separate? | Ask — do not proceed |
59
+ | Deploy target | Ask — do not proceed |
60
+ | i18n required? | Ask — do not proceed |
61
+
62
+ **Minor details** (port, file names) → Assume and state at the beginning: `Assumption: [what] — [why]`.
63
+
64
+ ---
65
+
66
+ ## PROJECT MEMORY & LOCK PROTOCOL
67
+
68
+ - **Memory Initialization:** All agents reference `.gemini/PROJECT_MEMORY.md` at the start of any task.
69
+ - **Kalıcı Hafıza Protokolü:** Every agent MUST append a summary to the **HISTORY** section of `PROJECT_MEMORY.md`.
70
+ - **HISTORY Entry Format (Zorunlu):**
71
+
72
+ ```markdown
73
+ ### [YYYY-MM-DD] — [Görev Başlığı]
74
+
75
+ - **Ajan:** @[agent-name]
76
+ - **Trace ID:** [uuid veya —]
77
+ - **Yapılan:** [Ne yapıldı, 2-3 cümle]
78
+ - **Karar:** [Varsa önemli karar]
79
+ - **Sonraki Adım:** [Ne yapılması gerekiyor]
80
+ ```
81
+
82
+ - **MEVCUT DURUM Güncellemesi:** Her oturum sonunda `MEVCUT DURUM` tablosundaki `Aktif Faz`, `Son Güncelleme` ve `Aktif Trace ID` alanlarını güncelle.
83
+ - **Memory Lock Rule:** To prevent concurrent writes, agents check for `.gemini/PROJECT_MEMORY.lock`.
84
+ - If exists: Wait 1s, retry. (Max 5 retries).
85
+ - After 5 retries: Report `BLOCKED — Memory Lock Timeout`.
86
+ - On success: Create lock, write, delete lock.
87
+
88
+ ---
89
+
90
+ ## FILE OWNERSHIP MATRIS
91
+
92
+ | Component | Primary Owner | Secondary |
93
+ | --------------------------- | ---------------- | ------------------------------------- |
94
+ | `apps/backend/` | @backend | @analyst |
95
+ | `apps/web/` | @frontend | @analyst |
96
+ | `apps/mobile/` | @mobile | @analyst |
97
+ | `apps/native/` | @native | @analyst |
98
+ | `packages/shared-types/` | @backend | @frontend |
99
+ | `.gemini/PROJECT_MEMORY.md` | @analyst | All (History only) |
100
+ | `.gemini/docs/api/` | @backend (yazar) | @analyst (denetler), @frontend (okur) |
101
+ | `.env.*` | @manager | @backend |
102
+
103
+ ---
104
+
105
+ ## CORE PRINCIPLES
106
+
107
+ - **@manager Orchestration:** Manager analiz eder, ajanları seçer ve Briefing Template sağlar. Her görev için benzersiz bir `Trace ID` (UUID) üretmekten sorumludur.
108
+ - **Contract-First Approach:** Backend ve Frontend kod yazmadan önce `shared-types` ve `.gemini/docs/api/` üzerinden anlaşmalıdır. **@backend** endpoint yazar → `.gemini/docs/api/[domain].md` günceller → **@frontend** okur, sonra kodlar.
109
+ - **Auth & i18n Responsibility:** Auth (@backend), i18n (@frontend - logic / @analyst - content).
110
+ - **Zero Mock Policy:** Sahte veri yasak.
111
+ - **Exception 1:** External 3rd party services (Stripe etc.) → `ADAPTER_PATTERN` + `SANDBOX_MODE`.
112
+ - **Exception 2:** Unit Tests → Mocks allowed for external dependencies.
113
+ - **Branded Types Law:** Tüm ID'ler Branded Types (`packages/shared-types`) olmalıdır.
114
+ - **Search Before Reading:** Hiçbir ajan bir dosyayı körü körüne okumamalıdır; önce `framework-mcp` (veya sarmaladığı `codebase_search`) araçlarıyla bağlamı taramalıdır.
115
+ - **Full-Spectrum Responsive:** Her bileşen mobile-first başlar (320px) ve ultra-wide ekranlara (1920px+) kadar `clamp()` ve `aspect-ratio` ile akışkan (fluid) kalmalıdır.
116
+ - **Supreme Frontend Aesthetics:** @frontend, "AI slop" estetiğinden kaçınmalı; özgün, karakterli ve üretim kalitesinde arayüzler tasarlamalıdır.
117
+ - **Audit Logging:** Tüm kritik işlemler loglanmalıdır.
118
+
119
+ ---
120
+
121
+ ## ABSOLUTE DON'TS — KIRMIZI ÇİZGİLER
122
+
123
+ | Kural | Gerekçe |
124
+ | ------------------------------ | ----------------------------------------------------------- |
125
+ | `any` tipi yasak | Type safety bozulur; `unknown` + type guard kullanılır. |
126
+ | `console.log` yasak | Production'da yasak; structured logger (`pino`) kullanılır. |
127
+ | Hardcoded secret yasak | API key/token asla kod içinde olmaz; `.env` kullanılır. |
128
+ | Raw SQL string yasak | Sadece Kysely; injection riski. |
129
+ | Controller'da DB çağrısı yasak | Repository pattern zorunludur. |
130
+ | try/catch'siz async yasak | Her async blok hata yönetimi içermeli. |
131
+ | İzinsiz dosya değişimi yasak | File Ownership kuralı geçerlidir. |
132
+
133
+ ---
134
+
135
+ ## EXECUTION PROFILES
136
+
137
+ - **Lightweight Profile (MVP):** SaaS, MVP veya hızlı prototipler için. Sadece manager, backend, frontend, analyst ve explorer aktiftir.
138
+ - **Full Profile (Enterprise):** Karmaşık sistemler, mobil/native entegrasyonu olan veya yüksek güvenlik gerektiren projeler için. Tüm ajanlar aktiftir.
139
+
140
+ ---
141
+
142
+ ## ENVIRONMENT POLICY
143
+
144
+ - **Hierarchy:** `.env.development` (yerel), `.env.test` (CI), `.env.production` (deployment).
145
+ - **Management:** `@manager` stratejiyi belirler, `@backend` implementasyonu yapar. Sırlar asla commit edilmez, `.env.example` güncel tutulur.
146
+
147
+ ---
148
+
149
+ ## OUTPUT FLOWS — ZORUNLU ÇIKTI STANDARDI
150
+
151
+ Her agent yanıtı şu sırayla yapılandırılır:
152
+
153
+ 1. **Assumptions** — Yapılan varsayımlar.
154
+ 2. **Problem** — Ne inşa edildiği ve neden (max 3 cümle).
155
+ 3. **File Tree** — Oluşturulan/değiştirilen dosyalar.
156
+ 4. **Code** — Eksiksiz kod (`...` ile kısaltma yasaktır).
157
+ 5. **Tests** — Vitest (Web/Backend), Jest (Mobile), Playwright (Native).
158
+ 6. **Dependency Map** — Sadece `@manager` yanıtları için zorunlu (Mermaid).
159
+ 7. **Agent Completion Report** — Standart blok.
160
+
161
+ ---
162
+
163
+ ## STATE MACHINE — EXECUTION PHASES
164
+
165
+ | Faz | Durum | Giriş Kriteri | Çıkış Kriteri (DoD) |
166
+ | ------- | ------------ | ------------- | ----------------------------------------------- |
167
+ | PHASE_0 | Discovery | — | tech-stack.md onaylandı, Profile seçildi. |
168
+ | PHASE_1 | Architecture | PHASE_0 tamam | shared-types onaylandı, contract hash üretildi. |
169
+ | PHASE_2 | Development | PHASE_1 tamam | Core featurelar ve birim testler teslim edildi. |
170
+ | PHASE_3 | Integration | PHASE_2 tamam | Gerçek DB ile entegrasyon testleri geçti. |
171
+ | PHASE_4 | Deployment | PHASE_3 tamam | Production deploy, walkthrough hazır. |
172
+
173
+ ---
174
+
175
+ ## DEFINITION OF DONE (DoD) CHECKLIST
176
+
177
+ _DoD kontrolleri sadece seçilen (Lightweight/Full) profildeki **aktif** ajanları kapsar._
178
+
179
+ **PHASE_0 → PHASE_1:**
180
+
181
+ - [ ] `tech-stack.md` approved by @manager.
182
+ - [ ] Target Audience, Platform, DB defined.
183
+ - [ ] Execution Profile selected.
184
+
185
+ **PHASE_1 → PHASE_2:**
186
+
187
+ - [ ] `shared-types` approved by all parties.
188
+ - [ ] `contract.version.json` created and hash verified.
189
+ - [ ] OpenAPI schema documented in `.gemini/docs/api/`.
190
+
191
+ **PHASE_2 → PHASE_3:**
192
+
193
+ - [ ] All features delivered with Unit Tests (Vitest).
194
+ - [ ] MANDATORY Log schema implemented in all **active** agents.
195
+ - [ ] No `any` or `console.log` violations.
196
+
197
+ **PHASE_3 → PHASE_4:**
198
+
199
+ - [ ] Integration tests passed with real DB (TestContainers).
200
+ - [ ] Zero Mock Policy verified (except exceptions).
201
+
202
+ **PHASE_4 (Done):**
203
+
204
+ - [ ] `PROJECT_MEMORY.md` fully updated.
205
+ - [ ] Walkthrough documentation ready.
206
+
207
+ ---
208
+
209
+ ## API & CONTRACT MANAGEMENT
210
+
211
+ ### 1. contract.version.json Schema
212
+
213
+ ```json
214
+ {
215
+ "version": "MAJOR.MINOR",
216
+ "last_updated": "ISO-8601",
217
+ "contract_hash": "sha256-...",
218
+ "breaking_changes": [{ "version": "1.0", "description": "Initial" }]
219
+ }
220
+ ```
221
+
222
+ ### 2. CI Hash Verification
223
+
224
+ ```bash
225
+ CURRENT_HASH=$(find packages/shared-types/src -name "*.ts" | sort | xargs sha256sum | sha256sum | awk '{print $1}')
226
+ STORED_HASH=$(jq -r '.contract_hash' packages/shared-types/contract.version.json)
227
+ [ "$CURRENT_HASH" = "$STORED_HASH" ] || (echo "HASH MISMATCH" && exit 1)
228
+ ```
229
+
230
+ ---
231
+
232
+ ## MANDATORY LOG SCHEMA (JSON)
233
+
234
+ All agents MUST log to `.gemini/logs/[agent].json` using `write_file` tool.
235
+ _Logs are stored as a **JSON Array**. Every turn appends a new object to the array._
236
+
237
+ ```json
238
+ {
239
+ "timestamp": "ISO-8601",
240
+ "agent": "string",
241
+ "action": "CREATE | MODIFY | DELETE | DECISION",
242
+ "requestId": "uuid",
243
+ "files": ["string[]"],
244
+ "status": "SUCCESS | FAILURE",
245
+ "summary": "İşlemin Türkçe özeti",
246
+ "details": { "key": "value" }
247
+ }
248
+ ```
249
+
250
+ ---
251
+
252
+ ## LANGUAGE POLICY
253
+
254
+ - **Language Alignment:** Başlıklar ve terminoloji İngilizce, içerik ve yorumlar Türkçe.
255
+ - **Code comments:** Türkçe (Neden yapıldığı).
256
+ - **Names:** English (Variable/File).
257
+
258
+ ---
259
+
260
+ ## ✅ HER YANIT SONU ZORUNLU BLOK (REPORT)
261
+
262
+ ---
263
+
264
+ **Agent Completion Report** (v1.0.2)
265
+
266
+ - Mock kullanıldı mı? [ ] Hayır / [ ] Evet
267
+ - shared-types değişti mi? [ ] Hayır / [ ] Evet
268
+ - **API kontratı yazıldı/okundu mu? [ ] Hayır / [ ] Evet → .gemini/docs/api/[domain].md**
269
+ - Log yazıldı mı? [ ] Hayır / [ ] Evet → .gemini/logs/[agent].json
270
+ - **PROJECT_MEMORY HISTORY güncellendi mi? [ ] Hayır / [ ] Evet**
271
+ - Bir sonraki adım: [ne yapılmalı]
272
+ - Blokajlar: [varsa yaz, yoksa "YOK"]
273
+
274
+ ---
package/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # 🏛️ AI-Enderun — Supreme Performance AI Orchestration (v0.0.1)
2
+
3
+ **Developer:** Yusuf BEKAR (Senior Software Architect)
4
+ **Status:** 🛠️ Professional Multi-Agent Framework
5
+ **Philosophy:** Senior Engineering Discipline & Ottoman Wisdom
6
+
7
+ **AI-Enderun**, modern yazılım ekosisteminde yapay zeka ajanlarını seçkin birer "Senior Mühendis" gibi çalıştıran, Osmanlı'nın disiplinli devlet geleneğinden (Enderun) ilham alan profesyonel bir orkestrasyon sistemidir.
8
+
9
+ [English](#english) | [Türkçe](#türkçe) | [Deutsch](#deutsch)
10
+
11
+ ---
12
+
13
+ <a name="english"></a>
14
+ ## 🇬🇧 English: The Sovereign Intelligence
15
+
16
+ ### 🛡️ The Philosophy: "Discipline Above All"
17
+ Named after the elite Ottoman palace school, **AI-Enderun** ensures that AI agents operate within a strict architectural constitution. It eliminates "AI Slop" by enforcing mandatory phase-based execution and a robust contract-first discipline.
18
+
19
+ ---
20
+
21
+ <a name="türkçe"></a>
22
+ ## 🇹🇷 Türkçe: Egemen Zeka
23
+
24
+ ### 🛡️ Felsefe: "Her Şeyin Başı Disiplin"
25
+ Adını Osmanlı'nın en seçkin beyinleri yetiştiren saray okulundan alan **AI-Enderun**, yapay zeka ajanlarının katı bir mimari anayasa çerçevesinde çalışmasını sağlar. Faz-bazlı yürütme ve kontrat-öncelikli disiplin ile kalitesiz kod üretimini (AI Slop) tamamen engeller.
26
+
27
+ ---
28
+
29
+ <a name="deutsch"></a>
30
+ ## 🇩🇪 Deutsch: Die Souveräne Intelligenz
31
+
32
+ ### 🛡️ Die Philosophie: "Disziplin über Alles"
33
+ Benannt nach der elitären osmanischen Palastschule, stellt **AI-Enderun** sicher, dass KI-Agenten innerhalb einer strengen architektonischen Verfassung agieren. Es eliminiert unstrukturierten Code durch die Erzwingung einer phasenbasierten Ausführung und einer robusten "Contract-First" Disziplin.
34
+
35
+ ---
36
+
37
+ ## 🏗️ Technical Structure / Teknik Yapı
38
+
39
+ | Path | Description |
40
+ | :--- | :--- |
41
+ | **`Gemini.md`** | The Constitution / Anayasa (Supreme Law) |
42
+ | **`.gemini/`** | Project Memory & Agent Personas / Hafıza ve Ajanlar |
43
+ | **`bin/cli.js`** | Command Center / Komuta Merkezi |
44
+ | **`packages/`** | Core Engine & Contracts / Çekirdek Motor ve Kontratlar |
45
+
46
+ ---
47
+
48
+ ## 🚀 Quick Start / Schnellstart
49
+
50
+ ```bash
51
+ npx ai-enderun init
52
+ ```
53
+
54
+ ---
55
+
56
+ ## 📜 Version History
57
+ | Version | Status | Description |
58
+ | :--- | :--- | :--- |
59
+ | **v0.0.1** | 🟢 Active | Rebranded as AI-Enderun. Multilingual support (EN, TR, DE). |
60
+
61
+ ---
62
+
63
+ > **Supreme Law:** Senior discipline is not an option, it's the standard.
package/bin/cli.js ADDED
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import { fileURLToPath } from "url";
6
+ import crypto from "crypto";
7
+
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ const sourceDir = path.join(__dirname, "..");
11
+ const targetDir = process.cwd();
12
+
13
+ // --- YARDIMCI FONKSİYONLAR ---
14
+
15
+ function getPackageVersion() {
16
+ const pkg = JSON.parse(fs.readFileSync(path.join(sourceDir, "package.json"), "utf8"));
17
+ return pkg.version;
18
+ }
19
+
20
+ function getMemoryPath() {
21
+ return path.join(targetDir, ".gemini", "PROJECT_MEMORY.md");
22
+ }
23
+
24
+ function generateUUID() {
25
+ return crypto.randomUUID();
26
+ }
27
+
28
+ // --- KOMUTLAR ---
29
+
30
+ /**
31
+ * Projeyi ilklendirir (Eski init.js mantığı)
32
+ */
33
+ async function initCommand(selectedAdapter) {
34
+ const ADAPTERS = {
35
+ gemini: ["Gemini.md", "gemini-extension.json"],
36
+ claude: ["CLAUDE.md"],
37
+ cursor: ["CURSOR.md"],
38
+ codex: ["CODEX.md"],
39
+ };
40
+
41
+ const CORE_FILES = [".gemini", "mcp.json", ".env.example", ".socraticodecontextartifacts.json"];
42
+
43
+ console.log("🚀 AI Agent Framework kuruluyor...");
44
+
45
+ let filesToCopy = [...CORE_FILES, ...ADAPTERS.gemini, ...ADAPTERS.claude, ...ADAPTERS.cursor, ...ADAPTERS.codex];
46
+
47
+ if (selectedAdapter) {
48
+ if (!ADAPTERS[selectedAdapter]) {
49
+ console.error(`❌ Geçersiz adaptör: ${selectedAdapter}`);
50
+ process.exit(1);
51
+ }
52
+ filesToCopy = [...CORE_FILES, "Gemini.md", ...ADAPTERS[selectedAdapter]];
53
+ }
54
+
55
+ for (const item of filesToCopy) {
56
+ const src = path.join(sourceDir, item);
57
+ const dest = path.join(targetDir, item);
58
+ if (fs.existsSync(src)) {
59
+ if (fs.lstatSync(src).isDirectory()) {
60
+ copyDir(src, dest);
61
+ } else {
62
+ fs.copyFileSync(src, dest);
63
+ }
64
+ console.log(`✅ ${item} oluşturuldu.`);
65
+ }
66
+ }
67
+ console.log("\n✨ Framework başarıyla kuruldu! (v" + getPackageVersion() + ")");
68
+ }
69
+
70
+ function copyDir(src, dest) {
71
+ fs.mkdirSync(dest, { recursive: true });
72
+ fs.readdirSync(src, { withFileTypes: true }).forEach(entry => {
73
+ const srcPath = path.join(src, entry.name);
74
+ const destPath = path.join(dest, entry.name);
75
+ entry.isDirectory() ? copyDir(srcPath, destPath) : fs.copyFileSync(srcPath, destPath);
76
+ });
77
+ }
78
+
79
+ /**
80
+ * Projenin mevcut durumunu gösterir
81
+ */
82
+ function statusCommand() {
83
+ const memoryPath = getMemoryPath();
84
+ if (!fs.existsSync(memoryPath)) {
85
+ console.error("❌ Hata: .gemini/PROJECT_MEMORY.md bulunamadı. Lütfen önce 'init' yapın.");
86
+ return;
87
+ }
88
+
89
+ const content = fs.readFileSync(memoryPath, "utf8");
90
+ const statusMatch = content.match(/\| Aktif Faz \| Son Güncelleme \| Aktif Trace ID \|\n\| :-------- \| :------------- \| :------------- \|\n\| (.*?) \| (.*?) \| (.*?) \|/);
91
+
92
+ console.log("\n📊 --- PROJE DURUMU ---");
93
+ if (statusMatch) {
94
+ console.log(`🔹 Faz: ${statusMatch[1].trim()}`);
95
+ console.log(`📅 Güncelleme: ${statusMatch[2].trim()}`);
96
+ console.log(`🆔 Trace ID: ${statusMatch[3].trim()}`);
97
+ }
98
+
99
+ const tasksSection = content.match(/## AKTİF GÖREVLER\n\n([\s\S]*?)\n\n##/);
100
+ if (tasksSection) {
101
+ console.log("\n📋 Aktif Görevler:");
102
+ console.log(tasksSection[1].trim());
103
+ }
104
+
105
+ console.log("\n-----------------------\n");
106
+ }
107
+
108
+ /**
109
+ * Yeni bir Trace ID üretir ve hafızaya ekler
110
+ */
111
+ function traceNewCommand(description, agent = "manager") {
112
+ const memoryPath = getMemoryPath();
113
+ if (!fs.existsSync(memoryPath)) {
114
+ console.error("❌ Hata: PROJECT_MEMORY.md bulunamadı.");
115
+ return;
116
+ }
117
+
118
+ const traceId = `TRACE-${generateUUID().slice(0, 8).toUpperCase()}`;
119
+ const date = new Date().toISOString().split('T')[0];
120
+ const newTask = `- [ ] [${traceId}] ${description} (@${agent})`;
121
+
122
+ let content = fs.readFileSync(memoryPath, "utf8");
123
+ content = content.replace("## AKTİF GÖREVLER\n\n", `## AKTİF GÖREVLER\n\n${newTask}\n`);
124
+
125
+ fs.writeFileSync(memoryPath, content);
126
+ console.log(`\n✅ Yeni Trace ID oluşturuldu: ${traceId}`);
127
+ console.log(`📝 Görev listesine eklendi: ${description}\n`);
128
+ }
129
+
130
+ // --- ANA DISPATCHER ---
131
+
132
+ async function main() {
133
+ const [command, ...args] = process.argv.slice(2);
134
+
135
+ switch (command) {
136
+ case "init":
137
+ await initCommand(args[0]);
138
+ break;
139
+ case "status":
140
+ statusCommand();
141
+ break;
142
+ case "trace:new":
143
+ if (!args[0]) {
144
+ console.error("❌ Kullanım: ai-agent-framework trace:new <açıklama> [agent]");
145
+ } else {
146
+ traceNewCommand(args[0], args[1]);
147
+ }
148
+ break;
149
+ case "version":
150
+ case "-v":
151
+ case "--version":
152
+ console.log(`v${getPackageVersion()}`);
153
+ break;
154
+ default:
155
+ console.log(`
156
+ 🤖 AI-Enderun CLI (v${getPackageVersion()})
157
+
158
+ Kullanılabilir Komutlar:
159
+ init [ai-name] Framework'ü ilklendirir (gemini, claude, cursor, codex)
160
+ status Mevcut faz ve görev durumunu gösterir
161
+ trace:new <desc> Yeni bir Trace ID üretir ve görevi hafızaya ekler
162
+ version Versiyon bilgisini gösterir
163
+
164
+ Örnek:
165
+ ai-agent-framework trace:new "Auth modülü tasarımı" backend
166
+ `);
167
+ break;
168
+ }
169
+ }
170
+
171
+ main().catch(console.error);
package/mcp.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "framework-mcp": {
4
+ "command": "npx",
5
+ "args": ["tsx", "packages/framework-mcp/src/index.ts"]
6
+ }
7
+ }
8
+ }
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "ai-enderun",
3
+ "version": "0.0.1",
4
+ "description": "Supreme AI Orchestration Framework — Senior Discipline & Ottoman Wisdom",
5
+ "author": "Yusuf BEKAR <ybekar@msn.com>",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/ysf-bkr/AI-Enderun.git"
9
+ },
10
+ "homepage": "https://github.com/ysf-bkr/AI-Enderun#readme",
11
+ "type": "module",
12
+ "bin": {
13
+ "ai-agent-framework": "bin/cli.js"
14
+ },
15
+ "files": [
16
+ "bin",
17
+ ".gemini/agents",
18
+ ".gemini/docs",
19
+ ".gemini/templates",
20
+ ".gemini/PROJECT_MEMORY.md",
21
+ "Gemini.md",
22
+ "CLAUDE.md",
23
+ "CURSOR.md",
24
+ "CODEX.md",
25
+ "README.md",
26
+ "mcp.json",
27
+ "package.json"
28
+ ],
29
+ "scripts": {
30
+ "mcp:dev": "npx tsx packages/framework-mcp/src/index.ts",
31
+ "mcp:status": "npx socraticode status"
32
+ }
33
+ }