feat(coding-agent): implement hooks system
- Add hooks infrastructure in core/hooks/ (loader, runner, types)
- HookUIContext interface with mode-specific implementations
- Interactive mode: TUI-based selector/input/confirm dialogs
- RPC mode: JSON protocol for hook UI requests/responses
- Print mode: no-op UI context (hooks run but can't prompt)
- AgentSession.branch() now async, returns { selectedText, skipped }
- Settings: hooks[] and hookTimeout configuration
- Export hook types from package for hook authors
Based on PR #147 proposal, adapted for new architecture.
This commit is contained in:
17
packages/coding-agent/src/core/hooks/index.ts
Normal file
17
packages/coding-agent/src/core/hooks/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export { type LoadedHook, type LoadHooksResult, loadHooks } from "./loader.js";
|
||||
export { type HookErrorListener, HookRunner } from "./runner.js";
|
||||
export type {
|
||||
AgentEndEvent,
|
||||
AgentStartEvent,
|
||||
BranchEvent,
|
||||
BranchEventResult,
|
||||
ExecResult,
|
||||
HookAPI,
|
||||
HookError,
|
||||
HookEvent,
|
||||
HookEventContext,
|
||||
HookFactory,
|
||||
HookUIContext,
|
||||
TurnEndEvent,
|
||||
TurnStartEvent,
|
||||
} from "./types.js";
|
||||
Reference in New Issue
Block a user