feat: 23:00 daily news recap; prompts drop futures
Summarizer still runs the 15-min analyst, plus a 24h breaking-news recap at 23:00 America/New_York. HUD pins kind=daily_recap. Prompts ignore futures/market tape.
This commit is contained in:
parent
d25ca8ed9c
commit
49ee5fe7a3
16 changed files with 431 additions and 75 deletions
|
|
@ -1350,15 +1350,18 @@ async function loadNews(force) {
|
|||
if (upd) upd.textContent = 'updating…';
|
||||
let articles = [];
|
||||
let summaries = [];
|
||||
let recaps = [];
|
||||
let tickerItems = [];
|
||||
try {
|
||||
const [rArticles, rSumm, rTick] = await Promise.all([
|
||||
const [rArticles, rSumm, rRecap, rTick] = await Promise.all([
|
||||
fetch(`${API}/api/news?limit=100`),
|
||||
fetch(`${API}/api/news/summaries?limit=1`),
|
||||
fetch(`${API}/api/news/summaries?kind=daily_recap&limit=1`),
|
||||
fetch(`${API}/api/news/ticker?limit=20`),
|
||||
]);
|
||||
if (rArticles.ok) articles = await rArticles.json();
|
||||
if (rSumm.ok) summaries = await rSumm.json();
|
||||
if (rRecap.ok) recaps = await rRecap.json();
|
||||
if (rTick.ok) tickerItems = await rTick.json();
|
||||
} catch (e) {
|
||||
const list = document.getElementById('news-list');
|
||||
|
|
@ -1369,7 +1372,7 @@ async function loadNews(force) {
|
|||
console.error('News load failed', e);
|
||||
return;
|
||||
}
|
||||
renderNewsSummary(summaries);
|
||||
renderNewsSummary(recaps.length ? recaps : summaries, recaps.length > 0);
|
||||
renderNewsList(articles);
|
||||
renderNewsTicker(articles, summaries, tickerItems);
|
||||
if (upd) upd.textContent = 'updated ' + new Date().toLocaleTimeString();
|
||||
|
|
@ -1377,7 +1380,7 @@ async function loadNews(force) {
|
|||
newsInterval = setInterval(() => loadNews(false), NEWS_REFRESH_MS);
|
||||
}
|
||||
}
|
||||
function renderNewsSummary(summaries) {
|
||||
function renderNewsSummary(summaries, isRecap) {
|
||||
const bodyEl = document.getElementById('ns-body');
|
||||
const timeEl = document.getElementById('ns-time');
|
||||
const badgeEl = document.getElementById('ns-badge');
|
||||
|
|
@ -1389,7 +1392,7 @@ function renderNewsSummary(summaries) {
|
|||
return;
|
||||
}
|
||||
const s = summaries[0];
|
||||
badgeEl.textContent = 'LATEST';
|
||||
badgeEl.textContent = isRecap || s.kind === 'daily_recap' ? 'DAILY RECAP' : 'LATEST';
|
||||
timeEl.textContent = s.batch_timestamp ? 'Batch: ' + new Date(s.batch_timestamp).toLocaleString() : '—';
|
||||
bodyEl.innerHTML = newsSimpleMD(s.summary_text || '');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue