summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.zig26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index c1212e8..15b2dd2 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -10,6 +10,15 @@ const extension_loader = @import("extension_loader.zig");
const lua = lua_bridge.c;
test {
+ // Test contract: deliberate error-path tests should not produce visible
+ // log output. Code logs at `.err` for genuine production failures and
+ // `.warn` for expected-failure paths exercised by tests; the test
+ // runner's logger gates on `std.testing.log_level`, which defaults to
+ // `.warn`. Raising it to `.err` silences expected warnings without
+ // changing production behavior. Anything that *should* be visible in a
+ // passing test must use `std.debug.print` or assert via the testing API.
+ std.testing.log_level = .err;
+
std.testing.refAllDecls(@This());
_ = lua_bridge;
_ = lua_runtime;
@@ -34,12 +43,29 @@ const CLIReceiver = struct {
const vtable: ReceiverVTable = .{
.onMessageStart = onMessageStart,
.onBlockStart = onBlockStart,
+ .onToolDetails = onToolDetails,
.onContentDelta = onContentDelta,
.onBlockComplete = onBlockComplete,
.onMessageComplete = onMessageComplete,
.onError = onError,
};
+ /// The print-based CLI defers tool-name rendering to onBlockComplete
+ /// to avoid cursor gymnastics (we can't go back and edit the prefix).
+ /// Receivers backed by a TUI capable of in-place updates would render
+ /// the name as soon as it's known here.
+ fn onToolDetails(
+ ptr: *anyopaque,
+ index: usize,
+ id: []const u8,
+ name: []const u8,
+ ) anyerror!void {
+ _ = ptr;
+ _ = index;
+ _ = id;
+ _ = name;
+ }
+
fn onMessageStart(ptr: *anyopaque, role: MessageRole) anyerror!void {
_ = ptr;
_ = role;