pub struct BuildCtx<'a> {
pub bin: &'a str,
pub prompt: &'a str,
pub model: Option<&'a str>,
pub system: Option<&'a str>,
pub resume: Option<&'a str>,
pub fork: bool,
pub mode: PermissionMode,
pub output_format: OutputFormat,
pub schema: Option<&'a str>,
}Expand description
Everything build_argv needs, with no I/O: the resolved binary, the prompt,
the optional model, whether to request the harness’s “don’t prompt” mode, and
the effective output format (the harness default, or a --output-format
override) for harnesses that take a format flag.
Fields§
§bin: &'a str§prompt: &'a str§model: Option<&'a str>§system: Option<&'a str>System prompt to apply. Adapters with a native system flag map it (Claude
Code’s --append-system-prompt, Goose’s --system); adapters without one
prepend it to the prompt via prompt_with_system so the instructions
still reach the model, rather than dropping it.
resume: Option<&'a str>Session id to continue, for harnesses that support resumption. Only set
after the command layer has verified the selected harness’s
supports_resume, so an adapter that maps it can assume support.
fork: boolWhen resuming, branch a new session from the resumed one instead of
appending to it — so the original (and its cached prefix) is untouched and
can seed independent follow-ups. Only honored alongside resume, and only
set after the command layer has verified supports_fork; an adapter maps it
to its native fork flag (Claude Code’s --fork-session, OpenCode’s
--fork). Ignored by adapters that cannot fork (they are never selected
with it).
mode: PermissionModeThe normalized approval mode to request. Each adapter maps it to its
harness’s native mechanism (argv flags here; any environment via the
matching ModeSpec). The command layer guarantees the selected harness
actually supports mode before calling build_argv, so an adapter only
needs correct output for the modes in its HarnessSpec::modes.
output_format: OutputFormat§schema: Option<&'a str>Inline JSON-Schema text to deliver through the harness’s native
structured-output flag, set only for an adapter with a
HarnessSpec::native_schema when a schema run is requested. Adapters
without native support ignore it — the command layer instead appends the
schema instruction to the prompt — so it is never silently dropped.
Auto Trait Implementations§
impl<'a> Freeze for BuildCtx<'a>
impl<'a> RefUnwindSafe for BuildCtx<'a>
impl<'a> Send for BuildCtx<'a>
impl<'a> Sync for BuildCtx<'a>
impl<'a> Unpin for BuildCtx<'a>
impl<'a> UnsafeUnpin for BuildCtx<'a>
impl<'a> UnwindSafe for BuildCtx<'a>
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> 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