Commit Graph

192 Commits

Author SHA1 Message Date
abdussamedulutas 0d21d8c8b3 #35: README — Go engine + yeni SDK yapısı
- /script → /sdk/index.js ES modül import örnekleri
- WebRTC API kullanım örneği (connect/addStream/track/sendFile)
- Studio UI kullanım örneği
- Env değişkenleri tablosu (MWSE_HOST/PORT/PUBLIC_DIR/SDK_DIR vs.)
- Mimari şeması: sdk/webrtc/ ve sdk/studio/ alt klasörleriyle güncellendi
- Durum tablosu: sanal IP alt ağı, WebRTC kütüphanesi, Studio UI eklendi
- TypeScript / npm / Parcel referansları kaldırıldı

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 13:05:38 +03:00
abdussamedulutas 777f422873 #38/#34: CanvasCompositor ve demo güncellemesi
sdk/webrtc/CanvasCompositor.js (#38):
  - Gelen video track'lerini tek canvas'ta birleştirme (grid/pip/side-by-side/focus)
  - OffscreenCanvas öncelikli (DOM gerektirmiyor), yoksa <canvas> kullanır
  - setFPS(), setLayout(), setFocus() ile runtime kontrol
  - stream() → MediaStream; StreamManager.addStream('composite', ...) ile gönderilir
  - setEncodings() ile bitrate/fps zaten StreamManager üzerinden destekleniyor

sdk/webrtc/index.js: CanvasCompositor re-export eklendi

public/demos/ (#34): Tüm demo'lar yeni SDK API'sine güncellendi:
  - <script src="/script"> → <script type="module"> import MWSE from '/sdk/index.js'
  - new MWSE() (endpoint otomatik import.meta.url'den alınıyor)
  - rtc.connect({ polite }) ile perfect negotiation polite/impolite tayini
  - rtc.addStream() / rtc.on('track') yeni API
  - rtc.on('failed') durumu gösteriliyor
  - window.send() module scope sorununu çözüyor (onclick handler)

go test -race ./... — tüm testler yeşil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 13:02:58 +03:00
abdussamedulutas 75d5999b4a #36/#37/#40/#41/#47: WebRTC kütüphanesi, sub-network ve Studio UI
sdk/webrtc/ — kapsamlı RTCEngine kütüphanesi:
  - PeerConnection.js: RTCPeerConnection wrapper; connectionstatechange +
    iceconnectionstatechange her ikisi de izleniyor (eski 'bağlantı kopsa
    fark etmez' hatası bu şekilde önleniyor)
  - Negotiator.js: perfect negotiation (RFC 8829); polite/impolite roller,
    teklif çakışması rollback, ICE adayları sıraya alınıyor
  - StreamManager.js: addStream/replaceTrack/removeStream/setEncodings —
    runtime'da track ekle/çıkar/değiştir, yeniden müzakere gerekmiyor
  - DataChannel.js: birincil veri kanalı, bağlantı canlıyken kapanırsa
    otomatik yeniden oluşturulur, açılana kadar mesaj kuyruğu
  - MediaSources.js: camera/microphone/screen/cameraAndMic fabrika metodları,
    AudioBuffer→MediaStream, canvas.captureStream, AudioContext mix bus
  - FileSender.js: en fazla 5 paralel DataChannel üzerinden dosya transferi,
    progress olayı, 16 KB chunk + bufferedAmountLow akış kontrolü
  - index.js (RTCEngine): tüm alt sistemleri koordine eder; ICE restart
    exponential backoff (1s→2s→4s); Peer.js ile geriye dönük uyumlu

sdk/WebRTC.js → ./webrtc/index.js'e ince re-export (Peer.js değişmedi)

sdk/studio/ — masaüstü-first Miller-kolon UI (#47):
  - Column.js: başlık + arama filtresi + öğe listesi
  - ColumnView.js: yatay kayan kolon yöneticisi, popTo() ile derine git
  - index.js (Studio): Server→Groups→Peers→Devices→Streams→Quality hiyerarşisi;
    WebRTC bağlantısını otomatik başlatır (polite = küçük socketId)
  - style.css: koyu masaüstü teması, aktif öğe vurgusu, ilerleme çubuğu

internal/services/ippressure.go — rastgele atama + sub-network (#40/#41):
  - lockIP/lockNumber/lockCode: önce 256 rastgele deneme, sonra sıralı yedek;
    yüksek bağlantı sayısında O(1) ortalama atama
  - SubNet: /24 sanal alt ağ (10.A.B.0/24); Alloc/Release/Whois metodları
  - alloc|release|whois APSubNet + APSubNetIP HTTP handler'ları eklendi
  - Bağlantı kesildiğinde subnet IP'leri ve prefix otomatik serbest bırakılıyor

sdk/IPPressure.js: allocSubNet/releaseSubNet/allocSubNetIP/releaseSubNetIP/
  querySubNetIP metodları eklendi

go test -race ./... — tüm testler yeşil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 12:59:16 +03:00
abdussamedulutas 06ca31eecb Eski Node.js / TypeScript yapı dosyaları temizlendi
Silinen dizinler:
- Source/        — Node.js engine (Go engine tarafından ikame edildi)
- frontend/      — TypeScript SDK kaynağı (sdk/ ES modülleri ile değiştirildi)
- script/        — Parcel bundle çıktısı (artık yok; /sdk/ route'u devrede)

Silinen kök dosyalar:
- index.js       — Node.js giriş noktası (Source/index.js'e refer ediyordu)
- package.json / package-lock.json — Parcel/TypeScript build araçları
- tsconfig.json  — TypeScript derleyici ayarları

Taşınan:
- script/status.xml → public/status.xml (httpserver fallback olarak kullanıyor)

Güncelleme:
- httpserver.go  : /script/* route'u kaldırıldı; / artık /sdk/index.js'e yönlendiriyor
- config.go      : ScriptDir alanı ve MWSE_SCRIPT_DIR env değişkeni kaldırıldı
- contract_test  : ScriptDir → SDKDir
- .gitignore     : Node/Parcel artıkları için temizlendi ve kısaltıldı

go test -race ./... yeşil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 12:28:37 +03:00
abdussamedulutas 28abefaaa9 Frontend TS→JS ES modülleri + #42 codec altyapısı + versiyon握手
SDK (sdk/ dizini — native ES module, bundler yok):
- sdk/version.js      : SDK_VERSION="1.0.0", CODEC_JSON/BINARY sabitleri
- sdk/codec.js        : WSTSCodec — JSON (şu an), binary stub (#42 altyapısı)
  Binary çerçeveleme: opcode(1B)+length(4B)+payload; şimdilik NotImplemented fırlatır
- sdk/EventTarget.js  : MWSEEventTarget (browser EventTarget ile çakışma yok)
- sdk/Connection.js   : endpoint:"auto" → import.meta.url ile sunucu tespiti
- sdk/WSTSProtocol.js : codec üzerinden encode/decode, sinyal yönlendirme
- sdk/EventPool.js    : request()/only() ayrımı (#33 korunuyor)
- sdk/Peer.js         : WebRTC stub bağlantısı, WOM pack/to (#33)
- sdk/Room.js         : WOM pack/room (#33), createRoom/join/eject
- sdk/PeerInfo.js, RoomInfo.js, IPPressure.js, P2PFileSender.js
- sdk/WebRTC.js       : placeholder — ayrıca ele alınacak
- sdk/index.js        : MWSE ana sınıfı + versiyon el sıkışması

Versiyon el sıkışması (backend ↔ frontend zorunlu):
- internal/protocol/version.go  : WSTSVersion="1.0.0", WSTSCodecJSON=0
- internal/services/yourid.go   : bağlantı anında wsts/hello sinyali gönderir
  (v + codecs listesi; id sinyalinden ÖNCE gelir)
- sdk/index.js _awaitHello()    : scope çalıştırılmadan önce wsts/hello beklenir;
  versiyon uyuşmazsa bağlantı kapatılır + 'error' eventi ateşlenir (5s timeout)

Servis (httpserver):
- /sdk.js  → 301 /sdk/index.js  (import.meta.url doğru çözümlenir)
- /sdk/    → sdk/ dizini file server
- internal/config: MWSE_SDK_DIR env değişkeni (varsayılan ./sdk)

Demo dosyaları: public/demos/{chat,audio,video}.html
go test -race ./... yeşil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 12:24:21 +03:00
abdussamedulutas 18269059cc #46: 3. parti sunucu köprüsü (bridge)
- internal/bridge: Inbox (bounded FIFO), HTTPApprover (fail-closed connection
  gate), HTTPTrigger (suit-reply push) — birim testleri ile birlikte
- ws.Approver arayüzü + ws.Options.Approver: bağlantı kabulü HTTP upgrade
  öncesinde delege edilir (403 ile reddedilebilir)
- services.WithBridgeInbox + bridge/send handler: client → uygulama sunucusu
  mesajları inbox'a yönlendirilir
- httpserver.ServerOptions: BridgeInbox + Approver enjeksiyonu
- POST /api/bridge/inbox endpoint: uygulama sunucusu inbox'ı atomik olarak boşaltır
- main.go: BRIDGE_APPROVE_URL / BRIDGE_TRIGGER_URL / BRIDGE_INBOX env değişkenleri
  ile köprü opsiyonel etkinleştirilir
- go test -race ./... yeşil

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-17 12:05:59 +03:00
abdussamedulutas 441093bad6 #43/#44/#45: Notify (store-and-forward + suit) ve data-sync alt sistemleri
- internal/notify: store-and-forward (#43) + suit/yanıtlı (#44). Offline hedefe
  bırakılan mesaj bağlanınca teslim; trace id ile durum sorgulanır; suit cevabı
  3. taraf trigger'a manuel iletilir. TTL + hedef-başı sınır + janitor → leak yok.
- internal/datastore: active sync/collection (CRUD broadcast, arrival-time seq ile
  çakışma çözümü) + passive sync (dedupe merge pool) + temp/permanent datastore.
  Saf paket (ws bağımsız), servis katmanı I/O yapar.
- services.Register artık *Registry döndürür + ...Option alır (WithNotifyTrigger).
  main.go janitor'ları başlatır/durdurur. Eski Register(hub) çağrıları çalışır.

Testler: internal/notify, internal/datastore birim testleri + services
notify_test/datasync_test (offline teslim, suit reply+trigger, CRUD broadcast,
concurrent arrival-order, passive convergence, disconnect unsubscribe).
go test -race ./... yeşil.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 08:30:20 +03:00
abdussamedulutas 945b7621a4 #32: SDK ↔ Go engine I/O sözleşmesi doğrulama harness'i
internal/httpserver/contract_test.go: gerçek engine'i (hub+services+HTTP)
gerçek WebSocket üzerinden ayağa kaldırıp SDK'nın gönderdiği WSTS frame'lerini
birebir konuşan entegrasyon testleri. Tarayıcısız uçtan-uca kanıt.

Kapsanan akışlar: my/socketid, create-room, joinroom, request/pair+accept/pair
sinyalleri, pack/to relay (SendOnly), request/to→response/to round-trip,
saQut heartbeat ping/pong. go test -race yeşil.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 08:16:34 +03:00
abdussamedulutas 63680fac19 #31: WebRTC signaling paritesi — engine relay testi
Sinyalleşme (offer/answer/ICE) ayrı bir engine kavramı değil; SDK bunları
{type:':rtcpack:', payload} olarak pack/to üzerinden tüneller (Node ile aynı,
sunucuda RTC handler'ı yok). Engine bu paketleri her iki yönde de payload'ı
incelemeden aynen taşır. Test: TestWebRTCSignalingRelay.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 08:13:22 +03:00
abdussamedulutas 91ebbeffb2 #33: EventPool WOM — askıda kalan promise düzeltmesi
Engine: dispatcher handler nil dönerse yanıt göndermez (nil = yanıt yok /
cevap out-of-band gelecek). Bu, request/to'nun erken [null,id,'E'] ile
ezilmesini önler; gerçek cevap response/to ile aynı id üzerinden gelir.

SDK: EventPool.only() WOM yolu eklendi (waiter bırakmaz); Peer.send ve
Room.send handshake'siz dalı request() yerine only() kullanır. Public API
değişmedi.

Test: TestServerNoReplyOnNilResult, TestRequestResponseRoundTrip,
TestTunnelDoesNotLeakSourceAddress, TestTunnelLargePayloadIntact. go test -race yeşil.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 08:11:29 +03:00
abdussamedulutas f079ef5325 Ajan çalışma sözleşmesi + gitea CLI + yol haritası dosyaları
CLAUDE.md (operating contract), todo.md (roadmap), tools/gitea CLI ve
.gitea-auth.example.json depoya eklendi. Gerçek .gitea-auth.json gitignore'da.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 08:08:05 +03:00
abdussamedulutas c058feb22d Ölçek ayarı, leak sağlamlaştırma ve #27/#28/#29 paritesi
Yüksek bağlantı sayısı + sürekli mesaj trafiği için engine'i sağlamlaştırır;
sınırsız bellek büyümesini (leak) kapatır; 1.0.0 engine parite issue'larını
(oda/pairing/sanal adresleme) tamamlar.

Ölçek/pool ayarı (config.ConnConfig, env-tunable, varsayılanlar yüksek):
- OutboundBuffer 1024, MaxMessageSize 16 MiB, read/write buffer, ping/pong/write
  timeout'ları yapılandırılabilir.
- gorilla WriteBufferPool (paylaşımlı sync.Pool) — yüksek bağlantıda büyük
  bellek tasarrufu. 150 bağlantı + ağır trafikte RSS ~43 MB.
- Dolu buffer'da düşür-ama-kapatma → relay teslimat %99.98 (150 bağlantı).

Leak düzeltmeleri (churn altında sınırsız büyüme yok):
- Pairing ters-indeksi (pairedBy): disconnect'te X'e değen tüm pair kenarları
  O(derece) temizlenir; tek-yönlü bekleyen istek çöpü kalmaz.
- Davet bekleme listesi: istemci waiting odalarını tutar, disconnect'te düşülür.
- realloc artık farklı adres verir (önce al sonra bırak).

#27/#28/#29 paritesi + ifexistsJoin; kapsamlı parite + leak testleri eklendi.
go build/vet/test -race ./... yeşil (18 servis testi). Detay: decisions.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 07:43:54 +03:00
abdussamedulutas 835f0b5f2e Go engine portu (0.1.0 çekirdek) — Node.js engine'i race-free Go'ya taşı
MWSE engine'i (Source/) performans odaklı, eşzamanlılık-güvenli bir Go
projesine taşır. WSTS tel sözleşmesi (SDK giriş/çıkış) korunur; frontend
dokunulmadan çalışmaya devam eder.

- internal/protocol: WSTS encode/decode (request/response/stream/signal)
- internal/ws: Client (bağlantı-başına tek-yazıcı), Room (RWMutex + snapshot
  broadcast), Hub (kayıt + router + event bus), Server (yaşam döngüsü, saQut
  heartbeat). #22 "ayrılırken-yazma" race'i yapısal olarak çözüldü.
- internal/services: YourID, Session, Auth, Room, IPPressure, DataTransfer
  portu (Node'daki bariz bug'lar düzeltildi; tel şekilleri korundu).
- internal/config, internal/httpserver: env config, statik + /api + graceful
  shutdown.
- loadtest/: ayrı modül — ping/relay yük testi + benchmark istemcisi.

go build/vet/test -race ./... yeşil. TestLeaveWhileSendRace regresyonu temiz.
Uçtan uca doğrulandı: ping ~140k req/s (p50 ~200µs, 0 hata),
relay ~190k msg/s (%98.5 teslim).

İnsan onayına bırakılanlar REVIEW.md'de; kararlar decisions.md'de;
durum PORT-PROGRESS.md'de. Hiçbir issue kapatılmadı, stable'a dokunulmadı,
deploy/push yapılmadı.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 07:09:36 +03:00
abdussamedulutas c623016841 Revision 2026-04-23 23:10:05 +03:00
abdussamedulutas 1b02eb1bce Revision 2026-02-26 08:12:40 +03:00
abdussamedulutas d98ec6330e İçerik güncellemesi / Bugfix 2025-12-07 13:57:08 +03:00
abdussamedulutas 5627d6adac Message leak detecting 2025-11-01 21:03:14 +03:00
abdussamedulutas 33b57d7e67 WebDevice suite 2025-10-17 09:37:09 +03:00
abdussamedulutas 212e0151fa Merge branch 'perfectnogation' into stable 2025-08-01 22:27:28 +03:00
abdussamedulutas 3d8fb16d70 Stable index.js 2025-08-01 22:26:49 +03:00
abdussamedulutas 473dd62789 mh288 protokolü oluşturuldu 2025-08-01 21:17:28 +03:00
saqut 41b7a052ab Merge pull request 'perfectnogation' (#20) from perfectnogation into stable
Reviewed-on: #20
2025-07-14 23:25:51 +03:00
abdussamedulutas bcdbe5f3fd Perfect nogation bugfixed 2025-07-14 23:22:37 +03:00
abdussamedulutas 326682aa25 Perfect nogation 2025-07-13 17:31:42 +03:00
abdussamedulutas 055fdd47bd Test added perfect nogation 2025-07-13 16:48:22 +03:00
abdussamedulutas 965ca07853 Test Arayüzü 2025-07-13 16:09:06 +03:00
abdussamedulutas bd3373fd10 Perfect nogation 2025-07-13 16:00:47 +03:00
abdussamedulutas 7756caa0f8 Perfect nogation try 2025-07-13 15:10:29 +03:00
abdussamedulutas cbe424f3e3 Styling 2025-07-01 21:26:31 +03:00
abdussamedulutas b66adffd3a Grid analyze 2025-06-16 02:50:27 +03:00
abdussamedulutas 3ebf5cc1f5 Grid analyze 2025-06-16 02:44:47 +03:00
abdussamedulutas c6c42d4bd8 Peer xclient bug fixed 2025-03-21 22:30:07 +03:00
Abdussamed 640bff88c0 Reversed 2025-02-13 23:01:32 +03:00
Abdussamed 7becdd5a80 Hand 2025-01-16 20:34:03 +03:00
AbdussamedULUTAŞ a19ae8a746 Recaiving stream added 2024-04-17 16:02:46 +03:00
AbdussamedULUTAŞ 07ee1d4db0 Recaiving stream added 2024-04-17 16:02:27 +03:00
AbdussamedULUTAŞ 999274e946 Syntax error 'id' not allowed error fixed 2024-04-15 11:19:39 +03:00
Abdussamed 912f32e7ab Safely send disconnected peers 2024-04-05 10:57:16 +03:00
Abdussamed eeee824b20 Syntax error fixed 2024-04-05 10:30:39 +03:00
Abdussamed 8d3c116a0b Syntax error fixed 2024-04-05 10:28:07 +03:00
Abdussamed 6affbf19be Build bundle 2024-04-05 10:21:38 +03:00
Abdussamed 4cd68f4a7f Disconnected pair event added 2024-04-05 10:06:23 +03:00
Abdussamed 73b5ade3e1 Syntax fix 2024-04-03 16:03:02 +03:00
Abdussamed 8d076456e3 Syntax error 2024-04-03 04:45:54 +03:00
Abdussamed 2439907c59 Connection bug fix / More than debugging 2024-03-21 09:25:31 +03:00
saqut 63f054f6bf README.md Güncelle 2024-03-19 01:15:08 +03:00
Abdussamed 88d87c2c68 Stabilization 234 2024-03-19 01:14:20 +03:00
Abdussamed e9e7ebbbc1 Bugfix 2024-03-04 10:51:17 +03:00
Abdussamed 5175c2b456 Bug fix patch 2024-02-11 23:32:44 +03:00
Abdussamed 870ec96e9a Removed unusal files 2024-02-11 20:39:41 +03:00