Struct GitConfig
pub struct GitConfig {Show 16 fields
pub enabled: bool,
pub provider: String,
pub app_id: u64,
pub private_key: Option<String>,
pub private_key_path: Option<String>,
pub installation_id: Option<u64>,
pub api_base_url: Option<String>,
pub access_token: String,
pub repos: Vec<String>,
pub poll_interval_secs: u64,
pub mention_only: bool,
pub listen_to_bots: bool,
pub proxy_url: Option<String>,
pub events: HashMap<String, GitEventRoute>,
pub events_backbone: bool,
pub excluded_tools: Vec<String>,
}Expand description
Git-forge channel configuration (polling-based; no webhook required).
A provider selects the forge. GitHub authenticates as a GitHub App:
a short-lived RS256 JWT signed with the app’s private key is exchanged
for per-installation access tokens. Gitea and Forgejo use a personal
access token against the instance’s /api/v1 endpoint, named by the
required api_base_url. Inbound issue/PR comments are polled from the
forge REST API, so the daemon needs no inbound network exposure.
Fields§
§enabled: boolWhether this channel is active. The runtime only loads channels whose
enabled = true. Default: false so an operator who pastes a partial
[channels.<type>.<alias>] block doesn’t accidentally bring a channel
live before the rest of its config is filled in.
provider: StringGit forge provider. Supported: "github", "gitea", and
"forgejo" (Forgejo uses the Gitea-compatible REST provider).
Default: "github".
app_id: u64GitHub App ID (shown on the app’s settings page). GitHub provider only.
private_key: Option<String>RS256 private key PEM, the contents of the .pem file GitHub
generates on the app’s settings page, inline and encrypted at rest.
Include the BEGIN/END lines. GitHub provider only.
private_key_path: Option<String>Filesystem path to the RS256 private key .pem file, read at startup
when private_key (inline PEM) is unset. Backward-compatible fallback
for configs that predate the inline-PEM field. GitHub provider only.
installation_id: Option<u64>Installation ID to act as. When unset, the app’s installations are listed on first use and a sole installation is auto-selected; startup fails if the app has zero or multiple installations.
api_base_url: Option<String>Gitea/Forgejo API base URL, including /api/v1, for example
https://git.example.org/api/v1 (for the public Gitea service:
https://gitea.com/api/v1). Required when provider is "gitea"
or "forgejo" - there is no default host, because every API
request carries access_token; the channel fails closed at
startup rather than send the token to an endpoint the operator
never named. Gitea/Forgejo provider only.
access_token: StringPersonal access token for Gitea/Forgejo API requests. The token needs repository read access plus issue/PR comment write access for replies and reactions. Gitea/Forgejo provider only.
repos: Vec<String>Repositories to poll, as owner/repo. Empty = every repository
visible to the installation.
poll_interval_secs: u64Poll interval in seconds for new issues and comments. Values below
15 are clamped to 15. Default: 30.
mention_only: boolOnly respond to comments that @-mention the app’s bot login.
Default: true.
listen_to_bots: boolProcess comments authored by other bot accounts. The app’s own
comments are always ignored. Default: false.
proxy_url: Option<String>Per-channel proxy override for GitHub API requests.
events: HashMap<String, GitEventRoute>Per-event routing table, keyed by normalized event type
("issue_comment.created", "pull_request.opened",
"workflow_run.failed", …). Event types absent from the table fall
back to the conversational default: issue_comment.created,
issues.opened, and pull_request.opened are delivered as
messages (mention-gated); everything else is ignored. Which API
endpoints are polled is derived from this table; routing an event
type is also subscribing to it.
events_backbone: boolAlso poll the repository Events API (/repos/{owner}/{repo}/events)
as a broad backbone transport: one conditional (ETag) request per
repository per tick, so an idle repo costs almost nothing. Caveats:
events arrive with a delay of up to ~5 minutes and the feed carries
no Actions/check events (workflow runs always use their dedicated
endpoint). Items also surfaced by a targeted endpoint are
de-duplicated. Default: false.
excluded_tools: Vec<String>Tools excluded from this channel’s tool spec. When set, these tools are not exposed to the model when responding via this channel.
Implementations§
Source§impl GitConfig
impl GitConfig
Sourcepub fn configurable_prefix() -> &'static str
pub fn configurable_prefix() -> &'static str
Returns the #[prefix] value for this Configurable struct.
Sourcepub fn secret_fields(&self) -> Vec<SecretFieldInfo>
pub fn secret_fields(&self) -> Vec<SecretFieldInfo>
Returns metadata about all #[secret] fields on this struct and nested children.
pub fn secret_field_terminals() -> Vec<&'static str>
Sourcepub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
pub fn encrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
Encrypt all secret fields in place using the provided store.
Sourcepub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
pub fn decrypt_secrets(&mut self, store: &SecretStore) -> Result<(), Error>
Decrypt all secret fields in place using the provided store.
Sourcepub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>
pub fn set_secret(&mut self, name: &str, value: String) -> Result<(), Error>
Set a secret field by its full dotted name, dispatching to nested children.
Sourcepub fn prop_fields(&self) -> Vec<PropFieldInfo>
pub fn prop_fields(&self) -> Vec<PropFieldInfo>
Returns metadata about all property fields on this struct and nested children.
Sourcepub fn get_prop(&self, name: &str) -> Result<String, Error>
pub fn get_prop(&self, name: &str) -> Result<String, Error>
Get a property value by its full dotted name, returning it as a display string.
Sourcepub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>
pub fn set_prop(&mut self, name: &str, value_str: &str) -> Result<(), Error>
Set a property value by its full dotted name, parsing from string.
Sourcepub fn prop_is_secret(name: &str) -> bool
pub fn prop_is_secret(name: &str) -> bool
Check if a property name refers to a secret field (static, no instance needed).
Sourcepub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
pub fn init_defaults(&mut self, prefix: Option<&str>) -> Vec<&'static str>
Instantiate None nested sections whose prefix matches.
Returns the prefixes that were initialized.
Sourcepub fn map_key_sections() -> Vec<MapKeySection>
pub fn map_key_sections() -> Vec<MapKeySection>
Enumerate every map-keyed (HashMap<String, T>) and list-shaped
(Vec<T>) section discoverable from this Configurable’s tree.
The dashboard / CLI consume this to surface “+ Add” affordances
without hardcoding the section list.
Sourcepub fn nested_section_help(name: &str) -> Option<&'static str>
pub fn nested_section_help(name: &str) -> Option<&'static str>
Help blurb for a #[nested] field on this struct, sourced from
the field-level /// docstring. Returns None for unknown
names so callers can fall through to a different lookup.
pub fn nested_section_group(name: &str) -> Option<&'static str>
Sourcepub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
pub fn get_map_keys(&self, section_path: &str) -> Option<Vec<String>>
Return the current alias keys at section_path, or None if
the path doesn’t resolve to a map-keyed section in this tree.
pub fn nested_option_entries(&self) -> Vec<NestedOptionEntry>
pub fn create_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
pub fn delete_map_key( &mut self, section_path: &str, map_key: &str, ) -> Result<bool, String>
pub fn rename_map_key( &mut self, section_path: &str, map_key: &str, new_key: &str, ) -> Result<bool, String>
Trait Implementations§
Source§impl ChannelConfig for GitConfig
impl ChannelConfig for GitConfig
Source§impl<'de> Deserialize<'de> for GitConfig
impl<'de> Deserialize<'de> for GitConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GitConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GitConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for GitConfig
impl JsonSchema for GitConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl MaskSecrets for GitConfig
impl MaskSecrets for GitConfig
fn mask_secrets(&mut self)
fn restore_secrets_from(&mut self, current: &GitConfig)
Source§impl Serialize for GitConfig
impl Serialize for GitConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for GitConfig
impl RefUnwindSafe for GitConfig
impl Send for GitConfig
impl Sync for GitConfig
impl Unpin for GitConfig
impl UnsafeUnpin for GitConfig
impl UnwindSafe for GitConfig
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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