xonecas.io
79113
Ma

mini-coding-agent / commit 82fce91

chore: remove slop comments

xonecas2026-10-06 82fce91f22a376a1e73ad1257831297c60087772 parent 59bdc7a

31 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

src/agent.zig+0−22
@@ -1,7 +1,3 @@
1-//! The agent loop: one turn, no compaction, no retries, no meta-messages.
2-//! Provider errors surface as-is. Every event reaches a listener; the headless
3-//! projection and the TUI are both listeners and own no agent semantics.
4-
51 const std = @import("std");
62 const types = @import("types.zig");
73 const api = @import("api.zig");
@@ -36,9 +32,6 @@ pub const Listener = struct {
3632 }
3733 };
3834
39-/// How the agent reaches the projection while a turn is in flight. Headless
40-/// passes `null`; the TUI supplies its own. `request_steering` blocks the turn
41-/// thread until the user submits a line or the turn is cancelled.
4235 pub const Interaction = struct {
4336 ctx: *anyopaque,
4437 is_pause_requested: *const fn (ctx: *anyopaque) bool,
@@ -57,11 +50,9 @@ pub const Interaction = struct {
5750 };
5851
5952 pub const Options = struct {
60- /// Long-lived allocator for the transcript and its messages.
6153 a: std.mem.Allocator,
6254 model: ?*const types.Model,
6355 system_prompt: []const u8,
64- /// Counts of the discovered files in the system prompt.
6556 loaded: struct { agent_files: usize = 0, skills: usize = 0 } = .{},
6657 tools_json: []const u8,
6758 supports_images: bool,
@@ -91,8 +82,6 @@ fn onToolOutput(ctx: *anyopaque, chunk: []const u8) void {
9182 listener.emit(.{ .tool_output = chunk });
9283 }
9384
94-/// Appends a user message the model reads at the next step boundary. A
95-/// persistence failure is returned so the caller can surface it and stop.
9685 fn steer(opts: Options, messages: *std.ArrayList(types.Message), content: []const u8) !void {
9786 if (content.len == 0) return;
9887 const message = types.Message{ .user = .{ .content = content, .timestamp = util.nowMs() } };
@@ -100,8 +89,6 @@ fn steer(opts: Options, messages: *std.ArrayList(types.Message), content: []cons
10089 try opts.session.appendMessage(opts.a, message);
10190 }
10291
103-/// Returns the steering typed while paused, or "" when there was no pause;
104-/// null once the turn has been cancelled.
10592 fn pauseStep(run: Run) ?[]const u8 {
10693 if (run.opts.cancel.load(.acquire)) return null;
10794 const interaction = run.interaction orelse return "";
@@ -121,9 +108,6 @@ const Run = struct {
121108 listener: Listener,
122109 };
123110
124-/// Runs one turn to completion, appending to `messages`. Returns after the
125-/// model stops without tool calls, after a cancellation, or after an error;
126-/// every outcome is reported through the listener.
127111 pub fn runTurn(opts: Options, messages: *std.ArrayList(types.Message), interaction: ?Interaction, listener: Listener) void {
128112 const run = Run{ .opts = opts, .messages = messages, .interaction = interaction, .listener = listener };
129113
@@ -139,8 +123,6 @@ pub fn runTurn(opts: Options, messages: *std.ArrayList(types.Message), interacti
139123 _ = arena.reset(.retain_capacity);
140124 const scratch = arena.allocator();
141125
142- // Cancellation and steering land at the step boundary, never between an
143- // assistant turn and its tool results.
144126 const steering = pauseStep(run) orelse {
145127 listener.emit(.cancelled);
146128 return;
@@ -211,9 +193,6 @@ pub fn runTurn(opts: Options, messages: *std.ArrayList(types.Message), interacti
211193 return;
212194 }
213195
214- // Steering is held until every result of this assistant turn has
215- // landed: the provider rejects a user message between an assistant
216- // turn and its tool results.
217196 var held: std.ArrayList([]const u8) = .empty;
218197 defer held.deinit(opts.a);
219198 for (assistant.content.items) |block| {
@@ -272,7 +251,6 @@ pub fn runTurn(opts: Options, messages: *std.ArrayList(types.Message), interacti
272251 }
273252 }
274253
275-/// Joins held steering lines with newlines, so the next step sees one message.
276254 fn tryJoin(a: std.mem.Allocator, parts: []const []const u8) std.mem.Allocator.Error![]const u8 {
277255 if (parts.len == 0) return "";
278256 if (parts.len == 1) return parts[0];
src/api.zig+0−81
@@ -1,20 +1,12 @@
1-//! The provider contract: one streaming request in, one assistant message out,
2-//! with deltas delivered through a sink.
3-
41 const std = @import("std");
52 const types = @import("types.zig");
63 const http = @import("http.zig");
74 const util = @import("util.zig");
85
96 pub const Event = union(enum) {
10- /// Assistant text delta.
117 text: []const u8,
12- /// Reasoning delta.
138 reasoning: []const u8,
14- /// A tool call block began; the name is known but arguments have not
15- /// finished streaming.
169 tool_start: []const u8,
17- /// A tool call block finished.
1810 tool_call: types.ToolCall,
1911 };
2012
@@ -27,8 +19,6 @@ pub const Sink = struct {
2719 }
2820 };
2921
30-/// JSON written byte-for-byte as it stands, never re-encoded. The struct field
31-/// that holds it supplies the key.
3222 pub const Raw = struct {
3323 bytes: []const u8 = "",
3424
@@ -39,8 +29,6 @@ pub const Raw = struct {
3929 }
4030 };
4131
42-/// A provider error value: a message string, or an object carrying one under
43-/// "message". An empty string is no error at all.
4432 pub const ErrField = struct {
4533 message: ?[]const u8 = null,
4634
@@ -59,7 +47,6 @@ pub const ErrField = struct {
5947 }
6048 };
6149
62-/// A token count a provider may send as an integer or a float.
6350 pub const Count = struct {
6451 value: u64 = 0,
6552
@@ -75,13 +62,10 @@ pub const Count = struct {
7562 };
7663
7764 pub const Request = struct {
78- /// Long-lived allocator: the returned message's content outlives the step.
7965 pers: std.mem.Allocator,
80- /// Per-step arena: the request body and each parsed event. Reset freely.
8166 scratch: std.mem.Allocator,
8267 model: *const types.Model,
8368 system_prompt: []const u8,
84- /// A pre-serialized JSON array of tool schemas, verbatim.
8569 tools_json: []const u8,
8670 messages: []const types.Message,
8771 effort: []const u8,
@@ -89,35 +73,17 @@ pub const Request = struct {
8973 cancel: *const std.atomic.Value(bool),
9074 };
9175
92-/// An untrusted stream index is a hint, never a size. Anything past this is
93-/// treated like a missing index so a hostile chunk cannot force an allocation.
9476 pub const max_stream_index = 10_000;
9577
96-/// How one wire reaches its provider: the URL, the key header, and the body
97-/// encoder. Everything else about the request is the same for all four.
9878 pub const Wire = struct {
99- /// The header the api key travels in, and the prefix its value carries.
100- /// An empty key sends no header at all.
10179 key_header: []const u8,
10280 key_prefix: []const u8 = "",
103- /// A protocol version header, sent verbatim when its name is not empty.
10481 version: [2][]const u8 = .{ "", "" },
105- /// The path appended to the model's base URL, after any trailing slash.
106- /// `build_url` overrides it for a provider whose URL is not base plus path.
10782 path: []const u8 = "",
10883 build_url: ?*const fn (std.mem.Allocator, Request) anyerror![]u8 = null,
10984 build_body: *const fn (Request) anyerror![]u8,
11085 };
11186
112-/// The request life cycle every wire shares, over a `State` that carries
113-/// `req`, `sink`, `arena`, `msg`, `stream_error` and `failed`, and handles each
114-/// payload through `State.handle`. `finalize` moves the accumulated state into
115-/// `msg`.
116-///
117-/// A stream that fails or is cancelled still finalizes first: the text the
118-/// model did stream belongs in the transcript, and dropping it would lose a
119-/// turn the user can see and cannot recover. A tool call whose arguments never
120-/// finished is not emitted, so a partial call is never handed to a tool.
12187 pub fn run(
12288 comptime State: type,
12389 comptime Chunk: type,
@@ -140,10 +106,6 @@ pub fn run(
140106
141107 var st = State{ .req = req, .sink = sink, .arena = &arena, .msg = &msg };
142108
143- // A stream that did not run to the end can leave a tool call with a name
144- // but truncated arguments. Such a call is not a call the model finished
145- // making, so `finalize` drops it rather than emit arguments to run; the
146- // transport's own stop reason is the one the message keeps.
147109 const complete = try post(req, url, hdrs, body, .{ .ctx = &st, .onEvent = onData(State, Chunk) }, &msg);
148110 st.failed = !complete;
149111 const reason = msg.stop_reason;
@@ -161,16 +123,11 @@ pub fn run(
161123 return msg;
162124 }
163125
164-/// The SSE hook every wire shares: parse one payload into the wire's `Chunk`
165-/// type and hand it to `State.handle`. The arena is reset before the next
166-/// payload, so nothing may keep a pointer into the chunk.
167126 fn onData(comptime State: type, comptime Chunk: type) *const fn (ctx: *anyopaque, data: []const u8) void {
168127 return struct {
169128 fn hook(ctx: *anyopaque, data: []const u8) void {
170129 const st: *State = @ptrCast(@alignCast(ctx));
171130 defer _ = st.arena.reset(.retain_capacity);
172- // The sentinel OpenAI-compatible streams send in place of a final
173- // event. It is not JSON, and it is not a failure.
174131 if (std.mem.eql(u8, std.mem.trim(u8, data, " \r\n"), "[DONE]")) return;
175132 const chunk = std.json.parseFromSliceLeaky(Chunk, st.arena.allocator(), data, .{ .ignore_unknown_fields = true }) catch |e| {
176133 if (e != error.OutOfMemory and st.stream_error == null) st.stream_error = "stream: invalid JSON chunk";
@@ -183,9 +140,6 @@ fn onData(comptime State: type, comptime Chunk: type) *const fn (ctx: *anyopaque
183140 }.hook;
184141 }
185142
186-/// Grows `list` so `index` exists, and returns the element there. An untrusted
187-/// stream index is a hint, never a size: anything outside the sane range
188-/// appends instead, so a hostile chunk cannot force an allocation.
189143 pub fn blockAt(comptime T: type, list: *std.ArrayList(T), a: std.mem.Allocator, index: i64) !*T {
190144 const idx: usize = if (index >= 0 and index <= max_stream_index)
191145 @intCast(index)
@@ -195,9 +149,6 @@ pub fn blockAt(comptime T: type, list: *std.ArrayList(T), a: std.mem.Allocator,
195149 return &list.items[idx];
196150 }
197151
198-/// Runs one streaming request. Transport and protocol failures are recorded in
199-/// the returned message's `stop_reason`/`error_message`; only a failure to
200-/// allocate is an error.
201152 pub fn stream(req: Request, sink: Sink) std.mem.Allocator.Error!types.AssistantMessage {
202153 if (std.mem.eql(u8, req.model.api, "openai-completions")) {
203154 return @import("api/openai_completions.zig").stream(req, sink);
@@ -227,9 +178,6 @@ fn newAssistant(req: Request) types.AssistantMessage {
227178 };
228179 }
229180
230-/// The header list every request shares: content negotiation, the wire's own
231-/// key and version headers, then the caller's custom and session headers. A
232-/// header with an empty value is left out entirely.
233181 fn wireHeaders(a: std.mem.Allocator, req: Request, wire: Wire) ![]http.Header {
234182 var list: std.ArrayList(http.Header) = .empty;
235183 errdefer list.deinit(a);
@@ -257,9 +205,6 @@ fn wireHeaders(a: std.mem.Allocator, req: Request, wire: Wire) ![]http.Header {
257205 return list.toOwnedSlice(a);
258206 }
259207
260-/// Sends the request and maps a transport failure onto `msg`. Returns false
261-/// once the caller must return `msg` as-is; true when the stream completed and
262-/// the caller should proceed to finalize.
263208 fn post(req: Request, url: []const u8, hdrs: []const http.Header, body: []const u8, handler: http.SseHandler, msg: *types.AssistantMessage) std.mem.Allocator.Error!bool {
264209 var err_body: ?[]const u8 = null;
265210 http.postSse(req.scratch, url, hdrs, body, handler, req.cancel, &err_body) catch |e| {
@@ -284,17 +229,13 @@ fn post(req: Request, url: []const u8, hdrs: []const http.Header, body: []const
284229 return true;
285230 }
286231
287-/// One tool call as the provider streams it. The wires differ only in where
288-/// the pieces arrive; the shape and the accumulation are the same.
289232 pub const Call = struct {
290233 id: []const u8 = "",
291234 name: []const u8 = "",
292235 args: std.ArrayList(u8) = .empty,
293236 started: bool = false,
294- /// Google's continuation data, replayed on the next request.
295237 thought_signature: ?[]const u8 = null,
296238
297- /// Records the name and announces the call the first time one arrives.
298239 pub fn announce(self: *Call, a: std.mem.Allocator, sink: Sink, name: []const u8) !void {
299240 if (self.name.len == 0) self.name = try a.dupe(u8, name);
300241 if (!self.started and self.name.len > 0) {
@@ -304,9 +245,6 @@ pub const Call = struct {
304245 }
305246 };
306247
307-/// Appends every call the stream finished with, and says whether there was
308-/// one. A stream that failed left arguments truncated, so its calls are
309-/// dropped: a partial call is not a call the model finished making.
310248 pub fn appendCalls(msg: *types.AssistantMessage, sink: Sink, a: std.mem.Allocator, calls: []const Call, failed: bool) !bool {
311249 if (failed) return false;
312250 var any = false;
@@ -328,13 +266,10 @@ pub fn appendCalls(msg: *types.AssistantMessage, sink: Sink, a: std.mem.Allocato
328266 return any;
329267 }
330268
331-/// A call's arguments, or an empty object when the provider streamed none.
332269 pub fn argumentsOrObject(args: []const u8) []const u8 {
333270 return if (args.len > 0) args else "{}";
334271 }
335272
336-/// Records the tokens a response cost and prices them. The total is the
337-/// provider's own when it reported one, and the sum of the parts otherwise.
338273 pub fn finishUsage(msg: *types.AssistantMessage, model: *const types.Model, usage: types.Usage) void {
339274 var u = usage;
340275 if (u.total_tokens == 0) u.total_tokens = u.input + u.output + u.cache_read + u.cache_write;
@@ -350,7 +285,6 @@ pub fn finishUsage(msg: *types.AssistantMessage, model: *const types.Model, usag
350285 msg.usage = u;
351286 }
352287
353-/// A non-empty string field, or null.
354288 pub fn stringField(obj: std.json.ObjectMap, key: []const u8) ?[]const u8 {
355289 const v = obj.get(key) orelse return null;
356290 return switch (v) {
@@ -359,11 +293,6 @@ pub fn stringField(obj: std.json.ObjectMap, key: []const u8) ?[]const u8 {
359293 };
360294 }
361295
362-/// How one provider frames its `tools` array value: `open` and `close` bound
363-/// it, and each element is `entry` wrapped around the call's schema under
364-/// `params_key`. The key `"tools"` is supplied by the struct field that holds
365-/// the value. A provider with no tools writes nothing at all, which is also how
366-/// an unparsable `tools_json` is treated.
367296 pub const ToolsForm = struct {
368297 open: []const u8,
369298 entry: []const u8,
@@ -372,9 +301,6 @@ pub const ToolsForm = struct {
372301 close: []const u8,
373302 };
374303
375-/// A request's `tools` array, rendered verbatim from the flat `tools_json` the
376-/// session recorded, in the wire form `form` describes. It is written as an
377-/// array value, so the caller's struct field supplies the key.
378304 pub const Tools = struct {
379305 a: std.mem.Allocator,
380306 json: []const u8,
@@ -387,9 +313,6 @@ pub const Tools = struct {
387313 }
388314 };
389315
390-/// Writes the `tools` array in the wire form `form` describes, from the flat
391-/// `tools_json` array the session recorded. Nothing at all is written when
392-/// there is no tool, which is also how an unparsable `tools_json` is treated.
393316 pub fn writeTools(w: *std.Io.Writer, a: std.mem.Allocator, tools_json: []const u8, form: ToolsForm) !void {
394317 if (tools_json.len == 0) return;
395318 const root = std.json.parseFromSliceLeaky(std.json.Value, a, tools_json, .{}) catch return;
@@ -411,9 +334,6 @@ pub fn writeTools(w: *std.Io.Writer, a: std.mem.Allocator, tools_json: []const u
411334 try w.writeAll(form.close);
412335 }
413336
414-/// `"name":"…","description":"…","<params_key>":<schema>` — the body every
415-/// provider's tool encoding shares. A schema that names no parameters is sent
416-/// as `{}` rather than panicking on a session log written by another version.
417337 fn writeToolBody(w: *std.Io.Writer, obj: std.json.ObjectMap, params_key: []const u8) !void {
418338 try w.writeAll("\"name\":");
419339 try std.json.Stringify.encodeJsonString(stringField(obj, "name") orelse "", .{}, w);
@@ -429,7 +349,6 @@ fn writeToolBody(w: *std.Io.Writer, obj: std.json.ObjectMap, params_key: []const
429349 }
430350 }
431351
432-/// `base_url` plus one path segment, with a trailing slash on the base ignored.
433352 fn buildUrl(a: std.mem.Allocator, base: []const u8, path: []const u8) ![]u8 {
434353 return std.fmt.allocPrint(a, "{s}{s}", .{ std.mem.trimEnd(u8, base, "/"), path });
435354 }
src/api/anthropic_messages.zig+0−23
@@ -1,15 +1,9 @@
1-//! Anthropic Messages API streaming adapter. The wire format behind every
2-//! customProvider with api "anthropic-messages".
3-
41 const std = @import("std");
52 const api = @import("../api.zig");
63 const types = @import("../types.zig");
74
85 const anthropic_version = "2023-06-01";
96
10-// ---- request building -----------------------------------------------------
11-
12-
137 const ImageSource = struct {
148 @"type": []const u8 = "base64",
159 @"media_type": []const u8,
@@ -36,7 +30,6 @@ const ToolUseBlock = struct {
3630 input: api.Raw,
3731 };
3832
39-/// One block of a tool_result's content: text or an image.
4033 const ResultContent = union(enum) {
4134 text: TextBlock,
4235 image: ImageBlock,
@@ -48,8 +41,6 @@ const ResultContent = union(enum) {
4841 }
4942 };
5043
51-/// A tool result as one block of a user message. Its content is a string when
52-/// there is only text, and an array when images must ride along.
5344 const ToolResultBlock = struct {
5445 @"type": []const u8 = "tool_result",
5546 @"tool_use_id": []const u8,
@@ -68,9 +59,6 @@ const ToolResultBlock = struct {
6859 };
6960 };
7061
71-/// A content block of an assistant turn. A thinking block carries its
72-/// signature back so the provider's continuation data survives the round trip;
73-/// a thinking block without one becomes plain text.
7462 const AssistantBlock = union(enum) {
7563 text: TextBlock,
7664 thinking: ThinkingBlock,
@@ -94,8 +82,6 @@ const AssistantMessage = struct {
9482 content: []const AssistantBlock,
9583 };
9684
97-/// One entry of the `messages` array: a user turn (with tool results) or an
98-/// assistant turn.
9985 const Message = union(enum) {
10086 user_text: struct { role: []const u8 = "user", content: []const TextBlock },
10187 user_results: struct { role: []const u8 = "user", content: []const ToolResultBlock },
@@ -120,8 +106,6 @@ const Body = struct {
120106 tools: ?api.Tools = null,
121107 };
122108
123-/// Anthropic thinking budget per effort. Anthropic requires max_tokens to
124-/// exceed the budget, so the caller raises max_tokens when it does not.
125109 fn budgetFor(effort: []const u8) u64 {
126110 const map = .{
127111 .{ "minimal", 1024 },
@@ -174,7 +158,6 @@ fn buildMessages(a: std.mem.Allocator, req: api.Request) ![]const Message {
174158 var i: usize = 0;
175159 while (i < req.messages.len) {
176160 if (req.messages[i] == .tool_result) {
177- // Every result of one assistant turn shares a single user message.
178161 var blocks: std.ArrayList(ToolResultBlock) = .empty;
179162 while (i < req.messages.len and req.messages[i] == .tool_result) : (i += 1) {
180163 const t = req.messages[i].tool_result;
@@ -225,15 +208,12 @@ fn buildBody(req: api.Request) ![]u8 {
225208 return std.json.Stringify.valueAlloc(a, body, .{ .emit_null_optional_fields = false });
226209 }
227210
228-// ---- streaming state ------------------------------------------------------
229-
230211 const BlockKind = enum { text, thinking, tool };
231212
232213 const Block = struct {
233214 kind: BlockKind = .text,
234215 text: std.ArrayList(u8) = .empty,
235216 signature: std.ArrayList(u8) = .empty,
236- /// The call this block's arguments belong to, when `kind` is `.tool`.
237217 call: usize = 0,
238218 };
239219
@@ -286,7 +266,6 @@ const State = struct {
286266 usage: types.Usage = .{},
287267 stop_reason: ?[]const u8 = null,
288268 stream_error: ?[]const u8 = null,
289- /// Set by `run` when the stream did not run to completion.
290269 failed: bool = false,
291270
292271 pub fn handle(st: *State, chunk: Chunk) !void {
@@ -383,8 +362,6 @@ const State = struct {
383362 }
384363 };
385364
386-/// A stream that produced finished calls is a tool turn, not a stop. A broken
387-/// stream reports none, and `run` restores the transport's own reason.
388365 fn mapStopReason(st: *State, has_calls: bool) void {
389366 if (has_calls) {
390367 st.msg.stop_reason = .tool_use;
src/api/google_generative_ai.zig+0−18
@@ -1,14 +1,7 @@
1-//! Google Generative AI (Gemini) streaming adapter. The wire format behind
2-//! every customProvider with api "google-generative-ai".
3-
41 const std = @import("std");
52 const api = @import("../api.zig");
63 const types = @import("../types.zig");
74
8-// ---- request building -----------------------------------------------------
9-
10-/// A part of a content object. Exactly one member is set; the rest are null
11-/// and are left out.
125 const Part = struct {
136 text: ?[]const u8 = null,
147 @"inlineData": ?struct { @"mimeType": []const u8, data: []const u8 } = null,
@@ -67,8 +60,6 @@ fn contentParts(a: std.mem.Allocator, msg: types.Message) ![]const Part {
6760 }
6861 }
6962
70-/// A run of tool results becomes one user turn of functionResponse parts. The
71-/// response key is "error" when the tool failed and "output" otherwise.
7263 fn toolResultContent(a: std.mem.Allocator, run: []const types.Message) !Content {
7364 const parts = try a.alloc(Part, run.len);
7465 for (run, parts) |msg, *part| {
@@ -101,7 +92,6 @@ fn buildContents(a: std.mem.Allocator, req: api.Request) ![]const Content {
10192 return out.items;
10293 }
10394
104-/// Thinking budget per effort. `off` disables thinking entirely.
10595 fn budgetFor(effort: []const u8) ?u64 {
10696 const map = .{
10797 .{ "off", 0 },
@@ -145,9 +135,6 @@ fn buildBody(req: api.Request) ![]u8 {
145135 return std.json.Stringify.valueAlloc(a, body, .{ .emit_null_optional_fields = false });
146136 }
147137
148-/// Google addresses a model by path, not by a query parameter, and streams
149-/// through `:streamGenerateContent`. A model id that already names its path is
150-/// not prefixed twice.
151138 fn buildUrl(a: std.mem.Allocator, req: api.Request) ![]u8 {
152139 const model = if (std.mem.startsWith(u8, req.model.id, "models/"))
153140 req.model.id
@@ -159,8 +146,6 @@ fn buildUrl(a: std.mem.Allocator, req: api.Request) ![]u8 {
159146 });
160147 }
161148
162-// ---- streaming state ------------------------------------------------------
163-
164149 const Chunk = struct {
165150 @"error": ?api.ErrField = null,
166151 candidates: []const Candidate = &.{},
@@ -198,7 +183,6 @@ const State = struct {
198183 usage: types.Usage = .{},
199184 finish: ?[]const u8 = null,
200185 stream_error: ?[]const u8 = null,
201- /// Set by `run` when the stream did not run to completion.
202186 failed: bool = false,
203187
204188 pub fn handle(st: *State, chunk: Chunk) !void {
@@ -240,8 +224,6 @@ const State = struct {
240224 }
241225 };
242226
243-/// Google sends a whole call in one part, so a call is appended, not grown in
244-/// place. The id is derived from the name and order because Google omits one.
245227 fn addCall(st: *State, part: Chunk.Piece) !void {
246228 const fc = part.@"functionCall" orelse return;
247229 const call = try st.calls.addOne(st.req.pers);
src/api/openai_completions.zig+0−22
@@ -1,20 +1,13 @@
1-//! OpenAI-compatible chat completions with streaming. The wire format behind
2-//! opencode-go and every customProvider with api "openai-completions".
3-
41 const std = @import("std");
52 const api = @import("../api.zig");
63 const types = @import("../types.zig");
74
8-// ---- request building -----------------------------------------------------
9-
105 const ToolCall = struct {
116 id: []const u8,
127 @"type": []const u8 = "function",
138 function: struct { name: []const u8, arguments: []const u8 },
149 };
1510
16-/// An assistant turn: its text, and one `tool_calls` entry per call. The key
17-/// is absent when the turn made no call.
1811 const Assistant = struct {
1912 role: []const u8 = "assistant",
2013 content: []const u8,
@@ -44,7 +37,6 @@ const Part = union(enum) {
4437 }
4538 };
4639
47-/// The images a run of tool results carried, as one trailing user message.
4840 const Images = struct {
4941 role: []const u8 = "user",
5042 content: []const Part,
@@ -101,10 +93,6 @@ fn buildMessages(a: std.mem.Allocator, req: api.Request) ![]const Message {
10193 var i: usize = 0;
10294 while (i < req.messages.len) {
10395 if (req.messages[i] == .tool_result) {
104- // A run of tool results lands together. Any images among them ride
105- // as one following user message: a tool message's content is a
106- // string, and a user message between a call and its results is
107- // rejected.
10896 const start = i;
10997 var images = false;
11098 while (i < req.messages.len and req.messages[i] == .tool_result) : (i += 1) {
@@ -155,8 +143,6 @@ fn buildBody(req: api.Request) ![]u8 {
155143 return std.json.Stringify.valueAlloc(a, body, .{ .emit_null_optional_fields = false });
156144 }
157145
158-// ---- streaming state ------------------------------------------------------
159-
160146 const Chunk = struct {
161147 id: ?[]const u8 = null,
162148 model: ?[]const u8 = null,
@@ -213,11 +199,8 @@ const State = struct {
213199 usage: types.Usage = .{},
214200 finish_reason: ?[]const u8 = null,
215201 stream_error: ?[]const u8 = null,
216- /// Set by `run` when the stream did not run to completion.
217202 failed: bool = false,
218203
219- /// One payload, already parsed. Everything this wire records about the
220- /// response it learns here; `run` owns the life cycle around it.
221204 pub fn handle(st: *State, chunk: Chunk) !void {
222205 if (chunk.@"error") |err| {
223206 if (err.message) |m| {
@@ -283,9 +266,6 @@ fn handleDelta(st: *State, delta: Chunk.Delta) !void {
283266 }
284267 }
285268
286-/// The usage facts one chunk carries. A prompt that is mostly a cache hit is
287-/// billed as the difference, so the cached and written-back tokens come out of
288-/// `input`.
289269 fn usageOf(u: Chunk.Usage) types.Usage {
290270 var cache_read = if (u.@"prompt_tokens_details") |d| d.@"cached_tokens".value else 0;
291271 if (cache_read == 0) cache_read = u.@"cached_tokens".value;
@@ -302,8 +282,6 @@ fn usageOf(u: Chunk.Usage) types.Usage {
302282 return usage;
303283 }
304284
305-/// A stream that produced finished calls is a tool turn, not a stop. A broken
306-/// stream reports none, and `run` restores the transport's own reason.
307285 fn mapStopReason(st: *State, has_calls: bool) void {
308286 if (has_calls) {
309287 st.msg.stop_reason = .tool_use;
src/api/openai_responses.zig+0−14
@@ -1,15 +1,7 @@
1-//! OpenAI Responses API streaming adapter. The wire format behind every
2-//! customProvider with api "openai-responses".
3-
41 const std = @import("std");
52 const api = @import("../api.zig");
63 const types = @import("../types.zig");
74
8-// ---- request building -----------------------------------------------------
9-
10-/// One entry of the `input` array. A user message is a `message` with a
11-/// `content` part; an assistant's own blocks are a `message` of `output_text`
12-/// parts and `function_call` entries.
135 const InputPart = struct {
146 @"type": []const u8,
157 text: ?[]const u8 = null,
@@ -79,7 +71,6 @@ fn buildInput(a: std.mem.Allocator, req: api.Request) ![]const InputItem {
7971
8072 fn buildBody(req: api.Request) ![]u8 {
8173 const a = req.scratch;
82- // OpenAI Responses rejects max_output_tokens below 16.
8374 const max_tokens: ?u64 = if (req.model.max_tokens > 0)
8475 (if (req.model.max_tokens > 16) req.model.max_tokens else 16)
8576 else
@@ -102,8 +93,6 @@ fn buildBody(req: api.Request) ![]u8 {
10293 return std.json.Stringify.valueAlloc(a, body, .{ .emit_null_optional_fields = false });
10394 }
10495
105-// ---- streaming state ------------------------------------------------------
106-
10796 const Chunk = struct {
10897 @"type": ?[]const u8 = null,
10998 message: ?[]const u8 = null,
@@ -154,7 +143,6 @@ const State = struct {
154143 status: ?[]const u8 = null,
155144 incomplete: ?[]const u8 = null,
156145 stream_error: ?[]const u8 = null,
157- /// Set by `run` when the stream did not run to completion.
158146 failed: bool = false,
159147
160148 pub fn handle(st: *State, chunk: Chunk) !void {
@@ -278,8 +266,6 @@ fn finalize(st: *State) !void {
278266 if (st.reasoning.items.len > 0) try st.msg.content.append(a, .{ .thinking = .{ .text = st.reasoning.items } });
279267 if (st.text.items.len > 0) try st.msg.content.append(a, .{ .text = st.text.items });
280268
281- // A broken stream leaves arguments truncated; running them would be a
282- // call the model never finished making.
283269 const has_calls = try api.appendCalls(st.msg, st.sink, a, st.calls.items, st.failed);
284270
285271 var usage = st.usage;
src/config.zig+0−25
@@ -1,8 +1,3 @@
1-//! Config: `$XDG_CONFIG_HOME/mini-coding-agent/config.json` (or the equivalent
2-//! under `$HOME`). Every user-facing behavior that can vary comes from here,
3-//! with a sane default. There is no project-local config. A `-c`/`--config`
4-//! file is read after the global one and overrides its keys.
5-
61 const std = @import("std");
72 const platform = @import("platform.zig");
83 const util = @import("util.zig");
@@ -28,8 +23,6 @@ pub const CustomProvider = struct {
2823 };
2924
3025 pub const Config = struct {
31- /// The file `save` writes back to: the global config, or the override when
32- /// one was given on the command line.
3326 path: []const u8,
3427 sessions_dir: []const u8,
3528 system_prompt: []const u8,
@@ -38,15 +31,11 @@ pub const Config = struct {
3831 tools: []const ToolName,
3932 provider: ?[]const u8,
4033 model: ?[]const u8,
41- /// Null when unset: no reasoning parameter is sent, so the provider picks.
4234 thinking_effort: ?[]const u8,
43- /// A theme id; see `theme.find`.
4435 theme: []const u8,
4536 custom_providers: []const CustomProvider,
4637 };
4738
48-/// The on-disk shape. Every key is optional so an override file may set any
49-/// subset; a `null` leaves the value the global file (or the default) supplied.
5039 const File = struct {
5140 @"sessionsDir": ?[]const u8 = null,
5241 @"systemPrompt": ?[]const u8 = null,
@@ -70,9 +59,6 @@ pub fn configPath(a: std.mem.Allocator) []const u8 {
7059 return util.join(a, &.{ configDir(a), "config.json" }) catch "config.json";
7160 }
7261
73-/// `$XDG_STATE_HOME/mini-coding-agent/sessions`, else
74-/// `$HOME/.local/state/mini-coding-agent/sessions`, else the relative
75-/// `sessions`.
7662 fn sessionsDir(a: std.mem.Allocator) []const u8 {
7763 const state = platform.getEnv("XDG_STATE_HOME") orelse blk: {
7864 const home = platform.home() orelse return "sessions";
@@ -81,11 +67,6 @@ fn sessionsDir(a: std.mem.Allocator) []const u8 {
8167 return util.join(a, &.{ state, "mini-coding-agent/sessions" }) catch "sessions";
8268 }
8369
84-/// Loads the config. The global file is always read; when `override` is given
85-/// it is read after and its keys win. A missing global file means every
86-/// default, but a missing override is an error. Any read, parse, or validation
87-/// failure is reported on stderr and returned. The result is allocated from
88-/// `a` and lives for the process.
8970 pub fn load(a: std.mem.Allocator, override: ?[]const u8) !Config {
9071 var cfg = try defaults(a);
9172 try readInto(a, configPath(a), false, &cfg);
@@ -126,16 +107,12 @@ fn readInto(a: std.mem.Allocator, path: []const u8, required: bool, cfg: *Config
126107 if (file.theme) |v| cfg.theme = v;
127108 }
128109
129-/// The subset of config a TUI command persists. `null` leaves a key alone.
130110 pub const Update = struct {
131111 provider: ?[]const u8 = null,
132112 model: ?[]const u8 = null,
133113 thinking_effort: ?[]const u8 = null,
134114 };
135115
136-/// Merges `update` into the on-disk config, preserving every other key. The
137-/// merge is textual: the file at `cfg.path` is parsed, the changed keys
138-/// replaced, and the whole object written back.
139116 pub fn save(a: std.mem.Allocator, cfg: *const Config, update: Update) !void {
140117 var arena = std.heap.ArenaAllocator.init(a);
141118 defer arena.deinit();
@@ -157,8 +134,6 @@ pub fn save(a: std.mem.Allocator, cfg: *const Config, update: Update) !void {
157134 const json_text = std.json.Stringify.valueAlloc(tmp, root, .{ .whitespace = .indent_2 }) catch
158135 return error.OutOfMemory;
159136 const out = try std.fmt.allocPrint(tmp, "{s}\n", .{json_text});
160- // Written atomically: a temp file, then a rename over the target, so an
161- // interrupted write can never leave a truncated config behind.
162137 const temp = try std.fmt.allocPrint(tmp, "{s}.tmp", .{path});
163138 try util.writeFile(temp, out);
164139 try std.Io.Dir.cwd().rename(temp, std.Io.Dir.cwd(), path, platform.io);
src/diff.zig+0−10
@@ -1,6 +1,3 @@
1-//! Unified diffs: an `Index:` line and a `---`/`+++` header pair, then hunks
2-//! with three lines of context. Display-only.
3-
41 const std = @import("std");
52
63 const context = 3;
@@ -8,7 +5,6 @@ const max_trace_bytes = 64 << 20;
85
96 const Line = struct {
107 p: []const u8,
11- /// The line ended with a newline.
128 nl: bool,
139 };
1410
@@ -27,13 +23,10 @@ fn splitLines(a: std.mem.Allocator, text: []const u8) ![]Line {
2723 return out.toOwnedSlice(a);
2824 }
2925
30-/// A line is its text plus whether it ended with a newline: a final line
31-/// without one is a different line from the same text with one.
3226 fn lineEq(x: Line, y: Line) bool {
3327 return x.nl == y.nl and x.p.len == y.p.len and std.mem.eql(u8, x.p, y.p);
3428 }
3529
36-/// Myers O(ND) diff over line arrays, producing an in-order edit script.
3730 fn myers(a: std.mem.Allocator, la: []const Line, lb: []const Line) ![]Op {
3831 const n = la.len;
3932 const m = lb.len;
@@ -92,7 +85,6 @@ fn myers(a: std.mem.Allocator, la: []const Line, lb: []const Line) ![]Op {
9285 }
9386
9487 if (found_d == null) {
95- // Trace budget exceeded: fall back to a coarse replacement.
9688 for (la) |l| try ops.append(a, .{ .kind = .del, .line = l });
9789 for (lb) |l| try ops.append(a, .{ .kind = .ins, .line = l });
9890 return ops.toOwnedSlice(a);
@@ -137,8 +129,6 @@ fn addRange(w: *std.Io.Writer, start: usize, count: usize) !void {
137129 }
138130 }
139131
140-/// A unified diff of two in-memory texts with the header a working-tree patch
141-/// carries. The result is allocated from `a`.
142132 pub fn unified(a: std.mem.Allocator, path: []const u8, before: []const u8, after: []const u8) ![]u8 {
143133 var arena = std.heap.ArenaAllocator.init(a);
144134 defer arena.deinit();
src/http.zig+0−8
@@ -1,10 +1,7 @@
1-//! Minimal HTTP client for streaming Server-Sent Events responses.
2-
31 const std = @import("std");
42 const platform = @import("platform.zig");
53 const build_options = @import("build_options");
64
7-/// Providers require a product user-agent; the client default is the std one.
85 const user_agent = "mini-coding-agent/" ++ build_options.version;
96
107 pub const Header = struct { name: []const u8, value: []const u8 };
@@ -25,9 +22,6 @@ const HttpError = error{
2522 Aborted,
2623 } || std.mem.Allocator.Error;
2724
28-/// POSTs `body` and dispatches each SSE event's concatenated data payload.
29-/// On a non-2xx status the response body is stored in `err_body` and
30-/// `error.HttpStatus` is returned, so the caller can surface it as-is.
3125 pub fn postSse(
3226 a: std.mem.Allocator,
3327 url: []const u8,
@@ -39,8 +33,6 @@ pub fn postSse(
3933 ) HttpError!void {
4034 const uri = std.Uri.parse(url) catch return error.RequestFailed;
4135 var client: std.http.Client = .{ .allocator = a, .io = platform.io };
42- // The client owns the connection pool; without this the idle connection
43- // (and its fd) outlives the request for the life of the process.
4436 defer client.deinit();
4537
4638 var hdrs: std.ArrayList(std.http.Header) = .empty;
src/main.zig+0−11
@@ -1,5 +1,3 @@
1-//! mini: a fast, transparent, config-first terminal coding agent.
2-
31 const std = @import("std");
42 const platform = @import("platform.zig");
53 const util = @import("util.zig");
@@ -13,9 +11,6 @@ const tools = @import("tools/index.zig");
1311 const tui = @import("tui/tui.zig");
1412 const term = @import("tui/term.zig");
1513
16-/// The terminal is process-wide state, so its reset is too: a panic or a
17-/// segfault must hand the tty back before the process dies, exactly as the
18-/// signal and exit paths do. Both handlers below are allocation-free.
1914 pub const panic = std.debug.FullPanic(panicRestore);
2015
2116 fn panicRestore(msg: []const u8, ra: ?usize) noreturn {
@@ -23,8 +18,6 @@ fn panicRestore(msg: []const u8, ra: ?usize) noreturn {
2318 std.debug.defaultPanic(msg, ra);
2419 }
2520
26-/// `std.debug` routes SEGV/ILL/BUS/FPE here when the root file declares it, so
27-/// a crash in the allocator or a bad pointer cannot leave the tty raw either.
2821 pub const debug = struct {
2922 pub fn handleSegfault(addr: ?usize, name: []const u8, ctx: ?std.debug.CpuContextPtr) noreturn {
3023 term.restore();
@@ -65,8 +58,6 @@ fn parseArgs(a: std.mem.Allocator) !ParsedArgs {
6558 return result;
6659 }
6760
68-/// The headless projection: tool activity on stderr, the reply on stdout. It
69-/// records only whether anything went wrong, which sets the exit code.
7061 const PrintCtx = struct { failed: bool = false };
7162
7263 fn printEvent(ctx: *anyopaque, event: agent.Event) void {
@@ -115,8 +106,6 @@ fn runPrint(a: std.mem.Allocator, prompt_text: []const u8, opts: agent.Options)
115106 opts.session.close();
116107 if (pc.failed) return 1;
117108
118- // The reply is the last assistant turn's text; anything before it is a
119- // tool round trip whose output already reached stderr.
120109 var i = messages.items.len;
121110 const last = while (i > 0) {
122111 i -= 1;
src/models.zig+0−31
@@ -1,14 +1,9 @@
1-//! Built-in provider table and model resolution.
2-
31 const std = @import("std");
42 const platform = @import("platform.zig");
53 const catalog = @import("catalog.zig");
64 const config = @import("config.zig");
75 const types = @import("types.zig");
86
9-/// A provider whose authentication is compiled in. Where and how the provider
10-/// is reached — the wire and the base URL — is a property of each catalog
11-/// model, not of the provider: one provider id may serve several wires.
127 const Builtin = struct {
138 id: []const u8,
149 env_keys: []const []const u8,
@@ -41,10 +36,6 @@ fn normalizeEffort(value: []const u8) []const u8 {
4136 return if (std.mem.eql(u8, value, "none")) "off" else value;
4237 }
4338
44-/// Clamps a desired effort to what the model accepts, preferring the next
45-/// higher level, then the next lower. An unset desire means no reasoning
46-/// parameter is sent, so the provider decides. A non-reasoning model runs
47-/// "off".
4839 fn clampEffort(info: *const catalog.ModelInfo, desired: ?[]const u8) []const u8 {
4940 const want = desired orelse return "";
5041 if (!info.reasoning) return "off";
@@ -55,8 +46,6 @@ fn clampEffort(info: *const catalog.ModelInfo, desired: ?[]const u8) []const u8
5546 const want_rank = rank(want);
5647 if (want_rank < 0) return normalizeEffort(info.effort[0]);
5748
58- // Nearest accepted level by ladder rank, preferring to go up. One pass in
59- // each direction beats scanning the whole ladder per rank.
6049 var up: ?[]const u8 = null;
6150 var down: ?[]const u8 = null;
6251 for (info.effort) |accepted| {
@@ -72,7 +61,6 @@ fn clampEffort(info: *const catalog.ModelInfo, desired: ?[]const u8) []const u8
7261 return normalizeEffort(pick);
7362 }
7463
75-/// The built-in provider with this id, or null.
7664 fn builtin(id: []const u8) ?*const Builtin {
7765 for (&builtins) |*b| {
7866 if (std.mem.eql(u8, b.id, id)) return b;
@@ -80,7 +68,6 @@ fn builtin(id: []const u8) ?*const Builtin {
8068 return null;
8169 }
8270
83-/// The custom provider with this id, or null.
8471 fn custom(cfg: *const config.Config, id: []const u8) ?*const config.CustomProvider {
8572 for (cfg.custom_providers) |*p| {
8673 if (std.mem.eql(u8, p.id, id)) return p;
@@ -97,20 +84,14 @@ fn firstEnv(keys: []const []const u8) ?[]const u8 {
9784 return null;
9885 }
9986
100-/// Resolves the configured provider and model. Returns null when either is
101-/// unset; otherwise `err` carries a message the caller surfaces as-is.
10287 pub fn resolve(a: std.mem.Allocator, cfg: *const config.Config, err: *?[]const u8) ?types.Model {
10388 const provider_id = cfg.provider orelse return null;
10489 const model_id = cfg.model orelse return null;
10590 return resolveNamed(a, cfg, provider_id, model_id, err);
10691 }
10792
108-/// Resolves one named provider and model, clamped to what the catalog says the
109-/// model accepts. `err` carries a message when the pair is unknown.
11093 pub fn resolveNamed(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8, model_id: []const u8, err: *?[]const u8) ?types.Model {
11194 if (builtin(provider_id)) |b| {
112- // The catalog is the only source of the wire and the base URL, and it
113- // holds no model it cannot address. A missing entry is unresolvable.
11495 const info = catalog.lookup(provider_id, model_id) orelse {
11596 err.* = unknownModel(a, model_id, provider_id);
11697 return null;
@@ -150,8 +131,6 @@ pub fn resolveNamed(a: std.mem.Allocator, cfg: *const config.Config, provider_id
150131 .base_url = p.@"baseUrl",
151132 .api_key = firstEnv(p.@"envKeys"),
152133 .effort = cfg.thinking_effort orelse "",
153- // Custom providers are uncatalogued; assume image input. A model
154- // that rejects images surfaces the provider error as-is.
155134 .supports_images = true,
156135 .context_window = 200_000,
157136 .max_tokens = 32_768,
@@ -167,7 +146,6 @@ pub fn resolveNamed(a: std.mem.Allocator, cfg: *const config.Config, provider_id
167146 return null;
168147 }
169148
170-/// A custom provider's header map as plain name/value pairs, or none.
171149 fn headerPairs(a: std.mem.Allocator, headers: ?std.json.ArrayHashMap([]const u8)) []const [2][]const u8 {
172150 const h = headers orelse return &.{};
173151 var out: std.ArrayList([2][]const u8) = .empty;
@@ -176,11 +154,8 @@ fn headerPairs(a: std.mem.Allocator, headers: ?std.json.ArrayHashMap([]const u8)
176154 return out.toOwnedSlice(a) catch &.{};
177155 }
178156
179-/// A provider the TUI can offer in `/provider`. `key_present` is only a hint;
180-/// a provider without a key is listed but will fail at request time as-is.
181157 const ProviderEntry = struct { id: []const u8, name: []const u8, key_present: bool };
182158
183-/// The built-in providers plus any custom provider in the config.
184159 pub fn providers(a: std.mem.Allocator, cfg: *const config.Config) []ProviderEntry {
185160 var out: std.ArrayList(ProviderEntry) = .empty;
186161 for (builtins) |b| {
@@ -192,8 +167,6 @@ pub fn providers(a: std.mem.Allocator, cfg: *const config.Config) []ProviderEntr
192167 return out.toOwnedSlice(a) catch &.{};
193168 }
194169
195-/// Every model a provider offers: the catalog entries for a built-in, the
196-/// declared ids for a custom provider.
197170 pub fn catalogModels(a: std.mem.Allocator, cfg: *const config.Config, provider_id: []const u8) ![]types.Model {
198171 var out: std.ArrayList(types.Model) = .empty;
199172 for (&catalog.entries) |*entry| {
@@ -210,18 +183,14 @@ pub fn catalogModels(a: std.mem.Allocator, cfg: *const config.Config, provider_i
210183 return out.toOwnedSlice(a);
211184 }
212185
213-/// The thinking levels a model accepts, in ladder order.
214186 pub fn supportedLevels(provider_id: []const u8, model_id: []const u8) []const []const u8 {
215187 if (builtin(provider_id) == null) return &ladder;
216188 const info = catalog.lookup(provider_id, model_id) orelse return &ladder;
217- // A model that does not reason runs "off" and offers nothing else,
218- // matching what `clampEffort` will send.
219189 if (!info.reasoning) return &.{"off"};
220190 if (info.effort.len == 0) return &ladder;
221191 return info.effort;
222192 }
223193
224-/// Clamps a requested thinking level to what the named model accepts.
225194 pub fn clampNamed(provider_id: []const u8, model_id: []const u8, desired: []const u8) []const u8 {
226195 if (builtin(provider_id) == null) return desired;
227196 const info = catalog.lookup(provider_id, model_id) orelse return desired;
src/platform.zig+0−6
@@ -1,9 +1,3 @@
1-//! Process-wide handles, set once at startup and never mutated.
2-//!
3-//! These are the only globals in the program: the IO implementation, the
4-//! long-lived allocator, the environment, and the command line. Everything
5-//! else is threaded explicitly by the caller.
6-
71 const std = @import("std");
82
93 pub var io: std.Io = undefined;
src/prompt.zig+0−7
@@ -1,6 +1,3 @@
1-//! The system prompt: the configured prompt, any discovered skills, and the
2-//! opted-in agent files. Nothing else is injected.
3-
41 const std = @import("std");
52 const platform = @import("platform.zig");
63 const util = @import("util.zig");
@@ -33,7 +30,6 @@ fn discoverSkills(a: std.mem.Allocator, dirs: []const []const u8) ![]Skill {
3330 for (util.listDir(a, root)) |entry| {
3431 const path = util.join(a, &.{ root, entry, "SKILL.md" }) catch continue;
Cut short: this commit's diff is over 1000 lines.
src/session.zig+0−15
Cut short: this commit's diff is over 1000 lines.
src/tools/bash.zig+0−13
Cut short: this commit's diff is over 1000 lines.
src/tools/common.zig+0−13
Cut short: this commit's diff is over 1000 lines.
src/tools/edit.zig+0−3
Cut short: this commit's diff is over 1000 lines.
src/tools/index.zig+0−10
Cut short: this commit's diff is over 1000 lines.
src/tools/read.zig+0−15
Cut short: this commit's diff is over 1000 lines.
src/tools/snapshot.zig+0−13
Cut short: this commit's diff is over 1000 lines.
src/tui/complete.zig+0−2
Cut short: this commit's diff is over 1000 lines.
src/tui/editor.zig+0−10
Cut short: this commit's diff is over 1000 lines.
src/tui/highlight.zig+1−50
Cut short: this commit's diff is over 1000 lines.
src/tui/render.zig+0−17
Cut short: this commit's diff is over 1000 lines.
src/tui/stream.zig+0−4
Cut short: this commit's diff is over 1000 lines.
src/tui/styles.zig+0−8
Cut short: this commit's diff is over 1000 lines.
src/tui/term.zig+0−22
Cut short: this commit's diff is over 1000 lines.
src/tui/theme.zig+0−54
Cut short: this commit's diff is over 1000 lines.
src/tui/tui.zig+0−117
Cut short: this commit's diff is over 1000 lines.
src/types.zig+0−15
Cut short: this commit's diff is over 1000 lines.
src/util.zig+0−13
Cut short: this commit's diff is over 1000 lines.