2026-09-23 15:15:02 +08:00

30 lines
807 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace modules\aiagent;
use crmeb\crontab\CrontabTaskRegistry;
use modules\aiagent\crontab\AiAgentTaskDispatcherTask;
use think\App as ThinkApp;
/** AI Agent 扩展入口 */
class App
{
public static function register(ThinkApp $app): void
{
// 注册 AI 自动化任务调度触发器(timer 按 eb_system_crontab.mark=aiAgentTask 每分钟触发)
$app->make(CrontabTaskRegistry::class)->register('aiAgentTask', AiAgentTaskDispatcherTask::class);
}
public static function boot(ThinkApp $app): void
{
$eventFile = __DIR__ . '/event.php';
if (is_file($eventFile)) {
$event = include $eventFile;
if (is_array($event)) {
$app->loadEvent($event);
}
}
}
}