{"files":{"SKILL.md":"---\nname: the-mercure-protocol\ndescription: \"The Mercure protocol API skill. Use when working with The Mercure protocol for .well-known. Covers 6 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# The Mercure protocol\nAPI version: 1.0.0\n\n## Auth\nBearer bearer | ApiKey mercure_access_token in cookie\n\n## Base URL\nNot specified.\n\n## Setup\n1. Set Authorization header with Bearer token\n2. GET /.well-known/mercure -- subscribe to updates\n3. POST /.well-known/mercure -- create first mercure\n\n## Endpoints\n6 endpoints across 1 group. See references/api-spec.lap for full details.\n\n### .well-known\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /.well-known/mercure | Subscribe to updates |\n| POST | /.well-known/mercure | Publish an update |\n| GET | /.well-known/oauth-protected-resource/.well-known/mercure | OAuth 2.0 protected resource metadata |\n| GET | /.well-known/mercure/subscriptions | Active subscriptions |\n| GET | /.well-known/mercure/subscriptions/{match_type}/{match} | Active subscriptions for the given topic matcher |\n| GET | /.well-known/mercure/subscriptions/{match_type}/{match}/{subscriber} | Active subscription for the given matcher and subscriber |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all mercure?\" -> GET /.well-known/mercure\n- \"Create a mercure?\" -> POST /.well-known/mercure\n- \"List all subscriptions?\" -> GET /.well-known/mercure/subscriptions\n- \"Get subscription details?\" -> GET /.well-known/mercure/subscriptions/{match_type}/{match}\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api The Mercure protocol\n@version 1.0.0\n@auth Bearer bearer | ApiKey mercure_access_token in cookie\n@endpoints 6\n@toc .well-known(6)\n\n@endpoint GET /.well-known/mercure\n@desc Subscribe to updates\n@optional {match: [str] # Exact topic matcher (the default matcher type). Repeatable. Case-sensitive. At least one matcher parameter is required., match_urlpattern: [str] # URL Pattern topic matcher (WHATWG URL Pattern). Repeatable., last_event_id: str # The last received event id, to retrieve missed events., Last-Event-ID: str # The last received event id, to retrieve missed events, takes precedence over the query parameter.}\n@returns(200) Event stream opened.\n@errors {400: Missing or invalid topic matcher parameter., 401: Missing or invalid access token. Carries a `WWW-Authenticate: Bearer` challenge (with `error=\"invalid_token\"` when a token was presented but failed validation) and, per RFC 9728, a `resource_metadata` parameter pointing to the protected resource metadata document.}\n\n@endpoint POST /.well-known/mercure\n@desc Publish an update\n@returns(200) The id of this update\n@errors {400: Invalid request, 401: Missing or invalid access token. Carries a `WWW-Authenticate: Bearer` challenge (with `error=\"invalid_token\"` when a token was presented but failed validation) and, per RFC 9728, a `resource_metadata` parameter pointing to the protected resource metadata document., 403: The access token is valid but does not grant the requested action on the topic. Carries a `WWW-Authenticate: Bearer` challenge with `error=\"insufficient_scope\"` (RFC 6750).}\n\n@endpoint GET /.well-known/oauth-protected-resource/.well-known/mercure\n@desc OAuth 2.0 protected resource metadata\n@returns(200) {resource: str(uri), bearer_methods_supported: [str], authorization_servers: [str], authorization_details_types_supported: [str], mercure_cookie: str, mercure_subscriptions: bool} # The protected resource metadata document\n\n@endpoint GET /.well-known/mercure/subscriptions\n@desc Active subscriptions\n@returns(200) {id: str(iri-reference), type: str, last_event_id: str, subscriptions: [map]} # The list of active subscriptions\n@errors {401: Missing or invalid access token. Carries a `WWW-Authenticate: Bearer` challenge (with `error=\"invalid_token\"` when a token was presented but failed validation) and, per RFC 9728, a `resource_metadata` parameter pointing to the protected resource metadata document., 403: The access token is valid but does not grant the requested action on the topic. Carries a `WWW-Authenticate: Bearer` challenge with `error=\"insufficient_scope\"` (RFC 6750).}\n\n@endpoint GET /.well-known/mercure/subscriptions/{match_type}/{match}\n@desc Active subscriptions for the given topic matcher\n@required {match_type: str # The matcher type (e.g. exact, urlpattern)., match: str # The percent-encoded topic matcher.}\n@returns(200) {id: str(iri-reference), type: str, last_event_id: str, subscriptions: [map]} # The list of active subscriptions\n@errors {401: Missing or invalid access token. Carries a `WWW-Authenticate: Bearer` challenge (with `error=\"invalid_token\"` when a token was presented but failed validation) and, per RFC 9728, a `resource_metadata` parameter pointing to the protected resource metadata document., 403: The access token is valid but does not grant the requested action on the topic. Carries a `WWW-Authenticate: Bearer` challenge with `error=\"insufficient_scope\"` (RFC 6750).}\n\n@endpoint GET /.well-known/mercure/subscriptions/{match_type}/{match}/{subscriber}\n@desc Active subscription for the given matcher and subscriber\n@required {match_type: str # The matcher type (e.g. exact, urlpattern)., match: str # The percent-encoded topic matcher., subscriber: str}\n@returns(200) {id: str(iri-reference), type: str, last_event_id: str, subscriptions: [map]} # The list of active subscriptions\n@errors {401: Missing or invalid access token. Carries a `WWW-Authenticate: Bearer` challenge (with `error=\"invalid_token\"` when a token was presented but failed validation) and, per RFC 9728, a `resource_metadata` parameter pointing to the protected resource metadata document., 403: The access token is valid but does not grant the requested action on the topic. Carries a `WWW-Authenticate: Bearer` challenge with `error=\"insufficient_scope\"` (RFC 6750).}\n\n@end\n"}}