Files
oh-my-opencode/dist/create-hooks.d.ts
T
2026-03-14 04:56:50 +00:00

79 lines
6.0 KiB
TypeScript

import type { AvailableSkill } from "./agents/dynamic-agent-prompt-builder";
import type { HookName, OhMyOpenCodeConfig } from "./config";
import type { LoadedSkill } from "./features/opencode-skill-loader/types";
import type { BackgroundManager } from "./features/background-agent";
import type { PluginContext } from "./plugin/types";
import type { ModelCacheState } from "./plugin-state";
export type CreatedHooks = ReturnType<typeof createHooks>;
type DisposableHook = {
dispose?: () => void;
} | null | undefined;
export type DisposableCreatedHooks = {
runtimeFallback?: DisposableHook;
todoContinuationEnforcer?: DisposableHook;
autoSlashCommand?: DisposableHook;
};
export declare function disposeCreatedHooks(hooks: DisposableCreatedHooks): void;
export declare function createHooks(args: {
ctx: PluginContext;
pluginConfig: OhMyOpenCodeConfig;
modelCacheState: ModelCacheState;
backgroundManager: BackgroundManager;
isHookEnabled: (hookName: HookName) => boolean;
safeHookEnabled: boolean;
mergedSkills: LoadedSkill[];
availableSkills: AvailableSkill[];
}): {
disposeHooks: () => void;
categorySkillReminder: ReturnType<typeof import("./hooks").createCategorySkillReminderHook> | null;
autoSlashCommand: ReturnType<typeof import("./hooks").createAutoSlashCommandHook> | null;
gptPermissionContinuation: ReturnType<typeof import("./hooks").createGptPermissionContinuationHook> | null;
stopContinuationGuard: ReturnType<typeof import("./hooks").createStopContinuationGuardHook> | null;
compactionContextInjector: ReturnType<typeof import("./hooks").createCompactionContextInjector> | null;
compactionTodoPreserver: ReturnType<typeof import("./hooks").createCompactionTodoPreserverHook> | null;
todoContinuationEnforcer: ReturnType<typeof import("./hooks").createTodoContinuationEnforcer> | null;
unstableAgentBabysitter: ReturnType<typeof import("./plugin/unstable-agent-babysitter").createUnstableAgentBabysitter> | null;
backgroundNotificationHook: ReturnType<typeof import("./hooks").createBackgroundNotificationHook> | null;
atlasHook: ReturnType<typeof import("./hooks").createAtlasHook> | null;
claudeCodeHooks: ReturnType<typeof import("./hooks").createClaudeCodeHooksHook> | null;
keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
thinkingBlockValidator: ReturnType<typeof import("./hooks").createThinkingBlockValidatorHook> | null;
commentChecker: ReturnType<typeof import("./hooks").createCommentCheckerHooks> | null;
toolOutputTruncator: ReturnType<typeof import("./hooks").createToolOutputTruncatorHook> | null;
directoryAgentsInjector: ReturnType<typeof import("./hooks").createDirectoryAgentsInjectorHook> | null;
directoryReadmeInjector: ReturnType<typeof import("./hooks").createDirectoryReadmeInjectorHook> | null;
emptyTaskResponseDetector: ReturnType<typeof import("./hooks").createEmptyTaskResponseDetectorHook> | null;
rulesInjector: ReturnType<typeof import("./hooks").createRulesInjectorHook> | null;
tasksTodowriteDisabler: ReturnType<typeof import("./hooks").createTasksTodowriteDisablerHook> | null;
writeExistingFileGuard: ReturnType<typeof import("./hooks").createWriteExistingFileGuardHook> | null;
hashlineReadEnhancer: ReturnType<typeof import("./hooks").createHashlineReadEnhancerHook> | null;
jsonErrorRecovery: ReturnType<typeof import("./hooks").createJsonErrorRecoveryHook> | null;
readImageResizer: ReturnType<typeof import("./hooks").createReadImageResizerHook> | null;
contextWindowMonitor: ReturnType<typeof import("./hooks").createContextWindowMonitorHook> | null;
preemptiveCompaction: ReturnType<typeof import("./hooks").createPreemptiveCompactionHook> | null;
sessionRecovery: ReturnType<typeof import("./hooks").createSessionRecoveryHook> | null;
sessionNotification: ReturnType<typeof import("./hooks").createSessionNotification> | null;
thinkMode: ReturnType<typeof import("./hooks").createThinkModeHook> | null;
modelFallback: ReturnType<typeof import("./hooks").createModelFallbackHook> | null;
anthropicContextWindowLimitRecovery: ReturnType<typeof import("./hooks").createAnthropicContextWindowLimitRecoveryHook> | null;
autoUpdateChecker: ReturnType<typeof import("./hooks").createAutoUpdateCheckerHook> | null;
agentUsageReminder: ReturnType<typeof import("./hooks").createAgentUsageReminderHook> | null;
nonInteractiveEnv: ReturnType<typeof import("./hooks").createNonInteractiveEnvHook> | null;
interactiveBashSession: ReturnType<typeof import("./hooks").createInteractiveBashSessionHook> | null;
ralphLoop: ReturnType<typeof import("./hooks").createRalphLoopHook> | null;
editErrorRecovery: ReturnType<typeof import("./hooks").createEditErrorRecoveryHook> | null;
delegateTaskRetry: ReturnType<typeof import("./hooks").createDelegateTaskRetryHook> | null;
startWork: ReturnType<typeof import("./hooks").createStartWorkHook> | null;
prometheusMdOnly: ReturnType<typeof import("./hooks").createPrometheusMdOnlyHook> | null;
sisyphusJuniorNotepad: ReturnType<typeof import("./hooks").createSisyphusJuniorNotepadHook> | null;
noSisyphusGpt: ReturnType<typeof import("./hooks").createNoSisyphusGptHook> | null;
noHephaestusNonGpt: ReturnType<typeof import("./hooks").createNoHephaestusNonGptHook> | null;
questionLabelTruncator: ReturnType<typeof import("./hooks").createQuestionLabelTruncatorHook> | null;
taskResumeInfo: ReturnType<typeof import("./hooks").createTaskResumeInfoHook> | null;
anthropicEffort: ReturnType<typeof import("./hooks/anthropic-effort").createAnthropicEffortHook> | null;
runtimeFallback: ReturnType<typeof import("./hooks").createRuntimeFallbackHook> | null;
delegateTaskEnglishDirective: ReturnType<typeof import("./hooks").createDelegateTaskEnglishDirectiveHook> | null;
};
export {};