pub struct BeholderRegistry { /* private fields */ }Expand description
Registry of available beholders, consulted at task.run time.
Entries are tried in insertion (priority) order. Earlier registrations have
higher priority when multiple beholders’ matches predicates would fire.
Implementations§
Source§impl BeholderRegistry
impl BeholderRegistry
pub fn new() -> Self
Sourcepub fn register(&mut self, factory: Box<dyn BeholderFactory>)
pub fn register(&mut self, factory: Box<dyn BeholderFactory>)
Register a beholder factory. Earlier entries have higher priority.
Sourcepub fn attach(
&self,
raw_cmd: &str,
select: &BeholderSelect,
verbatim_output: bool,
) -> AttachResult
pub fn attach( &self, raw_cmd: &str, select: &BeholderSelect, verbatim_output: bool, ) -> AttachResult
Determine and attach a beholder for the given invocation.
-
Tokenizes
raw_cmdand strips wrapper binaries (bunx, npx, pnpm, npm exec). -
verbatim_outputsignals that somebody reads this run’s output as text — a human watching a terminal tile, or an attach client that promised its caller byte-identical passthrough.Rewriterbeholders decline inAutomode rather than change what that reader sees;Forcestill attaches but recordsforced-against-verbatim.This flag used to be
tty_attached, and the rename is the R739-B10 fix rather than tidying. A PTY was never the thing that mattered: what matters is whether anything downstream renders the bytes.yah build runmoved off a PTY onto pipes (R739-F6) and instantly started leaking--message-format=json-render-diagnosticsoutput into an agent’s stdout, because the only flag that could have stopped it was named after the mechanism instead of the requirement. -
Behaviour depends on
select:Auto— walk in priority order, firstmatcheshit wins.Force(name)— find by name; bypassmatches(recordsforced-against-flagsif the beholder would have declined, orforced-against-verbatimif the output is read verbatim and mode is Rewriter).None— bytes-only; no beholder attached.
-
If a
Rewriterbeholder attaches, itsadjust_argvis applied to the returnedAttachResult.argvand the diff is surfaced onstatus.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BeholderRegistry
impl !UnwindSafe for BeholderRegistry
impl Freeze for BeholderRegistry
impl Send for BeholderRegistry
impl Sync for BeholderRegistry
impl Unpin for BeholderRegistry
impl UnsafeUnpin for BeholderRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more