import type { RpcClient, RpcResponse } from "./rpc"; export type RpcSender = Pick; export function sendPrompt(rpc: RpcSender, text: string): Promise { return rpc.send({ type: "prompt", message: text }); } export function runSlashCommand( rpc: RpcSender, command: string, args = "", ): Promise { const suffix = args.trim() ? ` ${args.trim()}` : ""; return sendPrompt(rpc, `/${command}${suffix}`); } export function runBash( rpc: RpcSender, command: string, excludeFromContext: boolean, ): Promise { return rpc.send({ type: "bash", command, excludeFromContext }); } export function cycleModel(rpc: RpcSender): Promise { return rpc.send({ type: "cycle_model" }); } export function cycleThinking(rpc: RpcSender): Promise { return rpc.send({ type: "cycle_thinking_level" }); } export function compactSession(rpc: RpcSender): Promise { return rpc.send({ type: "compact" }); } export function abortCurrent(rpc: RpcSender): Promise { return rpc.send({ type: "abort" }); }