"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const electron_1 = require("electron");
electron_1.contextBridge.exposeInMainWorld('cheapcode', {
    send: (text) => electron_1.ipcRenderer.send('chat:send', text),
    cancel: () => electron_1.ipcRenderer.send('chat:cancel'),
    clear: () => electron_1.ipcRenderer.send('chat:clear'),
    respondApproval: (decision) => electron_1.ipcRenderer.send('approval:respond', decision),
    setModel: (model) => electron_1.ipcRenderer.send('model:set', model),
    getState: () => electron_1.ipcRenderer.invoke('state:get'),
    chooseFolder: () => electron_1.ipcRenderer.invoke('folder:choose'),
    listModels: () => electron_1.ipcRenderer.invoke('models:list'),
    onEvent: (cb) => {
        const listener = (_e, ev) => cb(ev);
        electron_1.ipcRenderer.on('agent:event', listener);
        return () => electron_1.ipcRenderer.removeListener('agent:event', listener);
    },
});
