@@ -11,12 +11,10 @@ import (
1111// Each agent implementation (Claude Code, Cursor, Aider, etc.) converts its
1212// native format to the normalized types defined in this package.
1313//
14- // The interface is organized into four groups:
15- //
14+ // The interface is organized into three groups:
1615// - Identity (5 methods): Name, Type, Description, DetectPresence, ProtectedDirs
17- // - Event Mapping (2 methods): HookNames, ParseHookEvent
1816// - Transcript Storage (3 methods): ReadTranscript, ChunkTranscript, ReassembleTranscript
19- // - Legacy (8 methods): Will be moved to optional interfaces or removed in a future phase
17+ // - Legacy (6 methods): Will be moved to optional interfaces or removed in a future phase
2018type Agent interface {
2119 // --- Identity ---
2220
@@ -41,18 +39,6 @@ type Agent interface {
4139 // Examples: [".claude"] for Claude, [".gemini"] for Gemini.
4240 ProtectedDirs () []string
4341
44- // --- Event Mapping ---
45-
46- // HookNames returns the hook verbs this agent supports.
47- // These become subcommands under `entire hooks <agent>`.
48- // e.g., ["stop", "user-prompt-submit", "session-start", "session-end"]
49- HookNames () []string
50-
51- // ParseHookEvent translates an agent-native hook into a normalized lifecycle Event.
52- // Returns nil if the hook has no lifecycle significance (e.g., pass-through hooks).
53- // This is the core contribution surface for new agent implementations.
54- ParseHookEvent (hookName string , stdin io.Reader ) (* Event , error )
55-
5642 // --- Transcript Storage ---
5743
5844 // ReadTranscript reads the raw transcript bytes for a session.
@@ -91,9 +77,23 @@ type Agent interface {
9177// HookSupport is implemented by agents with lifecycle hooks.
9278// This optional interface allows agents like Claude Code and Cursor to
9379// install and manage hooks that notify Entire of agent events.
80+ //
81+ // The interface is organized into two groups:
82+ // - Hook Mapping (2 methods): HookNames, ParseHookEvent
83+ // - Hook Management (3 methods): InstallHooks, UninstallHooks, AreHooksInstalled
9484type HookSupport interface {
9585 Agent
9686
87+ // HookNames returns the hook verbs this agent supports.
88+ // These become subcommands under `entire hooks <agent>`.
89+ // e.g., ["stop", "user-prompt-submit", "session-start", "session-end"]
90+ HookNames () []string
91+
92+ // ParseHookEvent translates an agent-native hook into a normalized lifecycle Event.
93+ // Returns nil if the hook has no lifecycle significance (e.g., pass-through hooks).
94+ // This is the core contribution surface for new agent implementations.
95+ ParseHookEvent (hookName string , stdin io.Reader ) (* Event , error )
96+
9797 // InstallHooks installs agent-specific hooks.
9898 // If localDev is true, hooks point to local development build.
9999 // If force is true, removes existing Entire hooks before installing.
0 commit comments