session.Config used to spread 16 per-transport tuning fields across its
top level (VideoWidth/Height/.../VP8FPS/.../SEIAckTimeoutMS). The flat
layout meant every caller had to know which fields belong to which
transport, and the YAML→session bridge in internal/config repeated the
same name 32 times across Apply/ApplyProfile.
Group them under VideoConfig/VP8Config/SEIConfig structs hung off
session.Config. internal/config now does e.g.
dst.Video.Width = pickInt(dst.Video.Width, f.Video.Width)
instead of touching dst.VideoWidth. session.ApplyTransportDefaults,
validateVideoChannel/VP8Channel/SEIChannel and buildTransportOptions
read through cfg.Video.*/cfg.VP8.*/cfg.SEI.* in the same way.
The YAML schema itself was already grouped (Video / VP8 / SEI sections);
this commit lines session.Config up with it so the Apply functions can
mirror the YAML structure 1:1 instead of unpacking it into 32 flat
assignments.
All session/config/e2e/cmd/main tests that referenced cfg.VideoX directly
are updated to cfg.Video.X.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
internal/carrier and internal/carrier/builtin sat between transports and
engines, wrapping every engine.Session in carrier.Session +
engineByteStream/engineVideoTrack adapters that mechanically proxied every
method. That layer existed solely to translate Capabilities/AddTrack names;
no behaviour lived above engine.
Replace with internal/engine/builtin: a name-keyed registry that calls
auth.Issue and engine.New directly. Transports look up engine.Session via
enginebuiltin.Open, then type-assert engine.VideoTrackCapable for video
transports. A small per-transport engineVideoSession adapter unifies the
reconnect callback signature (engine uses func(*webrtc.DataChannel); the
transports want func()).
Updates:
- internal/engine/builtin/builtin.go: new Register/Open registry + auth
pass-through ("none") + auth-driven factories for jazz/telemost/wbstream/jitsi.
- internal/transport/datachannel/transport.go: uses engine.Session directly
via Capabilities().ByteStream check.
- internal/transport/{seichannel,videochannel,vp8channel}: each gains an
engineVideoSession adapter and routes Connect/Send/Close/AddTrack through
the engine session.
- internal/app/session: imports enginebuiltin; carrier.Available() →
enginebuiltin.Available().
- pkg/olcrtc/olcrtc.go: switches to enginebuiltin.RegisterDefaults.
- internal/carrier and internal/carrier/builtin: deleted.
- Tests rewritten to register a fakeEngineSession (implements engine.Session
+ engine.VideoTrackCapable) through enginebuiltin.Register. The e2e
memoryStream gains the same dual interface so memorySession is gone.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
internal/link and internal/link/direct were a single-implementation
abstraction layer where directLink mechanically proxied every method to
transport.Transport — only Features() lived above transport.Transport,
and even that was a Features() alias. Six layers of plumbing for zero
behavioural value.
Drop the layer entirely:
- muxconn.Conn now takes a transport.Transport directly.
- server.Server and client.Client store transport.Transport, call
transport.New, and expose Features() through transport.Transport's
built-in method.
- server.Config and client.Config lose their Link string field.
- session.Config loses Link + validateLink + ErrLinkRequired/ErrUnsupportedLink.
- config.File and config.Profile lose the link YAML key.
- pkg/olcrtc/tunnel.Config loses Link.
- mobile drops defaultLink, SetLink, and mobileConfig.link.
Two e2e tests that exercised link.New directly are renamed to call
transport.New (TestTransportCreatesAllProviderTransportCombinations and
TestTransportConnectsFastProviderTransportMatrix); behaviour is unchanged.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
transport.Config used to carry a flat union of video+vp8+sei tuning fields
that every transport ignored except its own. Replace with an opaque
transport.Options marker interface and per-transport Options structs
(videochannel.Options, vp8channel.Options, seichannel.Options). Datachannel
keeps an unset Options.
link.Config gains TransportOptions and drops the 16 transport-specific
fields. server.Config and client.Config follow suit. session.Config is
left untouched in this commit — buildTransportOptions packs its existing
flat fields into the typed Options bundle before calling server/client
(session.Config is rebuilt in a later commit when YAML config moves to
typed sections).
Tests that synthesized link/server/client/transport configs are updated
to pass typed Options bundles. The shared e2eTransportOptions helper
replaces three copies of the flat field bundle in e2e/tunnel_test.go.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
WB Stream removed the room creation API; gen mode for wbstream no
longer works. Remove the wbstream branch from session.Gen, drop the
auto-generate prompt from srv.sh and the entrypoint fallback, and
update docs to instruct users to create rooms manually at stream.wb.ru.
Each auth.Provider now declares DefaultServiceURL() so callers do not
need to know service-specific endpoints. ApplyAuthDefaults fills Engine
and URL from the provider before validation runs — explicit flags always
win, and providers with no default URL require -url to be set explicitly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Break CLI backwards compatibility as planned for refactor/universal-carrier:
- Drop -carrier flag; add -auth (auth provider name), -engine (engine
name for -auth none), -url and -token (SFU endpoint + access token for
direct/none auth mode).
- session.Config.Carrier → Auth + Engine + URL + Token.
- session.Gen() is now generic: auth.Get(cfg.Auth).(auth.RoomCreator)
replaces the hard-coded switch on carrier names.
- Register a "none" carrier in builtin (registerDirect) that bypasses
auth and connects directly to any engine with caller-supplied URL+Token.
- auth/telemost.Provider.Issue now accepts a raw room-ID hash in addition
to a full https://telemost.yandex.ru/j/<id> URL.
- Plumb Engine/URL/Token from session.Config through server.Run,
client.Run/RunWithReady, bringUpLink, link.Config, transport.Config, and
carrier.Config so the "none" carrier has access to them end-to-end.
- Update all tests and mobile.go call sites.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Split the SaluteJazz provider along the same engine/auth seam used for
WB Stream:
- internal/engine/salutejazz — Sber WS+SDP signaling engine (pub/sub
split, _reliable data channel, length-prefixed DataPacket envelope).
Consumes URL/Token/Extra[password] from engine.Config; no embedded
HTTP/auth logic. Registered as engine "salutejazz".
- internal/auth/salutejazz — create-meeting + preconnect flow.
Implements auth.Provider (Engine() → "salutejazz") and
auth.RoomCreator. Accepts cfg.RoomURL in "<roomID>:<password>" form
for join, or empty / "any" / "dummy" for create-on-the-fly, matching
the legacy provider.
The carrier name "jazz" now goes through registerEngineAuth.
engine.Config gains an Extra map so auth providers can pass engine-
specific fields (password here); engine_adapter forwards
auth.Credentials.Extra into it.
session.Gen for jazz uses the auth.RoomCreator capability. Output now
includes the password ("<roomID>:<password>") — without it the printed
room is not joinable, so the legacy roomID-only output was effectively
broken for the gen flow.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Split the WB Stream provider into two orthogonal pieces:
- internal/engine/livekit — generic LiveKit transport (URL+Token only,
no service-specific assumptions). Registered as engine "livekit".
- internal/auth/wbstream — WB Stream API flow (guest register, join,
token exchange). Implements auth.Provider and auth.RoomCreator,
reports engine "livekit".
The carrier name "wbstream" now goes through registerEngineAuth, which
wires the auth provider to the engine it declares. CLI surface is
unchanged. session.Gen for wbstream calls the RoomCreator directly;
that path will become fully generic in a later step. jazz and telemost
remain on the legacy provider path for now.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>