From 4f0a91ef55fe96835172bdad34feec1e2a0a0977 Mon Sep 17 00:00:00 2001 From: t Date: Sun, 16 Aug 2026 20:42:43 -0600 Subject: subagents extension on the generic host surfaces The rock now owns all subagent policy on top of libpanto-lua's generic APIs: children are ordinary panto.agent instances over rock-constructed stores, started with agent:run_async and awaited by arming uv.new_poll on each job's wake_fd from the tool handler's coroutine. subagents/jobs.lua carries the session policy the host used to own: the concurrency gate (4 running, FIFO queue, cancel-while-queued never starts), the await contract (results in input order; "first" returns settled plus remaining by identity), and settle-time shaping. subagents/spawn.lua seeds new children (primary system context, child role, profile body with manifest metadata), resolves model/reasoning through panto.ext.resolve_model, filters subagents.* out of the inherited tool set via agent:set_tools, and reads resume defaults back from stored message metadata. One-shot structured workers are a null_store agent with a declaration-only output tool, tool_choice forced, dispatch_tools=false. subagents/progress.lua renders per-tool-entry cards through the component handle's invalidate seam; turn_interrupt cancels live children, turn_end closes them. Spec suite rewritten against fakes of the new surfaces (98 cases), including gate/queue/cancel bounds, resume-default extraction, one-shot capture via unresolved tool calls, tool filtering, and manifest seeding. --- panto-subagents-0.1.0-1.rockspec | 84 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 panto-subagents-0.1.0-1.rockspec (limited to 'panto-subagents-0.1.0-1.rockspec') diff --git a/panto-subagents-0.1.0-1.rockspec b/panto-subagents-0.1.0-1.rockspec new file mode 100644 index 0000000..073ff56 --- /dev/null +++ b/panto-subagents-0.1.0-1.rockspec @@ -0,0 +1,84 @@ +-- LuaRocks rockspec for `panto-subagents`: the `subagents` extension for +-- Pantograph — pure Lua, no compiled artifact of its own. +-- +-- Module naming. Pantograph requires the first whitespace-delimited token of an +-- `[extensions] rocks = [...]` entry, so `require("panto-subagents")` must +-- resolve to this rock's entry point; that is what the first `modules` line +-- maps. The remaining modules keep the same `subagents.` paths a local +-- checkout gets from `paths = ["/path/to/panto-subagents"]`, so both load paths +-- resolve identical requires. +-- +-- Dependencies. `lyaml` parses profile frontmatter and is a C binding over the +-- system libyaml, which luarocks does not vendor: a machine without it needs +-- `brew install libyaml` (or `apt install libyaml-dev`) first, and may need +-- `YAML_DIR=...` passed to luarocks. `toml2lua` (module name `toml`) reads TOML +-- workflows and is pure Lua. `luv` backs the recursive discovery walk and the +-- wake pipes child jobs are polled on, and ships with panto as a pinned +-- battery, so it is normally already present in the tree this rock installs +-- into. +-- +-- Deliberately absent: `jsonschema`. It validates structured workflow output +-- when installed, and subagents/workflow.lua uses it if `require` finds it, but +-- it depends on `lrexlib-pcre`, which needs a system PCRE that stock macOS does +-- not have. A failed dependency install would take the whole extension down +-- silently (panto logs and skips a rock that fails to load), so the built-in +-- subset validator is the default and `jsonschema` stays opt-in. + +rockspec_format = "3.0" +package = "panto-subagents" +version = "0.1.0-1" + +source = { + url = "git+https://github.com/travisp/panto-subagents", +} + +description = { + summary = "Delegation and workflows for Pantograph: the `subagents` extension.", + detailed = [[ + Lets a primary panto agent start specialized child agents from Markdown + profiles, run several at once, and continue their conversations later. + Provides the subagents.run / subagents.models / subagents.lua / + subagents.workflow tools, a callback-based Lua workflow API with + one-shot structured workers, and TOML dependency graphs exposed as + /workflow: commands. + ]], + homepage = "https://github.com/travisp/panto-subagents", + license = "MIT", + labels = { "ai", "llm", "agent", "panto", "pantograph", "extension" }, +} + +dependencies = { + "lua >= 5.4, < 5.5", + "lyaml >= 6.2, < 7.0", + "toml2lua >= 3.0, < 4.0", + "luv >= 1.48", +} + +-- The specs run on plain Lua and decode structured child output with dkjson +-- when the host's own JSON codec (`panto.ext.json`) is absent. +test_dependencies = { + "dkjson >= 2.11", +} + +test = { + type = "command", + command = "lua spec/run.lua", +} + +build = { + type = "builtin", + modules = { + ["panto-subagents"] = "init.lua", + ["subagents.frontmatter"] = "subagents/frontmatter.lua", + ["subagents.jobs"] = "subagents/jobs.lua", + ["subagents.luatool"] = "subagents/luatool.lua", + ["subagents.models"] = "subagents/models.lua", + ["subagents.paths"] = "subagents/paths.lua", + ["subagents.profiles"] = "subagents/profiles.lua", + ["subagents.progress"] = "subagents/progress.lua", + ["subagents.run"] = "subagents/run.lua", + ["subagents.spawn"] = "subagents/spawn.lua", + ["subagents.toml_workflows"] = "subagents/toml_workflows.lua", + ["subagents.workflow"] = "subagents/workflow.lua", + }, +} -- cgit v1.3