1. Go to this page and download the library: Download mauricioperera/php-a2e library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$result = $a2e->validate($jsonl);
// Stage 1: Structure — IDs exist, no duplicates, — FilterData needs array input, etc.
// Stage 4: API compat — URLs registered (optional)
// Stage 5: Credentials — refs exist in vault (optional)
// Stage 6: Patterns — infinite loops, large workflows
// Register an agent with permissions
$apiKey = $a2e->auth->register('agent-1', 'My Agent',
allowedApis: ['user-api'],
allowedCredentials: ['api-token'],
allowedOperations: ['ApiCall', 'FilterData'],
);
// Agent authenticates with API key
$agentId = $a2e->auth->authenticate($apiKey);
// Capabilities filtered by permissions
$caps = $a2e->capabilities('agent-1');
// Store encrypted credential
$a2e->vault->store('api-token', 'bearer-token', 'secret-value', ['api' => 'users']);
// In workflows, agents reference by ID only
// {"Authorization": {"credentialRef": {"id": "api-token"}}}
// → Server injects: {"Authorization": "Bearer secret-value"}
use PHPA2E\Operation\OperationInterface;
use PHPA2E\Executor\DataModel;
class SendSlackMessage implements OperationInterface
{
public function type(): string { return 'SendSlack'; }
public function execute(array $config, DataModel $data): array
{
$message = $data->resolveReferences($config['message']);
// ... send to Slack
return ['sent' => true, 'channel' => $config['channel']];
}
}
$a2e->operations->register(new SendSlackMessage());