()
| 27 | const NOOP_RESULT: HookEventResult = { blocked: false, results: [] }; |
| 28 | |
| 29 | function getCommonFields(): { |
| 30 | session_id: string; |
| 31 | transcript_path: string; |
| 32 | cwd: string; |
| 33 | permission_mode?: string; |
| 34 | } { |
| 35 | try { |
| 36 | const session = getCurrentSession(); |
| 37 | const permissionMode = services.toolPermissions?.isReady() |
| 38 | ? services.toolPermissions.getState().currentMode |
| 39 | : undefined; |
| 40 | |
| 41 | return { |
| 42 | session_id: session.sessionId, |
| 43 | transcript_path: "", // We don't have a transcript file like Claude Code |
| 44 | cwd: process.cwd(), |
| 45 | permission_mode: permissionMode, |
| 46 | }; |
| 47 | } catch { |
| 48 | return { |
| 49 | session_id: "", |
| 50 | transcript_path: "", |
| 51 | cwd: process.cwd(), |
| 52 | }; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | function isHookServiceReady(): boolean { |
| 57 | try { |
no test coverage detected