Direct bridge to the Language Server via ConnectRPC.

Discovers the LS port from getDiagnostics console logs, then makes HTTPS POST calls to the LS endpoints.

const ls = new LSBridge(commandBridge);
await ls.initialize();

// Create a headless cascade
const cascadeId = await ls.createCascade({
text: 'Analyze test coverage',
model: Models.GEMINI_FLASH,
});

// Send follow-up
await ls.sendMessage({ cascadeId, text: 'Focus on edge cases' });

// Switch UI to it
await ls.focusCascade(cascadeId);

Constructors

Accessors

Methods

  • Cancel a running cascade invocation.

    Parameters

    • cascadeId: string

    Returns Promise<void>

  • Switch the UI to show a specific cascade conversation.

    Parameters

    • cascadeId: string

    Returns Promise<void>

  • Discover the Language Server port. Must be called before other methods.

    Returns Promise<boolean>

  • Make a raw RPC call to any LS method.

    Parameters

    • method: string

      RPC method name (e.g. 'StartCascade')

    • payload: any

      JSON payload

    Returns Promise<any>