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

MCP `pull` answers with a `ui://forge/pull` card: title, state, checks, preview link #5345

opened this

Merged 38d 19h ago, live in production

The MCP pull tool now also returns a ui://forge/pull card model for hosts that draw MCP Apps cards. Its text answer is unchanged. The type check reports no errors, test/mcp.test.ts passes (39 tests), and scripts/design-lint.ts is clean.

Notes

opened this

The MCP pull tool now also returns a ui://forge/pull card model for hosts that draw MCP Apps cards. Its text answer is unchanged. The type check reports no errors, test/mcp.test.ts passes (39 tests), and scripts/design-lint.ts is clean. I did not run the full check.

  • Card: the title is #N title. The status reads open · check green|red|running|cancelled · conflicts, or just merged or closed once the pull is no longer open. Rows are head → base, linked to the pull on the forge, the conflicting paths when there are any, and a Preview row. The card is plain text, with no HTML in the model.
  • Links: every link is absolute and http(s); anything else is dropped (the hostile-preview case in the test is dropped).
  • Registration: CardKind gains pull, CARD_OF_TOOL maps pull to it, and the kind list is extended, so resources/list and resources/read serve ui://forge/pull. tools/list ties the pull tool to it.
  • Extra data for the card: the pull answer has no repository slug or preview URL, and adding them would change the text. So an Answer can now carry a card hint that cardFor reads and the text reply never includes. The pull tool fills it with owner/name and, only while the pull is open and the repository is an app, the preview URL. That meant touching src/http/mcp.ts, which the issue allowed only if the kind list wasn't derived.
  • Tests: test/mcp.test.ts extends the resources test with ui://forge/pull and the pull tool's resource link. A new test covers an open pull with a green check and conflicts, a merged pull with no preview, and a javascript: preview URL being dropped. I didn't add a test that calls the pull tool end to end, so the link from the tool to the card hint is checked only by the type check.
  • Left out: the card has no action buttons (merge, say), and I did not try it in a live host.

Closes #5318

4 earlier comments
commented

The MCP pull tool now also returns a ui://forge/pull card model for hosts that draw MCP Apps cards. Its text answer is unchanged. The type check reports no errors, test/mcp.test.ts passes (39 tests), and scripts/design-lint.ts is clean. I did not run the full check.

  • Card: the title is #N title. The status reads open · check green|red|running|cancelled · conflicts, or just merged or closed once the pull is no longer open. Rows are head → base, linked to the pull on the forge, the conflicting paths when there are any, and a Preview row. The card is plain text, with no HTML in the model.
  • Links: every link is absolute and http(s); anything else is dropped (the hostile-preview case in the test is dropped).
  • Registration: CardKind gains pull, CARD_OF_TOOL maps pull to it, and the kind list is extended, so resources/list and resources/read serve ui://forge/pull. tools/list ties the pull tool to it.
  • Extra data for the card: the pull answer has no repository slug or preview URL, and adding them would change the text. So an Answer can now carry a card hint that cardFor reads and the text reply never includes. The pull tool fills it with owner/name and, only while the pull is open and the repository is an app, the preview URL. That meant touching src/http/mcp.ts, which the issue allowed only if the kind list wasn't derived.
  • Tests: test/mcp.test.ts extends the resources test with ui://forge/pull and the pull tool's resource link. A new test covers an open pull with a green check and conflicts, a merged pull with no preview, and a javascript: preview URL being dropped. I didn't add a test that calls the pull tool end to end, so the link from the tool to the card hint is checked only by the type check.
  • Left out: the card has no action buttons (merge, say), and I did not try it in a live host.
commented

The MCP pull tool now also returns a ui://forge/pull card for hosts that draw MCP Apps cards. Its text answer is unchanged. The type check is clean and test/mcp.test.ts passes (40 tests); I did not run the full check.

  • Card: the title is #N title. The status reads open, merged or closed, plus check green/red/running and conflicts while the pull is open. Rows are head → base, linked to the pull on the forge, the conflicting paths, and a Preview row. Every link is absolute http(s) and the model is plain text.
  • Registration: CardKind has pull, CARD_OF_TOOL maps pull to it, and resources/list and resources/read serve ui://forge/pull.
  • Card data: the pull answer has no repository slug or preview URL, and adding them would change the text. So an answer can carry a card hint that cardFor reads and the text reply never includes. This touches src/http/mcp.ts.
  • Preview row (review fix): the row now shows only when appView lists a pull-N environment, the same source previewCard uses on the pull page, so both agree. A fork head waiting for approval, a first deploy still running or a cancelled deploy gets no row. The link is that environment's own URL.
  • Wiring test (review fix): a new tools/call pull test goes through the MCP endpoint. It checks that the Branches row links /alice/game/pulls/N, that there is no Preview row when the pull has no environment, and that the text content has no card key. The test runtime serves no environments, so the positive Preview case is covered only by the direct cardFor tests.
  • Left out: the card has no action buttons, and I did not try it in a live host.
commented

The MCP pull tool now also returns a ui://forge/pull card for hosts that draw MCP Apps cards. Its text answer is unchanged. I last ran the type check and test/mcp.test.ts (40 tests) before this docs-only commit, and both passed. I did not run the full check, and I did not try the card in a live host.

  • Card: the title is #N title. The status reads open, merged or closed, plus check green/red/running and conflicts while the pull is open. Rows are head → base, linked to the pull on the forge, the conflicting paths, and a Preview row. Every link is absolute http(s) and the model is plain text.
  • Registration: CardKind has pull, CARD_OF_TOOL maps pull to it, and resources/list and resources/read serve ui://forge/pull.
  • Preview row: it shows only when appView lists a pull-N environment, the same source the pull page's previewCard uses. A pull with no environment gets no row.
  • Card data: the pull answer has no repository slug or preview URL, and adding them would change the text. So an answer can carry a card hint that cardFor reads and the text reply never includes. This touches src/http/mcp.ts.
  • Docs: docs/MCP.md now names ui://forge/pull in its Cards paragraph. The pull row in its tools table says what the card shows.
  • Tests: a tools/call pull test goes through the endpoint and checks the Branches link, no Preview row without an environment, and no card key in the text. The test runtime serves no environments, so the positive Preview case is covered only by the direct cardFor tests.
  • Left out: the card has no action buttons.
commented

The full gate on land was red; the pull is open again. Red tests:

  • tools/list stays under 40 KB, with 3 KB of headroom (37,000 bytes)
  • tools/list stays under 40 KB, with 3 KB of headroom (37,000 bytes) [21.99ms] [shard 630]

Red on top of #5133, #5362, #5137, which landed first from the same merge-queue candidate: red on its own on that base, or only together with them. Bring this pull up to date with the base and push.

commented

The tools/list size test was red because the pull tool's new _meta.ui.resourceUri pushed the list 46 bytes past its 37,000-byte headroom. I merged origin/main into the branch, trimmed four tool descriptions and pushed. test/mcp-size.test.ts, test/mcp.test.ts, test/mcp-pulls.test.ts and test/access-log.test.ts pass, and the type check is clean. I did not re-run the full check.

  • Descriptions trimmed: wording only, on flow, access, asks_act and propose_to_parent_forge. I left the signup and quotas wording alone because test/mcp.test.ts pins signup's text. I did not raise the ceiling.
  • The feature: the pull tool still answers with a ui://forge/pull card beside the unchanged text answer. The card has the title, state with check and conflicts, head → base linked to the pull, and a preview link only when the pull has an environment. The tests and docs/MCP.md are as before.
  • Left out: the card has no action buttons. The positive Preview row is covered only by the direct cardFor test, because the test runtime serves no environments.
Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs