Commit Graph
26 Commits
Author SHA1 Message Date
mstfyldz d2ea58942c fix: add stream routes and guarantee finalJson answer property 2026-08-14 11:53:04 +03:00
mstfyldz c4947422dc feat: add digital-intern live-qa endpoints for pinpoint hearing assistance 2026-08-14 11:48:49 +03:00
mstfyldz 7da869224f fix: add alias routes for case analysis endpoints 2026-08-14 01:16:05 +03:00
mstfyldz fab80e05a0 feat: upgrade AI prompts to v2 specification with grounding and injection shield 2026-08-14 00:52:41 +03:00
mstfyldz 571e1f63d1 feat: Arabuluculuk & Müzakere Asistanı analiz endpoint'leri eklendi 2026-08-12 10:58:44 +03:00
mstfyldz 437f973d6f feat: Add precedent caching mechanism via txt and supabase 2026-08-12 02:17:57 +03:00
mstfyldz 69edf3aa61 feat(drafting): add fast-path generateAngarya endpoint for routine petitions 2026-08-11 21:45:17 +03:00
mstfyldz 6299a269a1 feat: dava stratejisi olusturucu - analyzeStrategy endpoint 2026-08-11 17:02:18 +03:00
mstfyldz 5c8c676d45 feat: add deficiency analysis route 2026-08-11 16:30:22 +03:00
mstfyldz 05fcc00de9 revision 2026-08-11 16:27:02 +03:00
mstfyldz 97ec7cd7f8 feat: DeepSeek-OCR endpoint + GPU request queue for AI calls
Mizan ve DeepSeek-OCR aynı self-hosted GPU'yu paylaşıyor; backend'de hiçbir
eşzamanlılık sınırı yoktu, yoğun anlarda istekler Ollama kuyruğunda 90sn'yi
aşıp sessizce "başarısız" görünüyordu. aiQueue.ts, GPU'ya giden istek sayısını
sınırlayıp fazlasını backend'de bekletiyor.

