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

MCP `pull` carries the pull's looks: each picture with its width, line and URL #8438

Merged opened this

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

Merged

MCP `pull` now returns a `looks` list, so an agent sees a pull's pictures without a second call.

shipped production is serving it deploy 45be4c2

opened this

MCP pull now returns a looks list, so an agent sees a pull's pictures without a second call.

Each entry is { id, width, says, by, commit, url, at }, newest first. The look URL (url) comes from lookUrl, and the list is read from looksForEnv for the pull's preview environment. A pull with no app or no looks gets looks: []. by is the attacher's username, or null for a look the forge took itself. Looks that failed to render are left out. The tool's doc now names looks.

Writers only. looks is filled only for someone who can write the repository; anyone else gets []. The issue didn't say this. I did it because attached looks are shown to writers only, and mayFetchLook keeps the owner's pictures with the writers too. Reusing mayFetchLook would have pulled web code into the MCP, so I chose the simpler gate. A reader could be shown the nobody-taken looks later.

Docs. docs/MCP.md and docs/mcp/tools/ don't exist in this tree. The tool list is served live from each tool's doc, and scripts/mcp-tools.ts writes only src/http/mcp/tools/index.ts. Nothing needed regenerating.

Tests. A new test in test/attach-look.test.ts attaches a look through MCP attach_look and reads it back from MCP pull, checking its fields, its URL and the newest-first order. It also checks that a non-writer sees [] and that a second pull with none has looks: []. These pass: bun test test/mcp* (which includes the size ceilings and doc checks), test/attach-look.test.ts, and bun x tsc --noEmit. bun scripts/gate.ts printed nothing, and I didn't check its exit code. I did not touch src/http/api.ts or the OpenAPI rows.

Closes #8425

commented

MCP pull now returns a looks list, so an agent sees a pull's pictures without a second call.

Each entry is { id, width, says, by, commit, url, at }, newest first. The look URL (url) comes from lookUrl, and the list is read from looksForEnv for the pull's preview environment. A pull with no app or no looks gets looks: []. by is the attacher's username, or null for a look the forge took itself. Looks that failed to render are left out. The tool's doc now names looks.

Writers only. looks is filled only for someone who can write the repository; anyone else gets []. The issue didn't say this. I did it because attached looks are shown to writers only, and mayFetchLook keeps the owner's pictures with the writers too. Reusing mayFetchLook would have pulled web code into the MCP, so I chose the simpler gate. A reader could be shown the nobody-taken looks later.

Docs. docs/MCP.md and docs/mcp/tools/ don't exist in this tree. The tool list is served live from each tool's doc, and scripts/mcp-tools.ts writes only src/http/mcp/tools/index.ts. Nothing needed regenerating.

Tests. A new test in test/attach-look.test.ts attaches a look through MCP attach_look and reads it back from MCP pull, checking its fields, its URL and the newest-first order. It also checks that a non-writer sees [] and that a second pull with none has looks: []. These pass: bun test test/mcp* (which includes the size ceilings and doc checks), test/attach-look.test.ts, and bun x tsc --noEmit. bun scripts/gate.ts printed nothing, and I didn't check its exit code. I did not touch src/http/api.ts or the OpenAPI rows.

Approved

Clean, small and safe. MCP pull now returns looks for the pull preview env. The list is gated on canWrite, so non-writers get [] and nothing leaks. Errored looks are filtered out and URLs come from lookUrl. The test covers the fields, newest-first order, a non-writer and a pull with no looks. The tool doc names the field, and no README or dependency was touched. Minor, not blocking: no test covers a failed look being left out.

commented

Left #8425 open: 4 unticked items remain (MCP pull (src/http/mcp/tools/pull.ts) answers a looks list: [{ id, width, says, by, commit, url, at }], newest first, from looksForEnv (src/core/looks.ts) for the pull's preview environment, url from lookUrl. No app or no looks is looks: [].; The tool's doc names looks; docs/MCP.md and docs/mcp/tools/ regenerated with bun scripts/mcp-tools.ts.; Test: a look attached with MCP attach_look comes back in MCP pull; a pull with none has looks: [].; …).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs