From 05b1930e04ac222d73ffb2f45c1b1febb69f893d Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Wed, 28 Jan 2026 22:19:28 -1000 Subject: Add Agent Context API for external agent integration Phase 1: Authentication and read-only context - POST /agent/auth/request - request access with name + agent_id - GET /agent/auth/poll - poll for approval status - POST /agent/auth/approve|deny - user approval (browser auth required) - GET /agent/context - 7-day timeline context (agent session required) Phase 1.5: Browser-only agent endpoints (HTML pages) - GET /agent/web/request - request page with token - GET /agent/web/status - status page with polling - GET /agent/web/context - context page with timeline data WebSocket notifications: - GET /ws/notifications - push agent requests to browsers - Approval modal with trust indicators and countdown timer Database: - agents table for registered agent tracking - agent_sessions table for pending/active sessions Co-Authored-By: Claude Opus 4.5 --- web/templates/agent-context.html | 121 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 web/templates/agent-context.html (limited to 'web/templates/agent-context.html') diff --git a/web/templates/agent-context.html b/web/templates/agent-context.html new file mode 100644 index 0000000..3a4778a --- /dev/null +++ b/web/templates/agent-context.html @@ -0,0 +1,121 @@ + + + + + + Agent Context - {{.AgentName}} + + + + + +
+

Agent Context

+

Timeline data for {{.AgentName}}

+ +
Generated At
+
{{.GeneratedAt}}
+ +
Date Range
+
{{.RangeStart}} to {{.RangeEnd}}
+
+ +
+

Summary

+
+
+
{{with .Summary}}{{.total_items}}{{else}}0{{end}}
+
Total Items
+
+
+
{{with .Summary}}{{.overdue}}{{else}}0{{end}}
+
Overdue
+
+
+
{{with .Summary}}{{.today}}{{else}}0{{end}}
+
Due Today
+
+
+
+ +
+

Timeline

+ {{if .Timeline}} + + + + + + + + + + + {{range .Timeline}} + + + + + + + {{end}} + +
SourceTitleDueType
{{.Source}} + {{if .URL}}{{.Title}}{{else}}{{.Title}}{{end}} + {{if .Description}}
{{.Description}}{{end}} +
{{if .Due}}{{.Due.Format "Jan 2, 3:04 PM"}}{{else}}-{{end}}{{.Type}}
+ {{else}} +

No items in the timeline for this date range.

+ {{end}} +
+ + -- cgit v1.2.3