Yeni POST /documents/ocr-image, tek bir görseli DeepSeek-OCR ile metne
çeviriyor (Electron tarafındaki çok sayfalı TIFF/taranmış PDF işleme
adımının kullanacağı uç, ayrı bir PR'da bağlanacak).
2026-08-11 10:12:33 +03:00
mstfyldzandClaude Sonnet 5 ce6fa9deae feat: Google Drive restore endpoints (Faz 3)
GET /api/google-drive/backup-files: kullanıcının senkronize
edilmiş dosyalarının listesi (PRD §28 "N dosya bulundu"). GET
/download: bir dosyayı Drive'dan proxy'leyip ham baytları döner —
istenen drive_file_id'nin gerçekten bu kullanıcıya ait olduğu
önce doğrulanıyor (PRD §39, başka kullanıcının backup'ı sızmasın).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 04:24:56 +03:00
mstfyldzandClaude Sonnet 5 313d5b72ef feat: Google Drive backup upload endpoint (Faz 2 — backend half)
POST /api/google-drive/upload: Electron'un backupQueue'sunun
gönderdiği tek dosyayı alıp Google'ın resumable upload session'ıyla
Drive'a yazıyor (mevcutsa aynı drive_file_id'yi PATCH ederek yeni
sürüm olarak, PRD Test 4). Dava başlığı = Drive'daki alt klasör adı
(lokal yapı korunuyor). GET /backup-status: Ayarlar > Yedekleme
paneli için toplam dosya/boyut/son senkron özeti.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 04:14:27 +03:00
mstfyldzandClaude Sonnet 5 328aef91bd feat: Google Drive backup OAuth (Faz 1 — backend)
PRD "AyrisLegal Google Drive Backup & Recovery" kapsamında sadece
backend altyapısı: OAuth connect/callback/status/disconnect/refresh
uç noktaları, AES-256-GCM token şifreleme (tokenCrypto.ts), tek
kullanımlık CSRF state (oauthState.ts), drive.file scope ile
AyrisLegal/Davalar klasör oluşturma (googleDriveClient.ts). Electron
tarafı (dosya tarama/kuyruk/UI) ayrı bir aşamada.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 03:51:02 +03:00
mstfyldzandClaude Sonnet 5 9618ff4513 feat: file attachments in chat + document-select for case chat
- Yeni POST /api/documents/extract-text: dosyayı hiçbir yere
  kaydetmeden sadece metnini çıkarıp döner (chat ataç özelliği için)
- chatMessage ve sendThreadMessage artık body'de attachments
  ({filename,text}[]) kabul ediyor; AI bağlamına ekleniyor, kayıtlı
  mesaja da "[Ek dosya(lar): ...]" notu düşülüyor
- chatMessage ayrıca document_ids kabul ediyor — dosya sohbetinde
  kullanıcının bu mesajda özellikle işaret ettiği mevcut belge(ler)
  AI'ye vurgulanıyor

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 01:03:13 +03:00
mstfyldzandClaude Sonnet 5 0318f2ac77 feat: persist general chat as chat_threads, decoupled from cases
Sohbet/Asistan sayfasındaki genel sohbetler artık kalıcı: yeni
chat_threads/thread_messages tabloları (cases ile ilişkisiz) ile
sendThreadMessage endpoint'i eklendi. Eski caseId==='general'
(kalıcı olmayan) dalı kaldırıldı, AI çağrısı ortak callAiChat
yardımcısına taşındı.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-10 00:07:44 +03:00
mstfyldzandClaude Sonnet 5 fa01432ffe feat: use firm's own templates as style guide for AI-drafted petitions
Belge Şablonları uploads now also get extracted_text (same OCR/office
pipeline as documents), and a new POST /api/drafting/generate builds
a real AI draft from the case's actual data (title, UYAP parties,
latest Dosya Özeti) — if the lawyer picks one of their own templates,
its extracted text is passed as a style/format reference only (the
prompt explicitly forbids copying the template's old case facts).
Dilekçe Hazırlama no longer fakes a draft with setTimeout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-09 20:20:47 +03:00
mstfyldzandClaude Sonnet 5 af5a03db92 feat: add template upload/download/delete endpoints
Belge Şablonları now stores real files: POST /api/templates/upload
(multer -> Supabase Storage under templates/<user>/, then a templates
row), GET /api/templates/:id/download-url (short-lived signed URL),
and DELETE /api/templates/:id. Mounted at /api/templates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-09 19:50:46 +03:00
mstfyldzandClaude Sonnet 5 99d4d770d5 feat: add POST /api/cases/parties to store UYAP taraf bilgileri
The UYAP extension now captures the davaci/davali/sanik + vekil data
from the "Taraf Bilgileri" tab and sends it once per case. This
endpoint finds/creates the matching case by title (same lookup used
by registerLocalDocument, now shared via lib/caseLookup.ts) and stores
it in a new cases.parties column - a much more reliable source for
the case detail screen's "Taraflar" info than the AI's own guess from
OCR'd document text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-09 19:29:53 +03:00
mstfyldzandClaude Sonnet 5 9f5c5c1e45 feat: add case-level AI summary endpoint
POST /api/cases/:caseId/summarize combines extracted text from all of
a case's documents and runs the existing AI analysis prompt, storing
the result as a case-level analysis (document_id: null). Powers the
"Özet Hazırla" button on the case detail screen.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-09 16:14:41 +03:00
mstfyldz 67b0398b8c feat: add POST /api/documents/register-local for extension import
Accepts pre-extracted text (no raw file) from the AyrisLegal Electron
app's local OCR pipeline, matches/creates a case by title, and runs
the existing AI analysis flow. Also fixes a bug in uploadDocument:
officeparser@7.x's parseOffice() now returns a result object with
.toText() instead of a plain string, which was breaking PDF/DOCX
manual uploads.
2026-08-09 11:26:36 +03:00
mstfyldz d213d68e0f feat: add POST /api/precedent-analysis for research "Analiz modu"
Takes the user's described situation plus the top search results and
asks the AI model for a short legal assessment. Auth-protected since
it's a paid AI call.
2026-08-09 10:47:59 +03:00
mstfyldz 0e40aaef96 feat: add case creation endpoint and auto-title from first message
POST /api/cases lets the frontend actually create a new dava dosyası
(no working "Yeni Dosya" flow existed before). chatMessage now
generates a short title from a case's first message (like Claude/
ChatGPT auto-titling) and renames the case, returned as `newTitle`.
2026-08-09 10:34:55 +03:00
mstfyldz 7b354d4f96 feat: add DELETE /api/cases/:caseId to fully delete a case
Chat panel's trash icon should remove the whole case (not just clear
its chat history) — documents/analyses/chat_messages cascade-delete
via the existing ON DELETE CASCADE foreign keys.
2026-08-09 10:26:36 +03:00
mstfyldz 0831ebb25b feat: add DELETE /api/chat/:caseId to clear a case's chat history
Frontend's chat history trash icon was calling this endpoint but it
didn't exist yet, causing a JSON-parse error on the default 404 page.

Also renames the LegalOS health-check message to AyrisLegal.
2026-08-09 10:09:15 +03:00
mstfyldz df70520ede Initial commit 2026-08-08 17:19:28 +03:00