feat(aidd-context): one helper for files changed this turn in hooks, and OpenCode V2 plugin shape

Aberta
#1,198 0 comentários 0 reações 0 responsáveis Ver no GitHub

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
55/100
Tipo de issue
Funcionalidade
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
node.js, typescript

Direção de pesquisa

Start with plugins/aidd-context/hooks/lib/host.cjs and cli/src/contexts/tools/domain/profiles/opencode/opencode-hooks-bridge.ts; review #1191, #1193, and #978 for related context. Build and check the Node built-ins helper against Bash writes, then test whether the existing bridge loads with the described OpenCode V2 plugin shape. Done means the Bash write is detected and V2 is either supported or documented as unsupported with a test.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Problem

plugins/aidd-context/hooks/lib/host.cjs reads written files only for Write and Edit (WRITES, line 17) from tool_input.file_path. Writes through Bash, Codex apply_patch and the write tools of other hosts are missed. The contract says not to filter on tool names.

The OpenCode bridge targets the 1.x plugin shape. OpenCode V2 (2.2.7, measured 2026-11-11) uses a default-exported { id, setup(ctx) } in .opencode/plugins/<name>/index.js with ctx.tool.hook("execute.before" | "execute.after"), and its input field is path, not filePath. The 1.x bridge most likely does not load on V2 (deduced, not tested).

Scope
  • A Node built-ins helper for hooks: sha1 of the relevant files at SessionStart and after each successful Stop; the difference is "changed this turn". No git, under 5 s.
  • Hooks use it instead of tool names.
  • Test whether the OpenCode bridge loads on V2, then either support V2 or document it as unsupported.
Acceptance criteria
  • A write made through Bash is seen by a hook using the helper.
  • OpenCode V2 is either supported or documented as unsupported, with a test behind the statement.
Prior art in this repo
  • plugins/aidd-context/hooks/lib/host.cjs, cli/src/contexts/tools/domain/profiles/opencode/opencode-hooks-bridge.ts, #1191, #1193, #978.
Out of scope

Relaying new events on OpenCode and Kilo (#1193).

Linguagem predominante
TypeScript
Estrelas
481
Forks
45
Merge médio
1d 13h
PRs com merge (30d)
91

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de ai-driven-dev/framework

Todas as issues de ai-driven-dev/framework

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.