feat(hooks): add hashline-edit-diff-enhancer for TUI inline diff display

Capture file content before hashline edit execution and compute filediff
metadata after, enabling opencode TUI to render inline diffs for the
plugin's edit tool (which replaces the built-in EditTool).
This commit is contained in:
YeonGyu-Kim
2026-02-19 14:56:54 +09:00
parent 02bb5d43cc
commit 50de1a18f2
8 changed files with 326 additions and 0 deletions
+1
View File
@@ -29,6 +29,7 @@ export function createToolExecuteBeforeHandler(args: {
await hooks.prometheusMdOnly?.["tool.execute.before"]?.(input, output)
await hooks.sisyphusJuniorNotepad?.["tool.execute.before"]?.(input, output)
await hooks.atlasHook?.["tool.execute.before"]?.(input, output)
await hooks.hashlineEditDiffEnhancer?.["tool.execute.before"]?.(input, output)
if (input.tool === "task") {
const argsObject = output.args
const category = typeof argsObject.category === "string" ? argsObject.category : undefined