// @ts-nocheck

import { Saeeol } from "@saeeol/core"
import { ReadTool } from "@saeeol/core/tools"

const saeeol = Saeeol.make({})

saeeol.tool.add(ReadTool)

saeeol.tool.add({
  name: "bash",
  schema: {
    type: "object",
    properties: {
      command: {
        type: "string",
        description: "The command to run.",
      },
    },
    required: ["command"],
  },
  execute(input, ctx) {},
})

saeeol.auth.add({
  provider: "openai",
  type: "api",
  value: process.env.OPENAI_API_KEY,
})

saeeol.agent.add({
  name: "build",
  permissions: [],
  model: {
    id: "gpt-5-5",
    provider: "openai",
    variant: "xhigh",
  },
})

const sessionID = await saeeol.session.create({
  agent: "build",
})

saeeol.subscribe((event) => {
  console.log(event)
})

await saeeol.session.prompt({
  sessionID,
  text: "hey what is up",
})

await saeeol.session.prompt({
  sessionID,
  text: "what is up with this",
  files: [
    {
      mime: "image/png",
      uri: "data:image/png;base64,xxxx",
    },
  ],
})

await saeeol.session.wait()

console.log(await saeeol.session.messages(sessionID))
