fix: remove inline imports and debug logging

- Convert all inline import() types to top-level imports
- Remove debug console.error statements from plan-mode hook
This commit is contained in:
Helmut Januschka 2026-01-03 22:36:44 +01:00
parent 816b488815
commit 0a73710cba
4 changed files with 14 additions and 25 deletions

View file

@ -12,7 +12,7 @@ import { getAgentDir } from "../../config.js";
import type { HookMessage } from "../messages.js";
import type { SessionManager } from "../session-manager.js";
import { execCommand } from "./runner.js";
import type { ExecOptions, HookAPI, HookFactory, HookMessageRenderer, RegisteredCommand } from "./types.js";
import type { ExecOptions, HookAPI, HookContext, HookFactory, HookMessageRenderer, RegisteredCommand } from "./types.js";
// Create require function to resolve module paths at runtime
const require = createRequire(import.meta.url);
@ -101,7 +101,7 @@ export interface HookShortcut {
/** Description for help */
description?: string;
/** Handler function */
handler: (ctx: import("./types.js").HookContext) => Promise<void> | void;
handler: (ctx: HookContext) => Promise<void> | void;
/** Hook path that registered this shortcut */
hookPath: string;
}
@ -296,7 +296,7 @@ function createHookAPI(
shortcut: string,
options: {
description?: string;
handler: (ctx: import("./types.js").HookContext) => Promise<void> | void;
handler: (ctx: HookContext) => Promise<void> | void;
},
): void {
shortcuts.set(shortcut, { shortcut, hookPath, ...options });