diff --git a/src/api.js b/src/api.js index 253c078..45bf42b 100644 --- a/src/api.js +++ b/src/api.js @@ -601,3 +601,28 @@ export const getAgentStates = () => apiGet('/api/agent-office/state export const getActivityFeed = (limit=50, offset=0) => apiGet(`/api/agent-office/activity?limit=${limit}&offset=${offset}`); export const getAgentTokenUsage = (id, days=1) => apiGet(`/api/agent-office/agents/${id}/token-usage?days=${days}`); +// --- Lotto Briefing --- + +export async function getLatestBriefing() { + const r = await fetch('/api/lotto/briefing/latest'); + if (r.status === 404) return null; + if (!r.ok) throw new Error(`briefing fetch failed: ${r.status}`); + return r.json(); +} + +export async function getCuratorUsage(days = 30) { + const r = await fetch(`/api/lotto/curator/usage?days=${days}`); + if (!r.ok) throw new Error(`usage fetch failed: ${r.status}`); + return r.json(); +} + +export async function triggerLottoCurate() { + const r = await fetch('/api/agent-office/command', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ agent: 'lotto', action: 'curate_now', params: {} }), + }); + if (!r.ok) throw new Error(`curate trigger failed: ${r.status}`); + return r.json(); +} +