Class CommandBridge

Bridges between the SDK and Antigravity's command system.

All interactions with Antigravity go through registered VS Code commands, ensuring we never bypass the official extension API.

const bridge = new CommandBridge();

// Open the agent panel
await bridge.execute(AntigravityCommands.OPEN_AGENT_PANEL);

// Start a new conversation
await bridge.execute(AntigravityCommands.START_NEW_CONVERSATION);

// Send a prompt
await bridge.execute(AntigravityCommands.SEND_PROMPT_TO_AGENT, 'Hello!');

Implements

Constructors

Methods

  • Execute an Antigravity command.

    Type Parameters

    • T = unknown

    Parameters

    • command: string

      The command ID to execute

    • ...args: unknown[]

      Arguments to pass to the command

    Returns Promise<T>

    The command's return value

    If the command fails

  • Get all registered Antigravity commands.

    Returns Promise<string[]>

    List of command IDs starting with 'antigravity.'

  • Check if a command is registered and available.

    Parameters

    • command: string

      Command ID to check

    Returns Promise<boolean>

    true if the command exists

  • Register a command handler.

    Parameters

    • command: string

      Command ID to register

    • handler: (...args: unknown[]) => unknown

      Function to handle the command

    Returns IDisposable

    Disposable to unregister the command