summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-06-10 09:46:00 -0600
committert <t@tjp.lol>2026-06-10 09:55:05 -0600
commit9bf1d800f2a24ed71221c64370c98ee8d907314b (patch)
treed1b77ac9140e57ba523e97a4b815475ddba2c04e /examples
parent938db5f476184b2d4f613e04cce60a5191581d7f (diff)
expose `panto` to extensions as a require()able module, not a global
Diffstat (limited to 'examples')
-rw-r--r--examples/extensions/echo.lua2
-rw-r--r--examples/extensions/greet.lua2
2 files changed, 4 insertions, 0 deletions
diff --git a/examples/extensions/echo.lua b/examples/extensions/echo.lua
index d384e5b..2f2d4de 100644
--- a/examples/extensions/echo.lua
+++ b/examples/extensions/echo.lua
@@ -1,6 +1,8 @@
-- A trivial Lua tool that echoes back whatever the LLM asks it to.
-- Useful for exercising the panto CLI's Lua extension path end-to-end.
+local panto = require("panto")
+
panto.ext.register_tool {
name = "echo",
description = "Echo back the given message. Useful for testing whether tools work.",
diff --git a/examples/extensions/greet.lua b/examples/extensions/greet.lua
index 30a6f12..d74095b 100644
--- a/examples/extensions/greet.lua
+++ b/examples/extensions/greet.lua
@@ -6,6 +6,8 @@
-- writing to stdout). `args` is the trimmed text after the command name;
-- it is an empty string when none was given. The return value is ignored.
+local panto = require("panto")
+
panto.ext.register_command {
name = "greet",
description = "Print a greeting. Optional args name who to greet.",