feat: v1 — persistent shell, model gateway, artifact improvements (#1462)

This commit is contained in:
dancer 2026-03-20 09:37:02 +00:00 committed by GitHub
parent 3651670fb9
commit f9652b452a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
161 changed files with 5166 additions and 8009 deletions

View file

@ -0,0 +1,67 @@
CREATE TABLE IF NOT EXISTS "User" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"email" varchar(64) NOT NULL,
"password" varchar(64),
"name" text,
"emailVerified" boolean NOT NULL DEFAULT false,
"image" text,
"isAnonymous" boolean NOT NULL DEFAULT false,
"createdAt" timestamp DEFAULT now() NOT NULL,
"updatedAt" timestamp DEFAULT now() NOT NULL
);
CREATE TABLE IF NOT EXISTS "Chat" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"createdAt" timestamp NOT NULL,
"title" text NOT NULL,
"userId" uuid NOT NULL REFERENCES "User"("id"),
"visibility" varchar NOT NULL DEFAULT 'private'
);
CREATE TABLE IF NOT EXISTS "Message_v2" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"chatId" uuid NOT NULL REFERENCES "Chat"("id"),
"role" varchar NOT NULL,
"parts" json NOT NULL,
"attachments" json NOT NULL,
"createdAt" timestamp NOT NULL
);
CREATE TABLE IF NOT EXISTS "Vote_v2" (
"chatId" uuid NOT NULL REFERENCES "Chat"("id"),
"messageId" uuid NOT NULL REFERENCES "Message_v2"("id"),
"isUpvoted" boolean NOT NULL,
PRIMARY KEY ("chatId", "messageId")
);
CREATE TABLE IF NOT EXISTS "Document" (
"id" uuid DEFAULT gen_random_uuid() NOT NULL,
"createdAt" timestamp NOT NULL,
"title" text NOT NULL,
"content" text,
"text" varchar NOT NULL DEFAULT 'text',
"userId" uuid NOT NULL REFERENCES "User"("id"),
PRIMARY KEY ("id", "createdAt")
);
CREATE TABLE IF NOT EXISTS "Suggestion" (
"id" uuid DEFAULT gen_random_uuid() NOT NULL,
"documentId" uuid NOT NULL,
"documentCreatedAt" timestamp NOT NULL,
"originalText" text NOT NULL,
"suggestedText" text NOT NULL,
"description" text,
"isResolved" boolean NOT NULL DEFAULT false,
"userId" uuid NOT NULL REFERENCES "User"("id"),
"createdAt" timestamp NOT NULL,
PRIMARY KEY ("id"),
FOREIGN KEY ("documentId", "documentCreatedAt") REFERENCES "Document"("id", "createdAt")
);
CREATE TABLE IF NOT EXISTS "Stream" (
"id" uuid DEFAULT gen_random_uuid() NOT NULL,
"chatId" uuid NOT NULL,
"createdAt" timestamp NOT NULL,
PRIMARY KEY ("id"),
FOREIGN KEY ("chatId") REFERENCES "Chat"("id")
);