feat: add HoloLake personal channel module runtime

This commit is contained in:
冰朔 2026-08-09 14:14:07 +08:00
commit a106b23f9b
21 changed files with 786 additions and 31 deletions

View file

@ -47,9 +47,10 @@ interface Props {
apiBase: string;
runtimeRevision?: number;
onClose?: () => void;
onWorldChanged?: () => void;
}
export default function AgentChat({ apiBase, runtimeRevision = 0, onClose }: Props) {
export default function AgentChat({ apiBase, runtimeRevision = 0, onClose, onWorldChanged }: Props) {
const [messages, setMessages] = useState<Message[]>([]);
const [conversations, setConversations] = useState<ConversationSummary[]>([]);
const [activeConversationId, setActiveConversationId] = useState('');
@ -172,6 +173,7 @@ export default function AgentChat({ apiBase, runtimeRevision = 0, onClose }: Pro
setPendingActions(data.actions || []);
setMessages(data.messages || messages);
await refreshConversationList();
if (decision === 'confirm') onWorldChanged?.();
} catch (error) {
setMessages(previous => [...previous, { role: 'assistant', content: `动作未执行:${error instanceof Error ? error.message : String(error)}`, timestamp: new Date().toISOString() }]);
} finally {