import { InitialSessionContextBuilder } from "../core/profiles.js";
import { runPiboTui } from "../core/runtime.js";
import { createLocalRoutedTuiClient, } from "./client.js";
import { createLocalRoutedTuiExtension } from "./extension.js";
export { LOCAL_TUI_CHANNEL_NAME, LocalRoutedTuiClient, createLocalRoutedTuiClient, } from "./client.js";
export { createLocalRoutedTuiExtension } from "./extension.js";
function createLocalControllerProfile() {
    return new InitialSessionContextBuilder("pibo-local-routed-controller")
        .withBuiltinTools("disabled")
        .createSession();
}
export async function runLocalRoutedTui(options = {}) {
    const client = createLocalRoutedTuiClient(options);
    try {
        await runPiboTui({
            cwd: options.cwd,
            persistSession: false,
            profile: createLocalControllerProfile(),
            extensionFactories: [createLocalRoutedTuiExtension(client, { showThinking: options.showThinking })],
        });
    }
    finally {
        await client.close();
    }
}
