From 7343898524f9f692620f4cb276f56cfde30f6269 Mon Sep 17 00:00:00 2001 From: t Date: Fri, 12 Jun 2026 10:38:28 -0600 Subject: fuzzy selectors for models and reasoning levels --- src/main.zig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/main.zig') diff --git a/src/main.zig b/src/main.zig index 693e88c..e867c0e 100644 --- a/src/main.zig +++ b/src/main.zig @@ -27,6 +27,7 @@ const tui_engine = @import("tui_engine.zig"); const tui_components = @import("tui_components.zig"); const tui_event = @import("tui_event.zig"); const tui_app = @import("tui_app.zig"); +const tui_selectors = @import("tui_selectors.zig"); // Shorthand alias for the Lua C API. The bridge module owns the actual // `@cImport`; we re-use it here so the smoke check uses identical types. @@ -66,6 +67,7 @@ test { _ = tui_components; _ = tui_event; _ = tui_app; + _ = tui_selectors; } /// Spin up a Lua interpreter, run a no-op, tear it down. Catches @@ -545,6 +547,22 @@ pub fn main(init: std.process.Init) !void { ); defer alloc.free(model_label); + // Runtime model/reasoning selectors (Ctrl+M / Ctrl+R). Live-session only: + // a pick rebuilds the provider config and pushes it to the agent via + // `setConfig`; nothing is written back to config.toml. Borrows the + // long-lived `app_config`, `models.defs`, and `active_config`. + const selector_ctrl = try tui_app.SelectorController.init( + alloc, + &app, + agent, + &app_config, + &models.defs, + &active_config, + model_label, + ); + defer selector_ctrl.deinit(); + app.setSelectors(selector_ctrl); + // The render engine writes through a buffered file writer; flush after the // loop so the final frame and teardown sequences reach the terminal. defer tui_file.interface.flush() catch {}; -- cgit v1.3