amiagent is the Amiga half of amimcp. It is a small TCP daemon that lets a
program on another machine work on this Amiga: run AmigaDOS commands, read and
write files, list drawers, report system state, capture the screen, run ARexx,
and inject mouse and keyboard input.
The other half is an MCP server that runs on a Mac or PC, which is how Claude
(Anthropic's LLM) talks to it. Nothing about the agent is specific to that,
though - the wire protocol is documented (PROTOCOL.md, now in this archive)
and simple enough to drive from a shell script if you would rather.
It is written in plain C against the OS libraries, needs no third-party
dependencies, and runs on AmigaOS 2.0 upwards. Two builds of each program are
included:
amiagent 68000 - runs on any Amiga
amiagent.020 68020+ - slightly smaller and faster
amimon 68000 - the status window, GadTools (runs everywhere)
amimon.020 68020+ - the same, for an 020 and up
amimon-mui 68000 - the status window, MUI (needs MUI 3.8+)
amimon-mui.020 68020+ - the same, for an 020 and up
NEW IN 0.12.0
TASKPRI and TASKLIST on the AMIAGENT ARexx port:
address AMIAGENT
'TASKPRI "imp3" -1' /* RESULT: imp3 pri 0 -> -1 */
'TASKLIST "imp"' /* RESULT: IMP3 - Debugger (0), imp3 (-1) */
TASKPRI sets a task's priority BY NAME - the reach ChangeTaskPri lacks:
it only addresses CLI process numbers, while the tasks you actually need
to re-prioritise (a Workbench-started player spinning at 100% CPU and
starving its own audio decoder) have no CLI number at all. Exact name
match beats substring, rc=0/5, RESULT reports "name pri old -> new".
Plus a fix worth having if you script the port from the network side: a
client-sent ARexx program that itself did "address AMIAGENT" deadlocked
the agent. It now keeps serving its port while such a program runs.
NEW IN 0.11.0 - A LOCAL AREXX PORT
The agent now opens a public ARexx port, "AMIAGENT", so your own ARexx
scripts and ARexx-aware applications can drive its input machinery
directly - no network, no AI, just ARexx:
/* activate a window by title pattern, then type into it */
address AMIAGENT
'ACTIVATEWINDOW "CHAT --*"' /* rc=0 found+activated, rc=5 not */
'ENTERTEXT "hello there<enter>"'
Commands:
ACTIVATEWINDOW <pattern> AmigaDOS wildcards ('*' accepted as #?),
plain text matches as a substring, any
screen; on success RESULT holds the
matched window title.
ENTERTEXT <text> (alias TYPE) typed through YOUR keymap, so
umlauts come out right. Inline key tokens
in the commodities style: <enter>, <esc>,
<tab>, <f1>..<f10>, <up>, <ctrl c>,
<shift tab>, <lamiga q>, ... - "<<" gives
a literal '<'.
KEY <name> one key press, same names as above.
VERSION / HELP what you would expect.
rc=0 means it worked, rc=5 window not found, rc=10 bad command - so
your script can check whether the window even opened. Test for the
port with show('P','AMIAGENT') and fall back to whatever you did
before; if a second agent instance is started it simply runs without
the port rather than fighting over it.
ALSO RECENT (0.9.0 / 0.10.0)
* CMD_AREXX - clients can run ARexx programs here and read the RESULT;
REXXPORTS lists what is scriptable right now.
* A semantic GUI layer: walk windows/gadgets as objects, click "the OK
button" by name, enumerate menus and invoke by shortcut.
* GETRANGE - chunked download for big files.
* Optional TLS via AmiSSL 5 (opt-in SSL=1 rebuild; self-signs a cert on
first run). The binaries in this archive are plain TCP.
RUNNING IT
Bring your TCP/IP stack up first (Roadshow, AmiTCP, ...), then:
amiagent TOKEN=somesecret
It listens on port 7846 and prints that it is waiting. Ctrl-C stops it
(from a Shell: Status, then Break <n> - the agent exits cleanly). To
start it at boot, add this to S:User-Startup AFTER your TCP/IP stack:
run >NIL: <path-to>/amiagent TOKEN=somesecret QUIET
Then, optionally, run amimon (or amimon-mui) from the drawer to watch it
work.
SECURITY - PLEASE READ
amiagent runs whatever commands it is sent, and the connection is NOT
encrypted. Always set a TOKEN, keep it on a LAN you trust, and never forward
the port through your router. Without a TOKEN, anything on the network can
run any command on this machine - and both monitors will say so in
red-letter terms, showing "OPEN, no token".
Source, the MCP server, the protocol document and the issue tracker:
https://github.com/thomas-luebker/amimcp
Distributed under the licence in the archive.
|