| import { classify } from "../ai/classifier.js"; | |
| import { decide } from "./decision_engine.js"; | |
| import { saveEvent } from "./memory.js"; | |
| export async function emit(eventType, payload) { | |
| if (eventType === "USER_INPUT") { | |
| const classification = classify(payload.text); | |
| const decision = decide(classification); | |
| saveEvent({ | |
| input: payload.text, | |
| classification, | |
| decision | |
| }); | |
| return { | |
| message: decision.message | |
| }; | |
| } | |
| return { | |
| message: "Unknown event" | |
| }; | |
| } |