From bb85e867bc938138f29fb45230169af1ba60761c Mon Sep 17 00:00:00 2001 From: t Date: Wed, 10 Jun 2026 10:06:07 -0600 Subject: Add addUserText helper; update all call sites Conversation.addUserMessage now takes a []ContentBlock (symmetric with addAssistantMessage). Introduce a thin addUserText wrapper in agent.zig for the plain-text case and update every call site in agent.zig and anthropic_messages_json.zig accordingly. --- build/gen_panto_so_embed.zig | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 build/gen_panto_so_embed.zig (limited to 'build/gen_panto_so_embed.zig') diff --git a/build/gen_panto_so_embed.zig b/build/gen_panto_so_embed.zig new file mode 100644 index 0000000..37b8329 --- /dev/null +++ b/build/gen_panto_so_embed.zig @@ -0,0 +1,42 @@ +//! Build-time codegen: emit a Zig module exposing the compiled +//! `libpanto-lua` shared object (`panto.so`) as embedded bytes. Bootstrap +//! writes these to `/lib/lua//panto.so` on first run so the +//! embedded VM's `require('panto')` resolves to the native module on a +//! cold machine with no network — the guaranteed initial module load. +//! +//! Invoked from `build.zig`: +//! +//! gen-panto-so-embed +//! +//! `` is the filename the generated module `@embedFile`s; the +//! actual `.so` is materialized alongside the generated file under that +//! name via `addCopyFile` so `@embedFile` can reach it. + +const std = @import("std"); + +pub fn main(init: std.process.Init) !void { + const io = init.io; + + var args = init.minimal.args.iterate(); + defer args.deinit(); + _ = args.next(); + const embed_name = args.next() orelse return error.MissingEmbedName; + const out_path = args.next() orelse return error.MissingOutPath; + + var out_file = try std.Io.Dir.cwd().createFile(io, out_path, .{}); + defer out_file.close(io); + var buf: [4096]u8 = undefined; + var writer = out_file.writer(io, &buf); + const w = &writer.interface; + + try w.print( + \\//! Auto-generated. Do not edit. See build/gen_panto_so_embed.zig. + \\ + \\/// The compiled `libpanto-lua` shared object, embedded so the + \\/// bootstrap can stage it onto the embedded VM's `package.cpath`. + \\pub const bytes: []const u8 = @embedFile("{s}"); + \\ + , .{embed_name}); + + try w.flush(); +} -- cgit v1.3