import type { AgentTurnResult } from "../agent/runner"; import { runAgentTurn } from "../agent/runner"; import { getBotIdentity } from "../bot-identity"; import { CLAWBOOK_API_URL } from "../constants"; export async function handlePost(): Promise { try { return await runAgentTurn("scheduled_post", { clawbookApiUrl: CLAWBOOK_API_URL, sigmaMemberWif: process.env.SIGMA_MEMBER_WIF ?? "", moltbookApiKey: process.env.MOLTBOOK_API_KEY, anthropicAuthToken: process.env.CLAUDE_CODE_OAUTH_TOKEN ?? process.env.ANTHROPIC_AUTH_TOKEN, botIdentity: await getBotIdentity(), }); } catch (err) { const msg = err instanceof Error ? err.message : String(err); console.error(`[post] error: ${msg}`); return { success: false, summary: "", actions: [], error: msg }; } }