* feat(agent): add AI chat panel and dashboard updates Add ElizaOS-powered agent chat panel with streaming, voice input, markdown rendering, and page-aware context. Update dashboard layout with context menu and refactored pages. Add agent memory schema, new UI components, and fix lint errors across AI-related files. * fix(auth): use Host header for SSO redirect URI nextUrl.origin returns http://localhost:3000 on CF Workers, breaking OAuth callbacks. Use Host header to derive the correct production origin for WorkOS redirect URI. * fix(auth): add Toaster to auth layout, fix error codes Auth pages had no Toaster component so toast.error() calls were invisible. Also return 401 for auth errors instead of generic 500 from the login API. --------- Co-authored-by: Nicholai <nicholaivogelfilms@gmail.com>
21 lines
731 B
SQL
Executable File
21 lines
731 B
SQL
Executable File
CREATE TABLE `agent_conversations` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`user_id` text NOT NULL,
|
|
`title` text,
|
|
`last_message_at` text NOT NULL,
|
|
`created_at` text NOT NULL,
|
|
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE `agent_memories` (
|
|
`id` text PRIMARY KEY NOT NULL,
|
|
`conversation_id` text NOT NULL,
|
|
`user_id` text NOT NULL,
|
|
`role` text NOT NULL,
|
|
`content` text NOT NULL,
|
|
`embedding` text,
|
|
`metadata` text,
|
|
`created_at` text NOT NULL,
|
|
FOREIGN KEY (`conversation_id`) REFERENCES `agent_conversations`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade
|
|
); |