Repository navigation
Architecture
Pavel Erokhin edited this page Oct 24, 2026
·
9 revisions
- A player asks. The plugin opens a stream to the backend,
POST /api/v2/chat, and shows the live status. - When the model needs something from the game, the backend sends a tool call.
- The plugin runs the tool on the server thread and posts the result back.
- The answer streams into the chat, with buttons.
The protocol is docs/protocol-v2.md in Allay Server. Change both sides together. When a backend has no v2, the plugin falls back to v1.
-
expansionis the expansion API other plugins and mods build against,chat.allay:allay-expansionon Maven Central: plain Java with no dependencies and a version of its own. Every Allay jar carries its classes as they are, never relocated. See Expansions. -
coreholds everything that doesn't touch a game platform: the whole flow of a question (Handler, the live status, buttons in answers), the commands (Commands), chat mode, languages, billing, memory, privacy and consent, quotas, the automation agents' wakes (Agents), the tools that need no world (get_allay_guide,allay_settings, the agents' own), the backend client, settings, permissions and their defaults, items as the model reads them, the game's formulas, players' state on the backend (PlayerData) and the sealed files, goals, and the chest and inventory planners. It never importsorg.bukkitornet.minecraft. Here too are the catalog of things to find (Catalog,GameNameswith the game's names in every language, andCatalogCache, which keeps a platform's catalog until its recipes, expansions, or names change), the server's commands assearch_commandsshows them (CommandCatalog: each platform builds it from its command map or tree, and the core searches it, hides what the asker can't run, and checks/askxlines) and the expansions' registry (Expansions), which checks each expansion once and offers its tools under the same rules as Allay's own. -
spigotis the adapter for Spigot, Paper, and their forks. Its entry pointZygotebuilds the core'sAllayfrom two pieces:BukkitPlatform, which wraps senders, chat lines, the scheduler, and sounds, andSpigotGame, the tools that read the world, goals' boss bars, deaths, marks, drafts, automation's work, and the chest windows. It then hands Bukkit's commands and events to the core. -
modcoreis what both mods share: the game without a loader, built against NeoForm's Minecraft (the game's own names since 26.1).Modbuilds the core'sAllayfor each server the game starts, a dedicated one or the one under a singleplayer world, fromModPlatformandModGame, and drops it when that server stops. Its tools, windows, and automation mirrorspigotfile by file, with the same names, arguments, and results. The game's events reach Allay throughHooks: the loader's events where there are some, narrow mixins where there are none, the same on both loaders. What only the asker may see, like marks and drafts, goes to their client alone as packets. The integrations sit here too, each asked only when its mod is loaded. The game tests live here as well (src/gametest), and both mods run them. -
fabricandneoforgeare the mods, thin adapters aroundmodcore. Each sets aLoader(OnFabric,OnNeoForge): the mod list, the config folder, Allay's version, the loader's own ingredients, and its permissions API. ItsAllayModhands the loader's events toModandHooks, and its client part answers on servers without Allay. Fabric adds Plan, which has no NeoForge build.
A new mod loader is one more adapter next to fabric and neoforge, built from the same version. It brings:
-
A
Loaderformodcore: its id (the backend'sloader), its name forget_server, Allay's version, theconfig/folder, whether a mod is loaded and which mods a player installed, whether an ingredient is the loader's own kind, its permissions API, and which mod's jar holds a class (owner), sosearch_commandscan say whose a command is: Brigadier keeps no owner. -
Its events: server start, stop, and tick; commands; join and quit; chat before anyone else sees it; a broken block after the break, a respawn, a change of dimension, and a left click on a block, each to
ModorHooksasfabric/…/AllayMod.ktdoes.modcore's mixins catch the rest. -
Its client:
/ask,/askall,/askx, and/allayregistered on the client, answered throughElsewherewhile the server's command tree has none of them, and never in singleplayer. -
Its game tests: the shared ones with the loader's
GameTestannotation, plus a singleplayer check.
A license made in a player's own game becomes Solo (Allay Server 6.12): it answers one player.
-
Spigot API only, so one jar runs on Spigot and Paper. The exception is windows (the consent notice and the age question): Paper has its own dialog API instead of Spigot's, so
spigot/src/paper/draws them there, compiled against paper-api and loaded only on Paper. - Threads. Bukkit calls happen on the server thread; network calls never do.
- Privacy. Tools see only the asker and the world around them. Other players reach the model only as the asker's locator bar shows them.
-
Operator tools are checked three times: the registry offers them only to operators, the backend client refuses them for anyone else, and the tool checks
isOp()once more. Automation agents never get them. - Chest changes are planned in memory, checked, and written in one tick, or nothing moves.
- Windows only show pictures: every click, drag, and hopper move on them is cancelled.
- Secrets. The BYOK key and the license never reach the log or the chat.
The full map of files and every rule live in CLAUDE.md in the repository.
Next: Releasing