diff options
| author | t <t@tjp.lol> | 2026-07-03 09:49:13 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-07-03 10:53:10 -0600 |
| commit | 94568d9f70b12fa348040a7998dac7b0808b0258 (patch) | |
| tree | e177f28e534c44525ec9828edc3cab18e7c6756e /panto-agent/init.lua | |
panto-agent is a luarocks rock providing the agent.* extension suite
for pantograph's panto CLI:
- agent.rules: injects AGENTS.md/CLAUDE.md (AGENTS.md wins, never both)
from the base agent dir, user config dir, and project root into the
system prompt at session start. Also hooks std.read tool results to
append rules files found between a read location and the project
root, each injected at most once per session.
- agent.skill: discovers Agent Skills (SKILL.md with YAML frontmatter)
across data/config/home/project skill dirs with later dirs shadowing
earlier ones, and exposes them via an agent.skill tool whose enum and
description are built from the surviving skills. The tool returns the
skill's instructions with frontmatter stripped. Not registered when
no skills are found.
Includes a rockspec, README, and a panto-runnable self-check
(_selfcheck.lua, underscore-prefixed so panto's directory scan skips
it). Sources live under panto-agent/ so require works the same
installed or from a checkout.
Diffstat (limited to 'panto-agent/init.lua')
| -rw-r--r-- | panto-agent/init.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/panto-agent/init.lua b/panto-agent/init.lua new file mode 100644 index 0000000..017f4ee --- /dev/null +++ b/panto-agent/init.lua @@ -0,0 +1,20 @@ +-- panto-agent: the agent.* extension suite for pantograph. +-- +-- Returns the list of extension entries this rock provides. Works both +-- installed as a rock (`require("panto-agent")`, submodules namespaced) +-- and as a directory source via `extensions.paths` (siblings on +-- `package.path`). + +local function sub(name) + -- Truncate to one value: require returns (module, loaderdata) and a + -- trailing multi-value would expand inside the entries list below. + local ok, mod = pcall(require, "panto-agent." .. name) + if ok then return mod end + local fallback = require(name) + return fallback +end + +return { + sub("rules"), + sub("skill"), +} |
