Skip to content

Commit f10c15d

Browse files
committed
feat: wire comment-checker hook to main plugin
1 parent fdb39ba commit f10c15d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Plugin } from "@opencode-ai/plugin"
22
import { createBuiltinAgents } from "./agents"
3-
import { createTodoContinuationEnforcer, createContextWindowMonitorHook, createSessionRecoveryHook } from "./hooks"
3+
import { createTodoContinuationEnforcer, createContextWindowMonitorHook, createSessionRecoveryHook, createCommentCheckerHooks } from "./hooks"
44
import { updateTerminalTitle } from "./features/terminal"
55
import { builtinTools } from "./tools"
66
import { createBuiltinMcps } from "./mcp"
@@ -43,6 +43,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
4343
const todoContinuationEnforcer = createTodoContinuationEnforcer(ctx)
4444
const contextWindowMonitor = createContextWindowMonitorHook(ctx)
4545
const sessionRecovery = createSessionRecoveryHook(ctx)
46+
const commentChecker = createCommentCheckerHooks()
4647

4748
updateTerminalTitle({ sessionId: "main" })
4849

@@ -161,7 +162,9 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
161162
}
162163
},
163164

164-
"tool.execute.before": async (input, _output) => {
165+
"tool.execute.before": async (input, output) => {
166+
await commentChecker["tool.execute.before"](input, output)
167+
165168
if (input.sessionID === mainSessionID) {
166169
updateTerminalTitle({
167170
sessionId: input.sessionID,
@@ -175,6 +178,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
175178

176179
"tool.execute.after": async (input, output) => {
177180
await contextWindowMonitor["tool.execute.after"](input, output)
181+
await commentChecker["tool.execute.after"](input, output)
178182

179183
if (input.sessionID === mainSessionID) {
180184
updateTerminalTitle({

0 commit comments

Comments
 (0)