pub struct Governor { /* private fields */ }Expand description
Who decides for one attempt, and what they decided.
Implementations§
Source§impl Governor
impl Governor
Sourcepub fn pending(&self) -> Option<Value>
pub fn pending(&self) -> Option<Value>
The call waiting for a person nobody could ask, if one is.
Sourcepub fn asking(&self) -> Duration
pub fn asking(&self) -> Duration
How long a person has spent deciding so far: the attempt’s clock stands while they do.
Sourcepub fn reported(&self, call: &ToolRequest)
pub fn reported(&self, call: &ToolRequest)
The agent reported a call it makes: recorded beside the decisions,
as the agent’s own (decision: "reported") — its claim, never
evidence. Masked, its long values cut; one that changed something
without a decision of speccoder’s is counted (Governor::unasked).
Sourcepub fn unasked(&self) -> u32
pub fn unasked(&self) -> u32
Calls the agent reported changing something (an edit, a command) that never reached speccoder as a request: its own settings let it decide them.
Sourcepub fn permission(
&self,
call: &ToolRequest,
options: &[PermissionOption],
) -> Option<String>
pub fn permission( &self, call: &ToolRequest, options: &[PermissionOption], ) -> Option<String>
Answers a permission request: the agent’s allow-once option when
allowed (a plain read, or a person’s yes), its reject option when
not, None (cancelled) when the attempt ends here.
Sourcepub fn abandon(&self, call: &ToolRequest)
pub fn abandon(&self, call: &ToolRequest)
A decision that could not be made (it failed): refused, and the request closed.
Sourcepub fn decide(
&self,
tool: &str,
args: &Value,
call: Option<&ToolRequest>,
) -> Verdict
pub fn decide( &self, tool: &str, args: &Value, call: Option<&ToolRequest>, ) -> Verdict
Decides one speccoder tool call as a native attempt would.
Sourcepub async fn read_text_file(
&self,
path: &Path,
line: Option<u32>,
limit: Option<u32>,
) -> Result<String, String>
pub async fn read_text_file( &self, path: &Path, line: Option<u32>, limit: Option<u32>, ) -> Result<String, String>
fs/read_text_file: a file in the worktree, read through the
workspace tools (credentials refused, copied secrets masked).
§Errors
Why it is refused or cannot be read.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Governor
impl !RefUnwindSafe for Governor
impl !UnwindSafe for Governor
impl Forget for Governor
impl Send for Governor
impl Sync for Governor
impl Unpin for Governor
impl UnsafeUnpin for Governor
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> 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