| # Integrations |
|
|
| mona-agent is designed to be glued into whatever you already run. |
|
|
| ## Cloud REST API (client view) |
|
|
| The daemon talks to the control plane at `https://agent.mona.expert` over |
| HTTPS with Bearer auth. From a client perspective the endpoints are: |
|
|
| | Method | Path | Purpose | |
| |---|---|---| |
| | GET | `/api/v1/agent/health` | Cloud health / uptime check | |
| | GET | `/api/v1/agent/verify` | Validate the device token | |
| | POST | `/api/v1/agent/chat/:agentId` | Send a chat message, get a reply | |
| | POST | `/api/v1/agent/tool/:agentId` | Execute a tool directly | |
| | GET | `/api/v1/agent/agents` | List your agents | |
| | POST | `/api/v1/agent/think` | Streaming reasoning (SSE) | |
| | POST | `/api/v1/agent/stats` | Device metrics snapshot (every 10 s) | |
|
|
| The client picks the right base URL and paths automatically |
| (`MONA_CLOUD` overrides the default). |
|
|
| ## Boot persistence |
|
|
| Keep the daemon alive across reboots: |
|
|
| - **macOS** β install [examples/macos/com.monaexpert.agent.plist](../examples/macos/com.monaexpert.agent.plist) |
| into `~/Library/LaunchAgents/` and `launchctl load` it. |
| - **Linux (systemd)** β drop [examples/linux/mona-agent.service](../examples/linux/mona-agent.service) |
| into `~/.config/systemd/user/` and `systemctl --user enable --now mona-agent`. |
| - **cron fallback** β `@reboot $HOME/.local/bin/mona-agent start` |
|
|
| ## Scheduling |
|
|
| The agent plays nicely with cron (see [EXAMPLES.md](EXAMPLES.md) for |
| recipes). One-liners: |
|
|
| ```bash |
| mona-agent chat "β¦" # ask the cloud brain, answer in dashboard history |
| mona-agent exec "β¦" # run a guarded command, stream the output |
| ``` |
|
|
| ## Health checks |
|
|
| - **Interactive** β `mona-agent connect` runs the full connectivity test |
| (health, auth, agent list) and prints the result. |
| - **Scripted** β parse `mona-agent connect` exit code in your monitoring: |
|
|
| ```bash |
| if mona-agent connect; then echo "agent ok"; else echo "agent degraded"; fi |
| ``` |
|
|
| ## Webhooks & outbound calls |
|
|
| The `net` tool lets the agent call your webhooks, health endpoints or |
| notification services (outbound HTTPS only): |
|
|
| ```bash |
| mona-agent exec "curl -fsS https://hc-ping.com/<your-uuid>" |
| ``` |
|
|
| ## Building on the client |
|
|
| - `packages/engine` β the cloud-brain client (self-contained) |
| - `packages/protocol` β typed message schemas shared with the cloud |
|
|
| Both are MIT licensed; reuse them freely. |
|
|