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. --- libpanto-lua/libpanto-lua-0.0.0-1.rockspec | 63 ++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 libpanto-lua/libpanto-lua-0.0.0-1.rockspec (limited to 'libpanto-lua/libpanto-lua-0.0.0-1.rockspec') diff --git a/libpanto-lua/libpanto-lua-0.0.0-1.rockspec b/libpanto-lua/libpanto-lua-0.0.0-1.rockspec new file mode 100644 index 0000000..c14353f --- /dev/null +++ b/libpanto-lua/libpanto-lua-0.0.0-1.rockspec @@ -0,0 +1,63 @@ +-- LuaRocks rockspec for `libpanto-lua`: the native Lua 5.4 binding for +-- libpanto, built in pure Zig. +-- +-- Distribution model (see docs/libpanto-bindings.md): this is the *source* +-- rock — universal, buildable on any OS/arch that has a Zig toolchain. +-- LuaRocks prefers a matching pre-built `.PLATFORM.rock` when one is +-- published and falls back to building this source rock otherwise (the +-- pip "wheel-or-sdist" model). Pre-built binary rocks per platform are a +-- later step; no rockspec change is needed to add them. +-- +-- Build: `build.type = "command"` shells out to `zig build` (so the build +-- dependency is Zig, declared informally below since LuaRocks can't fetch +-- a compiler), then stages the emitted `panto.so` into `$(LIBDIR)` as the +-- bare module name `panto` — discovered by `require('panto')` on cpath. + +rockspec_format = "3.0" +package = "libpanto-lua" +version = "0.0.0-1" + +source = { + url = "git+https://github.com/earendil-works/pantograph.git", + -- The module lives in the `libpanto-lua/` subdirectory of the repo. + dir = "pantograph/libpanto-lua", +} + +description = { + summary = "Native Lua 5.4 bindings for libpanto (pure Zig).", + detailed = [[ + A loadable Lua 5.4 C-module exposing libpanto's agent + pull-stream + API. require('panto') yields panto.agent{...}; an Agent runs turns + that stream Events, registers Lua tool handlers (driven by libuv via + luv), swaps provider config, manages the system prompt, and compacts. + Implemented entirely in Zig (no C translation units); the .so is + emitted by `zig build`. + ]], + homepage = "https://github.com/earendil-works/pantograph", + license = "MIT", + labels = { "ai", "llm", "agent", "libpanto" }, +} + +-- Lua 5.4 only (Lua has no stable ABI across minor versions; a module +-- built for 5.4 will not load in 5.3 or 5.5). `luv` is required for tool +-- dispatch: tool handlers run as coroutines driven by `uv.run`. +dependencies = { + "lua >= 5.4, < 5.5", + "luv", +} + +-- Zig is required at build time. LuaRocks has no notion of a Zig toolchain +-- dependency, so this is enforced by the build_command failing loudly if +-- `zig` is absent rather than by a declared dependency. + +build = { + type = "command", + -- Build the shared object. `zig build` reads ./build.zig and emits + -- zig-out/lib/panto.so (see build.zig: the install step renames the + -- artifact to the bare `panto.so` a Lua C-module requires). + build_command = "zig build -Doptimize=ReleaseFast", + -- Stage the emitted module into LuaRocks' library dir under the bare + -- name `panto` so `require('panto')` resolves it on cpath. $(LIBDIR) + -- is substituted by LuaRocks at install time. + install_command = "cp zig-out/lib/panto.so $(LIBDIR)/panto.so", +} -- cgit v1.3