Skip to main content

AgentAction

Enum AgentAction 

Source
pub enum AgentAction {
    Unlock {
        ttl: String,
        absolute_ttl: String,
    },
    Lock,
    Status {
        json: bool,
    },
}

Variants§

§

Unlock

Prompt for approval + vault password, then start the background agent daemon.

Prints a shell export line to stdout: $env:TSAFE_AGENT_SOCK = “…” # PowerShell export TSAFE_AGENT_SOCK=“…” # bash/zsh

Copy-paste or eval this line in the calling shell/process that needs access.

Fields

§ttl: String

Idle TTL — how long the agent stays alive without a vault request. Resets on each vault access. Common values include 15m, 1h, and 4h. Default: 30m.

§absolute_ttl: String

Absolute TTL — hard cap regardless of activity. Default: 8h. Must be >= idle TTL. Common values include 8h, 12h, and 24h.

§

Lock

Immediately revoke the current session and stop the agent.

§

Status

Show whether the current agent socket is reachable.

Use --json for a stable machine-readable output (ADR-029). Consumers such as the VS Code extension and tray agent depend on this flag. The schema version field must be checked before reading any other field.

Fields

§json: bool

Emit a stable JSON object to stdout (schema version "1"). See docs/decisions/agent-status-json-contract.md (ADR-029) for the full schema.

Trait Implementations§

Source§

impl FromArgMatches for AgentAction

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for AgentAction

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.