Download the PHP package waaseyaa/ai-agent without Composer
On this page you can find all versions of the php package waaseyaa/ai-agent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download waaseyaa/ai-agent
More information about waaseyaa/ai-agent
Files in waaseyaa/ai-agent
Package ai-agent
Short Description AI agent orchestration and tool execution for Waaseyaa
License GPL-2.0-or-later
Informations about the package ai-agent
waaseyaa/ai-agent
Layer 5 — AI
Waaseyaa agent runtime: the executor, the run service, the Messenger handler, and the in-process audit-log persistence. This package turns a registered AgentDefinition and an initiator account into a persisted AgentRun with real-time SSE progress, token / cost accounting, HITL approvals, and an append-only audit trail.
Where to start
The canonical doctrine spec is docs/specs/agent-executor.md. It owns the success criteria, NFR thresholds, audit invariants, SSE event vocabulary, HITL state machine, security posture, and the Waaseyaa\AI\Tools\ToolRegistryInterface contract.
For the tool catalogue (8 stock tools + remote MCP source) see packages/ai-tools/README.md.
Surfaces
| Surface | Entry point | Notes |
|---|---|---|
| CLI | packages/cli/src/Command/Ai/{AiRunCommand,AiPurgeRunsCommand,AiReapStalledRunsCommand}.php |
bin/waaseyaa ai:run "<prompt>" --inline for sync; omit --inline for async enqueue. |
| HTTP | packages/ai-agent/src/Controller/AgentRunController.php (routes: packages/ai-agent/src/Routing/AgentRouteServiceProvider.php) |
POST /api/ai/agent/run, GET /api/ai/agent/run/{id}, DELETE /api/ai/agent/run/{id}, POST /api/ai/agent/run/{id}/approve. Per-route capability checks + initiator ownership via AgentRunAccessPolicy. |
| SSE | BroadcastStorage push on agent.run.<id> |
Consume via GET /broadcast?channels=agent.run.<id>. Events: run_started, iteration, tool_call, tool_result, approval_required, run_completed, run_failed, run_cancelled. |
| Messenger worker | packages/ai-agent/src/Message/{RunAgent,RunAgentHandler}.php |
Consumes the RunAgent message; CAS-guarded against duplicate delivery (NFR-015). |
| Scheduler | packages/scheduler/src/Schedule/Ai/AgentScheduleEntries.php |
Daily purge + 5-minute stalled-run reaper. |
Extension points
Register agent bundles and tools via attribute discovery — the package-manifest compiler scans both.
After adding new attributes run bin/waaseyaa optimize:manifest (or restart the dev server).
Persisted entities
| Entity | Purpose |
|---|---|
Waaseyaa\AI\Agent\Entity\AgentRun |
Run record: initiator, bundle snapshot, status, transcript (truncated at the configured cap), token/cost totals, approval state, timestamps. |
Waaseyaa\AI\Agent\Entity\AgentAuditLog |
Append-only event log: one row per provider call / tool call / tool result / approval. Purged only by AiPurgeRunsCommand. |
Repositories live in packages/ai-agent/src/Repository/. The legacy in-memory Waaseyaa\AI\Agent\AgentAuditLog value-object list inside AgentExecutor is removed.
Services
| Class | Role |
|---|---|
AgentRunService |
enqueue() (async path) and runInline() (CLI/dev sync path). |
AgentExecutor |
Per-iteration loop: provider call, tool dispatch via ToolRegistryInterface, HITL gating, cancellation poll. |
AgentDefinitionRegistry |
Resolves AgentDefinition VOs by id. |
StalledRunReaper |
Transitions runs stuck past max_runtime_seconds to failed. |
Mcp\McpClientToolSource + StreamableHttpMcpClient |
Adapts remote MCP servers into the local tool registry; capability prefix tool.mcp.<server>.<name>. |
Quality gates
Every change to this package MUST keep the following green:
bin/check-package-layers— ai-agent imports only from layer ≤ 5 (entity, entity-storage, access, queue, ai-schema, ai-tools).bin/check-dead-code— no new findings beyondphpstan-dead-code-baseline.neon.composer check-composer-policy— CP002 / CP003 / CP-NEW.composer phpstan— level 5.composer cs-check— PHP-CS-Fixer dry-run.- Bulk-edit gate —
occurrence_map.yamlvalidates; zeroBLOCKrows in the diff-compliance report.
Tests:
All versions of ai-agent with dependencies
symfony/messenger Version ^7.0
symfony/uid Version ^7.0
waaseyaa/access Version ^0.1.0-alpha.189
waaseyaa/ai-observability Version ^0.1.0-alpha.189
waaseyaa/ai-schema Version ^0.1.0-alpha.189
waaseyaa/ai-tools Version ^0.1.0-alpha.189
waaseyaa/api Version ^0.1.0-alpha.189
waaseyaa/bimaaji Version ^0.1.0-alpha.189
waaseyaa/database-legacy Version ^0.1.0-alpha.189
waaseyaa/entity Version ^0.1.0-alpha.189
waaseyaa/entity-storage Version ^0.1.0-alpha.189
waaseyaa/foundation Version ^0.1.0-alpha.189
waaseyaa/http-client Version ^0.1.0-alpha.189