承接 ai-os/error-agent 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ai-os/error-agent

Composer 安装命令:

composer require ai-os/error-agent

包简介

AI Engineering OS — PHP error capture & auto-fix agent for Laravel and any PHP project.

README 文档

README

Capture PHP errors and send them to AI Engineering OS for centralized tracking and auto-fix.

Installation

composer require ai-os/error-agent

Laravel

1. Add to .env

AI_OS_API_URL=http://your-platform:3001
AI_OS_PROJECT_ID=your-project-uuid

2. Register Service Provider (auto-discovered by Laravel)

3. Publish config (optional)

php artisan vendor:publish --tag=error-agent-config

4. Override Exception Handler

In app/Exceptions/Handler.php:

use AiOs\ErrorAgent\ErrorAgent;

public function register(): void
{
    $this->reportable(function (Throwable $e) {
        ErrorAgent::capture($e, config('error-agent'));
        return false;
    });
}

Usage (any PHP)

use AiOs\ErrorAgent\ErrorAgent;

$agent = new ErrorAgent([
    'apiUrl' => 'http://localhost:3001',
    'projectId' => 'your-uuid',
]);

try {
    // your code
} catch (\Throwable $e) {
    $agent->send([
        'message' => $e->getMessage(),
        'severity' => 'critical',
        'stack' => $e->getTraceAsString(),
        'projectType' => 'laravel',
        'source' => 'agent',
        'context' => [
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ],
    ]);
    throw $e;
}

// Or static method
ErrorAgent::capture($e, [
    'apiUrl' => 'http://localhost:3001',
    'projectId' => 'your-uuid',
]);

Endpoint

POST /api/projects/:projectId/errors/log
Content-Type: application/json

{
  "message": "Error message",
  "severity": "critical",
  "stack": "#0 /var/www/...",
  "projectType": "laravel",
  "source": "agent",
  "context": { "file": "UserController.php", "line": 42 }
}

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固