summaryrefslogtreecommitdiff
path: root/panto-agent/init.lua
blob: 017f4ee36a039cdd255f50375babf2a12159f6f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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"),
}