fix(hooks): align Claude Code hooks with opencode-cc-plugin reference
100% port verification via Oracle agent parallel checks: - PreToolUse: recordToolUse(), isHookDisabled(), Object.assign(), error message - PostToolUse: recordToolResult(), isHookDisabled(), permissionMode, title field - Stop: isHookDisabled(), parentSessionId, error/interrupt state tracking - UserPromptSubmit: interrupt checks, recordUserMessage(), log messages All four hooks now match opencode-cc-plugin/src/plugin/*.ts exactly. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
@@ -69,6 +69,8 @@ function loadPluginConfig(directory: string): OhMyOpenCodeConfig {
|
||||
}
|
||||
|
||||
const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
const pluginConfig = loadPluginConfig(ctx.directory);
|
||||
|
||||
const todoContinuationEnforcer = createTodoContinuationEnforcer(ctx);
|
||||
const contextWindowMonitor = createContextWindowMonitorHook(ctx);
|
||||
const sessionRecovery = createSessionRecoveryHook(ctx);
|
||||
@@ -77,12 +79,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
const directoryAgentsInjector = createDirectoryAgentsInjectorHook(ctx);
|
||||
const emptyTaskResponseDetector = createEmptyTaskResponseDetectorHook(ctx);
|
||||
const thinkMode = createThinkModeHook();
|
||||
const claudeCodeHooks = createClaudeCodeHooksHook(ctx);
|
||||
const claudeCodeHooks = createClaudeCodeHooksHook(ctx, {});
|
||||
|
||||
updateTerminalTitle({ sessionId: "main" });
|
||||
|
||||
const pluginConfig = loadPluginConfig(ctx.directory);
|
||||
|
||||
return {
|
||||
tool: builtinTools,
|
||||
|
||||
@@ -99,10 +99,10 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
const projectAgents = loadProjectAgents();
|
||||
|
||||
config.agent = {
|
||||
...config.agent,
|
||||
...builtinAgents,
|
||||
...userAgents,
|
||||
...projectAgents,
|
||||
...config.agent,
|
||||
};
|
||||
config.tools = {
|
||||
...config.tools,
|
||||
|
||||
Reference in New Issue
Block a user