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

未关闭
#1,198 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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).

主要语言
TypeScript
星标
481
派生
45
平均合并
1 天 13 小时
30 天内合并 PR
91

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ai-driven-dev/framework 的其他 Issue

查看 ai-driven-dev/framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。