Code Engineering
Compile the current project; auto-detects the build tool from on-disk markers.
buildRuns the project's compile step in a subprocess (no tests), captures stdout/stderr, truncates to 50 KB, and returns the exit code so the agent can decide whether the change holds together.
READ_ONLY-permission tool wrapping ProcessBuilder. Detection is first-match-wins by marker file. Default timeout 300s; the agent may override runner explicitly. Output is capped at MAX_OUTPUT_CHARS so a noisy build doesn't blow the prompt budget.
When a user asks:
Did my last edit break the compile?
the agent calls the tool:
build()and gets back: exit=0 — compiled in 8.2s (mvn -B -q -DskipTests compile)
Real scenarios where agents put this tool to work.
Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/code/build/BuildTool.java in the swarm-ai repository.