PHPackages                             ai-os/error-agent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ai-os/error-agent

ActiveLibrary

ai-os/error-agent
=================

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

00PHP

Since Jul 12Pushed 1mo agoCompare

[ Source](https://github.com/effortless-codes/ai-os-error-agent)[ Packagist](https://packagist.org/packages/ai-os/error-agent)[ RSS](/packages/ai-os-error-agent/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

AI Engineering OS — PHP Error Agent
===================================

[](#ai-engineering-os--php-error-agent)

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

Installation
------------

[](#installation)

```
composer require ai-os/error-agent
```

Laravel
-------

[](#laravel)

### 1. Add to `.env`

[](#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)

[](#2-register-service-provider-auto-discovered-by-laravel)

### 3. Publish config (optional)

[](#3-publish-config-optional)

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

### 4. Override Exception Handler

[](#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)
---------------

[](#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
--------

[](#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 }
}
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance59

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2660622?v=4)[Rismunandar Winata](/maintainers/winata)[@winata](https://github.com/winata)

---

Top Contributors

[![winatabayu00](https://avatars.githubusercontent.com/u/86112044?v=4)](https://github.com/winatabayu00 "winatabayu00 (1 commits)")

### Embed Badge

![Health badge](/badges/ai-os-error-agent/health.svg)

```
[![Health](https://phpackages.com/badges/ai-os-error-agent/health.svg)](https://phpackages.com/packages/ai-os-error-agent)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
