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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

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

opened this

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 by promptRoutes(router); in the same place, between egressGrantRoutes(router) and secretRoutes(router). The actions/prompts.ts import goes too, since api.ts no longer uses it, and api.ts has no /prompts route left.
  • src/http/api/prompts.ts: the list, add, run and delete routes, moved without edits, comments included. It uses the existing exports — loadRepo from ../api.ts and respondAccess, str, body, json, notFound and requireScope from ../respond.ts — the same way egress_grants.ts and secrets.ts do. 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

Closes #6334

commented

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 by promptRoutes(router); in the same place, between egressGrantRoutes(router) and secretRoutes(router). The actions/prompts.ts import goes too, since api.ts no longer uses it, and api.ts has no /prompts route left.
  • src/http/api/prompts.ts: the list, add, run and delete routes, moved without edits, comments included. It uses the existing exports — loadRepo from ../api.ts and respondAccess, str, body, json, notFound and requireScope from ../respond.ts — the same way egress_grants.ts and secrets.ts do. 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

Approved

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.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs