1---2name: hooks3description: Skill for the Hooks area of Wiki. 371 symbols across 150 files.4---56# Hooks78371 symbols | 150 files | Cohesion: 55%910## When to Use1112- Working with code in `AI/`13- Understanding how mergeHookPresets, normalizeHooksPath, normalizeServePath work14- Modifying hooks-related functionality1516## Key Files1718| File | Symbols |19|------|---------|20| `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | ensureGcloudOnPath, resolvePythonExecutablePath, gcloudEnv, runGcloudCommand, ensureDependency (+10) |21| `AI/3-Application/Openclaw-source/src/hooks/message-hook-mappers.ts` | buildCanonicalSentMessageHookContext, toPluginMessageContext, toPluginMessageSentEvent, toInternalMessageSentContext, deriveInboundMessageHookContext (+8) |22| `AI/3-Application/Openclaw-source/src/hooks/internal-hooks.ts` | isHookEventTypeAndAction, getHookContext, hasStringContextField, isAgentBootstrapEvent, isGatewayStartupEvent (+7) |23| `AI/3-Application/Openclaw-source/src/hooks/workspace.ts` | readHookPackageManifest, resolvePackageHooks, loadHooksFromDir, loadHookEntriesFromDir, loadHookFromDir (+6) |24| `AI/3-Application/Claude-Code-source/src/hooks/fileSuggestions.ts` | findLongestCommonPrefix, getFileIndex, getGitIndexMtime, getClaudeConfigFiles, getPathsForSuggestions (+5) |25| `AI/3-Application/Openclaw-source/src/hooks/install.ts` | buildHookInstallForwardParams, installFromResolvedHookDir, installHooksFromArchive, installHooksFromPath, validateHookId (+5) |26| `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | mergeHookPresets, normalizeHooksPath, normalizeServePath, buildDefaultHookUrl, resolveGmailHookRuntimeConfig (+4) |27| `AI/3-Application/Claude-Code-source/src/utils/hooks/fileChangedWatcher.ts` | startWatching, handleFileEvent, updateWatchPaths, restartWatching, onCwdChangedForHooks (+4) |28| `AI/3-Application/Claude-Code-source/src/utils/sessionStorage.ts` | saveWorktreeState, isChainParticipant, getUserType, insertMessageChain, recordTranscript (+3) |29| `AI/3-Application/Claude-Code-source/src/hooks/useVoice.ts` | normalizeLanguageForSTT, useVoice, updateState, finishRecording, armFocusSilenceTimer (+3) |3031## Entry Points3233Start here when exploring this area:3435- **`mergeHookPresets`** (Function) — `AI/3-Application/Openclaw-source/src/hooks/gmail.ts:64`36- **`normalizeHooksPath`** (Function) — `AI/3-Application/Openclaw-source/src/hooks/gmail.ts:70`37- **`normalizeServePath`** (Function) — `AI/3-Application/Openclaw-source/src/hooks/gmail.ts:79`38- **`buildDefaultHookUrl`** (Function) — `AI/3-Application/Openclaw-source/src/hooks/gmail.ts:90`39- **`resolveGmailHookRuntimeConfig`** (Function) — `AI/3-Application/Openclaw-source/src/hooks/gmail.ts:99`4041## Key Symbols4243| Symbol | Type | File | Line |44|--------|------|------|------|45| `WindowsToWSLConverter` | Class | `AI/3-Application/Claude-Code-source/src/utils/idePathConversion.ts` | 24 |46| `TerminalEvent` | Class | `AI/3-Application/Claude-Code-source/src/ink/events/terminal-event.ts` | 18 |47| `KeyboardEvent` | Class | `AI/3-Application/Claude-Code-source/src/ink/events/keyboard-event.ts` | 11 |48| `mergeHookPresets` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 64 |49| `normalizeHooksPath` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 70 |50| `normalizeServePath` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 79 |51| `buildDefaultHookUrl` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 90 |52| `resolveGmailHookRuntimeConfig` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 99 |53| `buildGogWatchStartArgs` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 207 |54| `buildTopicPath` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 252 |55| `parseTopicPath` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail.ts` | 256 |56| `startGmailWatcher` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-watcher.ts` | 131 |57| `startGmailWatcherWithLogs` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-watcher-lifecycle.ts` | 10 |58| `resolvePythonExecutablePath` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 117 |59| `ensureDependency` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 167 |60| `ensureGcloudAuth` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 193 |61| `runGcloud` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 207 |62| `ensureTopic` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 215 |63| `ensureSubscription` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 226 |64| `ensureTailscaleEndpoint` | Function | `AI/3-Application/Openclaw-source/src/hooks/gmail-setup-utils.ts` | 263 |6566## Execution Flows6768| Flow | Type | Steps |69|------|------|-------|70| `Setup → JsonStringify` | cross_community | 6 |71| `Setup → GetFsImplementation` | cross_community | 6 |72| `Setup → StatSync` | cross_community | 6 |73| `PartialCompactConversation → GetIsNonInteractiveSession` | cross_community | 5 |74| `PromptInput → CallSafe` | cross_community | 4 |75| `Setup → ToLowerCase` | cross_community | 4 |76| `Setup → Trim` | cross_community | 4 |77| `LogSelector → UseApp` | cross_community | 4 |78| `LogSelector → UseDoublePress` | cross_community | 4 |79| `UseTypeahead → UseAppStore` | cross_community | 4 |8081## Connected Areas8283| Area | Connections |84|------|-------------|85| Plugins | 75 calls |86| Scripts | 40 calls |87| Components | 33 calls |88| Services | 14 calls |89| Constants | 10 calls |90| Infra | 10 calls |91| Auto-reply | 8 calls |92| Oauth | 8 calls |9394## How to Explore95961. `gitnexus_context({name: "mergeHookPresets"})` — see callers and callees972. `gitnexus_query({query: "hooks"})` — find related execution flows983. Read key files listed above for implementation details