Files
zclaw_openfang/desktop/src/components/ButlerPanel/index.tsx
iven a5b887051d
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
fix: butler audit critical fixes — pain detection, proposal trigger, URI + data flow
5 fixes from focused audit:
- Connect analyze_for_pain_signals() to post_conversation_hook (pain points now auto-created)
- Add "generate solution" button in InsightsSection for high-confidence pain points (>=0.7)
- Fix Memory URI mismatch: viking://agents/ → viking://agent/ (singular)
- Remove duplicate .then() chain in useButlerInsights (was destructuring undefined)
- Update stale director.rs doc comment (multi-agent now enabled by default)
2026-04-07 10:23:54 +08:00

61 lines
1.9 KiB
TypeScript

import { useButlerInsights } from '../../hooks/useButlerInsights';
import { InsightsSection } from './InsightsSection';
import { ProposalsSection } from './ProposalsSection';
import { MemorySection } from './MemorySection';
interface ButlerPanelProps {
agentId: string | undefined;
}
export function ButlerPanel({ agentId }: ButlerPanelProps) {
const { painPoints, proposals, loading, error, refresh } = useButlerInsights(agentId);
if (!agentId) {
return (
<div className="flex items-center justify-center h-full">
<p className="text-sm text-gray-500 dark:text-gray-400"> Agent</p>
</div>
);
}
return (
<div className="space-y-6">
{error && (
<div className="rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 px-3 py-2 text-xs text-red-700 dark:text-red-300">
{error}
</div>
)}
{loading && (
<div className="flex items-center justify-center py-4">
<div className="w-5 h-5 border-2 border-gray-300 dark:border-gray-600 border-t-blue-500 rounded-full animate-spin" />
</div>
)}
{/* Insights section */}
<div>
<h3 className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-2">
</h3>
<InsightsSection painPoints={painPoints} onGenerate={refresh} />
</div>
{/* Proposals section */}
<div>
<h3 className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-2">
</h3>
<ProposalsSection proposals={proposals} onStatusChange={refresh} />
</div>
{/* Memory section */}
<div>
<h3 className="text-sm font-semibold text-gray-900 dark:text-gray-100 mb-2">
</h3>
<MemorySection agentId={agentId} />
</div>
</div>
);
}