feat(agent-office): InstaAgent collect_trends action + preferences-aware on_schedule

This commit is contained in:
2026-05-16 17:57:44 +09:00
parent 41225b3337
commit 86694ae4fe
3 changed files with 116 additions and 0 deletions

View File

@@ -56,6 +56,8 @@ class InstaAgent(BaseAgent):
requires_approval=False)
await self.transition("working", "뉴스 수집·키워드 추출", task_id)
try:
prefs = await service_proxy.insta_get_preferences()
add_log(self.agent_id, f"insta preferences: {prefs}", "info", task_id)
await self._run_collect_and_extract()
kws = await service_proxy.insta_list_keywords(used=False)
if auto_select:
@@ -147,6 +149,12 @@ class InstaAgent(BaseAgent):
return {"ok": False, "message": "keyword_id 필수"}
await self._render_and_push(kid)
return {"ok": True}
if command == "collect_trends":
await messaging.send_raw("🌐 외부 트렌드 수집 시작")
created = await service_proxy.insta_collect_trends()
st = await self._wait_task(created["task_id"], step="trends_collect", timeout_sec=300)
await messaging.send_raw(f"✅ 트렌드 수집 완료: {st.get('message', '')}")
return {"ok": True, "result": st}
return {"ok": False, "message": f"Unknown command: {command}"}
async def on_callback(self, action: str, params: dict) -> dict: