- Split 25+ index.ts files into hook.ts + extracted modules - Rename all catch-all utils.ts/helpers.ts to domain-specific names - Split src/tools/lsp/ into ~15 focused modules - Split src/tools/delegate-task/ into ~18 focused modules - Separate shared types from implementation - 155 files changed, 60+ new files created - All typecheck clean, 61 tests pass
27 lines
640 B
TypeScript
27 lines
640 B
TypeScript
import type { BackgroundManager } from "../../features/background-agent"
|
|
|
|
interface Event {
|
|
type: string
|
|
properties?: Record<string, unknown>
|
|
}
|
|
|
|
interface EventInput {
|
|
event: Event
|
|
}
|
|
|
|
/**
|
|
* Background notification hook - handles event routing to BackgroundManager.
|
|
*
|
|
* Notifications are now delivered directly via session.prompt({ noReply })
|
|
* from the manager, so this hook only needs to handle event routing.
|
|
*/
|
|
export function createBackgroundNotificationHook(manager: BackgroundManager) {
|
|
const eventHandler = async ({ event }: EventInput) => {
|
|
manager.handleEvent(event)
|
|
}
|
|
|
|
return {
|
|
event: eventHandler,
|
|
}
|
|
}
|