Commit Graph

29 Commits

Author SHA1 Message Date
Eric Jungbauer eac7b64a90 The Pirate — Phase 1.a: conversational read-only media agent
Ships a chat-based agent at /pirate that LLM-routes user questions to media-stack tools and returns natural-language answers grounded in real data. Foundation built on top of the existing API-tokens + dual-auth infrastructure so other apps (Open WebUI, HA voice, Synap) can consume the same Pirate API.

New subsystem (not the standard trigger/result pattern):
- pirate_conversations + pirate_messages tables
- service_configs table (admin-wide creds shared by media agents)
- /api/pirate/chat + /api/pirate/conversations/* (dual-auth: user session OR Bearer token scoped to user's pirate instance)
- /api/internal/pirate/* endpoints used by runtime subprocess
- /api/admin/services + Services tab in admin.html for cred management
- Auto-seeded service_configs on startup from Media Stack Reference defaults (never overwrite admin edits)
- Auto-seeded pirate catalog entry + per-user pirate instance on startup

Pirate package (agents/pirate/):
- prompts.py: system prompt, enforces read-only in Phase 1
- runtime.py: Anthropic-native tool-use loop (max 8 iterations, persists every turn)
- tools/_common.py: service_configs fetch + qBit session auth
- tools/sonarr.py: queue, upcoming, series_search, library_stats
- tools/radarr.py: queue, movie_search, library_stats
- tools/qbittorrent.py: torrents, transfer_stats, categories
- tools/storage.py: disk_space (via Sonarr diskspace API)
- Default model: claude-sonnet-4-5 (Haiku fumbles multi-step chains)

Dashboard:
- static/pirate.html — full chat UI with conversation sidebar, suggestion chips, inline tool-call visualization, 24h idle reset + New Chat button
- Pirate button added to main dashboard header

Wiki reorg: Agents / Developer Guides / Plans parent docs, per-agent reference docs, The Pirate doc. API Clients + Calling Agents docs moved under Developer Guides.

Working folder: PIRATE_PHASE_1A.md + NEXT_SESSION_PROMPT.md for fast bootstrap.

Smoke tested end-to-end: real tool calls against qBittorrent (13 active torrents correctly reported) and Sonarr disk-space; multi-turn conversation state preserved across follow-up questions.

On deck: Phase 1.b (Lidarr/Whisparr/Overseerr/Plex tools), then 1.d (OWUI pipeline), then 1.c (HA voice).
2026-04-20 19:01:50 +00:00
Eric Jungbauer 043aa18f3f API Clients + structured JSON results: app-level tokens for Synap/WSIT integration
- New api_clients + api_client_scopes tables; tokens scoped per-instance
- Admin UI tab at /admin for token create/rotate/revoke/delete with one-time reveal
- Dual-auth dependency (user session OR Bearer app token) on trigger + runs endpoints
- /api/instances/{id}/trigger pre-creates a run and returns run_id + cached last_result instantly
- New GET /api/runs/{id} for polling
- Generic trigger path for sub-agent instances (weather, calendar, etc.)
- runs.result column for structured JSON alongside markdown output
- agent_catalog.result_schema describes each agent's result shape
- Weather, daily-briefing, project-monitor retrofitted to emit structured results
- log_run: env INSTANCE_ID/RUN_ID only used when target matches, so nested sub-agents don't clobber parent runs
- Wiki docs: API Clients & Token Scoping + Calling Agents From Your Apps
2026-04-20 17:54:32 +00:00
eric f01553c511 Intelligent Agent Router: LLM-powered natural language routing with suggestion UI 2026-04-14 14:41:44 +00:00
eric f39bd13fc6 Fix wiki report posting - handle root-level parent doc creation 2026-04-13 16:12:27 +00:00
eric 4d8451c987 Add Quick Links (App URL, Wiki, Gitea) to project status reports 2026-04-13 16:07:09 +00:00
eric 071c4a04e3 Move daily briefings to personal scratchpads, project reports under Project Status Reports parent 2026-04-13 16:02:01 +00:00
eric 4ee0dc4c11 Fix default LLM model to claude-3-haiku (compatible with API key tier) 2026-04-13 15:49:22 +00:00
eric a1454a0d05 Fix config save (SQLAlchemy JSON mutation), auto-rename project monitors 2026-04-13 15:30:14 +00:00
eric ad06fa2d70 Accept full wiki URLs, URL slugs, or UUIDs in project monitor config 2026-04-13 15:07:56 +00:00
eric 1ddc2a009c Project Monitor agent: LLM-powered project status reports with wiki+Gitea integration 2026-04-13 14:38:52 +00:00
eric b48028dd91 Fix Run Now: mount agents in container, install deps, fix datetime bug 2026-04-13 14:24:27 +00:00
eric d29555ae53 Auto-retry on transient failures + Run Now button for manual triggers 2026-04-13 14:20:16 +00:00
eric d28143ec00 Bring Your Own LLM: per-user LLM config with system default fallback 2026-04-13 14:13:02 +00:00
eric f57dd9621f Magic link auth via Gmail SMTP + password fallback 2026-04-13 14:08:16 +00:00
eric 00e76e412d Add email field to users, login accepts email or username 2026-04-13 13:55:26 +00:00
eric 845d6e4fbe Phase 2: Native macOS menu bar app + DMG download from dashboard 2026-04-13 13:49:22 +00:00
eric c17594d7c0 Bridge distribution: auth, heartbeat, installer script, per-user ports 2026-04-13 13:31:14 +00:00
eric 9bead9ca5d Switch to CalVer versioning (YYYY.MM.DD.XX) 2026-04-13 13:23:14 +00:00
eric 8cf5bb51ee Add Reminders (CalDAV), Notes, Reading List agents + Mac bridge 2026-04-13 03:20:44 +00:00
eric 852d329379 Add calendar agent (CalDAV + ICS), wire into daily briefing 2026-04-13 02:34:52 +00:00
eric 26156543f6 v2.0: Multi-user platform with agent catalog, admin panel, LLM providers 2026-04-13 02:21:45 +00:00
eric b299ea701a GUI-configurable agent settings + hide paused agents 2026-04-13 01:48:56 +00:00
eric 1dcfc9f46e Per-person briefings (Eric + Angela) with configurable weather locations 2026-04-13 01:38:03 +00:00
eric e07341faf9 Split into Weather sub-agent + Daily Briefing orchestrator 2026-04-13 01:31:53 +00:00
eric ebfa9c7154 Nest daily briefings under Year/Month hierarchy 2026-04-13 01:28:30 +00:00
eric 73ea08003e Add session-based login page and auth for dashboard 2026-04-13 01:19:56 +00:00
eric 90cf0992b8 Use Mountain Time for all timestamps and dates 2026-04-13 01:15:25 +00:00
eric f50355a818 Nest daily briefings under Eric s Daily Briefing doc 2026-04-13 01:14:18 +00:00
eric c86eb9ccc5 Initial commit: Agent Command Center dashboard + weather briefing agent 2026-04-13 01:06:42 +00:00