pub struct Repos {
pub roots: Vec<PathBuf>,
pub auto_clone: bool,
pub clone_command: Option<Vec<String>>,
pub scan_ttl: u64,
pub fetch_interval: u64,
}Expand description
Where magi repos and GET /api/repos look for local checkouts.
roots is one of the array keys [array_merge_policy] marks as
append-across-layers: which checkouts exist in general is a machine
fact in the same way the agent roster is - a repository’s own magi.toml
cannot state where its siblings live before magi has resolved which
repository to read that file from in the first place - but a repository
that genuinely has an extra root worth scanning is not forced to choose
between an error and losing the machine’s roots outright. Both layers’
roots are scanned; see Config::refuse_split_arrays for the keys that
are still refused.
Fields§
§roots: Vec<PathBuf>Roots to scan for a ghq-layout checkout: <root>/<host>/<owner>/<repo>
with a .git directory. Empty by default - nothing is scanned unless
asked to be.
auto_clone: boolAllow explicit owner/repo misses to be confirmed with gh and cloned.
clone_command: Option<Vec<String>>Literal argv template; {repo}, {owner}, {name}, {dest} are substituted.
Defaults to gh repo clone https://github.com/{repo}.git {dest}.
Declare in a single layer.
scan_ttl: u64How long a scan is trusted before the next request re-scans it,
seconds. 0 means never trust it: scan on every request. Defaults to
a day, the same order of magnitude as Graph::answer_timeout for
the same reason - a checkout does not usually appear or vanish inside
a session, so there is little to gain from scanning more often than
that, and an explicit refresh exists for the moment one does.
fetch_interval: u64How often magi serve runs git fetch origin in every checkout under
roots, seconds, so origin/main stays fresh whatever state the
working tree is in. Fetch only: no branch, HEAD or working tree is
touched. 0 disables it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Repos
impl<'de> Deserialize<'de> for Repos
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for Repos
impl Freeze for Repos
impl Move for Repos
impl RefUnwindSafe for Repos
impl Send for Reposwhere
RawVecInner: Send,
impl Sync for Reposwhere
RawVecInner: Sync,
impl Unpin for Repos
impl UnsafeUnpin for Reposwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<PathBuf>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Reposwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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