From b0688c8819da1b7fcb4a97b6ec1fa58050e4841e Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Mon, 23 Mar 2026 06:50:43 +0000 Subject: feat: complete Agent Context API Phase 2 & 3 (Write/Create/Management) - Implement write operations (complete, uncomplete, update due date, update task) - Implement create operations (create task, add shopping item) - Add Trusted Agents management UI in Settings with revocation support - Fix SQLite timestamp scanning bug for completed tasks - Add comprehensive unit tests for all new agent endpoints - Update worklog and feature documentation --- cmd/dashboard/main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index 4112640..1d9e054 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -194,10 +194,20 @@ func main() { r.Post("/auth/deny", h.HandleAgentAuthDeny) }) - // Agent session required for context + // Agent session required for context and write operations r.Group(func(r chi.Router) { r.Use(h.AgentAuthMiddleware) r.Get("/context", h.HandleAgentContext) + + // Write Operations + r.Post("/tasks/{id}/complete", h.HandleAgentTaskComplete) + r.Post("/tasks/{id}/uncomplete", h.HandleAgentTaskUncomplete) + r.Patch("/tasks/{id}/due", h.HandleAgentTaskUpdateDue) + r.Patch("/tasks/{id}", h.HandleAgentTaskUpdate) + + // Create Operations + r.Post("/tasks", h.HandleAgentTaskCreate) + r.Post("/shopping", h.HandleAgentShoppingAdd) }) // HTML endpoints for browser-only agents (GET requests only) @@ -273,6 +283,7 @@ func main() { r.Post("/settings/features", h.HandleCreateFeature) r.Post("/settings/features/toggle", h.HandleToggleFeature) r.Delete("/settings/features/{name}", h.HandleDeleteFeature) + r.Delete("/settings/agents/{id}", h.HandleDeleteAgent) // WebSocket for notifications r.Get("/ws/notifications", h.HandleWebSocket) -- cgit v1.2.3