<?php

use boru\boruai\BoruAI;
use boru\boruai\Models\Response;
use boru\boruai\Models\ResponseHistory;
use boru\boruai\Models\WebSearchTool;
use boru\boruai\UI\Connector;
use boru\boruai\UI\User;
use boru\boruai\UI\WebUI;
use boru\boruai\Vtiger\VtigerToolFunctions;
use boru\query\Factory;

// Prevent execution from the vendor directory
if (strpos(__DIR__, DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'boru'.DIRECTORY_SEPARATOR.'boruai'.DIRECTORY_SEPARATOR.'web') !== false) {
    throw new \RuntimeException(
        'This file must be copied out of vendor/boru/boruai/web before executing.'
    );
}

define('BORUAI', true);
require __DIR__.'/config.php';
    
$webUI = new WebUI($_REQUEST,$config);

$webUI->handleRequest(__DIR__);
exit();