feat(dashboard): tableau de bord Second Brain configurable avec chargement progressif
Briefing granulaire, pistes rapides puis enrichissement async, layout persisté v5, suggestions agents, intégration Gmail et navigation sidebar alignée sur /home. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -117,17 +117,48 @@ fi
|
||||
# --- Background cron scheduler ---
|
||||
(
|
||||
sleep 60
|
||||
CRON_SECRET="${CRON_SECRET:-}"
|
||||
tick=0
|
||||
while true; do
|
||||
node -e "
|
||||
const http = require('http');
|
||||
const req = http.request('http://localhost:3000/api/cron/agents', { method: 'POST' }, (res) => {
|
||||
let body = '';
|
||||
res.on('data', (d) => body += d);
|
||||
res.on('end', () => console.log('[Scheduler] Cron response:', res.statusCode, body));
|
||||
});
|
||||
req.on('error', (e) => console.error('[Scheduler] Cron error:', e.message));
|
||||
req.end();
|
||||
" 2>&1 || true
|
||||
if [ -n "$CRON_SECRET" ]; then
|
||||
CRON_TICK="$tick" node -e "
|
||||
const http = require('http');
|
||||
const secret = process.env.CRON_SECRET || '';
|
||||
const tick = Number(process.env.CRON_TICK || '0');
|
||||
const call = (path, method) => new Promise((resolve) => {
|
||||
const req = http.request({
|
||||
hostname: 'localhost',
|
||||
port: 3000,
|
||||
path,
|
||||
method: method || 'POST',
|
||||
headers: { Authorization: 'Bearer ' + secret },
|
||||
}, (res) => {
|
||||
let body = '';
|
||||
res.on('data', (d) => body += d);
|
||||
res.on('end', () => { console.log('[Scheduler]', path, res.statusCode, body.slice(0, 200)); resolve(); });
|
||||
});
|
||||
req.on('error', (e) => { console.error('[Scheduler]', path, e.message); resolve(); });
|
||||
req.end();
|
||||
});
|
||||
(async () => {
|
||||
await call('/api/cron/agents');
|
||||
await call('/api/cron/agent-suggestions');
|
||||
if (tick % 12 === 0) {
|
||||
await call('/api/cron/reminders');
|
||||
await call('/api/cron/sync-usage');
|
||||
}
|
||||
if (tick % 72 === 0) {
|
||||
await call('/api/cron/clusters', 'GET');
|
||||
}
|
||||
if (tick % 288 === 0) {
|
||||
await call('/api/cron/gmail');
|
||||
}
|
||||
})();
|
||||
" 2>&1 || true
|
||||
else
|
||||
warn "CRON_SECRET unset — scheduled crons disabled"
|
||||
fi
|
||||
tick=$((tick + 1))
|
||||
sleep 300
|
||||
done
|
||||
) &
|
||||
|
||||
Reference in New Issue
Block a user