{"openapi":"3.1.0","info":{"title":"citizen-game MVP","description":"古典文明世界 / 多 polis / 人类玩家与 AI 公民共治 (D-21 账号统一框架,D-22 MVP 5-7 月)","version":"0.1.0"},"paths":{"/register":{"get":{"tags":["register"],"summary":"Register Form","description":"GET 注册表单。M7:若已有亡故玩家,顶部提示承袭路径。","operationId":"register_form_register_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["register"],"summary":"Register Submit","description":"POST 注册。校验通过后落库 + 跳 dashboard。","operationId":"register_submit_register_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_register_submit_register_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}":{"get":{"tags":["register"],"summary":"Agent Dashboard","description":"GET 角色卡 + dashboard(含昨日 events 摘要)。","operationId":"agent_dashboard_agent__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/plan":{"get":{"tags":["plan"],"summary":"Plan Form","description":"当日 plan 表单。","operationId":"plan_form_agent__account_id__plan_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["plan"],"summary":"Plan Submit","description":"提交 plan + schema 校验 + 落库。","operationId":"plan_submit_agent__account_id__plan_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_plan_submit_agent__account_id__plan_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/plan/draft":{"get":{"tags":["plan"],"summary":"Plan Draft","description":"M8 反馈 §4.6:返 plan 草稿 JSON,供 plan.html JS 填表单。\n\nresponse body:\n    {\n      \"main_intent\": str,\n      \"morning\": str, \"noon\": str, \"afternoon\": str, \"evening\": str,\n      \"key_relationships_today\": list[str],\n    }\n\n400  — action 不在 ACTION_KEYS\n404  — 公民不存在\n200  — 即使该 action 不适用(返 {\"main_intent\": \"\"} 兜底)","operationId":"plan_draft_agent__account_id__plan_draft_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"action","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":32,"title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/plan/{day}":{"get":{"tags":["plan"],"summary":"Plan View","description":"查看历史某日 plan(只读)。","operationId":"plan_view_agent__account_id__plan__day__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"day","in":"path","required":true,"schema":{"type":"integer","title":"Day"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world":{"get":{"tags":["world"],"summary":"World Overview","description":"世界概览。\n\njob_id / job_status:从 POST /world/tick 重定向带过来,\nUI 用 JS 轮询 /world/tick_status/{job_id} 显示进度。","operationId":"world_overview_world_get","parameters":[{"name":"job_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Job Id"}},{"name":"job_status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Job Status"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/seed/{polis_id}":{"post":{"tags":["world"],"summary":"Seed Polis Npcs","description":"为某 polis 创建 N 个 NPC(同步 LLM 调用,4 个 ~ 8-15s 并发)。","operationId":"seed_polis_npcs_world_seed__polis_id__post","parameters":[{"name":"polis_id","in":"path","required":true,"schema":{"type":"string","title":"Polis Id"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_seed_polis_npcs_world_seed__polis_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/tick":{"post":{"tags":["world"],"summary":"Tick One Day","description":"提交一个 tick job 到后台 worker → 立即 303 跳到结算页或 /world?job_id=xxx。\n\nM1 perf 重构 + M7 试玩模式 + M9 多玩家跳结算修复:\n- play_speed: normal / playtest / fast 三档(见 resolve_tick_params)\n- settle_account_id: 玩家从角色卡推进时透传,tick 完成后跳该玩家的 settle\n  (M9 P0-3 修复:旧实现仅在数据库恰好 1 个 human_direct 时跳 settle,\n   多玩家时回退 /world,玩家看不到自己的结算)\n- 提交后立即返回 303,UI 轮询 /world/tick_status/{job_id}\n- 同一时刻只跑 1 个 tick(线程池 max_workers=1 + DB 幂等保护)\n- 重复 POST 时若已有 running job → 返回相同 job_id(busy)","operationId":"tick_one_day_world_tick_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_tick_one_day_world_tick_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/tick_status/{job_id}":{"get":{"tags":["world"],"summary":"Tick Status","description":"JSON 轮询接口:返回 job 状态(UI 用 fetch 轮询)。","operationId":"tick_status_world_tick_status__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/dialogues":{"get":{"tags":["world"],"summary":"World Dialogues","description":"全局对话历史(NPC↔NPC + 玩家相关)— 让玩家看到 NPC 间的剧情。","operationId":"world_dialogues_world_dialogues_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/world/assemblies":{"get":{"tags":["world"],"summary":"World Assemblies","description":"议会历史 — 从 world_event 表过滤 proposal_resolved / proposal_submitted。","operationId":"world_assemblies_world_assemblies_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/world/news":{"get":{"tags":["world"],"summary":"World News","description":"日报:M7\"人物故事卡 + 5 focus\"视图(D-23 新闻 view layer)。\n\nfocus(默认 me 若有 account_id,否则 world):\n  - me      = 与我有关(actor=account_id 或 affected 含 account_id)\n  - polis   = 本邦大事(importance >= 5,actor / affected 涉本邦)\n  - world   = 天下大事(importance >= 7)\n  - market  = 市场变化\n  - gossip  = 人物八卦(婚 / 嗣 / 殁 / 承诺 / 选举 / 漂移 / 贿)\n\nraw=1 → 回退原始 6 子系统分类(M6 旧版,内部仍计算用于 LLM 摘要)","operationId":"world_news_world_news_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}},{"name":"polis_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Polis Id"}},{"name":"with_summary","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"With Summary"}},{"name":"focus","in":"query","required":false,"schema":{"type":"string","default":"","title":"Focus"}},{"name":"account_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Account Id"}},{"name":"raw","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Raw"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/alliances/dissolve/{alliance_id}":{"post":{"tags":["world"],"summary":"World Alliance Dissolve","description":"玩家手动解散一个联盟(MVP-21)。","operationId":"world_alliance_dissolve_world_alliances_dissolve__alliance_id__post","parameters":[{"name":"alliance_id","in":"path","required":true,"schema":{"type":"string","title":"Alliance Id"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_world_alliance_dissolve_world_alliances_dissolve__alliance_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/alliances":{"get":{"tags":["world"],"summary":"World Alliances","description":"联盟列表(MVP-21):列出所有 active alliances + 历史 dissolved。","operationId":"world_alliances_world_alliances_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/world/snapshots":{"get":{"tags":["world"],"summary":"World Snapshots","description":"检查点列表(M1):tick 前自动 snapshot,玩家可一键回退。","operationId":"world_snapshots_world_snapshots_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/world/snapshots/restore/{snapshot_id}":{"post":{"tags":["world"],"summary":"World Snapshot Restore","description":"一键回退到指定 snapshot。","operationId":"world_snapshot_restore_world_snapshots_restore__snapshot_id__post","parameters":[{"name":"snapshot_id","in":"path","required":true,"schema":{"type":"string","title":"Snapshot Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/snapshots/manual":{"post":{"tags":["world"],"summary":"World Snapshot Manual","description":"手动创建一个 snapshot(玩家在关键节点之前自定义存档)。","operationId":"world_snapshot_manual_world_snapshots_manual_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/world/market":{"get":{"tags":["world"],"summary":"World Market","description":"市场订单簿(M3 MVP-25 / MVP-26)。\n\npolis_id=\"\":列出所有 polis 的 open 挂单(分组显示)\npolis_id=\"polis_x\":只显示该邦","operationId":"world_market_world_market_get","parameters":[{"name":"polis_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Polis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/recent_events":{"get":{"tags":["world"],"summary":"Recent Events","description":"最近 N 天 event 流(默认 7)。","operationId":"recent_events_world_recent_events_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":30,"minimum":1,"default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dialogue/{account_id}":{"get":{"tags":["dialogue"],"summary":"Inbox","description":"收件箱:我发出 + 我收到(按 status 分组)。","operationId":"inbox_dialogue__account_id__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dialogue/{account_id}/invite":{"get":{"tags":["dialogue"],"summary":"Invite Form","description":"发邀请表单。可选目标 = 同 polis 其他 agent(简化)。","operationId":"invite_form_dialogue__account_id__invite_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"recipient","in":"query","required":false,"schema":{"type":"string","default":"","title":"Recipient"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["dialogue"],"summary":"Invite Submit","description":"玩家发起邀请 → 同步调 NPC.respond_to_invitation → 落 ORM。","operationId":"invite_submit_dialogue__account_id__invite_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_invite_submit_dialogue__account_id__invite_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dialogue/session/{dialogue_id}":{"get":{"tags":["dialogue"],"summary":"Session Detail","description":"单条对话详情(含 transcript + 输入框 if active)。\n\nM3 多玩家私聊:\n- 若双 human_direct,viewer query param 用于显示\"我\"对应的发言。\n- 任一玩家访问 → 都能 submit 发言(不强制轮换)。","operationId":"session_detail_dialogue_session__dialogue_id__get","parameters":[{"name":"dialogue_id","in":"path","required":true,"schema":{"type":"string","title":"Dialogue Id"}},{"name":"viewer","in":"query","required":false,"schema":{"type":"string","default":"","title":"Viewer"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dialogue/session/{dialogue_id}/respond":{"post":{"tags":["dialogue"],"summary":"Session Respond","description":"玩家手动响应 NPC 主动发起的邀请(对应 NPC↔玩家 dialogue,status=pending)。","operationId":"session_respond_dialogue_session__dialogue_id__respond_post","parameters":[{"name":"dialogue_id","in":"path","required":true,"schema":{"type":"string","title":"Dialogue Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_session_respond_dialogue_session__dialogue_id__respond_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dialogue/session/{dialogue_id}/say":{"post":{"tags":["dialogue"],"summary":"Session Say","description":"玩家提交 1 轮发言 → NPC LLM 回 1 轮 → 视情况触发 close。","operationId":"session_say_dialogue_session__dialogue_id__say_post","parameters":[{"name":"dialogue_id","in":"path","required":true,"schema":{"type":"string","title":"Dialogue Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_session_say_dialogue_session__dialogue_id__say_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/propose":{"get":{"tags":["proposal"],"summary":"Propose Form","description":"GET 提案表单。","operationId":"propose_form_agent__account_id__propose_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["proposal"],"summary":"Propose Submit","description":"POST 创建提案 → 落 ORM → 跳 dashboard。","operationId":"propose_submit_agent__account_id__propose_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_propose_submit_agent__account_id__propose_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/vote":{"get":{"tags":["proposal"],"summary":"Vote List","description":"列出本邦待投票提案。","operationId":"vote_list_agent__account_id__vote_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/vote/{proposal_id}":{"post":{"tags":["proposal"],"summary":"Vote Cast","description":"玩家手动投票 → 写 ProposalRow.votes_json[account_id]=decision。","operationId":"vote_cast_agent__account_id__vote__proposal_id__post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"proposal_id","in":"path","required":true,"schema":{"type":"string","title":"Proposal Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_vote_cast_agent__account_id__vote__proposal_id__post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime":{"get":{"tags":["wartime"],"summary":"Wartime Menu","description":"战时玩家行动菜单。无 active_war 显示和平期文案。","operationId":"wartime_menu_agent__account_id__wartime_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/enlist":{"post":{"tags":["wartime"],"summary":"Wartime Enlist","description":"玩家从军 → state.military_role=\"soldier\" + player_enlisted event。\n\n约束:\n- 必须有 active_war\n- 玩家邦必须是交战方(attacker / defender;neutral 不可)\n- 已是 soldier 时 400","operationId":"wartime_enlist_agent__account_id__wartime_enlist_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/supply":{"post":{"tags":["wartime"],"summary":"Wartime Supply","description":"玩家报名战时供应商 → state.wealth += 50 + wartime_supply_signed event。\n\n约束:\n- state.wartime_mode 必须 True(只有动员 / 交锋期推进到 wartime_mode 才算战时供应窗口)\n- 每天最多 1 次(查 wartime_supply_signed event 判)","operationId":"wartime_supply_agent__account_id__wartime_supply_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/embargo":{"post":{"tags":["wartime"],"summary":"Wartime Embargo","description":"玩家提议对敌方贸易禁令 → trade_embargo_proposed event。\n\nM1 简化:不入议会(不创建 ProposalRow),仅产 event 记录玩家立场宣告,\n供 NPC 反思阶段引用 / 影响印象分。\n\n约束:\n- 必须有 active_war\n- 玩家邦必须是交战方(neutral 不可,因无明确\"敌方\")","operationId":"wartime_embargo_agent__account_id__wartime_embargo_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/parley":{"post":{"tags":["wartime"],"summary":"Wartime Parley","description":"我邦请和(发起 parley)。\n\n约束:\n- 必须 active_war\n- 玩家邦必须是交战方\n- 已存在挂起求和(parley_proposed_by ∈ {self / 对方 / mutual})视情况:\n    * mutual:已双方同意 → 400(无需再发)\n    * 对方挂起 → 400(应去 parley_respond)\n    * 本邦挂起 → 400(已发,等对方)","operationId":"wartime_parley_agent__account_id__wartime_parley_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/parley_respond":{"post":{"tags":["wartime"],"summary":"Wartime Parley Respond","description":"我邦响应对方求和。decision: \"accept\" / \"decline\"。\n\n约束:\n- 必须 active_war\n- 必须有挂起求和,且发起方 != 本邦 != \"mutual\"","operationId":"wartime_parley_respond_agent__account_id__wartime_parley_respond_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_wartime_parley_respond_agent__account_id__wartime_parley_respond_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/desert":{"post":{"tags":["wartime"],"summary":"Wartime Desert","description":"解甲归田 — 清 state.military_role,产 player_deserted event。\n\n约束:\n- 必须当前是 soldier(军籍存在才有\"退\"可言)","operationId":"wartime_desert_agent__account_id__wartime_desert_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/wartime/battle_decision":{"get":{"tags":["wartime"],"summary":"Wartime Battle Decision Get","description":"决战方略选择页(GET 显示选项)。\n\n仅 clashing 阶段且本邦交战方时显示完整选项;否则显示提示。","operationId":"wartime_battle_decision_get_agent__account_id__wartime_battle_decision_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["wartime"],"summary":"Wartime Battle Decision Post","description":"提交决战方略 — 仅产 player_battle_decision event。\n\n约束:\n- active_war 且 phase=clashing\n- 玩家邦交战方\n- strategy ∈ aggressive/defensive/withdraw/parley\n- aggression ∈ cautious/balanced/aggressive","operationId":"wartime_battle_decision_post_agent__account_id__wartime_battle_decision_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_wartime_battle_decision_post_agent__account_id__wartime_battle_decision_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/wartime/casualties":{"get":{"tags":["wartime"],"summary":"World Wartime Casualties","description":"伤亡名册:本场战争(若存在)已死的具体 NPC 名字 + day + 来自哪邦。\n\n数据源:WorldEvent 中 event_type=npc_died 且 related_action_id=war_id 的行;\n名字从 Account.name 反查(payload 内只存 polis / profession)。","operationId":"world_wartime_casualties_world_wartime_casualties_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/agent/{account_id}/espionage":{"get":{"tags":["espionage"],"summary":"Espionage Home","description":"暗中行事主页:已发 / 已收贿赂 + 我邦近期已暴露的间谍 / 贿赂事件。","operationId":"espionage_home_agent__account_id__espionage_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/espionage/offer":{"post":{"tags":["espionage"],"summary":"Espionage Offer","description":"提议贿赂 → 落 BribeRow status=pending + bribe_offered event。\n\n校验:\n- target_id 不存在 → 404\n- amount <= 0 → 400\n- 不能贿赂自己 → 400\n- intent 长度 5-200 → 400\n- briber 余金不足以备付 → 400(只校验,不预扣;真扣在接受时)","operationId":"espionage_offer_agent__account_id__espionage_offer_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_espionage_offer_agent__account_id__espionage_offer_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/espionage/respond":{"post":{"tags":["espionage"],"summary":"Espionage Respond","description":"target 决策 accept / reject / report。\n\naccept:转钱(若 briber 资金不足 → status=failed_insufficient,不转)+ 双方印象 +\n        随机判定暴露(BRIBE_EXPOSURE_BASE_RATE),暴露则 bribe_exposed event。\nreject:无金钱流动 + briber 对 target 印象 -;status=rejected。\nreport:无金钱 + briber 印象大跌(-30)+ bribe_reported(importance=8 丑闻);\n        status=reported,exposed=True。\n\n校验:\n  - bribe 不存在 → 404\n  - bribe.target != account_id → 403(只能处理收到的)\n  - bribe.status != pending → 400(已处理)\n  - decision 不在 (accept / reject / report) → 400","operationId":"espionage_respond_agent__account_id__espionage_respond_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_espionage_respond_agent__account_id__espionage_respond_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy":{"get":{"tags":["economy"],"summary":"Economy Home","description":"经济主页:概览 + 借贷 + 契约 + 已挂订单 + 捐税。","operationId":"economy_home_agent__account_id__economy_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"flash","in":"query","required":false,"schema":{"type":"string","default":"","title":"Flash"}},{"name":"error","in":"query","required":false,"schema":{"type":"string","default":"","title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy/loan/issue":{"post":{"tags":["economy"],"summary":"Loan Issue","description":"玩家以自己为债权人(lender)发起一笔放款给 borrower_id。\n\n校验:\n  - borrower 存在\n  - borrower != self\n  - amount > 0,wealth 足够\n  - LOAN_RATE_MIN ≤ rate ≤ LOAN_RATE_MAX\n  - duration > 0","operationId":"loan_issue_agent__account_id__economy_loan_issue_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_loan_issue_agent__account_id__economy_loan_issue_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy/loan/repay":{"post":{"tags":["economy"],"summary":"Loan Repay","description":"玩家以自己为债务人偿还指定借贷。\n\n校验:\n  - loan 存在 + status='active' + borrower=self\n  - 资金足够 = repaid;不足 = defaulted(状态写回,一并入账)","operationId":"loan_repay_agent__account_id__economy_loan_repay_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_loan_repay_agent__account_id__economy_loan_repay_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy/contract/sign":{"post":{"tags":["economy"],"summary":"Contract Sign","description":"玩家发起立约。role=buyer 表示我作为买方,seller 表示我作为卖方。\n\n驱动逻辑:contract 入 ORM,driver 在每日 tick 调 execute_contract_day 履约。","operationId":"contract_sign_agent__account_id__economy_contract_sign_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_contract_sign_agent__account_id__economy_contract_sign_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy/order/post":{"post":{"tags":["economy"],"summary":"Order Post","description":"主动挂市(玩家自挂):\n  - sell:挂卖单 → 锁库存,落 MarketOrderRow(status=open,seller=self)\n  - buy:挂买单 → 锁定资金 = qty × price_per_unit(从 wealth 扣留作担保),\n                  落 MarketOrderRow(status=open,seller=self,但 resource 标 buy)\n                  — M6++ 简化:复用 MarketOrder 行,但把 buy 也挂同表;\n                  现网撮合默认只读 sell 单,所以\"买单\"暂作为玩家持仓视图,\n                  driver / 撮合还认 sell。M7 起加 buy 单撮合(占位)。\n\nM6++ 简化:为了 RYO 主动挂市的玩家体验,先支持 sell(立刻闭环),\nbuy 走\"挂市等卖家\"语义但暂不撮合(挂上去就当广告板)。","operationId":"order_post_agent__account_id__economy_order_post_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_order_post_agent__account_id__economy_order_post_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy/order/cancel":{"post":{"tags":["economy"],"summary":"Order Cancel","description":"撤回未成交的挂单:status open → cancelled,sell 单库存归还。","operationId":"order_cancel_agent__account_id__economy_order_cancel_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_order_cancel_agent__account_id__economy_order_cancel_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/economy/tax_history":{"get":{"tags":["economy"],"summary":"Tax History","description":"捐税明细页:从 world_event 流过滤 event_type=tax_paid 且 actor=self。","operationId":"tax_history_agent__account_id__economy_tax_history_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/election":{"get":{"tags":["political"],"summary":"Election Status","description":"选举状态页:本邦当前 active 选举 / 候选人 / 我是否候选 / 联署票。\n\n若本邦无 active 选举,显示\"下次议会日 day X 自动开选\"提示,\n并提供\"出而竞选\"按钮(POST register 时即时建 stub)。","operationId":"election_status_agent__account_id__election_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/election/register":{"post":{"tags":["political"],"summary":"Election Register","description":"出而竞选:本邦 active 选举提名期内报名。\n\n约束:\n  - 提名期内(status=nominating)\n  - 未已注册\n  - 必须本邦公民(account.polis_id == election.polis_id;路由强制\n    从 account.polis_id 读,不接受外邦)","operationId":"election_register_agent__account_id__election_register_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/election/withdraw":{"post":{"tags":["political"],"summary":"Election Withdraw","description":"退避(退出候选)。仅提名期内。","operationId":"election_withdraw_agent__account_id__election_withdraw_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/election/endorse":{"post":{"tags":["political"],"summary":"Election Endorse","description":"联署支持(拉票)某候选人。\n\n约束:\n  - 本邦 active 选举(nominating / voting 都可)\n  - candidate_id 在 candidates 列表内\n  - 不能联署自己\n  - 同 endorser 再次 endorse 覆盖(改主意)","operationId":"election_endorse_agent__account_id__election_endorse_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_election_endorse_agent__account_id__election_endorse_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/speech":{"get":{"tags":["political"],"summary":"Speech Main","description":"议堂演说主页:我历史演说 + 议会日发表表单。\n\n若当日非议会日,显示\"下次议会日 day X\"提示,表单仍可填但 POST 会 400。\npending 提案列表(本邦)供选填 target_proposal_id。","operationId":"speech_main_agent__account_id__speech_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/speech/post":{"post":{"tags":["political"],"summary":"Speech Post","description":"议会日发表演说。\n\n约束:\n  - 当日须是议会日(world.yaml clock.assembly_days)\n  - text 长度 20-600 字\n  - target_proposal_id(可选)若给,须是本邦 pending 提案","operationId":"speech_post_agent__account_id__speech_post_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_speech_post_agent__account_id__speech_post_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/elections":{"get":{"tags":["political"],"summary":"World Elections","description":"全部选举编年:各邦历次选举 + 当选人。","operationId":"world_elections_world_elections_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/agent/{account_id}/drift":{"get":{"tags":["persona"],"summary":"Drift Page","description":"心性变迁:列出 profile_snapshot 表里所有快照,玩家自己看演化轨迹。\n\n若无快照(刚注册 / 没跑过 reflect),展示当前 personality/values 一行 + 提示。","operationId":"drift_page_agent__account_id__drift_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/lineage":{"get":{"tags":["persona"],"summary":"Lineage Page","description":"家谱:向上追祖(account.lineage 列出的祖先链)+ 向下看后代。\n\n向下:扫 world.accounts,凡 lineage 包含本人 account_id 的都是后代。","operationId":"lineage_page_agent__account_id__lineage_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/will":{"get":{"tags":["persona"],"summary":"Will Form","operationId":"will_form_agent__account_id__will_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["persona"],"summary":"Will Submit","description":"立 / 改遗嘱(upsert by account_id)。\n\n所有字段可选:\n  - target_heir(account_id 字符串,目前仅作记录;create_heir 不强绑)\n  - message(留给后人的话,会拼到 heir.long_term)\n  - preferred_profession(子嗣职业,若不在白名单则忽略)","operationId":"will_submit_agent__account_id__will_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_will_submit_agent__account_id__will_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/memory":{"get":{"tags":["persona"],"summary":"Memory Page","description":"完整长期记忆 + 印象列表 + 关系列表。","operationId":"memory_page_agent__account_id__memory_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/world/disasters":{"get":{"tags":["disaster"],"summary":"World Disasters","operationId":"world_disasters_world_disasters_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/agent/{account_id}/marriage":{"get":{"tags":["marriage"],"summary":"Marriage Page","operationId":"marriage_page_agent__account_id__marriage_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/marriage/propose":{"post":{"tags":["marriage"],"summary":"Marriage Propose","description":"求婚:校验后委托 marriage 子系统。\n\n校验:\n  - 自己不存在 → 404\n  - target 不存在 → 404\n  - 自婚自 → 400\n  - 已婚 / target 已婚 → 400\n  - 不存活 → 400","operationId":"marriage_propose_agent__account_id__marriage_propose_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_marriage_propose_agent__account_id__marriage_propose_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/marriage/respond":{"post":{"tags":["marriage"],"summary":"Marriage Respond","description":"应允或拒绝求婚。\n\ndecision ∈ {\"accept\", \"reject\"}。\n- accept → 调 respond_marriage(accept=True),后端创建 Marriage 行 + 印象 +30\n- reject → 调 respond_marriage(accept=False),后端打事件 + 印象 -10","operationId":"marriage_respond_agent__account_id__marriage_respond_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_marriage_respond_agent__account_id__marriage_respond_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/family":{"get":{"tags":["marriage"],"summary":"Family Page","description":"完整家族(横向亲属):配偶 + 父母 + 兄弟姐妹 + 子女(+ 简介)。\n\n与 lineage.html 互补:lineage 看祖孙线(纵深),family 看横向亲属一览。","operationId":"family_page_agent__account_id__family_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/help":{"get":{"summary":"Help Overview","operationId":"help_overview_help_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/character":{"get":{"summary":"Help Character","operationId":"help_character_help_character_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/economy":{"get":{"summary":"Help Economy","operationId":"help_economy_help_economy_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/social":{"get":{"summary":"Help Social","operationId":"help_social_help_social_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/politics":{"get":{"summary":"Help Politics","operationId":"help_politics_help_politics_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/family":{"get":{"summary":"Help Family","operationId":"help_family_help_family_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/war":{"get":{"summary":"Help War","operationId":"help_war_help_war_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/special":{"get":{"summary":"Help Special","operationId":"help_special_help_special_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/help/glossary":{"get":{"summary":"Help Glossary","operationId":"help_glossary_help_glossary_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/agent/{account_id}/settle":{"get":{"tags":["settle"],"summary":"Settle Latest","description":"最新一日结算页 — 若无快照(未 tick 过)显示 placeholder。\n\nM11 §11(P0-4):若 query param job_id 指向 running/queued job,\n模板顶部显示等待卡 + JS 轮询;完成后 reload。","operationId":"settle_latest_agent__account_id__settle_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"job_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/settle/{game_day}":{"get":{"tags":["settle"],"summary":"Settle For Day","description":"历史某日结算 — 回看用。","operationId":"settle_for_day_agent__account_id__settle__game_day__get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"game_day","in":"path","required":true,"schema":{"type":"integer","title":"Game Day"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/goals":{"get":{"tags":["goals"],"summary":"Goals Page","description":"目标主页:渲染三层 tree。","operationId":"goals_page_agent__account_id__goals_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/goals/new":{"post":{"tags":["goals"],"summary":"Goals New","description":"玩家手动加一个 L2 中期目标。","operationId":"goals_new_agent__account_id__goals_new_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_goals_new_agent__account_id__goals_new_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/goals/{goal_id}/update":{"post":{"tags":["goals"],"summary":"Goals Update","description":"改进度 / 标完成 / 弃置 / 删除。","operationId":"goals_update_agent__account_id__goals__goal_id__update_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"goal_id","in":"path","required":true,"schema":{"type":"string","title":"Goal Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_goals_update_agent__account_id__goals__goal_id__update_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/goals/seed":{"post":{"tags":["goals"],"summary":"Goals Seed","description":"M9 P2-1:接受所有职业推荐目标 → 批量写入 GoalRecordRow。\n\n幂等保护:若玩家已有任何 medium goal(active / done / abandoned),\n不重复写入(避免误点反复弹推荐 → 反复入库)。","operationId":"goals_seed_agent__account_id__goals_seed_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/goals/long_term":{"post":{"tags":["goals"],"summary":"Goals Long Term Update","description":"玩家改长期目标(罕见,需 confirm=yes)。","operationId":"goals_long_term_update_agent__account_id__goals_long_term_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_goals_long_term_update_agent__account_id__goals_long_term_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/opportunities":{"get":{"tags":["opportunities"],"summary":"Opportunities Index","description":"今日机会卡主页:展示 pending(可选)+ 历史(已选 / 已忽略 / 已过期)。","operationId":"opportunities_index_agent__account_id__opportunities_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/opportunities/{card_id}/choose":{"post":{"tags":["opportunities"],"summary":"Choose Card","description":"选一张卡的 action_idx。\n\n- 若 action.intent_text 非空 → 卡 accepted,intent 注入今日 plan / goals\n- 若 intent_text 为空(忽略按钮)→ 卡 ignored,无 intent 注入","operationId":"choose_card_agent__account_id__opportunities__card_id__choose_post","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}},{"name":"card_id","in":"path","required":true,"schema":{"type":"string","title":"Card Id"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_choose_card_agent__account_id__opportunities__card_id__choose_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/relationships":{"get":{"tags":["relationships"],"summary":"Relationships View","description":"8 关系桶可视化。","operationId":"relationships_view_agent__account_id__relationships_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/agent/{account_id}/progress":{"get":{"tags":["relationships"],"summary":"Progress View","description":"5 大成长指标。","operationId":"progress_view_agent__account_id__progress_get","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string","title":"Account Id"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Healthz","description":"LB / 启动验证 — 极简,不查 DB / 不查 LLM。","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/":{"get":{"summary":"Index","description":"玩家面 landing 页 — 介绍世界 + 入世入口。","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/dev":{"get":{"summary":"Dev Panel","description":"开发面板 — 项目信息 / 技术栈 / API / 已实装清单。\n从 / 抽出来,玩家面保持纯净。","operationId":"dev_panel_dev_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"Body_choose_card_agent__account_id__opportunities__card_id__choose_post":{"properties":{"action_idx":{"type":"integer","title":"Action Idx"}},"type":"object","required":["action_idx"],"title":"Body_choose_card_agent__account_id__opportunities__card_id__choose_post"},"Body_contract_sign_agent__account_id__economy_contract_sign_post":{"properties":{"other_id":{"type":"string","title":"Other Id"},"role":{"type":"string","title":"Role"},"resource":{"type":"string","title":"Resource"},"qty_per_period":{"type":"integer","title":"Qty Per Period"},"price_per_unit":{"type":"number","title":"Price Per Unit"},"duration_days":{"type":"integer","title":"Duration Days"}},"type":"object","required":["other_id","role","resource","qty_per_period","price_per_unit","duration_days"],"title":"Body_contract_sign_agent__account_id__economy_contract_sign_post"},"Body_election_endorse_agent__account_id__election_endorse_post":{"properties":{"candidate_id":{"type":"string","title":"Candidate Id"}},"type":"object","required":["candidate_id"],"title":"Body_election_endorse_agent__account_id__election_endorse_post"},"Body_espionage_offer_agent__account_id__espionage_offer_post":{"properties":{"target_id":{"type":"string","title":"Target Id"},"amount":{"type":"integer","title":"Amount"},"intent":{"type":"string","title":"Intent"}},"type":"object","required":["target_id","amount","intent"],"title":"Body_espionage_offer_agent__account_id__espionage_offer_post"},"Body_espionage_respond_agent__account_id__espionage_respond_post":{"properties":{"bribe_id":{"type":"string","title":"Bribe Id"},"decision":{"type":"string","title":"Decision"}},"type":"object","required":["bribe_id","decision"],"title":"Body_espionage_respond_agent__account_id__espionage_respond_post"},"Body_goals_long_term_update_agent__account_id__goals_long_term_post":{"properties":{"new_long_term":{"type":"string","title":"New Long Term"},"confirm":{"type":"string","title":"Confirm","default":""}},"type":"object","required":["new_long_term"],"title":"Body_goals_long_term_update_agent__account_id__goals_long_term_post"},"Body_goals_new_agent__account_id__goals_new_post":{"properties":{"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description","default":""},"target_metric":{"type":"string","title":"Target Metric","default":""},"target_value":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Target Value"},"duration_days":{"type":"integer","title":"Duration Days","default":30},"reward_text":{"type":"string","title":"Reward Text","default":""},"failure_condition":{"type":"string","title":"Failure Condition","default":""}},"type":"object","required":["title"],"title":"Body_goals_new_agent__account_id__goals_new_post"},"Body_goals_update_agent__account_id__goals__goal_id__update_post":{"properties":{"action":{"type":"string","title":"Action"},"progress":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Progress"},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["action"],"title":"Body_goals_update_agent__account_id__goals__goal_id__update_post"},"Body_invite_submit_dialogue__account_id__invite_post":{"properties":{"target":{"type":"string","title":"Target"},"topic":{"type":"string","title":"Topic"},"purpose":{"type":"string","maxLength":100,"minLength":5,"title":"Purpose"},"invitation_text":{"type":"string","maxLength":200,"minLength":10,"title":"Invitation Text"}},"type":"object","required":["target","topic","purpose","invitation_text"],"title":"Body_invite_submit_dialogue__account_id__invite_post"},"Body_loan_issue_agent__account_id__economy_loan_issue_post":{"properties":{"borrower_id":{"type":"string","title":"Borrower Id"},"amount":{"type":"integer","title":"Amount"},"annual_rate":{"type":"number","title":"Annual Rate"},"duration_days":{"type":"integer","title":"Duration Days"}},"type":"object","required":["borrower_id","amount","annual_rate","duration_days"],"title":"Body_loan_issue_agent__account_id__economy_loan_issue_post"},"Body_loan_repay_agent__account_id__economy_loan_repay_post":{"properties":{"loan_id":{"type":"string","title":"Loan Id"}},"type":"object","required":["loan_id"],"title":"Body_loan_repay_agent__account_id__economy_loan_repay_post"},"Body_marriage_propose_agent__account_id__marriage_propose_post":{"properties":{"target_id":{"type":"string","title":"Target Id","default":""}},"type":"object","title":"Body_marriage_propose_agent__account_id__marriage_propose_post"},"Body_marriage_respond_agent__account_id__marriage_respond_post":{"properties":{"proposal_id":{"type":"string","title":"Proposal Id","default":""},"decision":{"type":"string","title":"Decision","default":""}},"type":"object","title":"Body_marriage_respond_agent__account_id__marriage_respond_post"},"Body_order_cancel_agent__account_id__economy_order_cancel_post":{"properties":{"order_id":{"type":"string","title":"Order Id"}},"type":"object","required":["order_id"],"title":"Body_order_cancel_agent__account_id__economy_order_cancel_post"},"Body_order_post_agent__account_id__economy_order_post_post":{"properties":{"action":{"type":"string","title":"Action"},"resource":{"type":"string","title":"Resource"},"qty":{"type":"integer","title":"Qty"},"price_per_unit":{"type":"number","title":"Price Per Unit"}},"type":"object","required":["action","resource","qty","price_per_unit"],"title":"Body_order_post_agent__account_id__economy_order_post_post"},"Body_plan_submit_agent__account_id__plan_post":{"properties":{"main_intent":{"type":"string","maxLength":200,"minLength":5,"title":"Main Intent"},"morning":{"type":"string","maxLength":200,"minLength":1,"title":"Morning"},"noon":{"type":"string","maxLength":200,"minLength":1,"title":"Noon"},"afternoon":{"type":"string","maxLength":200,"minLength":1,"title":"Afternoon"},"evening":{"type":"string","maxLength":200,"minLength":1,"title":"Evening"},"if1":{"type":"string","title":"If1","default":""},"then1":{"type":"string","title":"Then1","default":""},"if2":{"type":"string","title":"If2","default":""},"then2":{"type":"string","title":"Then2","default":""}},"type":"object","required":["main_intent","morning","noon","afternoon","evening"],"title":"Body_plan_submit_agent__account_id__plan_post"},"Body_propose_submit_agent__account_id__propose_post":{"properties":{"proposal_type":{"type":"string","title":"Proposal Type"},"proposal_text":{"type":"string","title":"Proposal Text"},"target_polis_for_war":{"type":"string","title":"Target Polis For War","default":""},"target_polis_for_alliance":{"type":"string","title":"Target Polis For Alliance","default":""},"alliance_purpose":{"type":"string","title":"Alliance Purpose","default":""},"target_alliance_id":{"type":"string","title":"Target Alliance Id","default":""}},"type":"object","required":["proposal_type","proposal_text"],"title":"Body_propose_submit_agent__account_id__propose_post"},"Body_register_submit_register_post":{"properties":{"username":{"type":"string","maxLength":64,"minLength":1,"title":"Username"},"polis_id":{"type":"string","title":"Polis Id"},"profession":{"type":"string","title":"Profession"},"long_term_goal":{"type":"string","maxLength":200,"minLength":3,"title":"Long Term Goal"},"birth_class":{"type":"string","title":"Birth Class"},"gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"},"agree_privacy":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agree Privacy"}},"type":"object","required":["username","polis_id","profession","long_term_goal","birth_class"],"title":"Body_register_submit_register_post"},"Body_seed_polis_npcs_world_seed__polis_id__post":{"properties":{"count":{"type":"integer","title":"Count","default":4}},"type":"object","title":"Body_seed_polis_npcs_world_seed__polis_id__post"},"Body_session_respond_dialogue_session__dialogue_id__respond_post":{"properties":{"decision":{"type":"string","title":"Decision"},"reasoning":{"type":"string","maxLength":300,"title":"Reasoning","default":""}},"type":"object","required":["decision"],"title":"Body_session_respond_dialogue_session__dialogue_id__respond_post"},"Body_session_say_dialogue_session__dialogue_id__say_post":{"properties":{"speaker":{"type":"string","title":"Speaker"},"content":{"type":"string","maxLength":400,"minLength":1,"title":"Content"},"want_to_close":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Want To Close"}},"type":"object","required":["speaker","content"],"title":"Body_session_say_dialogue_session__dialogue_id__say_post"},"Body_speech_post_agent__account_id__speech_post_post":{"properties":{"text":{"type":"string","title":"Text"},"target_proposal_id":{"type":"string","title":"Target Proposal Id","default":""}},"type":"object","required":["text"],"title":"Body_speech_post_agent__account_id__speech_post_post"},"Body_tick_one_day_world_tick_post":{"properties":{"redirect_to":{"type":"string","title":"Redirect To","default":"/world"},"play_speed":{"type":"string","title":"Play Speed","default":"normal"},"enable_reflection":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Enable Reflection"},"npc_dialogue_prob":{"type":"number","title":"Npc Dialogue Prob","default":0.3},"settle_account_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Settle Account Id"}},"type":"object","title":"Body_tick_one_day_world_tick_post"},"Body_vote_cast_agent__account_id__vote__proposal_id__post":{"properties":{"decision":{"type":"string","title":"Decision"}},"type":"object","required":["decision"],"title":"Body_vote_cast_agent__account_id__vote__proposal_id__post"},"Body_wartime_battle_decision_post_agent__account_id__wartime_battle_decision_post":{"properties":{"strategy":{"type":"string","title":"Strategy"},"aggression":{"type":"string","title":"Aggression","default":"balanced"}},"type":"object","required":["strategy"],"title":"Body_wartime_battle_decision_post_agent__account_id__wartime_battle_decision_post"},"Body_wartime_parley_respond_agent__account_id__wartime_parley_respond_post":{"properties":{"decision":{"type":"string","title":"Decision"}},"type":"object","required":["decision"],"title":"Body_wartime_parley_respond_agent__account_id__wartime_parley_respond_post"},"Body_will_submit_agent__account_id__will_post":{"properties":{"target_heir":{"type":"string","title":"Target Heir","default":""},"message":{"type":"string","title":"Message","default":""},"preferred_profession":{"type":"string","title":"Preferred Profession","default":""}},"type":"object","title":"Body_will_submit_agent__account_id__will_post"},"Body_world_alliance_dissolve_world_alliances_dissolve__alliance_id__post":{"properties":{"reason":{"type":"string","title":"Reason","default":""}},"type":"object","title":"Body_world_alliance_dissolve_world_alliances_dissolve__alliance_id__post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}