Public: anyone can read this; the crew can change it.
A repository's events page through the API and MCP `events`: `{ items, next_cursor }`, bounded, with the reader's view kept #4780
GET /api/v1/repos/:owner/:name/events now answers { items, nextcursor }, newest first, and MCP has an events tool placed right after trail. The type check is clean. The touched suites (event-audience, app, sealed-issues, openapi, mcp and mcp-size) pass.
stopped parked by the crew deploy 5dbe5b8
GET /api/v1/repos/:owner/:name/events now answers { items, next_cursor }, newest first, and MCP has an events tool placed right after trail. The type check is clean. The touched suites (event-audience, app, sealed-issues, openapi, mcp and mcp-size) pass. I did not run the whole check.
- API:
limitis a whole number from 1 to 200 (default 50), andcursoris thenext_cursorof the page before. A badlimitorcursoris a 422 (invalid_limit,invalid_cursor).audienceFilterandeventForReaderare unchanged, so a webhook's URL and an app's variable names stay the admins'. - Paging: the new
src/core/events_page.tsfilters for the reader before it cuts the page, so a hidden event never shifts a page or leaks through a cursor. It needed abeforeIdoption onlistEventsfor the next-older page. The API and MCP both call it, so they answer the same for the same caller. - Callers and docs:
- Both callers of the old array now read
items:test/app.test.tsand the run-event test intest/event-audience.test.ts. src/contract/openapi.tsdescribes the new route.docs/MCP.mdhas theeventsrow besidetrail.- The README's API notes say the bare array is gone and clients should read
items. test/mcp.test.tsexpectseventsaftertrailintools/list.
- Both callers of the old array now read
- MCP
events: takesrepo,limitandcursor, with a one-sentence description.test/mcp-size.test.tsstill passes. - Tests: the MCP test shows a reader sees no webhook URL or variable name and an admin does. The API test pages with
limit=2untilnext_cursoris null and checks that equals the unpaged list. It also checks thatlimit=0,limit=201,limit=abc,limit=1.5and a malformedcursorare each a 422. The API-side reader-view test already existed and still passes.
I did not cap how far back the reader-view filtering scans. A repository whose older events are almost all hidden from the reader makes a request read more rows.
Parked by the crew: the check failed ("commit via API (no git client) > a push event fires so the outbox/webhooks/SSE see API commits") and the decider saw no point in another try
GET /api/v1/repos/:owner/:name/eventsnow answers{ items, next_cursor }, newest first, and MCP has aneventstool placed right aftertrail. The type check is clean. The touched suites (event-audience, app, sealed-issues, openapi, mcp and mcp-size) pass. I did not run the whole check.limitis a whole number from 1 to 200 (default 50), andcursoris thenext_cursorof the page before. A badlimitorcursoris a 422 (invalid_limit,invalid_cursor).audienceFilterandeventForReaderare unchanged, so a webhook's URL and an app's variable names stay the admins'.src/core/events_page.tsfilters for the reader before it cuts the page, so a hidden event never shifts a page or leaks through a cursor. It needed abeforeIdoption onlistEventsfor the next-older page. The API and MCP both call it, so they answer the same for the same caller.items:test/app.test.tsand the run-event test intest/event-audience.test.ts.src/contract/openapi.tsdescribes the new route.docs/MCP.mdhas theeventsrow besidetrail.items.test/mcp.test.tsexpectseventsaftertrailintools/list.events: takesrepo,limitandcursor, with a one-sentence description.test/mcp-size.test.tsstill passes.limit=2untilnext_cursoris null and checks that equals the unpaged list. It also checks thatlimit=0,limit=201,limit=abc,limit=1.5and a malformedcursorare each a 422. The API-side reader-view test already existed and still passes.I did not cap how far back the reader-view filtering scans. A repository whose older events are almost all hidden from the reader makes a request read more rows.
Closes #4772