feat: implement Agent Chat Widget for entity pages
TASK_PHASE_AGENT_CHAT_WIDGET_MVP.md completed:
Backend:
- Add /api/v1/agents/{agent_id}/chat-room endpoint
- Add /api/v1/nodes/{node_id}/chat-room endpoint
- Add /api/v1/microdaos/{slug}/chat-room endpoint
Frontend:
- Create AgentChatWidget.tsx floating chat component
- Integrate into /agents/:agentId page
- Integrate into /nodes/:nodeId page
- Integrate into /microdao/:slug page
Ontology rule implemented:
'No page without agents' = ability to directly talk to agents on that page
This commit is contained in:
@@ -21,6 +21,7 @@ import { updateAgentVisibility, AgentVisibilityUpdate } from '@/lib/api/agents';
|
||||
import { ensureOrchestratorRoom } from '@/lib/api/microdao';
|
||||
import { Bot, Settings, FileText, Building2, Cpu, MessageSquare, BarChart3, Users, Globe, Lock, Eye, EyeOff, ChevronLeft, Loader2, MessageCircle, PlusCircle } from 'lucide-react';
|
||||
import { CityChatWidget } from '@/components/city/CityChatWidget';
|
||||
import { AgentChatWidget } from '@/components/chat/AgentChatWidget';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
// Tab types
|
||||
@@ -664,6 +665,9 @@ export default function AgentConsolePage() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Floating Chat Widget */}
|
||||
<AgentChatWidget contextType="agent" contextId={agentId} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { MicrodaoRoomsSection } from "@/components/microdao/MicrodaoRoomsSection
|
||||
import { MicrodaoRoomsAdminPanel } from "@/components/microdao/MicrodaoRoomsAdminPanel";
|
||||
import { ChevronLeft, Users, MessageSquare, Crown, Building2, Globe, Lock, Layers, BarChart3, Bot, MessageCircle } from "lucide-react";
|
||||
import { CityChatWidget } from "@/components/city/CityChatWidget";
|
||||
import { AgentChatWidget } from "@/components/chat/AgentChatWidget";
|
||||
import { ensureOrchestratorRoom } from "@/lib/api/microdao";
|
||||
|
||||
export default function MicrodaoDetailPage() {
|
||||
@@ -398,6 +399,9 @@ export default function MicrodaoDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* Floating Chat Widget */}
|
||||
<AgentChatWidget contextType="microdao" contextId={slug} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
NodeStandardComplianceCard
|
||||
} from '@/components/node-dashboard';
|
||||
import { NodeGuardianCard } from '@/components/nodes/NodeGuardianCard';
|
||||
import { AgentChatWidget } from '@/components/chat/AgentChatWidget';
|
||||
|
||||
function getNodeLabel(nodeId: string): string {
|
||||
if (nodeId.includes('node-1')) return 'НОДА1';
|
||||
@@ -182,6 +183,9 @@ export default function NodeCabinetPage() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Floating Chat Widget */}
|
||||
<AgentChatWidget contextType="node" contextId={nodeId} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -337,6 +341,9 @@ export default function NodeCabinetPage() {
|
||||
<ExternalLink className="w-3 h-3" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Floating Chat Widget */}
|
||||
<AgentChatWidget contextType="node" contextId={nodeId} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user