Skip to content

Commit a2466b2

Browse files
authored
Split server upstream transports (#10)
* Split server upstream transports * Add Mod topology routing * Simplify JS transport surfaces * Rename client auto session router fields * Use single upstream transport send surface * Fix upstream config and binding event routing * Fix native upstream defaults and keepalive startup * Expose reverse upstream endpoint on transport * Use reversews endpoint field in tests * Simplify pipe and native upstream transport state * Remove synthetic native transport URL state * Simplify transport state * Simplify ModCDP transport routing * Collapse loopback CDP into websocket transport * Simplify transport and launcher configuration * big cleanup * Move Runtime context routing into router * Make ModCDPServer a startable class * Remove ModCDP session handle facade * Remove ModCDP server version field * Remove server version ready checks from SDKs * Remove duplicated server config state * clenaup * Clean up ModCDP config schemas * Hydrate base component configs with zod * clean translation * more 1 to 1 cleanup * Align translated transport config surfaces * Move translated route config under router * Fix proxy CLI extension loading tests * Align translated config naming * Fix Linux local Chrome sandbox default * Use config naming consistently * Track translated router context state * Fix JS extension loading in CI * Apply remaining config naming cleanup * Align translated ModCDP type surfaces * Align translated upstream transport helpers * Fix service worker custom event demo delivery * Align Go router state names * Align translated client launcher default * Add translated client configure methods * Remove invalid native messaging shell demo jobs * Align translated router send routing * Use config naming in Go client constructor * Add translated router topology support * Align translated config propagation tests * Align translated injector config tests * Use config wording in client comments * Align translated extension injection behavior * Align CI matrix with translated transports * Align translated demo event emission * Fix Python config typing drift * Accept Pydantic schemas for custom registrations * Fix Python static type checks * Type router config map in Python * Accept wildcard middleware names in Go * Make Go latency ping deterministic * Align Python and Go translated utility surfaces * Export translated helpers from Python and Go roots * Fill translated root exports * Align translated builtin Mod schemas * Align Python websocket transport tests * Align translated protocol validation tests * Align custom namespace schema tests * Align translated client config surfaces * Align translated upstream config shape * Align custom namespace live tests * Align translated Browserbase injector config * Align service worker schema tests * Remove Go-only client helper drift * Align router config and event unwrapping parity * Align Browserbase base URL config ownership * Align launcher config propagation parity * Validate Python send results * Align raw client routing across runtimes * Match raw connect initialization parity * Deduplicate Go custom config shapes * Preserve Python event payload data shape * Align schema config validation across runtimes * Narrow Python registry config inputs * Align Python protocol payload types * Narrow Python CDP payload maps * Align launcher server config routing * Align launcher tests across runtimes * Add binding payload encoder parity * Tighten Python topology type parity * Align Python route helper default * Align no-injector error wording * Align Go route helper default test * Align config mode errors * Align upstream event listener parity * Remove transport server config hook * Route startup through auto session router * Align websocket transport JSON state * Use config wording in proxy docs * Align router upstream event ownership * Preserve inherited injector launcher config * Refresh generated package artifacts * Match server configure upstream shape * Accept object-shaped Mod domain params * Align Go router upstream ownership * Align close state and python typing * Fix python transport state typing * Avoid python state dict key narrowing * Align topology result schema registry * Fix topology schema nullability * Align translated ModCDP schemas * Fix translated Python type narrowing * Annotate translated Python argument maps * Avoid Python mapping key narrowing * Align translated injector discovery behavior * Align translated AutoSessionRouter tests * Align translated custom namespace tests * Align translated client config tests * Align translated Go test names * Align translated event and transport tests * Deduplicate Go client config type * Fix Python client config validation test * Align router native command validation * Align translated router and test names * Align custom namespace translated test names * Align ModCDPClient translated tests * Inline Go translated test helpers * Remove Go launcher transport helper aliases * Align translated test case names * Align service worker routing across clients * Align Go client state names with translated shape * Remove Go translate compatibility aliases * Keep Go extension state on injector * Remove duplicate Go injector extension id fields * Align Go toJSON sensitive state filtering * Unify CDPTypes command schema registries * Read Go demo extension state from injector * Fix CDPTypes lint and Go demo state reads * Tighten translated runtime parity * Use real browser for absent CLI extension target test * Align Python and Go supported ModCDP surface * Remove borrow injection from translated runtimes * Align translated client config and transport tests * Align translated ModCDP runtimes * Fix service worker upstream routing * Route ModCDP server upstream transports directly * Send server-peer registrations upstream * Clarify reverse transport direction
1 parent 4856a7d commit a2466b2

298 files changed

Lines changed: 34258 additions & 26263 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ jobs:
4545
pnpm exec vitest run \
4646
$(find js/test -name 'test.*.ts' \
4747
! -name 'test.ModCDPClient.ts' \
48-
! -name 'test.NatsUpstreamTransport.ts' \
49-
! -name 'test.ReverseWebSocketUpstreamTransport.ts' \
48+
! -name 'test.NATSUpstreamTransport.ts' \
49+
! -name 'test.ReverseWSUpstreamTransport.ts' \
5050
! -name 'test.proxy.ts' | sort) \
5151
--fileParallelism=false --maxWorkers=1
5252
;;
@@ -55,8 +55,6 @@ jobs:
5555
uv run python -m unittest \
5656
$(find tests -name 'test_*.py' \
5757
! -name 'test_ModCDPClient.py' \
58-
! -name 'test_NatsUpstreamTransport.py' \
59-
! -name 'test_ReverseWebSocketUpstreamTransport.py' \
6058
| sed 's#/#.#g; s#\.py$##' | sort)
6159
;;
6260
go)
@@ -81,18 +79,43 @@ jobs:
8179
strategy:
8280
fail-fast: false
8381
matrix:
84-
client: [js, python, go]
85-
upstream: [ws, pipe, reversews, nativemessaging]
86-
mode: [direct, loopback, debugger]
87-
exclude:
88-
- upstream: reversews
82+
include:
83+
- client: js
84+
upstream: ws
85+
mode: direct
86+
- client: js
87+
upstream: ws
88+
mode: loopback
89+
- client: js
90+
upstream: ws
91+
mode: debugger
92+
- client: js
93+
upstream: pipe
8994
mode: direct
90-
- upstream: reversews
95+
- client: js
96+
upstream: pipe
9197
mode: loopback
92-
- upstream: reversews
98+
- client: js
99+
upstream: pipe
93100
mode: debugger
94-
- upstream: nativemessaging
101+
- client: python
102+
upstream: ws
95103
mode: direct
104+
- client: python
105+
upstream: ws
106+
mode: loopback
107+
- client: python
108+
upstream: ws
109+
mode: debugger
110+
- client: go
111+
upstream: ws
112+
mode: direct
113+
- client: go
114+
upstream: ws
115+
mode: loopback
116+
- client: go
117+
upstream: ws
118+
mode: debugger
96119
env:
97120
CI: "true"
98121
CHROME_PATH: /usr/bin/chromium
@@ -168,37 +191,26 @@ jobs:
168191
run: |
169192
pnpm exec vitest run \
170193
js/test/test.ModCDPClient.ts \
171-
js/test/test.NatsUpstreamTransport.ts \
194+
js/test/test.NATSUpstreamTransport.ts \
172195
js/test/test.proxy.ts \
173196
--testNamePattern "^(?!.*reversews).*" \
174197
--fileParallelism=false --maxWorkers=1
175198
- name: Run JS serialized reversews tests
176199
run: |
177200
pnpm exec vitest run \
178-
js/test/test.ReverseWebSocketUpstreamTransport.ts \
201+
js/test/test.ReverseWSUpstreamTransport.ts \
179202
js/test/test.proxy.ts \
180203
--testNamePattern "reversews" \
181204
--fileParallelism=false --maxWorkers=1
182205
- name: Run Python serialized non-reverse connector tests
183206
run: |
184207
cd python
185-
uv run python -m unittest \
186-
tests.test_ModCDPClient \
187-
tests.test_NatsUpstreamTransport
188-
- name: Run Python serialized reversews tests
189-
run: |
190-
cd python
191-
uv run python -m unittest \
192-
tests.test_ReverseWebSocketUpstreamTransport
208+
uv run python -m unittest tests.test_ModCDPClient
193209
- name: Run Go serialized non-reverse connector tests
194210
run: |
195211
cd go
196212
go test -count=1 -p 1 ./modcdp/client
197-
go test -count=1 -p 1 ./modcdp/transport -run 'Test(UpstreamTransport|WebSocketUpstreamTransport|PipeUpstreamTransport|NativeMessagingUpstreamTransport|NatsUpstreamTransport)'
198-
- name: Run Go serialized reversews tests
199-
run: |
200-
cd go
201-
go test -count=1 -p 1 ./modcdp/transport -run 'TestReverseWebSocketUpstreamTransport'
213+
go test -count=1 -p 1 ./modcdp/transport -run 'Test(UpstreamTransport|WebSocketUpstreamTransport)'
202214
203215
serialized-reversews-demo:
204216
name: serialized reversews demos
@@ -216,26 +228,12 @@ jobs:
216228
with:
217229
node-version: 22
218230
cache: pnpm
219-
- uses: actions/setup-python@v5
220-
with:
221-
python-version: "3.12"
222-
- uses: astral-sh/setup-uv@v5
223-
- uses: actions/setup-go@v5
224-
with:
225-
go-version-file: go/go.mod
226-
cache-dependency-path: go/go.sum
227231
- run: pnpm install --frozen-lockfile
228232
- run: pnpm run build
229233
- name: Run reversews demos serially
230234
run: |
231235
for mode in loopback debugger; do
232236
node dist/js/examples/demo.js --"$mode" --upstream=reversews
233-
cd python
234-
uv run python examples/demo.py --"$mode" --upstream=reversews
235-
cd ..
236-
cd go
237-
go run ./examples/demo --"$mode" --upstream=reversews
238-
cd ..
239237
done
240238
241239
proxy-example:

0 commit comments

Comments
 (0)