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:
ZacharyZhang-NY committed 2026-07-17 23:45:05 -04:00
1 parent fa75eb139a
commit 5e4e24db99
120 files changed
+301 -11327

No files matched your search

@@ -1,108 +0,0 @@
use agent_client_protocol as acp;
use kigi_tools::implementations::grok_build::{
IMAGE_GEN_TOOL_NAME, IMAGINE_COMMAND_NAME, imagine_instruction, imagine_usage_message,
};
use crate::slash::command::{CommandExecCtx, CommandResult, SlashCommand};
const REQUIRED_TOOLS: &[&str] = &[IMAGE_GEN_TOOL_NAME];
pub struct ImagineCommand;
impl SlashCommand for ImagineCommand {
fn name(&self) -> &str {
IMAGINE_COMMAND_NAME
}
fn description(&self) -> &str {
"Generate an image from a text description"
}
fn usage(&self) -> &str {
"/imagine <description>"
}
fn takes_args(&self) -> bool {
true
}
fn args_required(&self) -> bool {
true
}
fn arg_placeholder(&self) -> Option<&str> {
Some("description of the image to generate")
}
fn required_tools(&self) -> &[&str] {
REQUIRED_TOOLS
}
fn run(&self, _ctx: &mut CommandExecCtx, args: &str) -> CommandResult {
let prompt = args.trim();
if prompt.is_empty() {
return CommandResult::Message(imagine_usage_message().to_string());
}
CommandResult::InjectSkill {
display_text: format!("/imagine {prompt}"),
prompt_blocks: vec![acp::ContentBlock::Text(acp::TextContent::new(
imagine_instruction(prompt),
))],
display_as_skill: false,
scheduled_task_preview: None,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn requires_image_gen_tool() {
assert_eq!(ImagineCommand.required_tools(), &["image_gen"]);
}
#[test]
fn empty_prompt_returns_usage() {
let models = crate::acp::model_state::ModelState::default();
let mut ctx = super::super::tests::make_ctx(&models);
let result = ImagineCommand.run(&mut ctx, "");
assert!(matches!(result, CommandResult::Message(_)));
}
#[test]
fn whitespace_prompt_returns_usage() {
let models = crate::acp::model_state::ModelState::default();
let mut ctx = super::super::tests::make_ctx(&models);
let result = ImagineCommand.run(&mut ctx, " ");
assert!(matches!(result, CommandResult::Message(_)));
}
#[test]
fn valid_prompt_returns_inject_skill() {
let models = crate::acp::model_state::ModelState::default();
let mut ctx = super::super::tests::make_ctx(&models);
let result = ImagineCommand.run(&mut ctx, "a golden sunset");
match result {
CommandResult::InjectSkill {
display_text,
prompt_blocks,
display_as_skill,
..
} => {
assert_eq!(display_text, "/imagine a golden sunset");
assert!(!display_as_skill);
assert_eq!(prompt_blocks.len(), 1);
let text = match &prompt_blocks[0] {
acp::ContentBlock::Text(t) => &t.text,
_ => panic!("expected Text block"),
};
assert!(text.contains("image_gen"));
assert!(text.contains("a golden sunset"));
}
other => panic!("expected InjectSkill, got {other:?}"),
}
}
}
@@ -1,116 +0,0 @@
use agent_client_protocol as acp;
use kigi_tools::implementations::grok_build::{
IMAGE_TO_VIDEO_TOOL_NAME, IMAGINE_VIDEO_COMMAND_NAME, imagine_video_instruction,
imagine_video_usage_message,
};
use crate::slash::command::{CommandExecCtx, CommandResult, SlashCommand};
const REQUIRED_TOOLS: &[&str] = &[IMAGE_TO_VIDEO_TOOL_NAME];
pub struct ImagineVideoCommand;
impl SlashCommand for ImagineVideoCommand {
fn name(&self) -> &str {
IMAGINE_VIDEO_COMMAND_NAME
}
fn description(&self) -> &str {
"Generate a video from a text description"
}
fn usage(&self) -> &str {
"/imagine-video <description>"
}
fn takes_args(&self) -> bool {
true
}
fn args_required(&self) -> bool {
true
}
fn arg_placeholder(&self) -> Option<&str> {
Some("description of the video to generate")
}
fn required_tools(&self) -> &[&str] {
REQUIRED_TOOLS
}
fn run(&self, _ctx: &mut CommandExecCtx, args: &str) -> CommandResult {
let prompt = args.trim();
if prompt.is_empty() {
return CommandResult::Message(imagine_video_usage_message().to_string());
}
CommandResult::InjectSkill {
display_text: format!("/imagine-video {prompt}"),
prompt_blocks: vec![acp::ContentBlock::Text(acp::TextContent::new(
imagine_video_instruction(prompt),
))],
display_as_skill: false,
scheduled_task_preview: None,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn requires_image_to_video_tool() {
assert_eq!(ImagineVideoCommand.required_tools(), &["image_to_video"]);
}
#[test]
fn empty_prompt_returns_usage() {
let models = crate::acp::model_state::ModelState::default();
let mut ctx = super::super::tests::make_ctx(&models);
let result = ImagineVideoCommand.run(&mut ctx, "");
assert!(matches!(result, CommandResult::Message(_)));
}
#[test]
fn whitespace_prompt_returns_usage() {
let models = crate::acp::model_state::ModelState::default();
let mut ctx = super::super::tests::make_ctx(&models);
let result = ImagineVideoCommand.run(&mut ctx, " ");
assert!(matches!(result, CommandResult::Message(_)));
}
#[test]
fn valid_prompt_returns_inject_skill() {
let models = crate::acp::model_state::ModelState::default();
let mut ctx = super::super::tests::make_ctx(&models);
let result = ImagineVideoCommand.run(&mut ctx, "a cat playing piano");
match result {
CommandResult::InjectSkill {
display_text,
prompt_blocks,
display_as_skill,
..
} => {
assert_eq!(display_text, "/imagine-video a cat playing piano");
assert!(!display_as_skill);
assert_eq!(prompt_blocks.len(), 1);
let text = match &prompt_blocks[0] {
acp::ContentBlock::Text(t) => &t.text,
_ => panic!("expected Text block"),
};
assert!(
text.contains("image_to_video"),
"skill should reference image_to_video"
);
assert!(
text.contains("reference_to_video"),
"skill should reference reference_to_video"
);
assert!(text.contains("a cat playing piano"));
}
other => panic!("expected InjectSkill, got {other:?}"),
}
}
}
@@ -27,8 +27,6 @@ pub mod gboom;
pub mod help;
pub mod history;
pub mod home;
pub mod imagine;
pub mod imagine_video;
pub mod import_claude;
pub mod jump;
pub mod login;
@@ -111,8 +109,6 @@ pub fn builtin_commands() -> Vec<Arc<dyn SlashCommand>> {
Arc::new(recap::RecapCommand),
Arc::new(terminal_setup::TerminalSetupCommand),
Arc::new(loop_cmd::LoopCommand),
Arc::new(imagine::ImagineCommand),
Arc::new(imagine_video::ImagineVideoCommand),
Arc::new(timestamps::TimestampsCommand),
Arc::new(timeline::TimelineCommand),
Arc::new(toggle_mouse_reporting::ToggleMouseReportingCommand),
+4 -4
View File
@@ -2555,19 +2555,19 @@ mod tests {
let state = SlashState::default();
let models = ModelState::default();
let text = "hi /imagine\n\n /execute-plan";
let cursor = text.find("/imagine").unwrap() + "/imagine".len();
let text = "hi /compact\n\n /execute-plan";
let cursor = text.find("/compact").unwrap() + "/compact".len();
ctrl.refresh(&state, text, cursor, &models);
let snapshot = state.snapshot();
assert!(
snapshot.cursor_in_command,
"cursor at end of /imagine must stay in command mode for Tab"
"cursor at end of /compact must stay in command mode for Tab"
);
assert_eq!(snapshot.args_range, None);
assert_eq!(
snapshot.command_range,
Some(3..11),
"Tab must target /imagine, not the later /execute-plan token"
"Tab must target /compact, not the later /execute-plan token"
);
}