From 1344967118daad716ef99a313212ae4cda89fd5c Mon Sep 17 00:00:00 2001 From: gahusb Date: Wed, 15 Apr 2026 08:30:33 +0900 Subject: [PATCH] =?UTF-8?q?feat(lotto):=20=EB=B8=8C=EB=A6=AC=ED=95=91?= =?UTF-8?q?=C2=B7=ED=81=90=EB=A0=88=EC=9D=B4=ED=84=B0=20API=20=ED=97=AC?= =?UTF-8?q?=ED=8D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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(); +} +