Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat(cos): add quick summary widget for at-a-glance dashboard
Adam Eivya2718cbcd12e
diff --git a/.changelog/v0.12.x.md b/.changelog/v0.12.x.mdindex 28cc0263f3..5209d5ed2c 100644--- a/.changelog/v0.12.x.md+++ b/.changelog/v0.12.x.md@@ -105,6 +105,24 @@ This release adds branch management and automated release workflow capabilities- `client/src/services/api.js` — Added `getAgentPublished()` API function- `client/src/components/agents/tabs/ToolsTab.jsx` — Published Content section with posts/comments tables, engagement stats, days selector, and auto-refresh on publish/engage+### Agents — Post Monitor & Engagement Response+- **Check Posts button**: One-click check of engagement on all published posts, with comment counts and scores+- **Auto-upvote**: Upvotes positive comments on the agent's posts (respects rate limits)+- **AI reply generation**: Generates and publishes contextual replies to comments using the agent's personality+- **`monitor` scheduled action**: New automation type for recurring post engagement checks+- **Engagement summary**: Results panel showing posts checked, comments found, upvotes given, and replies posted++**Server changes**:+- `server/services/agentPublished.js` — New shared service for collecting published posts from activity logs (extracted from route for DRY reuse)+- `server/routes/agentTools.js` — Added `POST /check-posts` endpoint, refactored `/published` to use shared helper+- `server/services/agentActionExecutor.js` — Added `executeMonitor` function and `monitor` case to action dispatch+- `server/lib/validation.js` — Added `monitor` to action types, added `checkPostsSchema`++**Client changes**:+- `client/src/services/api.js` — Added `checkAgentPosts()` API function+- `client/src/components/agents/tabs/ToolsTab.jsx` — Added Check Posts button, loading spinner, and engagement results panel+- `client/src/components/agents/constants.js` — Added `monitor` action type+### Agents — Agent-Centric Drill-Down Redesign- **Agent list view**: Top-level grid of agent cards with aggregate stats, replacing the flat tab layout- **Agent detail view**: Drill into any agent to see all its data: personality, accounts, tools, published content, schedules, and activity@@ -150,3 +168,20 @@ This release adds branch management and automated release workflow capabilities**Client changes**:- `client/src/services/api.js` — Added `getCosLearningSummary()` API function- `client/src/pages/ChiefOfStaff.jsx` — Added learning summary state, fetches summary with page data, renders clickable Learning stat card in both desktop (5-column grid) and mobile layouts++### CoS — Quick Summary Widget+- **At-a-glance dashboard**: New compact status bar on the Tasks tab showing today's work, streak status, pending items, and next scheduled job+- **Today's progress**: Displays tasks completed/failed, active running count, and total time worked today+- **Streak visualization**: Shows current daily streak with fire icon that lights up orange when 3+ day streaks are active+- **Pending queue**: Highlights pending user tasks and system tasks awaiting approval+- **Next job countdown**: Shows the next scheduled autonomous job with time until due (e.g., "git-maintenance in 2h 15m")+- **Smart visibility**: Widget only appears when there's meaningful data to display, staying hidden during first-run or idle states++**Server changes**:+- `server/routes/cos.js` — Added `GET /quick-summary` endpoint that aggregates today's activity, streak data, job schedule, and pending approvals in a single efficient call++**Client changes**:+- `client/src/components/cos/QuickSummary.jsx` — New component with responsive layout, auto-refresh every 30 seconds+- `client/src/components/cos/index.js` — Exported QuickSummary component+- `client/src/services/api.js` — Added `getCosQuickSummary()` API function+- `client/src/pages/ChiefOfStaff.jsx` — Renders QuickSummary widget on the Tasks tabdiff --git a/client/src/components/cos/QuickSummary.jsx b/client/src/components/cos/QuickSummary.jsxnew file mode 100644index 0000000000..2710cd32f8--- /dev/null+++ b/client/src/components/cos/QuickSummary.jsx@@ -0,0 +1,132 @@+import { useState, useEffect } from 'react';+import {+ CheckCircle,+ Clock,+ Flame,+ Calendar,+ ListTodo,+ Zap,+ AlertCircle,+ Timer+} from 'lucide-react';+import * as api from '../../services/api';++/**+ * QuickSummary - At-a-glance dashboard widget for CoS status+ * Shows today's progress, streak status, next job, and pending work+ */+export default function QuickSummary() {+ const [summary, setSummary] = useState(null);+ const [loading, setLoading] = useState(true);++ useEffect(() => {+ const loadSummary = async () => {+ const data = await api.getCosQuickSummary().catch(() => null);+ setSummary(data);+ setLoading(false);+ };++ loadSummary();+ // Refresh every 30 seconds+ const interval = setInterval(loadSummary, 30000);+ return () => clearInterval(interval);+ }, []);++ if (loading || !summary) {+ return null;+ }++ const { today, streak, nextJob, queue } = summary;++ // Only show if there's meaningful data to display+ const hasActivity = today.completed > 0 || today.running > 0 || streak.current > 0 || queue.total > 0;+ if (!hasActivity && !nextJob) {+ return null;+ }++ // Format time until next job+ const formatTimeUntil = (isoDate) => {+ if (!isoDate) return null;+ const now = Date.now();+ const due = new Date(isoDate).getTime();+ const diffMs = due - now;++ if (diffMs <= 0) return 'now';++ const minutes = Math.floor(diffMs / 60000);+ const hours = Math.floor(minutes / 60);++ if (hours > 0) return `${hours}h ${minutes % 60}m`;+ return `${minutes}m`;+ };++ return (+ <div className="bg-gradient-to-r from-port-card to-port-bg border border-port-border rounded-lg p-3 mb-4">+ <div className="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm">+ {/* Today's Stats */}+ {(today.completed > 0 || today.running > 0) && (+ <div className="flex items-center gap-1.5">+ <CheckCircle size={14} className="text-port-success" />+ <span className="text-gray-400">Today:</span>+ <span className="font-medium text-white">+ {today.succeeded}{today.failed > 0 && <span className="text-port-error">/{today.failed}</span>}+ </span>+ {today.running > 0 && (+ <span className="text-port-accent animate-pulse">+ +{today.running} running+ </span>+ )}+ {today.timeWorked && today.timeWorked !== '0s' && (+ <span className="text-gray-500 text-xs">({today.timeWorked})</span>+ )}+ </div>+ )}++ {/* Streak */}+ {streak.current > 0 && (+ <div className="flex items-center gap-1.5">+ <Flame size={14} className={streak.current >= 3 ? 'text-orange-400' : 'text-gray-400'} />+ <span className="text-gray-400">Streak:</span>+ <span className={`font-medium ${streak.current >= 3 ? 'text-orange-400' : 'text-white'}`}>+ {streak.current} day{streak.current !== 1 ? 's' : ''}+ </span>+ {streak.current >= 3 && (+ <Zap size={12} className="text-yellow-400" />+ )}+ </div>+ )}++ {/* Pending Work */}+ {queue.total > 0 && (+ <div className="flex items-center gap-1.5">+ <ListTodo size={14} className="text-port-warning" />+ <span className="text-gray-400">Pending:</span>+ <span className="font-medium text-white">+ {queue.pendingUserTasks > 0 && (+ <span>{queue.pendingUserTasks} task{queue.pendingUserTasks !== 1 ? 's' : ''}</span>+ )}+ {queue.pendingUserTasks > 0 && queue.pendingApprovals > 0 && ', '}+ {queue.pendingApprovals > 0 && (+ <span className="text-port-warning">{queue.pendingApprovals} approval{queue.pendingApprovals !== 1 ? 's' : ''}</span>+ )}+ </span>+ </div>+ )}++ {/* Next Job */}+ {nextJob && (+ <div className="flex items-center gap-1.5">+ <Timer size={14} className={nextJob.isDue ? 'text-port-accent animate-pulse' : 'text-gray-400'} />+ <span className="text-gray-400">Next:</span>+ <span className={`font-medium truncate max-w-[120px] ${nextJob.isDue ? 'text-port-accent' : 'text-white'}`} title={nextJob.jobName}>+ {nextJob.jobName?.replace(/^(self-improvement|app-improvement)-/, '').replace(/-/g, ' ')}+ </span>+ <span className="text-gray-500 text-xs">+ {nextJob.isDue ? 'due' : formatTimeUntil(nextJob.nextDueAt)}+ </span>+ </div>+ )}+ </div>+ </div>+ );+}diff --git a/client/src/components/cos/index.js b/client/src/components/cos/index.jsindex c577c15069..7a8cd9259b 100644--- a/client/src/components/cos/index.js+++ b/client/src/components/cos/index.js@@ -17,6 +17,7 @@ export { default as StatusIndicator } from './StatusIndicator';export { default as StatCard } from './StatCard';export { default as StatusBubble } from './StatusBubble';export { default as EventLog } from './EventLog';+export { default as QuickSummary } from './QuickSummary';// Tab Componentsexport { default as TasksTab } from './tabs/TasksTab';diff --git a/client/src/pages/ChiefOfStaff.jsx b/client/src/pages/ChiefOfStaff.jsxindex a2f147471a..36a6901e31 100644--- a/client/src/pages/ChiefOfStaff.jsx+++ b/client/src/pages/ChiefOfStaff.jsx@@ -20,6 +20,7 @@ import {StatCard,StatusBubble,EventLog,+ QuickSummary,TasksTab,AgentsTab,JobsTab,@@ -566,6 +567,9 @@ export default function ChiefOfStaff() {</button></div>+ {/* Quick Summary - at-a-glance stats on tasks tab only */}+ {activeTab === 'tasks' && <QuickSummary />}+{/* Tabs - scrollable on mobile with touch-friendly sizing */}<div role="tablist" aria-label="Chief of Staff sections" className="flex gap-1 mb-4 lg:mb-6 border-b border-port-border overflow-x-auto scrollbar-hide pb-px">{TABS.map(tabItem => {diff --git a/client/src/services/api.js b/client/src/services/api.jsindex dd986f9815..eaac6344c4 100644--- a/client/src/services/api.js+++ b/client/src/services/api.js@@ -362,6 +362,13 @@ export const getAgentRelevantPosts = (agentId, accountId, maxResults) => {export const getAgentSubmolts = (accountId) => request(`/agents/tools/submolts?accountId=${accountId}`);export const getAgentPost = (accountId, postId) => request(`/agents/tools/post/${postId}?accountId=${accountId}`);export const getAgentRateLimits = (accountId) => request(`/agents/tools/rate-limits?accountId=${accountId}`);+export const getAgentPublished = (agentId, accountId, days = 7) =>+ request(`/agents/tools/published?agentId=${agentId}&accountId=${accountId}&days=${days}`);+export const checkAgentPosts = (agentId, accountId, days, maxReplies, maxUpvotes) =>+ request('/agents/tools/check-posts', {+ method: 'POST',+ body: JSON.stringify({ agentId, accountId, days, maxReplies, maxUpvotes })+ });// Agent Draftsexport const getAgentDrafts = (agentId) => request(`/agents/tools/drafts?agentId=${agentId}`);@@ -518,6 +525,7 @@ export const compareCosWeeks = (week1, week2) => request(`/cos/digest/compare?weexport const getCosProductivity = () => request('/cos/productivity');export const getCosProductivitySummary = () => request('/cos/productivity/summary');export const recalculateCosProductivity = () => request('/cos/productivity/recalculate', { method: 'POST' });+export const getCosQuickSummary = () => request('/cos/quick-summary');// Task Schedule (Configurable Intervals)export const getCosSchedule = () => request('/cos/schedule');diff --git a/server/routes/cos.js b/server/routes/cos.jsindex 1535c9c06b..df6e7e219a 100644--- a/server/routes/cos.js+++ b/server/routes/cos.js@@ -857,4 +857,49 @@ router.post('/productivity/recalculate', asyncHandler(async (req, res) => {res.json({ success: true, data });}));+// GET /api/cos/quick-summary - Get at-a-glance dashboard summary+// Combines today's activity, streak status, next job, and pending approvals into one efficient call+router.get('/quick-summary', asyncHandler(async (req, res) => {+ const [todayActivity, productivityData, tasksData, jobStats] = await Promise.all([+ cos.getTodayActivity(),+ productivity.getProductivitySummary(),+ cos.getAllTasks(),+ autonomousJobs.getJobStats()+ ]);++ // Count pending approvals from system tasks+ const pendingApprovals = tasksData.cos?.awaitingApproval?.length || 0;++ // Count pending user tasks+ const pendingUserTasks = tasksData.user?.grouped?.pending?.length || 0;++ res.json({+ today: {+ completed: todayActivity.stats.completed,+ succeeded: todayActivity.stats.succeeded,+ failed: todayActivity.stats.failed,+ running: todayActivity.stats.running,+ successRate: todayActivity.stats.successRate,+ timeWorked: todayActivity.time.combined+ },+ streak: {+ current: productivityData.currentStreak,+ longest: productivityData.longestStreak,+ weekly: productivityData.weeklyStreak,+ lastActive: productivityData.lastActive+ },+ nextJob: jobStats.nextDue,+ queue: {+ pendingApprovals,+ pendingUserTasks,+ total: pendingApprovals + pendingUserTasks+ },+ status: {+ running: todayActivity.isRunning,+ paused: todayActivity.isPaused,+ lastEvaluation: todayActivity.lastEvaluation+ }+ });+}));+export default router;