Skip to content

armgit / moli

Public Imported from GitHub
0

Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust

refactor(cdp): project native terminals with other renderer records

ldm030b7d61eb4cc
diff --git a/moli-protocol/src/domains/activity/output_ingress/renderer.rs b/moli-protocol/src/domains/activity/output_ingress/renderer.rs
index 88651407d..ebd0e4a82 100644
--- a/moli-protocol/src/domains/activity/output_ingress/renderer.rs
+++ b/moli-protocol/src/domains/activity/output_ingress/renderer.rs
@@ -181,8 +181,11 @@ async fn project_renderer_output_records_for_owner(
command_context: &mut CommandDispatchContext,
) {
for record in records {
- let (renderer_cause, item) = record.into_parts();
- let mut item = match item {
+ let (renderer_cause, mut item) = record.into_parts();
+ if !projection.admit_record(&mut item) {
+ continue;
+ }
+ match item {
RendererOutputItem::NativeTerminal(terminal) => {
command_context.protocol_events_mut().extend(
crate::domains::native::project_terminal_for_owner(
@@ -192,16 +195,6 @@ async fn project_renderer_output_records_for_owner(
terminal,
),
);
- continue;
- }
- item => item,
- };
- if !projection.admit_record(&mut item) {
- continue;
- }
- match item {
- RendererOutputItem::NativeTerminal(_) => {
- unreachable!("terminals were projected in producer order above")
}
RendererOutputItem::OwnerAction(action) => {
// A Page stream can remain bound to its implicit primary owner while a
diff --git a/moli-protocol/src/domains/activity/publication_route.rs b/moli-protocol/src/domains/activity/publication_route.rs
index 73599a130..738a5d624 100644
--- a/moli-protocol/src/domains/activity/publication_route.rs
+++ b/moli-protocol/src/domains/activity/publication_route.rs
@@ -42,7 +42,7 @@ pub(crate) enum RendererPublicationRoute {
}
/// A current Page can project its complete renderer stream. A replaced Page
-/// remains routable for final Network facts and terminal Inspector responses
+/// remains routable for final Network facts and terminal command responses
/// whose exact correlations are retained by the target/session. Other
/// historical records must not affect the replacement document.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
@@ -62,6 +62,7 @@ impl RendererPublicationProjection {
return true;
}
match item {
+ RendererOutputItem::NativeTerminal(_) => true,
RendererOutputItem::Observation(RendererProtocolObservation::Network { .. }) => true,
RendererOutputItem::Observation(RendererProtocolObservation::RuntimeInspector(
batch,