mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-05 06:24:37 +00:00
refactor: organize model definitions and flavor capabilities into dedicated modules (#400)
This commit is contained in:
@@ -20,7 +20,7 @@ import { useActiveSuggestions } from '@/hooks/useActiveSuggestions'
|
||||
import { applySuggestion } from '@/utils/applySuggestion'
|
||||
import { usePlatform } from '@/hooks/usePlatform'
|
||||
import { usePWAInstall } from '@/hooks/usePWAInstall'
|
||||
import { isClaudeFlavor, supportsModelChange } from '@/lib/agentFlavorUtils'
|
||||
import { supportsEffort, supportsModelChange } from '@hapi/protocol'
|
||||
import { markSkillUsed } from '@/lib/recent-skills'
|
||||
import { FloatingOverlay } from '@/components/ChatInput/FloatingOverlay'
|
||||
import { Autocomplete } from '@/components/ChatInput/Autocomplete'
|
||||
@@ -440,7 +440,7 @@ export function HappyComposer(props: {
|
||||
const showCollaborationSettings = Boolean(onCollaborationModeChange && collaborationModeOptions.length > 0)
|
||||
const showPermissionSettings = Boolean(onPermissionModeChange && permissionModeOptions.length > 0)
|
||||
const showModelSettings = Boolean(onModelChange && supportsModelChange(agentFlavor))
|
||||
const showEffortSettings = Boolean(onEffortChange && isClaudeFlavor(agentFlavor))
|
||||
const showEffortSettings = Boolean(onEffortChange && supportsEffort(agentFlavor))
|
||||
const showSettingsButton = Boolean(showCollaborationSettings || showPermissionSettings || showModelSettings || showEffortSettings)
|
||||
const showAbortButton = true
|
||||
const voiceEnabled = Boolean(onVoiceToggle)
|
||||
|
||||
@@ -1,19 +1,7 @@
|
||||
// Re-export from shared package for backwards compatibility
|
||||
export { isKnownFlavor, supportsModelChange, supportsEffort } from '@hapi/protocol'
|
||||
|
||||
// Flavor-family helper not yet in shared — keep here until next migration
|
||||
export function isCodexFamilyFlavor(flavor?: string | null): boolean {
|
||||
return flavor === 'codex' || flavor === 'gemini' || flavor === 'opencode'
|
||||
}
|
||||
|
||||
export function isClaudeFlavor(flavor?: string | null): boolean {
|
||||
return flavor === 'claude'
|
||||
}
|
||||
|
||||
export function isCursorFlavor(flavor?: string | null): boolean {
|
||||
return flavor === 'cursor'
|
||||
}
|
||||
|
||||
export function isKnownFlavor(flavor?: string | null): boolean {
|
||||
return isClaudeFlavor(flavor) || isCodexFamilyFlavor(flavor) || isCursorFlavor(flavor)
|
||||
}
|
||||
|
||||
export function supportsModelChange(flavor?: string | null): boolean {
|
||||
return flavor === 'claude' || flavor === 'gemini'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user