| 57 | } |
| 58 | |
| 59 | pub trait ProviderPlugin: Send + Sync { |
| 60 | /// Canonical provider id (for example: "claude", "gitlab"). |
| 61 | fn id(&self) -> &'static str; |
| 62 | |
| 63 | /// Discover provider credentials and config from the local machine. |
| 64 | fn discover_existing(&self) -> Result<Option<DiscoveredProvider>, ProviderError>; |
| 65 | |
| 66 | /// Return the known credential environment variable names for this provider type. |
| 67 | /// |
| 68 | /// Used by the TUI to label BYO key entry fields and to choose which |
| 69 | /// env var name to store a manually-entered credential under. |
| 70 | fn credential_env_vars(&self) -> &'static [&'static str] { |
| 71 | &[] |
| 72 | } |
| 73 | |
| 74 | /// Inject provider-specific environment variables into the sandbox env. |
| 75 | /// |
| 76 | /// Called during sandbox creation to project provider config (project IDs, |
| 77 | /// regions, SDK flags) into env vars the sandbox process will inherit. |
| 78 | /// Default is a no-op; GCP and Vertex providers override this. |
| 79 | fn inject_env(&self, _provider: &Provider, _env: &mut HashMap<String, String>) {} |
| 80 | } |
| 81 | |
| 82 | /// Blanket implementation of [`ProviderPlugin`] for [`ProviderDiscoverySpec`]. |
| 83 | /// |
nothing calls this directly
no outgoing calls
no test coverage detected