{"id":35278991,"url":"https://github.com/andreibesleaga/a2a-php","last_synced_at":"2026-02-09T16:12:27.814Z","repository":{"id":304043100,"uuid":"1017594444","full_name":"andreibesleaga/a2a-php","owner":"andreibesleaga","description":"A2A PHP SDK - PHP implementation of the AI A2A (Agent-to-Agent) Protocol (v0.2.5-0.3.0)","archived":false,"fork":false,"pushed_at":"2025-10-07T04:26:39.000Z","size":946,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-11T22:06:11.541Z","etag":null,"topics":["a2a","a2a-protocol","agent-to-agent","ai","php","php-sdk","protocol","sdk","sdk-php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreibesleaga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-10T19:26:55.000Z","updated_at":"2025-10-29T14:58:46.000Z","dependencies_parsed_at":"2025-08-11T07:14:15.208Z","dependency_job_id":"b0d21c8a-44a4-431e-95a9-381605bcd69e","html_url":"https://github.com/andreibesleaga/a2a-php","commit_stats":null,"previous_names":["andreibesleaga/a2a-php"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/andreibesleaga/a2a-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreibesleaga%2Fa2a-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreibesleaga%2Fa2a-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreibesleaga%2Fa2a-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreibesleaga%2Fa2a-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreibesleaga","download_url":"https://codeload.github.com/andreibesleaga/a2a-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreibesleaga%2Fa2a-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29271994,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-09T13:47:44.167Z","status":"ssl_error","status_checked_at":"2026-02-09T13:47:43.721Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["a2a","a2a-protocol","agent-to-agent","ai","php","php-sdk","protocol","sdk","sdk-php"],"created_at":"2025-12-30T14:14:32.210Z","updated_at":"2026-02-09T16:12:27.809Z","avatar_url":"https://github.com/andreibesleaga.png","language":"PHP","readme":"# A2A PHP SDK\n\nA PHP implementation of the A2A (Agent-to-Agent) Protocol v0.3.0. The repository includes a fully compliant sample server, strict JSON-RPC validation logic, task management utilities, streaming support, and push notification handling.\n\n## Quick start\n\n```bash\n# Install dependencies\ncomposer install\n\n# Start the reference server\nphp -S localhost:8081 examples/complete_a2a_server.php\n\n# (Optional) expose an authenticated extended card\nexport A2A_DEMO_AUTH_TOKEN=\"example-secret\"\n```\n\nThe server exposes the JSON-RPC endpoint at `http://localhost:8081/` and publishes the agent card at `http://localhost:8081/.well-known/agent-card.json`.\n\n## Compliance status\n\n| Category   | Result |\n| ---------- | ------ |\n| Mandatory  | 25 / 25 tests passing |\n| Capability | 14 / 14 tests passing |\n| Quality    | 12 / 12 tests passing |\n| Features   | 15 / 15 tests passing |\n\nResults are produced with the official [A2A Test Compatibility Kit](../a2a-tck) using `python3 run_tck.py --category all`.\n\n## Implementation highlights\n\n- Strict JSON-RPC 2.0 validation with precise error codes for malformed requests, invalid identifiers, or incorrect parameter payloads.\n- Task lifecycle support with history, metadata, artifact persistence, and idempotent cancellation semantics.\n- Server-Sent Events streaming, including the `tasks/resubscribe` snapshot feed that replays history before emitting the current task status.\n- Push notification configuration management with consistent list, get, set, and delete behaviour backed by the shared storage layer.\n- Authenticated extended agent card endpoint gated by the `A2A_DEMO_AUTH_TOKEN` environment variable for demonstration purposes.\n\n## Reference server methods\n\n| Method | Description | Notes |\n| ------ | ----------- | ----- |\n| `get_agent_card` | Returns the public agent card. | JSON-RPC response. |\n| `agent/getAuthenticatedExtendedCard` | Returns the extended card when `Authorization: Bearer` or `X-API-Key` matches `A2A_DEMO_AUTH_TOKEN`. | JSON-RPC response. |\n| `message/send` | Processes an inbound message and returns the task snapshot. | Validates message parts and metadata. |\n| `message/stream` | Starts an SSE session for live task updates while processing a streamed message. | Emits JSON-RPC envelopes over SSE. |\n| `tasks/send` | Accepts an explicit task and message payload, ensuring reuse of existing task IDs. | Sets status to working and finalises with handler result. |\n| `tasks/get` | Retrieves the latest task state, history, and artifacts. | Supports the optional `historyLength` parameter. |\n| `tasks/cancel` | Cancels a running task once and reports an error on repeated cancellation attempts. | Uses `TaskManager::cancelTask`. |\n| `tasks/resubscribe` | Emits task history and current status over SSE for reconnecting clients. | Utilises stored history snapshots. |\n| `tasks/pushNotificationConfig/set` | Persists a push configuration for a task. | Stores webhook data in shared storage. |\n| `tasks/pushNotificationConfig/get` | Returns the stored configuration for a task. | Null when absent. |\n| `tasks/pushNotificationConfig/list` | Lists all stored configurations, optionally filtered by `taskId`. | Returns an array of summary objects. |\n| `tasks/pushNotificationConfig/delete` | Removes the configuration for a task. | Returns `null` on success. |\n| `ping` | Health-check method. | Returns `{ \"status\": \"pong\" }`. |\n\nRefer to `docs/api-reference.md` for complete request and response schemas.\n\n## Working with Server-Sent Events\n\nThe reference server streams events from the same JSON-RPC endpoint when the `message/stream` or `tasks/resubscribe` methods are invoked. Responses are encoded as JSON-RPC payloads and delivered as SSE events with IDs set to the task or message identifiers. The `StreamingServer` guarantees that a resubscribe replay includes every stored message history entry before the terminal task status update.\n\n## Testing\n\n```bash\n# Start the server in one terminal\nphp -S localhost:8081 examples/complete_a2a_server.php\n\n# Run the TCK from the sibling repository\ncd ../a2a-tck\npython3 run_tck.py --sut-url http://localhost:8081 --category all\n\n# Run the PHPUnit suite from the project root\ncd ../a2a-php\ncomposer test\n```\n\nThe TCK run exercises JSON-RPC validation, streaming behaviour, push notification management, and task-state transitions. PHPUnit covers unit and integration scenarios for the PHP components.\n\n## Documentation\n\nAdditional documentation lives in the `docs/` directory:\n\n- `docs/README.md` – high-level overview and architecture notes.\n- `docs/api-reference.md` – detailed method and data model reference.\n- `docs/protocol-compliance.md` – TCK summary and behavioural guarantees.\n\nFor HTTPS deployment details, see `A2A_HTTPS_IMPLEMENTATION.md` and `HTTPS_SUMMARY.md`.\n\n## Contributing\n\n1. Fork the repository and create a feature branch.\n2. Install dependencies with `composer install`.\n3. Add unit tests or TCK scenarios covering the change.\n4. Run `composer test` and (optionally) `python3 ../a2a-tck/run_tck.py`.\n5. Open a pull request describing the change and validation steps.\n\n## License\n\nDistributed under the Apache License 2.0. See `LICENSE` for the full text.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreibesleaga%2Fa2a-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreibesleaga%2Fa2a-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreibesleaga%2Fa2a-php/lists"}