"use strict";
// TUI public entry point. Exposes a single `runTui` function the CLI
// dispatches to. Keeps the client construction in `client.ts` so it
// stays easy to unit-test independently.
Object.defineProperty(exports, "__esModule", { value: true });
exports.wrapText = exports.stripAnsi = exports.parseSseChunk = exports.formatStatusLine = exports.formatChatEntry = exports.formatActiveSubagentsBar = exports.createTuiClient = void 0;
exports.runTui = runTui;
var client_1 = require("./client");
Object.defineProperty(exports, "createTuiClient", { enumerable: true, get: function () { return client_1.createTuiClient; } });
var render_1 = require("./render");
Object.defineProperty(exports, "formatActiveSubagentsBar", { enumerable: true, get: function () { return render_1.formatActiveSubagentsBar; } });
Object.defineProperty(exports, "formatChatEntry", { enumerable: true, get: function () { return render_1.formatChatEntry; } });
Object.defineProperty(exports, "formatStatusLine", { enumerable: true, get: function () { return render_1.formatStatusLine; } });
Object.defineProperty(exports, "parseSseChunk", { enumerable: true, get: function () { return render_1.parseSseChunk; } });
Object.defineProperty(exports, "stripAnsi", { enumerable: true, get: function () { return render_1.stripAnsi; } });
Object.defineProperty(exports, "wrapText", { enumerable: true, get: function () { return render_1.wrapText; } });
const client_2 = require("./client");
/**
 * Boot the TUI. Resolves when the user issues /quit, /exit, or sends
 * EOF on stdin. Errors during boot reject; runtime errors are surfaced
 * inside the transcript instead.
 */
async function runTui(options = {}) {
    const client = (0, client_2.createTuiClient)(options);
    await new Promise((resolve) => {
        const onExit = () => resolve();
        process.once('SIGINT', onExit);
        process.once('SIGTERM', onExit);
        process.stdin.once('end', onExit);
    });
    await client.stop();
}
//# sourceMappingURL=index.js.map