Agentd daemon HTTP client for web server

t-694.11·WorkTask·
·
·
·Omni/Agents/Client.hs
Parent:t-694·Created1 month ago·Updated1 week ago·pipeline runs →

Description

Edit

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:

  • List agents: GET /agents
  • Get agent: GET /agents/:id
  • Spawn agent: POST /agents
  • Send message: POST /agents/:id/send
  • Stop agent: POST /agents/:id/stop

Module: Omni/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

Configuration

  • Daemon URL configurable via env var AGENTD_URL (default: http://localhost:8400)
  • Connection timeout: 5 seconds
  • Read timeout: 30 seconds (spawn can take a moment)

Dependencies

  • http-conduit (already used by Daemon.hs)
  • aeson for JSON

Timeline (5)

🔄[human]Open → InProgress1 month ago
🔄[human]InProgress → Review1 month ago
💬[human]1 week ago

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.

🔄[human]Review → Verified1 week ago