menu/menu_agent library
Lets an LLM agent read and drive a menu: the menu (state and output)
and menu_line (a line typed by a user) commands, over the VM service
(menuAgentVmRegister, done by the io console) or another json
transport (MenuAgent.describe, MenuAgent.run).
The VM service extensions are the ones of tekartik_app_agent: the
app-agent MCP server (tekartik_app_agent_mcp) connects with
app_connect to the VM service uri and lists the commands as tools.
Classes
- MenuAgent
- Reads and drives the menu for an LLM agent.
- MenuLineProcessor
-
A presenter that processes a line as if typed by the user: an item key
or shortcut, the answer of a pending prompt, a line for the menu
commandhandler.
Constants
-
The VM service extension listing the agent commands
(
{commands: [{name, description, inputSchema}]}). -
The VM service extension running an agent command (params
nameandargsas json text):{ok: true, result}or{ok: false, error}.
Properties
-
The menu agent, created on first use: it records the output from then
on.
no setter
-
The menu agent, null until menuAgent is first used.
no setter
Functions
-
Registers the VM service extensions menuAgentVmCommandsExtension and
menuAgentVmRunExtension of menuAgent (once), reachable from the Dart
tooling of a debug run (
dart run --enable-vm-service,flutter run): theapp-agentMCP server (tekartik_app_agent_mcp)app_connectthen listsmenuandmenu_lineas tools.