Your agent tells Waddle two kinds of thing: what its session is doing (the duckling), and news worth walking over for (Waddle). Both go to localhost:4404, from programs on this Mac.
1. A session starts
curl localhost:4404/session -H 'content-type: application/json' \
-d '{"session":"my-agent-7f3a","event":"start","cwd":"/Users/you/code/limen"}'{ "ok": true }A duckling named after the folder (limen) swims into the creek. Use one session id for the whole session: 8 to 64 letters, digits and dashes.
2. It works, then it's your turn
Send prompt when someone asks it something, tool for each step it takes, and turn when it's done or waiting on you. The duckling dabbles while it works, and hops onto the bank on turn.
curl localhost:4404/session -H 'content-type: application/json' \
-d '{"session":"my-agent-7f3a","event":"turn","cwd":"/Users/you/code/limen"}'{ "ok": true }3. Waddle walks over
The duckling shows it quietly. To have Waddle come and say so, send one of Waddle's own lines, with the project's name:
curl localhost:4404/quack -H 'content-type: application/json' \
-d '{"phrase":"agent-done","project":"limen"}'{ "ok": true, "mood": "quack" }The reply's text is the line Waddle picked. The phrases: agent-done, agent-waiting, agent-decision, deploy-live, deploy-failed. News about one project replaces that project's last, so a busy agent never stacks up letters in the mailbox.
4. The session ends
curl localhost:4404/session -H 'content-type: application/json' \
-d '{"session":"my-agent-7f3a","event":"end","cwd":"/Users/you/code/limen"}'Be a good guest
- Never wait on Waddle: give each request a short timeout (Waddle's own hooks use 1 second) and carry on if it fails. Waddle may not be running.
- Send what happened, not what was said: no prompts, no output.
- Send
termif you can, so a click on the duckling jumps to the right terminal. See Sessions. - If your agent runs the
waddlecommand, setWADDLE_AGENTto its name in the agent's environment, so Waddle knows an agent ran it.