- Python FastAPI 引擎:世界状态模拟、全局能量条、世界事件系统 - Node.js WebSocket 服务器:实时通信、事件队列批处理 - 前端仪表盘:世界状态可视化、行动日志、事件展示 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
630 B
TypeScript
42 lines
630 B
TypeScript
export interface GameEvent {
|
|
type: string;
|
|
text: string;
|
|
user: string;
|
|
ts: number;
|
|
}
|
|
|
|
export interface StepRequest {
|
|
events: GameEvent[];
|
|
}
|
|
|
|
export interface AgentState {
|
|
emotion: string;
|
|
goal: string;
|
|
memory: string[];
|
|
}
|
|
|
|
export interface WorldState {
|
|
tick: number;
|
|
weather: string;
|
|
town_mood: number;
|
|
agents: Record<string, AgentState>;
|
|
events: string[];
|
|
}
|
|
|
|
export interface Action {
|
|
agent_id: string;
|
|
say: string;
|
|
do: string;
|
|
}
|
|
|
|
export interface StepResponse {
|
|
world_state: WorldState;
|
|
actions: Action[];
|
|
}
|
|
|
|
export interface ClientMessage {
|
|
type: string;
|
|
text: string;
|
|
user: string;
|
|
}
|