Notify the embedder after the shared CDP owner is initialized and before
waiting for pipe input. Describe readiness in terms of the protocol
transport so the contract covers both TCP and pipe sessions.
Exercise the public pipe API with ace-protocol enabled: publish one usable
handle before any incoming CDP command, then revoke it after EOF. Repeat
for a second serving invocation. The new case times out without the hook.
`moli serve --remote-debugging-pipe` reads NUL-terminated CDP messages from
inherited file descriptor 3 and writes replies to descriptor 4, like
Chromium's flag of the same name. No listener is bound, so a parent process
can drive a private browser without choosing or exposing a port. The session
ends at EOF on the input pipe or on Browser.close.
- The CLI claims descriptors 3 and 4 once, after checking that both are pipes
or sockets, and hands them to `ProtocolServer::serve_pipe` as `OwnedFd`.
- The WebSocket writer is generic over any message sink, so the pipe shares
its bounded queue and stall handling.
- Shutdown follows `serve_listener`: stop the CDP owner, drain, then flush
storage on a blocking worker inside the shared shutdown budget, reporting a
failed flush.
- An inbound message is limited to the WebSocket transport's 64 MiB and is
rejected as soon as it exceeds that.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Route intercepted Window and dedicated Worker XHR through shared native
request, authentication and response decisions. One-shot pause ports let the
existing protocol/session machinery continue, fail or fulfill a request
without queueing a Page command behind its suspended JavaScript stack.
Publish native network facts across an explicit synchronous-wait scope, preserve
normal asynchronous streaming delivery, and cancel loads before owner
teardown. Remove the synchronous-only URL-rule copy and retain the canonical
protocol matcher, session chains and request identities.
Cover Page task suspension, independent protocol decisions, binary overrides,
CORS preflight, authentication, redirects, streaming, multi-session cleanup,
Worker termination and target close. Await actual callback/command identities
where network acknowledgements no longer imply Page delivery has finished.
Give BiDi commands independent admission, Native and navigation waits instead
of retaining the socket turn or a single Runtime slot. Share input state by
top-level host, retain its performActions queue, and allow release/control work
during pauses without applying future input state early.
Keep CDP navigation queues local to their sessions, project independent output
while another page is modal, and recover Worker network ownership from its
original session. Preserve exact host bindings, renderer/load predecessors,
original Runtime results and actual realm-retirement ordering.
Validate with cargo fmt --all, workspace Clippy (all targets/features, warnings
denied), and cargo nextest run --no-fail-fast: 23,068 passed, 20 existing skips.
/json/protocol served V8's js_protocol verbatim (Schema, Runtime, Debugger,
Console, Profiler, HeapProfiler), while the dispatcher implements 29 more
domain groups (Page, DOM, Network, Target, Input, Emulation, ...). Clients
that gate calls on the advertised protocol refused commands Moli supports.
- Derive strum::VariantNames on the action enums the dispatcher parses
methods against, and expose moli_protocol::implemented_cdp_commands()
(domain -> wire command names). Generated from the implementation, so
it cannot drift.
- /json/protocol merges that list into the V8 schema once (OnceLock):
V8 domains keep full schemas and gain any missing command names;
Moli-implemented domains list command names only, with a description
saying parameter schemas are not published.
- The embedded CDP_PROTOCOL_JSON constant is unchanged, so
embedded_protocol_preserves_the_complete_vendored_schema still holds.
Tests: wire names (getFullAXTree, getDOMStorageItems, navigate; 29
domains) and the discovery endpoint test now asserts Page / DOM /
Network / Target / Runtime / Input and Page.navigate are advertised.
Reverting to the verbatim V8 schema fails it ("must advertise Page").
fmt and clippy -D warnings clean for both crates.
Keep the socket actor responsive while a context-targeted Runtime command waits for its Document. Retain the original host and session binding until admission can validate and dispatch in one finite owner turn. Cover close, replacement, navigation completion, session end and disconnect in standalone and Classic-attached BiDi, including exact-once responses and revoked identities.