Move Core\Front\Api\* to php-api and Core\Front\Mcp\* to php-mcp.
Inline the api/mcp middleware group definitions in Front\Boot since
middleware() runs before package providers load. Simplify
McpToolsRegistering to just collect class names without validating
the McpToolHandler interface (avoids framework→package dependency).
Co-Authored-By: Virgil <virgil@lethean.io>
Extracted processMiddleware() helper and added it to fireWebRoutes,
fireAdminBooting, fireClientRoutes, fireApiRoutes, fireMcpRoutes,
and fireConsoleBooting. Modules can now register middleware aliases
via $event->middleware() on any lifecycle event consistently.
Previously only fireApiRoutes processed middleware (added in prior
commit), other methods silently ignored them despite the base
LifecycleEvent class supporting it.
Co-Authored-By: Virgil <virgil@lethean.io>
The LifecycleEvent base class supports middleware() requests but
fireApiRoutes() only processed route requests. Middleware aliases
like auth.api were registered via $event->middleware() by php-api
but never consumed during HTTP requests — only worked in CLI
because ConsoleBooting registered them separately.
Co-Authored-By: Virgil <virgil@lethean.io>
API routes are domain-scoped (api.lthn.ai, mcp.lthn.ai), not
path-embedded. The /api prefix forced workarounds for Website
modules that need stateless routes without path nesting.
No other frontage (web, admin, client, mcp) enforced a path prefix —
api was the odd one out.
Co-Authored-By: Virgil <virgil@lethean.io>
Wire MCP protocol routes through the event-driven module system.
Front\Mcp\Boot now fires McpRoutesRegistering, wrapping routes
with the 'mcp' middleware group (stateless, rate limiting, no prefix).
Co-Authored-By: Virgil <virgil@lethean.io>