summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-12 10:38:28 -0600
committert <t@tjp.lol>2026-06-12 11:06:18 -0600
commit7343898524f9f692620f4cb276f56cfde30f6269 (patch)
tree8cf0621d33c4ae7f292c95f4684e1e9590175ae8 /src/main.zig
parentaf8ba87475bfae9c1b4fa70c88fb4c59630a5670 (diff)
fuzzy selectors for models and reasoning levels
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig18
1 files changed, 18 insertions, 0 deletions
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 {};