[FEATURE]: Plugin sources for the composer's @ mention popup (Desktop and TUI)

Offen
#65,155 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
12/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
typescript

Rechercherichtung

This is a design proposal for a MentionSource registry in the GUI and a matching TUI API, so the first step is agreeing on the shape with maintainers rather than coding. Relevant context is the existing @ popup, which lists files, agents, skills and sessions, and how an @ file mention is turned into a chip on Desktop and a mention part in the TUI. Related issues #62368, #65154 and #51209 should be read first, since they overlap on the composer and plugin APIs. Done would mean an accepted API design and a plan for both clients.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area/plugins type/feature version/v2
Summary

Let plugins add their own results to the composer's @ mention popup, in both Desktop and the TUI. Today @ lists files, agents, skills and sessions, and all of these are built in.

Use case

opencode-gh-search searches the GitHub PRs and issues of the session's repo. Right now it's a /pr and /issue slash command that opens a dialog. What users actually want is to type @ while writing, then something like #123 or @fix login, and pick a PR inline the way they'd pick a file.

To build that today, a plugin would need its own popup and its own key handling:

  • In the TUI, plugins can't add parts to the prompt, so the plugin types a URL into it.
  • In Desktop, it attaches a chip. Neither works on the new-session screen (#65154).
Proposal

A MentionSource registry (GUI) and a matching TUI API. For example:

ctx.add(MentionSource, {
  id: "github",
  label: "GitHub",                 // group header in the popup
  // Called as the user types after `@`; results show next to files and agents.
  search: async ({ query, directory, signal }) => [
    { id: "pr:123", title: "Fix login", description: "#123 · open", icon: "github",
      part: { type: "note", label: "app#123", subject: "https://github.com/…/pull/123", href: "…" } },
  ],
})
  • Results show up in the existing @ popup, with the host's keys and styling.
  • Picking one inserts the item's part the way an @ file mention does: a chip on Desktop, a mention part in the TUI.
  • directory is the session's or the draft's directory, so it also works before the first message.
Related
  • #62368: TUI plugin autocomplete with its own trigger character. This issue asks for sources in the existing @ popup instead, on both clients.
  • #65154: the GUI plugin API has no access to the new-session draft's directory or composer.
  • #51209: expose the V2 TUI composer to plugins.
Vorherrschende Sprache
TypeScript
Sterne
227k
Forks
30.7k
Ø Merge
3 Std. 57 Min.
Gemergte PRs (30 T.)
484

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus anomalyco/opencode

Alle Issues in anomalyco/opencode

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.