From ff694d12f67a65798e0d6165854f64f292f5e209 Mon Sep 17 00:00:00 2001 From: ansible Date: Tue, 7 Apr 2026 13:28:29 +0000 Subject: [PATCH] =?UTF-8?q?Initial=20commit=20=E2=80=94=20fireclaw=20multi?= =?UTF-8?q?-agent=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firecracker microVM-based multi-agent system with IRC orchestration and local LLMs. Features: - Ephemeral command runner with VM snapshots (~1.1s) - Multi-agent orchestration via overseer IRC bot - 5 agent templates (worker, coder, researcher, quick, creative) - Tool access (shell + podman containers inside VMs) - Persistent workspace + memory system (MEMORY.md pattern) - Agent hot-reload (model/persona swap via SSH + SIGHUP) - Non-root agents, graceful shutdown, crash recovery - Agent-to-agent communication via IRC - DM support, /invite support - Systemd service, 20 regression tests Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitignore | 4 + IDEAS.md | 142 +++ README.md | 251 ++++ ROADMAP.md | 65 + TODO.md | 38 + agent/agent.py | 528 ++++++++ eslint.config.js | 25 + package-lock.json | 2385 ++++++++++++++++++++++++++++++++++++ package.json | 27 + scripts/setup-bridge.sh | 30 + scripts/teardown-bridge.sh | 20 + src/agent-manager.ts | 557 +++++++++ src/cleanup.ts | 47 + src/cli.ts | 134 ++ src/config.ts | 57 + src/firecracker-api.ts | 152 +++ src/index.ts | 5 + src/irc-framework.d.ts | 14 + src/network.ts | 165 +++ src/overseer.ts | 188 +++ src/rootfs.ts | 98 ++ src/setup.ts | 117 ++ src/snapshot.ts | 128 ++ src/ssh.ts | 107 ++ src/types.ts | 24 + src/vm.ts | 288 +++++ tests/test-suite.sh | 305 +++++ tsconfig.json | 16 + 28 files changed, 5917 insertions(+) create mode 100644 .gitignore create mode 100644 IDEAS.md create mode 100644 README.md create mode 100644 ROADMAP.md create mode 100644 TODO.md create mode 100644 agent/agent.py create mode 100644 eslint.config.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100755 scripts/setup-bridge.sh create mode 100755 scripts/teardown-bridge.sh create mode 100644 src/agent-manager.ts create mode 100644 src/cleanup.ts create mode 100644 src/cli.ts create mode 100644 src/config.ts create mode 100644 src/firecracker-api.ts create mode 100644 src/index.ts create mode 100644 src/irc-framework.d.ts create mode 100644 src/network.ts create mode 100644 src/overseer.ts create mode 100644 src/rootfs.ts create mode 100644 src/setup.ts create mode 100644 src/snapshot.ts create mode 100644 src/ssh.ts create mode 100644 src/types.ts create mode 100644 src/vm.ts create mode 100755 tests/test-suite.sh create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..95d7ca8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +*.js.map +.DS_Store diff --git a/IDEAS.md b/IDEAS.md new file mode 100644 index 0000000..34241df --- /dev/null +++ b/IDEAS.md @@ -0,0 +1,142 @@ +# Fireclaw Ideas + +Future features and experiments, loosely prioritized by usefulness. + +## Operator Tools + +### !status command +Quick dashboard in IRC: agent count, RAM/CPU per VM, Ollama model currently loaded, system uptime, disk free. One command to see the health of everything. + +### !logs [n] +Tail the last N interactions an agent had. Stored in the agent's workspace. Useful to see what an agent's been doing while you were away. + +### !persona [new persona] +View or live-edit an agent's persona via IRC. "Make the worker more sarcastic" without touching files or restarting. Uses hot-reload under the hood. + +### !pause / !resume +Temporarily mute an agent without destroying it. Agent stays alive but stops responding. Useful when you need a channel to yourself. + +## Agent Tools + +### Web search +Agents can search via the searx instance on mymx. Either bake the searx CLI into the rootfs, or add a proper `web_search(query)` tool that calls the searx API from inside the VM. Agents could actually research topics instead of relying on training data. + +### Fetch URL +`fetch_url(url)` tool to grab a webpage, strip HTML, return text. Combined with web search, agents become genuine research assistants. Could use `curl | python3 -c "from html.parser import..."` or a lightweight readability script. + +### File sharing between agents +A shared `/shared` mount (third virtio drive, or a common ext4 image) that all agents can read/write. Drop a file from one agent, pick it up from another. Enables collaboration: researcher writes findings, coder reads and implements. + +### Code execution sandbox +A `run_python(code)` tool that's safer than `run_command`. Executes in a subprocess with resource limits (timeout, memory cap). Better for code agents that need to test their own output. + +## Automation + +### Cron agents +Template gets an optional `schedule` field: `"schedule": "0 8 * * *"`. The overseer spawns the agent on schedule, it does its task, reports to #agents, and self-destructs. Use cases: +- Morning health check: "any disk/memory/service issues on grogbox?" +- Daily digest: "summarize what happened in #agents yesterday" +- Backup verification: "check that last night's backups completed" + +### Webhook triggers +HTTP endpoint on the host (e.g., `:8080/hook/