M2 audit: excise managed connectors and xAI media-gen tools

Managed connectors (grok.com MCP admin) removed root-and-branch:
- The managed-MCP fetch/injection pipeline is gone, including the whole
  kigi-shell-session-support crate (managed-config fetch client, gateway
  tool catalog + dispatch, header injection, refresh task), reactive
  managed re-auth, mcp_doctor's grok.com-source discovery, and the
  [managed_mcps] config surface.
- TUI: the 'Managed by grok.com' section, connectors URL/deep-link,
  Action::OpenManagedConnectors, and session_team_id are gone. Local MCP
  management (list/toggle/add/remove/auth/tools) is fully intact.
- Kept as LOCAL policy: managed-settings.json MCP allow/deny enforcement,
  the multi-source local MCP merge, folder-trust gating. PluginOrigin
  Project/User labels kept (they tag locally discovered plugin dirs).

imagine/media-gen tools (xAI image/video generation) removed:
- image_gen, image_edit, video_gen, image_to_video, reference_to_video
  implementations, registrations, ToolKind/ToolInput/Output variants
  (serde-safe), config plumbing end to end, ZDR video machinery,
  /imagine + /imagine-video commands and guidance text, the bundled
  imagine skill (added to legacy cleanup so user installs delete it),
  and the media-gen render path.
- Kept: image INPUT (paste/attach, [Image #N] meta, pdf/image fetch,
  clipboard wrap), generic media-ref rendering, and the generic tool
  401-retry machinery (tests renamed, assertions unweakened).
- deploy_app stays: it is a permanently-disabled local stub deploying
  nowhere.

121 files changed, 8 deleted. Gates: workspace check/clippy 0/0, fmt,
deny ok; suites green (tools 2554, shell 4862, tui 6608, workspace
1042). Remaining grok.com strings live only in the auth-method ids and
changelog archives (§9/M3 sweep).
This commit is contained in:
2026-07-17 23:45:05 -04:00
parent fa75eb139a
commit 5e4e24db99
120 changed files with 301 additions and 11327 deletions
+3 -55
View File
@@ -93,8 +93,6 @@ pub struct AgentBuilder {
backend_search: bool,
web_fetch_config: kigi_tools::implementations::grok_build::web_fetch::WebFetchConfig,
lsp: Option<std::sync::Arc<dyn kigi_tools::implementations::lsp::LspBackend>>,
image_gen_config: kigi_tools::implementations::grok_build::image_gen::ImageGenConfig,
video_gen_config: kigi_tools::implementations::grok_build::video_gen::VideoGenConfig,
app_builder_deployer_config:
kigi_tools::implementations::grok_build::deploy_app::AppBuilderDeployerConfig,
write_file_enabled: bool,
@@ -218,8 +216,6 @@ impl AgentBuilder {
backend_search: false,
web_fetch_config: Default::default(),
lsp: None,
image_gen_config: Default::default(),
video_gen_config: Default::default(),
app_builder_deployer_config: Default::default(),
write_file_enabled: true,
subagents_enabled: false,
@@ -451,33 +447,6 @@ impl AgentBuilder {
self.lsp = Some(handle);
self
}
/// Set the image generation configuration.
///
/// When `Enabled`, an `ImageGenClient` is created and injected into
/// the ToolBridge's resources and the `image_gen` tool is registered,
/// allowing image generation via the xAI Imagine API with session
/// credentials. When `Disabled` (default), the tool is not registered.
pub fn with_image_gen_config(
mut self,
config: kigi_tools::implementations::grok_build::image_gen::ImageGenConfig,
) -> Self {
self.image_gen_config = config;
self
}
/// Set the video generation configuration.
///
/// When `Enabled`, a `VideoGenClient` is created and injected into
/// the ToolBridge's resources and the `video_gen` tool is registered,
/// allowing video generation via the xAI Video Generation API with
/// session credentials. When `Disabled` (default), the tool is not
/// registered.
pub fn with_video_gen_config(
mut self,
config: kigi_tools::implementations::grok_build::video_gen::VideoGenConfig,
) -> Self {
self.video_gen_config = config;
self
}
/// Set the deploy service configuration.
pub fn with_app_builder_deployer_config(
mut self,
@@ -495,10 +464,9 @@ impl AgentBuilder {
self
}
/// Set the 401-attribution callback for tool HTTP clients
/// (`image_gen`, `video_gen`, `web_search`). When set, a 401
/// from any of those tools emits an `auth_401_attribution`
/// event with `consumer` of `"ImageGen"` / `"VideoGen.start"` /
/// `"VideoGen.poll"` / `"WebSearch"`. Callers should pass the
/// (`web_search`). When set, a 401 from such a tool emits an
/// `auth_401_attribution` event with `consumer` of
/// `"WebSearch"`. Callers should pass the
/// same `ShellAttribution` instance they wire into
/// `kigi_sampler::SamplerConfig::attribution_callback` so
/// all 401s share the same `AuthManager` reference and land in
@@ -712,24 +680,6 @@ impl AgentBuilder {
.tools
.push((&kigi_tools::implementations::grok_build::LspTool).into());
}
if self.image_gen_config.image_gen_enabled() {
tool_config
.tools
.push((&kigi_tools::implementations::grok_build::ImageGenTool).into());
}
if self.image_gen_config.image_edit_enabled() {
tool_config
.tools
.push((&kigi_tools::implementations::grok_build::ImageEditTool).into());
}
if self.video_gen_config.is_enabled() {
tool_config
.tools
.push((&kigi_tools::implementations::grok_build::ImageToVideoTool).into());
tool_config
.tools
.push((&kigi_tools::implementations::grok_build::ReferenceToVideoTool).into());
}
let has_write_tool = tool_config
.tools
.iter()
@@ -1024,8 +974,6 @@ impl AgentBuilder {
web_search_config: self.web_search_config,
web_fetch_config: self.web_fetch_config,
lsp: self.lsp,
image_gen_config: self.image_gen_config,
video_gen_config: self.video_gen_config,
app_builder_deployer_config: self.app_builder_deployer_config,
api_key_provider: self.api_key_provider,
attribution_callback: self.attribution_callback,