mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
CodeBuddy spawns hooks registered with shell: 'powershell' as a bare `pwsh`, so on Windows without PowerShell 7 every hook failed with spawn pwsh ENOENT and the failed UserPromptSubmit hook blocked prompts. Register CodeBuddy's hooks the way Claude's are: the managed .cmd path on cmd-safe profiles (runs under CodeBuddy's Git Bash or Windows PowerShell default shell) and the absolute powershell.exe encoded launcher otherwise. The next install rewrites existing registrations. Fixes #27182 Co-authored-by: Orca Worker <orca-worker@localhost>
35 lines
971 B
TypeScript
35 lines
971 B
TypeScript
import type { ClaudeManagedHookPlan } from '../claude/claude-managed-hook-events'
|
|
import { ClaudeHookService } from '../claude/hook-service'
|
|
|
|
export const CODEBUDDY_HOOK_EVENTS = [
|
|
'SessionStart',
|
|
'SessionEnd',
|
|
'UserPromptSubmit',
|
|
'PreToolUse',
|
|
'PostToolUse',
|
|
'PostToolUseFailure',
|
|
'PermissionRequest',
|
|
'Stop',
|
|
'StopFailure',
|
|
'Notification'
|
|
] as const
|
|
|
|
export const CODEBUDDY_MANAGED_HOOK_PLAN: ClaudeManagedHookPlan = {
|
|
install: CODEBUDDY_HOOK_EVENTS.map((eventName) => ({ eventName, definition: {} })),
|
|
retire: [],
|
|
statusLine: 'leave'
|
|
}
|
|
|
|
export const codebuddyHookService = new ClaudeHookService({
|
|
agent: 'codebuddy',
|
|
source: 'codebuddy',
|
|
displayName: 'CodeBuddy',
|
|
settings: {
|
|
configDirName: '.codebuddy',
|
|
scriptBaseName: 'codebuddy-hook',
|
|
// No `shell: 'powershell'`: CodeBuddy runs that as bare `pwsh`, absent on stock Windows (#27182).
|
|
usesWindowsCompatLauncher: true
|
|
},
|
|
hookPlan: CODEBUDDY_MANAGED_HOOK_PLAN
|
|
})
|