import { AgentSchema } from "./schemas";

export class BaseAgent {
  data: typeof AgentSchema._type;

  constructor(agentData: unknown) {
    this.data = AgentSchema.parse(agentData); // Validates structure
  }

  get beliefs() { return this.data.bdi.beliefs; }
  get desires() { return this.data.bdi.desires; }
  get intentions() { return this.data.bdi.intentions; }
  get metadata() { return this.data.metadata; }

  getGoals() {
    return this.data.metadata.goals;
  }

  validate() {
    return AgentSchema.safeParse(this.data);
  }
}