Files
SuperCharged-Claude-Code-Up…/dexto/packages/webui/components/hooks/useCurrentLLM.ts
admin b52318eeae feat: Add intelligent auto-router and enhanced integrations
- Add intelligent-router.sh hook for automatic agent routing
- Add AUTO-TRIGGER-SUMMARY.md documentation
- Add FINAL-INTEGRATION-SUMMARY.md documentation
- Complete Prometheus integration (6 commands + 4 tools)
- Complete Dexto integration (12 commands + 5 tools)
- Enhanced Ralph with access to all agents
- Fix /clawd command (removed disable-model-invocation)
- Update hooks.json to v5 with intelligent routing
- 291 total skills now available
- All 21 commands with automatic routing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-28 00:27:56 +04:00

38 lines
1.4 KiB
TypeScript

import { useQuery } from '@tanstack/react-query';
import { queryKeys } from '@/lib/queryKeys';
import { client } from '@/lib/client';
/**
* Hook to fetch the current LLM configuration for a session
* Centralized access point for currentLLM data
*/
export function useCurrentLLM(sessionId: string | null, enabled: boolean = true) {
return useQuery({
queryKey: queryKeys.llm.current(sessionId),
queryFn: async () => {
const response = await client.api.llm.current.$get({
query: sessionId ? { sessionId } : {},
});
if (!response.ok) {
throw new Error('Failed to fetch current LLM config');
}
const data = await response.json();
const cfg = data.config || data;
return {
provider: cfg.provider,
model: cfg.model,
displayName: cfg.displayName,
baseURL: cfg.baseURL,
viaDexto: data.routing?.viaDexto ?? false,
};
},
// Always enabled - API returns default config when no sessionId
// This ensures the model name shows on welcome screen
enabled,
retry: false, // Don't retry on error - UI can still operate
});
}
// Export type for components to use
export type CurrentLLM = NonNullable<ReturnType<typeof useCurrentLLM>['data']>;