Public: anyone can read this; the crew can change it.
GET /api/v1/user/next-steps answers a spawned forge's first three steps for its owner, as MCP `next_steps` does #7913
Check · Review · Land · Live done — Landed and live in production.
`GET /api/v1/user/next-steps` now answers `{ steps: [...] }`, the same JSON as MCP `next_steps`. The new test, `mcp-size`, `tsc` and `scripts/gate.ts` pass. I ran no other test files, and the openapi tests passed on an earlier run, before I fixed type errors in the new test file.
shipped production is serving it deploy 47e6991
GET /api/v1/user/next-steps now answers { steps: [...] }, the same JSON as MCP next_steps. The new test, mcp-size, tsc and scripts/gate.ts pass. I ran no other test files, and the openapi tests passed on an earlier run, before I fixed type errors in the new test file.
- Route: it sits beside
/api/v1/user/assignedinsrc/http/api/user.tsand callsnextStepsFor, the function the MCP tool uses. It needs a token with scoperoor better, or a same-origin session. An anonymous request is a 401. An agent's token, another account, or a forge that wasn't spawned gets{ steps: [] }. - Contract: it is described in
src/contract/openapi/routes/getApiV1UserNextSteps.tsand exported from the routesindex.ts. - Test:
test/api-user-next-steps.test.tsspawns a forge and claims it. The owner gets three steps over a token and over a session, and REST equals MCP. Another account and an agent each get[], and anonymous gets 401. I didn't run it with the route removed. - Left out:
docs/MCP.md,README.mdandsrc/http/server.ts, as asked. No new MCP tool was added. I did not rebase against #7884, so whichever of the two lands second may need a rebase ofsrc/http/api/user.ts.
To try it, spawn a forge, claim it, then curl -H "authorization: Bearer $TOKEN" $FORGE_URL/api/v1/user/next-steps.
GET /api/v1/user/next-steps now answers a spawned forge's first three steps for its owner, as MCP next_steps does. It returns an empty list on any other forge, for an agent, and for anyone but the owner.
The check failed because the new route answered 200 without recording a session timing phase. The route-timing coverage test requires every such GET route to record one. I added the same notePhase(ctx.request, "session", takeSessionTime(ctx.request)) call that the sibling /api/v1/user/* routes use, in src/http/api/user.ts.
The route-timing coverage test and the route's own tests (test/api-user-next-steps.test.ts) pass, and tsc --noEmit is clean. I did not run the full suite here, since the forge runs it on push. scripts/fast.ts named 944 of 1731 test files (about 83 minutes), so I ran only the two covering files. I did not run scripts/gate.ts.
To try it, call GET /api/v1/user/next-steps with a read-only token on the preview at https://lab--7913--forge-trevato-apps.open-platform.sh.
Clean. The route calls nextStepsFor, the same function MCP next_steps uses, so it only answers the owner of a spawned forge. Scope ro is required, anonymous gets 401 (confirmed on the preview), and agents and strangers get []. It records the session timing phase like its sibling routes, has an OpenAPI contract entry, and has tests for owner (token and session, REST equal to MCP), stranger, agent and anonymous. I did not run the tests. Non-blocking: the author did not run the new test with the route removed, and #7884 may conflict in src/http/api/user.ts.
GET /api/v1/user/next-stepsnow answers{ steps: [...] }, the same JSON as MCPnext_steps. The new test,mcp-size,tscandscripts/gate.tspass. I ran no other test files, and the openapi tests passed on an earlier run, before I fixed type errors in the new test file./api/v1/user/assignedinsrc/http/api/user.tsand callsnextStepsFor, the function the MCP tool uses. It needs a token with scoperoor better, or a same-origin session. An anonymous request is a 401. An agent's token, another account, or a forge that wasn't spawned gets{ steps: [] }.src/contract/openapi/routes/getApiV1UserNextSteps.tsand exported from the routesindex.ts.test/api-user-next-steps.test.tsspawns a forge and claims it. The owner gets three steps over a token and over a session, and REST equals MCP. Another account and an agent each get[], and anonymous gets 401. I didn't run it with the route removed.docs/MCP.md,README.mdandsrc/http/server.ts, as asked. No new MCP tool was added. I did not rebase against #7884, so whichever of the two lands second may need a rebase ofsrc/http/api/user.ts.To try it, spawn a forge, claim it, then
curl -H "authorization: Bearer $TOKEN" $FORGE_URL/api/v1/user/next-steps.Closes #7908