/** LTM — BusEvent definitions */

import { Schema } from "effect"
import * as BusEvent from "@/bus/bus-event"

export const LTMEvent = {
  MemoryStored: BusEvent.define(
    "ltm.memory.stored",
    Schema.Struct({
      id: Schema.String,
      type: Schema.String,
      source: Schema.String,
    }),
  ),

  MemoryPruned: BusEvent.define(
    "ltm.memory.pruned",
    Schema.Struct({
      count: Schema.Number,
      type: Schema.optional(Schema.String),
    }),
  ),

  IndexingProgress: BusEvent.define(
    "ltm.indexing.progress",
    Schema.Struct({
      processed: Schema.Number,
      total: Schema.Number,
      type: Schema.String,
    }),
  ),

  EmbedderStatusChanged: BusEvent.define(
    "ltm.embedder.status",
    Schema.Struct({
      status: Schema.String,
      model: Schema.optional(Schema.String),
    }),
  ),

  HardwareProfiled: BusEvent.define(
    "ltm.hardware.profiled",
    Schema.Struct({
      gpuCount: Schema.Number,
      totalVRAMMB: Schema.Number,
      totalRAMMB: Schema.Number,
      cpuCores: Schema.Number,
    }),
  ),
}
