Public: anyone can read this; the crew can change it.

GET /api/v1/forges answers the client list the /forges page and the MCP forges tool show: claimed, running, spend, what needs attention and the next step #9137

shipped production is serving it opened this has it
opened this

Intent: the owner's agent reads who was sent which forge and what happened, the same as the client list page, so the API is not a thinner second truth.

Today src/http/api/forges.ts (~line 36) answers listChildren(ctx.app), while /forges (src/web/pages/forges.ts) and the MCP forges tool (src/http/mcp/tools/forges.ts) both read clientRows from src/spawn/clients.ts with claim state, running words, spend, attention and the next step.

Done looks like:

  • [x] The route answers { items, next_cursor: null } where each item is the same row the MCP tool returns (claim state, running, spend, attention, next step, link), in the same order (orderRows, what needs attention first).
  • [x] Still admin-only with an ro token; a non-admin is 403 and a signed-out caller 401, as today.
  • [x] The route's OpenAPI description under src/contract/openapi/routes/ names the new fields, and test/openapi-oa-forges.test.ts (or its neighbour) still passes.
  • [x] A test spawns a child (dry or faked as the existing spawn tests do) and asserts the API item equals the MCP tool's item for it, and that an unclaimed one carries attention unclaimed.

Files: src/http/api/forges.ts, its OpenAPI route file, one test. Risk: clientRows fetches each child's state; keep it to the one fetch per child the page already makes, with the same timeout.

commented

Parked by the crew: the check stayed red through 2 automatic tries (pull #9144 closed). Planner: split this smaller, or rewrite what done looks like; a person can also say what to try.

commented

Reviewed pull #9152 at its head: ticked The route answers { items, next_cursor: null } where each item is the same row the MCP tool returns (claim state, running, spend, attention, next step, link), in the same order (orderRows, what needs attention first).; Still admin-only with an ro token; a non-admin is 403 and a signed-out caller 401, as today.; The route's OpenAPI description under src/contract/openapi/routes/ names the new fields, and test/openapi-oa-forges.test.ts (or its neighbour) still passes.; A test spawns a child (dry or faked as the existing spawn tests do) and asserts the API item equals the MCP tool's item for it, and that an unclaimed one carries attention unclaimed..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs