Create a lightweight HTTP client module for calling the Agentd daemon API from the web server.
The Omni.Web server needs to call the Agentd daemon's HTTP API (default localhost:8400) to:
GET /agentsGET /agents/:idPOST /agentsPOST /agents/:id/sendPOST /agents/:id/stopOmni/Agents/Client.hs-- | HTTP client for the Agentd daemon API
module Omni.Agents.Client where
-- Types matching Daemon's API types
data AgentInfo = AgentInfo { ... }
data SpawnRequest = SpawnRequest { ... }
data SpawnResponse = SpawnResponse { ... }
-- Client functions
listAgents :: Text -> IO [AgentInfo] -- baseUrl -> agents
getAgent :: Text -> Text -> IO (Maybe AgentInfo) -- baseUrl -> runId -> agent
spawnAgent :: Text -> SpawnRequest -> IO SpawnResponse
sendMessage :: Text -> Text -> Text -> IO Bool -- baseUrl -> runId -> message
stopAgent :: Text -> Text -> IO Bool -- baseUrl -> runId
AGENTD_URL (default: http://localhost:8400)http-conduit (already used by Daemon.hs)aeson for JSON
Ava verified: shipped as part of commit b05c4976 'agents web ui: interactive agent interface'. /agents endpoint live on beryllium and returns 200. Moving to Verified.