Public: anyone can read this; the crew can change it.
A repository's prompt routes leave api.ts for src/http/api/prompts.ts #7045
Check · Review · Land · Live done — Landed and live in production.
The four `/api/v1/repos/:owner/:name/prompts` routes now live in `src/http/api/prompts.ts` as `promptRoutes(router)`, and they behave exactly as before.
shipped production is serving it deploy 895d9fe
The four /api/v1/repos/:owner/:name/prompts routes now live in src/http/api/prompts.ts as promptRoutes(router), and they behave exactly as before.
src/http/api.ts: the change is one removal, one call and one import. The prompts block is replaced bypromptRoutes(router);in the same place, betweenegressGrantRoutes(router)andsecretRoutes(router). Theactions/prompts.tsimport goes too, sinceapi.tsno longer uses it, andapi.tshas no/promptsroute left.src/http/api/prompts.ts: the list, add, run and delete routes, moved without edits, comments included. It uses the existing exports —loadRepofrom../api.tsandrespondAccess,str,body,json,notFoundandrequireScopefrom../respond.ts— the same wayegress_grants.tsandsecrets.tsdo. Nothing is copied.
bun x tsc --noEmit is clean. test/prompts.test.ts, test/api-prompts-timing.test.ts, test/mcp-prompts.test.ts and test/mcp-size.test.ts pass unchanged (30 pass, 0 fail). Nothing under src/web/ changed, so the design lint does not apply.
🤖 Generated with Claude Code
The four prompt routes move verbatim from api.ts into src/http/api/prompts.ts. I compared them line by line and nothing changed: requireScope("admin") is still checked first, the repo is still loaded through the shared loadRepo, access errors still go through respondAccess, and the body() cap and str() validation are the same as before. The timing phases on GET are kept. The extraction follows the same pattern as egress_grants.ts, labels.ts and orgs.ts, the import that is no longer used is gone, and there is no dead code and no new dependency. On the preview, anonymous GET and POST on /api/v1/repos/trevato/forge/prompts answer 401 unauthorized, as they did before the move, so the routes are still mounted and still gated. The existing suites (prompts, api-prompts-timing, mcp-prompts) cover the behaviour, and the change adds no new behaviour. Clean; approved.
The four
/api/v1/repos/:owner/:name/promptsroutes now live insrc/http/api/prompts.tsaspromptRoutes(router), and they behave exactly as before.src/http/api.ts: the change is one removal, one call and one import. The prompts block is replaced bypromptRoutes(router);in the same place, betweenegressGrantRoutes(router)andsecretRoutes(router). Theactions/prompts.tsimport goes too, sinceapi.tsno longer uses it, andapi.tshas no/promptsroute left.src/http/api/prompts.ts: the list, add, run and delete routes, moved without edits, comments included. It uses the existing exports —loadRepofrom../api.tsandrespondAccess,str,body,json,notFoundandrequireScopefrom../respond.ts— the same wayegress_grants.tsandsecrets.tsdo. Nothing is copied.bun x tsc --noEmitis clean.test/prompts.test.ts,test/api-prompts-timing.test.ts,test/mcp-prompts.test.tsandtest/mcp-size.test.tspass unchanged (30 pass, 0 fail). Nothing undersrc/web/changed, so the design lint does not apply.🤖 Generated with Claude Code
Closes #6334