"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatcherBackedAgent = void 0;
class WatcherBackedAgent {
    watcher;
    name;
    agentEvents;
    eventTypes;
    constructor(watcher) {
        this.watcher = watcher;
        this.name = watcher.agentName;
        this.agentEvents = watcher.agentEvents;
        this.eventTypes = watcher.eventTypes;
    }
    getTotalCostUsd() {
        return 0;
    }
    async pause() {
        await this.watcher.pause();
    }
    async unpause() {
        await this.watcher.unpause();
    }
    async kill() {
        await this.watcher.kill();
        this.agentEvents.emit(this.eventTypes.done, "Agent killed");
    }
    addPendingUserMessage(message) {
        const text = typeof message.content === "string" ? message.content : "";
        this.watcher
            .sendMessage(text)
            .then(() => {
            console.log(`📨 Message sent to ${this.name}`);
        })
            .catch((err) => {
            console.error(`❌ Failed to send message to ${this.name}:`, err);
        });
    }
}
exports.WatcherBackedAgent = WatcherBackedAgent;
//# sourceMappingURL=SyncedAgentWatcher.js.map