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

Registry: MCP registry_search and registry_install, and a src/tui listing (#6009) #17193

opened this

Check · Review · Land · Live — Its check is queued. Next: reviewer, pushed since the last review.

Ready to land

This adds the MCP tools registrysearch and registryinstall and a terminal listing of the registry. They are the other doors of /r, which is on main now (the earlier decline predates it). A slice of #6009 (#17041).

Notes · 14 files · +508 −29

Look

9 pages beside main · 0 new to this pull

/apps

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/changelog

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/docs

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/explore

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/looks/failed

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/looks/missing

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/notes

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/review

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

/security

main

at 01e9b02 ·

this pull

In the dark

main

at 01e9b02 ·

this pull

at 451b076 ·

opened this

This adds the MCP tools registry_search and registry_install and a terminal listing of the registry. They are the other doors of /r, which is on main now (the earlier decline predates it). A slice of #6009 (#17041).

  • registry_search takes { query? } and returns the items whose name, title, description or type contain every word, name matches first. Each result has its version and what it dependsOn. An empty query lists all. It is read-only and is held for no scope.
  • registry_install takes { repo, item } and opens a pull on registry/install-<item>-<version>. The pull writes the item's files and those of the items it depends on, so the app owns the copy. Nothing lands until a person merges.
    • It needs an admin of the repository with an admin-scope token, the same gate as app_registry. Anyone else gets "no such app".
    • Asked twice, it finds the first pull instead of opening another. Asked again after the merge, it notes the install, so the existing update pulls follow.
  • Terminal: the palette's Component registry lists the items. / searches, and i asks for an owner/name and runs the same install. An app's Registry items screen reaches the listing with a.
  • Code and docs: the search and plan code is in src/registry/search.ts, the install action in src/actions/registry_install.ts, and the screen in src/tui/screens/registry_items.ts. The how-to is docs/features/registry-search.md, and component-registry.md links to it.
  • Tests: test/registry-install.test.ts covers search, dependency order, the MCP scope and stranger refusals, the opened, already and merged outcomes, and the terminal screen. I also updated the expected rosters in test/palette-roster.test.ts and test/mcp-forge-protocol.test.ts.

Checks: tsc is clean. gate.ts --explain read 32 rules with 0 fails. The unused-exports, palette-roster, MCP, own-source and feature-doors tests pass. I did not run the full suite; the forge's check runs it. After --fix the gate still prints three "one implementation?" notes: visit against withDependencies in search.ts, and the test's open helper against tui-report.test.ts's palette. They are advisory and I left them.

Left out:

  • No API route, since the issue asked for MCP and terminal.
  • No three-way merge of local edits.
  • Private items and the gallery are still not built.

Try it: open the palette's Component registry in a terminal, press / and type empty, then press i and enter an app you admin. Or call registry_search with {"query":"empty"} over the MCP.

Closes #17041

2 earlier comments
commented

This adds the MCP tools registry_search and registry_install and a terminal listing of the registry. They are the other doors of /r, which is on main now (the earlier decline predates it). A slice of #6009 (#17041).

  • registry_search takes { query? } and returns the items whose name, title, description or type contain every word, name matches first. Each result has its version and what it dependsOn. An empty query lists all. It is read-only and is held for no scope.
  • registry_install takes { repo, item } and opens a pull on registry/install-<item>-<version>. The pull writes the item's files and those of the items it depends on, so the app owns the copy. Nothing lands until a person merges.
    • It needs an admin of the repository with an admin-scope token, the same gate as app_registry. Anyone else gets "no such app".
    • Asked twice, it finds the first pull instead of opening another. Asked again after the merge, it notes the install, so the existing update pulls follow.
  • Terminal: the palette's Component registry lists the items. / searches, and i asks for an owner/name and runs the same install. An app's Registry items screen reaches the listing with a.
  • Code and docs: the search and plan code is in src/registry/search.ts, the install action in src/actions/registry_install.ts, and the screen in src/tui/screens/registry_items.ts. The how-to is docs/features/registry-search.md, and component-registry.md links to it.
  • Tests: test/registry-install.test.ts covers search, dependency order, the MCP scope and stranger refusals, the opened, already and merged outcomes, and the terminal screen. I also updated the expected rosters in test/palette-roster.test.ts and test/mcp-forge-protocol.test.ts.

Checks: tsc is clean. gate.ts --explain read 32 rules with 0 fails. The unused-exports, palette-roster, MCP, own-source and feature-doors tests pass. I did not run the full suite; the forge's check runs it. After --fix the gate still prints three "one implementation?" notes: visit against withDependencies in search.ts, and the test's open helper against tui-report.test.ts's palette. They are advisory and I left them.

Left out:

  • No API route, since the issue asked for MCP and terminal.
  • No three-way merge of local edits.
  • Private items and the gallery are still not built.

Try it: open the palette's Component registry in a terminal, press / and type empty, then press i and enter an app you admin. Or call registry_search with {"query":"empty"} over the MCP.

commented

I fixed one of the five failures and pushed it. The other four fail for reasons that aren't in this pull.

What changed. I added registry_install to the NOT_ASKED list in test/conversation-confirm.test.ts. The tool is writes: true and appears on neither that list nor ASKING, which is what failed "every tool that writes asks first or is named as one that does not (#8230)". It opens a pull, so a person can still review or close it. That makes it the same kind of write as open_pull, which is already on the list. test/conversation-confirm.test.ts now passes, 27 of 27.

What I left alone.

  • Page bytes and "falls to Live" in the talk-page tests: both fail the same way with my change stashed, and the check log says talk-page and talk-pane-bar are red on main too.
  • "fork flows" and "a writer's update names the agent and queues its run": I didn't reproduce either failure. test/fork-flows.test.ts passes 11 of 11 locally, which suggests the check run was flaky rather than broken. I didn't run the "writer's update" test.

Gate. bun scripts/gate.ts --fix changed nothing. It still lists similarity warnings about withDependencies and visit in src/registry/search.ts, and about open in test/registry-install.test.ts. I left those. I didn't run bun x tsc --noEmit this turn.

Try it.

  • In a terminal, open the palette's Component registry, press / and type empty.
  • Or call registry_search over the MCP with {"query":"empty"}.

🤖 Generated with Claude Code

commented

This update fixes the closed-pull block from the review and covers the two smaller points. test/registry-install.test.ts passes and tsc --noEmit is clean. I ran no other tests locally; the forge runs the full check on the push.

  • Closed pulls no longer block an item. installRegistryItem now treats a closed, unmerged pull as no pull. It opens the new pull on the next free branch, registry/install-<item>-<version>-2, then -3, and so on. I did this because editFiles with newBranch fails on a branch that already exists, so reusing the old name would have failed. A merged pull is still merged, and an open one is still already. The new test installs, closes the pull and installs again. That opens a different pull, and a third ask answers already with the new number.
  • The non-admin reader path is covered. A new test has bob, who can read alice's public app, press i in the terminal. It asserts "Installing is the app's admin's.", so deleting that branch now fails a test.
  • The terminal install test looks up button by name. It filters to the item with / instead of pressing j and indexing ITEMS[1].

The gate also asked for a "Replaces:" line on the two MCP tool files, so I added it to a commit message. A comment rewrap is committed too. I left the "one implementation?" notes alone, as you said, and the one for open in the test file too.

Sign in to join this conversation.

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

Keyboard shortcuts

Docs