/shared/platform-tools/api/agent.php // dirname(__DIR__, 3) === // The per-platform stub at /api/agent.php is a one-line require of this file. // // Hosts on a different stack (surf: src/ + App\Database) write their own thin // stub that bootstraps their way and calls agent_dispatch() directly — the // action set lives in functions_agent.php so both paths share it. $repo_root = dirname(__DIR__, 3); require_once $repo_root . '/config/db.php'; // opens $pdo, starts the session require_once $repo_root . '/config/functions.php'; // env(), helpers, migrations stub require_once __DIR__ . '/../functions_agent.php'; $secret = (string) (function_exists('env') ? (env('HUB_OPS_SECRET', '') ?: '') : (getenv('HUB_OPS_SECRET') ?: '')); agent_dispatch($pdo, $repo_root, $secret);