feat(cortex): update chat/nudge flow, deepgram streaming and agenda form

Refines chat panel, nudge messages and artifact rendering, reworks
deepgram token/streaming handling, and adds test tooling deps
(playwright, cypress) to package.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
colinislit
2026-07-09 22:37:46 +02:00
parent 6c6dae5eb7
commit cdeea793bd
20 changed files with 1634 additions and 283 deletions

View File

@@ -15,6 +15,7 @@ import { motion } from 'framer-motion';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import type { NudgeSuggestion } from '@/lib/cortex/types';
import { useCortexStore } from '@/stores/cortex-store';
interface NudgeChatMessageProps {
suggestion: NudgeSuggestion;
@@ -60,6 +61,8 @@ function getAcceptButtonText(intent: string): string {
return 'Ja, notitie maken';
case 'cancel_appointment':
return 'Ja, annuleren';
case 'register_no_show':
return 'Ja, pas brief aan';
default:
return 'Ja, uitvoeren';
}
@@ -71,6 +74,7 @@ export function NudgeChatMessage({
onDismiss,
}: NudgeChatMessageProps) {
const [progress, setProgress] = useState(100);
const isNoShowProcessing = useCortexStore((s) => s.isNoShowProcessing);
const styles = PRIORITY_STYLES[suggestion.priority];
const protocol = suggestion.suggestion.protocol;
@@ -169,9 +173,10 @@ export function NudgeChatMessage({
<Button
size="sm"
onClick={() => onAccept(suggestion.id)}
className="bg-teal-600 hover:bg-teal-700 text-white"
disabled={isNoShowProcessing}
className="bg-teal-600 hover:bg-teal-700 text-white disabled:opacity-50 disabled:cursor-not-allowed"
>
{getAcceptButtonText(suggestion.suggestion.intent)}
{isNoShowProcessing ? 'Bezig...' : getAcceptButtonText(suggestion.suggestion.intent)}
</Button>
<Button
size="sm"