feat(config): add disabled_hooks option for selective hook disabling

Allow users to individually disable built-in hooks via the
`disabled_hooks` configuration option in oh-my-opencode.json.

This addresses issue #28 where users requested the ability to
selectively disable hooks (e.g., comment-checker) that may
conflict with their workflow.

Available hooks:
- todo-continuation-enforcer
- context-window-monitor
- session-recovery
- comment-checker
- grep-output-truncator
- directory-agents-injector
- directory-readme-injector
- empty-task-response-detector
- think-mode
- anthropic-auto-compact
- rules-injector
- background-notification
- auto-update-checker

Closes #28
This commit is contained in:
Claude
2025-12-13 03:10:39 +00:00
committed by YeonGyu-Kim
parent 08e2bb4034
commit e131491db4
4 changed files with 114 additions and 34 deletions

View File

@@ -4,6 +4,7 @@ export {
AgentOverridesSchema,
McpNameSchema,
AgentNameSchema,
HookNameSchema,
} from "./schema"
export type {
@@ -12,4 +13,5 @@ export type {
AgentOverrides,
McpName,
AgentName,
HookName,
} from "./schema"

View File

@@ -24,6 +24,22 @@ export const AgentNameSchema = z.enum([
"document-writer",
])
export const HookNameSchema = z.enum([
"todo-continuation-enforcer",
"context-window-monitor",
"session-recovery",
"comment-checker",
"grep-output-truncator",
"directory-agents-injector",
"directory-readme-injector",
"empty-task-response-detector",
"think-mode",
"anthropic-auto-compact",
"rules-injector",
"background-notification",
"auto-update-checker",
])
export const AgentOverrideConfigSchema = z.object({
model: z.string().optional(),
temperature: z.number().min(0).max(2).optional(),
@@ -62,6 +78,7 @@ export const OhMyOpenCodeConfigSchema = z.object({
$schema: z.string().optional(),
disabled_mcps: z.array(McpNameSchema).optional(),
disabled_agents: z.array(AgentNameSchema).optional(),
disabled_hooks: z.array(HookNameSchema).optional(),
agents: AgentOverridesSchema.optional(),
claude_code: ClaudeCodeConfigSchema.optional(),
google_auth: z.boolean().optional(),
@@ -71,5 +88,6 @@ export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>
export type AgentOverrideConfig = z.infer<typeof AgentOverrideConfigSchema>
export type AgentOverrides = z.infer<typeof AgentOverridesSchema>
export type AgentName = z.infer<typeof AgentNameSchema>
export type HookName = z.infer<typeof HookNameSchema>
export { McpNameSchema, type McpName } from "../mcp/types"