[FEATURE]: GUI plugin API: expose the new-session draft's directory and composer
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- developer-experience
Direção de pesquisa
Start by reading the GUI plugin SDK definitions and the host code for ctx.screen.current(), ctx.sessions.current(), and draft composer writes; the issue names no source files or tests. Trace how /new-session stores the draft's server and directory, then determine how the proposed API should expose them and support composer actions. Done when a plugin can read the draft directory and use its composer before the first message is sent.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Environment
- OpenCode Desktop 2.3.2, macOS
- GUI plugin SDK
@opencode/plugin2.3.2
Summary
On the new-session (draft) screen, before the first message is sent, a GUI plugin can't find out which directory the draft runs in, and can't write to its composer:
ctx.sessions.current()isundefined(documented: "Undefined on Home, on a draft…").ctx.screen.current()isundefined, so there's nocomposertoattachorinsertinto.ctx.router.path()is/new-session, with no directory in it.ctx.tabs.list()returns the draft tab withsession: undefined, and no directory.
The draft composer does list plugin slash commands, so a command that attaches context to the prompt looks available but can't do anything.
Use case
opencode-gh-search adds /pr and /issue. They search the GitHub PRs and issues of the session's repo and attach the picked one to the composer as a chip. Starting a new session with "look at PR #123" is the most common way to use it, but on a draft:
- the plugin doesn't know which repo to search, and
- it has nowhere to attach the pick.
Today it disables the commands there, or shows a toast asking the user to send a message first.
Proposal
Give plugins the draft as well as mounted sessions, for example:
ctx.screen.current()returns a screen for the draft too, with a workingcomposer(attach,insert,focus). The host already supports writes that wait for the session's stored draft.- the draft's
serveranddirectoryare readable, either on that screen, as actx.drafts.current(), or as adirectoryon the draft'sShellTab.
Related
- #60883: no side region or plugin panels on the draft screen. Same root cause: plugin APIs are keyed on a session that doesn't exist yet.
- Linguagem predominante
- TypeScript
- Estrelas
- 227k
- Forks
- 30.7k
- Merge médio
- 3h 57min
- PRs com merge (30d)
- 484
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de anomalyco/opencode
-
[Site] Active section detection should respect scroll-margin-topTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertaarea/web reproduced type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
anomalyco/opencode#65384 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area/cli type/feature version/v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
anomalyco/opencode#65379 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Shell tool: no upper bound on the timeout a model can ask for, so one call can hold a turn for hoursAbertaarea/core platform/linux type/feature version/v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
anomalyco/opencode#65254 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
inference/go type/feature
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 72/100
anomalyco/opencode#65148 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area/providers type/feature version/v2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
anomalyco/opencode#64845 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de anomalyco/opencode
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
vercel-labs/ui#999 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
melgarafael/DeskcommCRM#5109 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Doist/todoist-sdk-typescript#783 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
nicobailon/pi-subagents#3319 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia