4.0 KiB
4.0 KiB
Technical Spec: Support 'agy' (Antigravity) CLI Agent in Warp
See specs/GH11368/product.md for the product spec.
Issue: warpdotdev/warp#11368
1. Problem
Warp lacks native command detection and branding support for the agy (Antigravity) CLI agent. Running the agent does not trigger Agent Mode or the associated toolbar.
To resolve this, we must wire CLIAgent::Antigravity into the terminal's agent detection and branding config. Support for plugins and OSC 777 notifications is intentionally excluded in this milestone.
2. Relevant Code
app/src/terminal/cli_agent.rs—CLIAgentenum with all identity methods:command_prefix(),to_serialized_name(),from_serialized_name(),from_harness(),display_name(),icon(),supported_skill_providers(),skill_command_prefix(),supports_bash_mode(),brand_color(),brand_icon_color(),detect(), and theFrom<CLIAgent> for CLIAgentTypetelemetry conversion.crates/input_classifier/src/util.rs—ONE_OFF_SHELL_COMMAND_KEYWORDSthat determine shell-vs-natural-language classification.crates/warp_core/src/ui/icons.rs—Iconenum register and SVG asset mappings.app/src/server/telemetry/events.rs—CLIAgentTypetelemetry enum.
3. Proposed Changes
3a. Add Identity and Branding (app/src/terminal/cli_agent.rs)
- Add
Antigravityto theCLIAgentenum (beforeUnknown):pub enum CLIAgent { ... Goose, Hermes, Vibe, Antigravity, Unknown, } - The new
Antigravityvariant must appear in every match arm across theCLIAgentimpl.command_prefix(): returns"agy".to_serialized_name(): Uses derive macro"Antigravity".from_serialized_name(): Uses derive macro"Antigravity".from_harness(): No change needed.display_name(): returns"Antigravity".icon(): returnsSome(Icon::AntigravityLogo).supported_skill_providers(): returns&[](no skills integration yet).skill_command_prefix(): Falls through to wildcard_ => "/".supports_bash_mode(): Falls through tofalse.brand_color(): returnsSome(ANTIGRAVITY_COLOR), matching Pi's white monochrome brand tile color. Add anANTIGRAVITY_COLORconstant at module level.brand_icon_color(): returnsColorU::new(0, 0, 0, 255), matching Pi's black logo color on light brand tiles.detect(): Works automatically viaenum_iterator::Sequenceand prefix"agy".
- Add
CLIAgent::Antigravity => CLIAgentType::Antigravityto the telemetry conversion. Add anAntigravityvariant toCLIAgentTypeinapp/src/server/telemetry/events.rs.
3b. Register Command Classifier (crates/input_classifier/src/util.rs)
Add "agy" to the static ONE_OFF_SHELL_COMMAND_KEYWORDS hashset:
static ref ONE_OFF_SHELL_COMMAND_KEYWORDS: HashSet<&'static str> = HashSet::from([
"#", "echo", "man", "sudo", "claude", "codex", "gemini", "agy"
]);
3c. Add SVG Asset and Icon Registry (crates/warp_core/src/ui/icons.rs)
- Add
AntigravityLogoto theIconenum. - Map it to the SVG path in the match expression inside
Icon::svg_path():Icon::AntigravityLogo => "bundled/svg/antigravity_cli.svg", - Add the SVG asset file
app/assets/bundled/svg/antigravity_cli.svg.
4. End-to-End Flow
- User types
agyin their terminal and hits Enter. - The classifier marks it as a command execution.
- The shell starts the
agyprocess. - Warp identifies the
agycommand viaCLIAgent::detect()and initiates the Agent Mode layouts and toolbar, with custom branding and icons.
5. Testing and Validation
- Unit tests: Verify CLI agent detection works for prefix
agyincli_agent_tests.rs. - Unit tests: Verify
"agy"short-circuits as a one-off shell keyword ininput_classifiertests, ensuring it bypasses natural language classification. - Manual Verification: Run Warp locally, trigger
agy, and verify Agent Mode transition and UI styling.