Skip to content

Agent API update - #2388

Open
s3inlc wants to merge 15 commits into
masterfrom
agent-api-rewrite
Open

Agent API update#2388
s3inlc wants to merge 15 commits into
masterfrom
agent-api-rewrite

Conversation

@s3inlc

@s3inlc s3inlc commented Jul 30, 2026

Copy link
Copy Markdown
Member

Rewrote the agent API (POST /api/server.php) from a procedural switch-based dispatcher with echo+die() handlers into a Slim 4 / PSR-7 application with typed controllers, middleware, and an auto-generated OpenAPI spec - all without changing the wire contract that agents depend on.

All 19 actions are now clean PSR-7 controllers returning ResponseInterface, with token authentication handled centrally by TokenAuthMiddleware, JSON body parsing by AgentBodyParserMiddleware, and exception handling that returns the correct action string and error message on failures.

The OpenAPI 3.1 spec is generated at runtime from a SchemaRegistry (referencing the existing PQuery/PResponse constants) is linted in CI with Redocly and Spectral using a relaxed ruleset.

@s3inlc
s3inlc requested a review from jessevz August 5, 2026 13:23
@s3inlc
s3inlc marked this pull request as ready for review August 5, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants