Skip to content

GTerm (Tool Packages)

Latest

Choose a tag to compare

@Earu Earu released this 12 Oct 16:56
· 3 commits to master since this release

TL;DR Addons and servers can now ship their own MCP tools to the agent, and Lua errors come back with a traceback.

Tool packages

Addons and servers can provide extra tools as Lua files at lua/gterm_packages/<package>.lua. Since lua/ is networked, a server can AddCSLuaFile a package and give the agent capabilities it would otherwise lack, such as acting on a dedicated server's realm. See the README for the file format and an example.

New MCP tools:

  • list_tool_packages: lists packages visible in the current session
  • request_tool_packages: opens a consent prompt in GTerm's console
  • call_package_tool: runs a tool from an enabled package with a JSON args object

Consent

Packages are opt-in, and only the user can enable them:

  • Type packages in GTerm to enable or disable packages for the current server without an agent.
  • get_game_status offers newly discovered packages once and lists the enabled ones with their tools, so the agent knows what it can use.
  • Consent is stored in Config.json under ToolPackageConsent, per server IPv4 (or local for listen servers and singleplayer) and per file hash. A changed package is asked again.
  • Enabled packages are dropped on disconnect, map change or server change.
  • Game output is held while the prompt is open and printed once it closes.

Requires sv_allowcslua 1, since discovery runs client-realm Lua.

Lua errors

Runtime errors from run_lua, package tools, screenshots and GTerm's own helper scripts now include a stack traceback instead of only the error message. Errors in helper scripts are reported as such rather than as a timeout or an empty result.