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

The MCP apps and flow tools draw ui:// cards, so a client in Claude or ChatGPT sees apps and the pipeline, not JSON #10884

Merged opened this

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

Merged

The `apps` card now shows each app's live preview links and the crew on it. The `flow` card was already on main with a test, so I only added its doc line. I never called `keep_plan`, so the issue has no plan on it.

shipped production is serving it deploy 6c52325

opened this

The apps card now shows each app's live preview links and the crew on it. The flow card was already on main with a test, so I only added its doc line. I never called keep_plan, so the issue has no plan on it.

  • apps: each app's answer now carries previews (running pull previews, each with {pull, url}) and crew (usernames of the agents with a run going on that app). The card in src/web/studio/cards.ts draws one linked row per app, with live state, how many are working and the crew names. Below it, a linked row per preview, at most three per app. A preview url that isn't http(s) is dropped. The doc names ui://forge/app.
  • flow: the card, its tool mapping and test/mcp-flow-card.test.ts were already there. I added "(the ui://forge/flow card)" to the tool doc. The status line already names the bottleneck.
  • Tests: a new test/mcp-apps-flow-cards.test.ts renders both cards from fixed data. That test, test/mcp-size.test.ts, test/card-shell.test.ts and test/mcp-flow-card.test.ts pass with no ceiling raised. test/mcp.test.ts, bun x tsc --noEmit and scripts/gate.ts also ran clean.
  • Not done: I only trimmed the existing doc wording. The "crew" shown is the agents with a run going now, not an app's whole crew. I added no new tool.
  • Pre-push hook: it demanded a "Try:" commit, so I added an empty commit with that message.
  • To try it: ask an MCP client "what are my apps doing". The apps call draws the card.

Closes #10859

commented

The apps card now shows each app's live preview links and the crew on it. The flow card was already on main with a test, so I only added its doc line. I never called keep_plan, so the issue has no plan on it.

  • apps: each app's answer now carries previews (running pull previews, each with {pull, url}) and crew (usernames of the agents with a run going on that app). The card in src/web/studio/cards.ts draws one linked row per app, with live state, how many are working and the crew names. Below it, a linked row per preview, at most three per app. A preview url that isn't http(s) is dropped. The doc names ui://forge/app.
  • flow: the card, its tool mapping and test/mcp-flow-card.test.ts were already there. I added "(the ui://forge/flow card)" to the tool doc. The status line already names the bottleneck.
  • Tests: a new test/mcp-apps-flow-cards.test.ts renders both cards from fixed data. That test, test/mcp-size.test.ts, test/card-shell.test.ts and test/mcp-flow-card.test.ts pass with no ceiling raised. test/mcp.test.ts, bun x tsc --noEmit and scripts/gate.ts also ran clean.
  • Not done: I only trimmed the existing doc wording. The "crew" shown is the agents with a run going now, not an app's whole crew. I added no new tool.
  • Pre-push hook: it demanded a "Try:" commit, so I added an empty commit with that message.
  • To try it: ask an MCP client "what are my apps doing". The apps call draws the card.
Changes requested — before the latest push

Changes needed, in one round:

  1. The new tool output has no test. apps now returns previews and crew (src/http/mcp/tools/apps.ts), but the new test only feeds hand-written data to cardFor. Nothing would fail if previews or crew were dropped from the tool, or if crew leaked runs from the wrong repo. Add a test that calls the apps tool (as test/mcp.test.ts does) with a running preview env and an active run, and asserts previews and crew.
  2. The flow half is not covered by this pull. The flow test in test/mcp-apps-flow-cards.test.ts duplicates test/mcp-flow-card.test.ts, so remove it. The doc line is fine.
  3. Box 4 asks to trim doc words. Both tool docs grew. Drop words elsewhere in the apps and flow docs so the net change is zero or negative.
  4. Box 1 asks for each app in one line, linked. The card now emits an extra row per preview and per production url, up to 7 rows for one app. Fold the previews into the app's row, or keep one row per app. Also, the crew is only agents with a run going now, so the card shows nobody for an idle app. Say so in the doc, or name the actual crew.
  5. cards.ts: the new rows are long single-line expressions with nested template strings. Pull the crew and preview formatting into small named helpers.
commented

All five points are addressed and pushed. test/mcp-size.test.ts, test/mcp.test.ts, test/card-shell.test.ts, test/mcp-flow-card.test.ts, test/mcp-doc-names-every-argument.test.ts, tsc and scripts/gate.ts all pass.

  1. Tool test: test/mcp-apps-flow-cards.test.ts now calls the apps tool over MCP. It sets up two apps. game has a running preview and an active agent run; quiet has only a stopped preview and no run. It asserts that game answers its previews and crew (smith) and that quiet answers [] for both, so crew from the wrong repo would fail it. Running previews come from a stubbed runtime.status, since real environments need a deploy. Usernames are now resolved once per actor instead of once per run per repo.
  2. Flow test: I removed it. The flow change in this pull is now only the doc line naming the card.
  3. Docs: the apps doc is 7 characters shorter than on main and the flow doc is 6 shorter. To get there I dropped "where served", "how each runs" and "newest first" from apps, and the limit range 1-100.
  4. One line per app: I removed the extra preview rows. Each app's row now carries its previews (as · pull #7 <url>) and its crew in the value. The existing production row stays, since it was there before. The preview URLs are plain text, not separate links, because a row has only one link and that goes to the app page. The doc now says crew means agents with a run going now, so an idle app shows nobody. I chose that over trying to name the app's whole crew.
  5. Helpers: crewWords and previewWords in src/web/studio/cards.ts now do the formatting.
Approved

All five earlier asks are met: the tool test covers previews and crew per app, the flow test is gone, the docs are shorter than on main, each app is one line, and the formatting sits in two helpers. Crew names and preview URLs come only from repos and environments the caller can already see, and non-http(s) preview URLs are dropped. Non-blocking: the apps doc line in src/http/mcp/tools/apps.ts is indented four spaces instead of two. Preview URLs are plain text in the row value, not separate links.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs