From d6a64989da9ff71f3d69382f0f0747f042d16662 Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:03:00 +0800 Subject: [PATCH 1/2] draft 1 --- AGENTS.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..9438b782 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,80 @@ +# LiveKit Flutter SDK + +## Commands + +Supported platforms: Android, iOS, macOS, Windows, Linux, Web. + +```zsh +# Fetch dependencies +flutter pub get + +# Analyze +flutter analyze + +# Run tests +flutter test + +# Format +dart format -l 120 lib test + +# Generate protobufs (requires ../protocol/protobufs checkout) +make proto + +# Build web E2EE worker +make e2ee +``` + +## Architecture + +``` +lib/ +├── livekit_client.dart # Public exports +├── livekit_client_web.dart # Web-specific entry point +└── src/ + ├── core/ # Room, Engine, SignalClient, Transport + ├── participant/ # LocalParticipant, RemoteParticipant + ├── track/ # Local/Remote tracks, Web track adapters + ├── publication/ # TrackPublication types + ├── data_stream/ # Reliable/unreliable data channels + ├── e2ee/ # End-to-end encryption + ├── agent/ # AI agent integration (e.g., chat) + ├── managers/ # Audio/video device and media managers + ├── support/ # WebSocket, platform shims, utilities + ├── hardware/ # Device/permission helpers + ├── token_source/ # TokenSource implementations + ├── stats/ # RTC stats models + ├── proto/ # Generated protobufs + ├── widgets/ # Flutter UI widgets (video, controls) + └── utils/ # Shared helpers +``` + +Key components: + +- `Room` - main entry point; manages connection state, participants, and tracks +- `Engine` - orchestrates signaling, transports, and media lifecycle +- `SignalClient` - WebSocket signaling with LiveKit server +- `Transport` - WebRTC peer connection wrapper +- `Participant` - local/remote participant state and publications +- `Track`/`TrackPublication` - media track abstractions + +## WebRTC + +WebRTC provides the underlying media transport. The Flutter SDK wraps native WebRTC via +platform-specific implementations in `android/`, `ios/`, `macos/`, `windows/`, `linux/`, `web/`, +and shared code in `shared_cpp/` and `shared_swift/`. Dart APIs in `core/` and `track/` shield +consumers from platform differences. + +Key files: + +- `lib/src/core/transport.dart` - peer connection wrapper and ICE/SDP handling +- `lib/src/core/signal_client.dart` - signaling protocol implementation +- `lib/src/track/` - track bindings and renderers (including `web/`) +- `lib/src/widgets/` - Flutter video rendering widgets + +## Testing + +- `test/core/` - unit tests for room, signaling, and core models +- `test/integration/` - integration tests (often require local `livekit-server --dev`) +- `test/agent/` - agent feature tests +- `test/token/` - token source tests +- `test/support/` and `test/utils/` - helpers and fixtures From b24eebba8321423b42713d86cab3b24290a0d817 Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:10:00 +0800 Subject: [PATCH 2/2] Update AGENTS.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 9438b782..48c5ad10 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -60,7 +60,7 @@ Key components: ## WebRTC WebRTC provides the underlying media transport. The Flutter SDK wraps native WebRTC via -platform-specific implementations in `android/`, `ios/`, `macos/`, `windows/`, `linux/`, `web/`, +platform-specific implementations in `android/`, `ios/`, `macOS/`, `windows/`, `linux/`, `web/`, and shared code in `shared_cpp/` and `shared_swift/`. Dart APIs in `core/` and `track/` shield consumers from platform differences.