+ :class="['reasoning-container max-h-[min(40vh,320px)] overflow-y-auto [scrollbar-width:thin] [scrollbar-color:#888_transparent] [scrollbar-gutter:stable]', scrollState]">
diff --git a/app/pages/agent/[id]/index.vue b/app/pages/agent/[id]/index.vue
index b3e06e5..3a5624c 100644
--- a/app/pages/agent/[id]/index.vue
+++ b/app/pages/agent/[id]/index.vue
@@ -55,25 +55,26 @@ const handleSubmit = async (message: BaseMessage, model: ModelWithProvider | nul
const { sendMessage, startGeneration } = await useChat(topic.id, false);
- sendMessage(message).then(async res => {
- if (res.ok === false) {
- console.error('Failed to send message:', res.error);
+ const res = await sendMessage(message);
+ if (res.ok === false) {
+ console.error('Failed to send message:', res.error);
- pendingMessage.value = null;
+ pendingMessage.value = null;
- await navigateTo(`/agent/${route.params.id}`);
+ await navigateTo(`/agent/${route.params.id}`);
- nextTick(() => {
- inputValue.value = message;
- });
- }
- });
+ nextTick(() => {
+ inputValue.value = message;
+ });
+
+ return;
+ }
await navigateTo(`/agent/${route.params.id}/topic/${topic.id}`);
autoRenameTopic(topic.id);
- return startGeneration(model);
+ return startGeneration(model, undefined, route.params.id as string);
};
diff --git a/app/pages/agent/[id]/topic/[topicId].vue b/app/pages/agent/[id]/topic/[topicId].vue
index f99e4c4..582c690 100644
--- a/app/pages/agent/[id]/topic/[topicId].vue
+++ b/app/pages/agent/[id]/topic/[topicId].vue
@@ -8,7 +8,7 @@ const rootStart = Date.now();
const chatPaneWrapper = ref
(null);
const inputValue = ref({ content: '', fileIds: [] });
const route = useRoute();
-const { getAgent } = await useAgents();
+const { getAgent, deleteTopic } = await useAgents();
const { open: sidebarOpen, openSidebar } = useSidebar();
const { providers, allModels } = await useModels();
const { addShortcut } = useKeyboardShortcuts();
@@ -84,12 +84,6 @@ const handleRegenerate = async (message: Message) => {
}
}
-const handleDelete = async (rootMessage: Message) => {
- await $fetch(`/api/messages/${rootMessage.id}`, {
- method: 'DELETE',
- });
-}
-
const flatMessages = computed(() => {
const messages: Message[] = [];
@@ -103,6 +97,17 @@ const flatMessages = computed(() => {
return messages;
});
+const handleDelete = async (rootMessage: Message) => {
+ await $fetch(`/api/messages/${rootMessage.id}`, {
+ method: 'DELETE',
+ });
+
+ if (flatMessages.value.length === 0) {
+ await navigateTo(`/agent/${route.params.id}`);
+ deleteTopic(route.params.id as string, topicId.value);
+ }
+}
+
const activeGeneration = computed(() => {
if (topic.value === null) return null;
const generations = flatMessages.value.flatMap(message => message.generation);
@@ -190,6 +195,14 @@ addShortcut(['ctrl', 'alt', 'arrowright'], async (event) => {
}
})
+addShortcut(['ctrl', 'alt', 'backspace'], async (event) => {
+ event.preventDefault();
+ event.stopPropagation();
+
+ await navigateTo(`/agent/${route.params.id}`);
+ deleteTopic(route.params.id as string, topicId.value);
+})
+
onMounted(() => {
scrollToBottom('instant');
});
diff --git a/app/pages/index.vue b/app/pages/index.vue
index 957814f..b2290cb 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -117,7 +117,7 @@ const handleChatSubmit = async (message: BaseMessage, model: ModelWithProvider |
autoRenameTopic(topic.id);
- return startGeneration(model);
+ return startGeneration(model, undefined, targetAgent.id);
};
onMounted(() => {
diff --git a/utils/message.ts b/utils/message.ts
index f988bdd..028dd11 100644
--- a/utils/message.ts
+++ b/utils/message.ts
@@ -57,8 +57,6 @@ export const marshallMessages = (agent: Agent, messages: Readonly {
if (attachment.file.mimeType.startsWith('image/')) {
return {
@@ -75,12 +73,13 @@ export const marshallMessages = (agent: Agent, messages: Readonly
Date: Mon, 27 Apr 2026 12:07:01 -0500
Subject: [PATCH 11/18] style: UI polish and miscellaneous fixes
Fixes link color from hardcoded white to currentColor for proper theme
support. Adds video and audio modality icons to ModelInfo. Registers
anthropic, nvidia, and xiaomi in the provider icon map. Removes unused
pagination validation from agents and topics endpoints. Adds convenience
start script. Updates AGENTS.md.
---
AGENTS.md | 53 +-------------------------------
app/assets/css/base.css | 10 ++++--
app/assets/css/reset.css | 4 ---
app/components/ModelInfo.vue | 8 +++++
app/components/ModelSelector.vue | 3 +-
app/utils/model-mapping.ts | 4 ++-
server/api/agents.get.ts | 13 --------
server/api/topics.get.ts | 18 +----------
start-veridian.sh | 32 +++++++++++++++++++
9 files changed, 54 insertions(+), 91 deletions(-)
create mode 100755 start-veridian.sh
diff --git a/AGENTS.md b/AGENTS.md
index 00a99ed..789cc93 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -151,7 +151,7 @@ await db.insert(agents).values(data).onConflictDoNothing();
2. **Session**: Better-auth creates session token → stored in cookie
3. **API Keys**: Encrypted client-side with AES-GCM (key derived from password + userId)
-**Key files**: `lib/auth.ts`, `lib/auth-client.ts`, `app/plugins/auth.*.ts`, `app/middleware/auth.global.ts`
+**Key files**: `lib/auth.ts`, `app/plugins/auth.*.ts`, `app/middleware/auth.global.ts`, `app/composables/useAuth.ts`
## Styling System
@@ -179,57 +179,6 @@ await db.insert(agents).values(data).onConflictDoNothing();
| `useTheme()` | Accent/neutral theme cookies |
| `useSettings()` | Settings dialog state |
-## Key Routes
-
-| Route | File |
-|-------|------|
-| `/` | `app/pages/index.vue` |
-| `/auth/login` | `app/pages/auth/login.vue` |
-| `/auth/register` | `app/pages/auth/register.vue` |
-| `/agent/:id` | `app/pages/agent/[id]/index.vue` |
-| `/agent/:id/topic/:topicId` | `app/pages/agent/[id]/topic/[topicId].vue` |
-| `/agent/:id/profile` | `app/pages/agent/[id]/profile.vue` |
-
-## Server API Routes
-
-| Endpoint | File |
-|----------|------|
-| `POST /api/chat/generate` | `server/api/chat/generate.post.ts` |
-| `POST /api/chat/cancel/:id` | `server/api/chat/cancel/[generationId].post.ts` |
-| `POST /api/provider/:id/models` | `server/api/provider/[providerId]/models.post.ts` |
-| `* /api/auth/*` | `server/api/auth/[...all].ts` |
-
-## Known Issues (from BUGS.md)
-
-1. Sidebar hover animation occasionally glitches on agent routes
-2. Theme switcher + sidebar interaction bug
-
-## Critical Architecture Notes
-
-### Chat Endpoint God File
-- `server/api/topic/[topicId]/chat/index.post.ts` is 1263 lines handling route validation, tool definitions, streaming orchestration, DB transactions, and event emission
-- Files that change together: this file + `server/utils/events.ts` + `server/utils/generations.ts`
-- Tool definitions (bash, python, file access) should be extracted to separate module before extending
-
-### Security: Code Execution Tools Have No Sandboxing
-- `bashTool` uses `exec()` and `pythonTool` uses `python3 -c` with user-controlled input — full RCE risk
-- Do NOT extend these tools without adding: timeouts, path restrictions, resource limits
-- Location: `server/api/topic/[topicId]/chat/index.post.ts` ~lines 261-455
-
-### Crash Risk: `todo()` Function
-- `todo()` literally throws `new Error('TODO')` on unhandled token types in chat handler
-- Handle gracefully before production deployment
-- Location: `server/api/topic/[topicId]/chat/index.post.ts` ~line 256
-
-### Module-Scoped Mutable State Limitations
-- `useDialog.ts` has module-scoped `actionCallback` — not SSR-safe, overwritten on concurrent dialogs
-- `pendingGenerations` in `server/utils/generations.ts` and in-memory event channels in `server/utils/events.ts` won't work in multi-process deployments
-- Fine for single-instance dev, but architectural ceiling for scaling
-
-### Pagination Params Validated But Unused
-- `agents.get.ts` validates `page`/`limit` query params but never applies them to the query
-- All agent queries return everything regardless of pagination params
-
## Development Notes
- **Never run dev server as agent** - just complete tasks and signal done
diff --git a/app/assets/css/base.css b/app/assets/css/base.css
index 130bc31..7b994a5 100644
--- a/app/assets/css/base.css
+++ b/app/assets/css/base.css
@@ -186,6 +186,10 @@ body {
height: 100%;
}
+a {
+ color: currentColor;
+}
+
button {
color: inherit;
display: flex;
@@ -273,15 +277,15 @@ button.accent:hover {
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='18' height='18'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 12a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0m7 0a1 1 0 1 0 2 0a1 1 0 1 0-2 0'/%3E%3C/svg%3E");
}
-.reasoning-contaizner.middle {
+.reasoning-container.middle {
mask-image: linear-gradient(#000, #000, transparent 0, #000 12%, #000 88%, transparent)
}
-.reasoning-contaizner.top {
+.reasoning-container.top {
mask-image: linear-gradient(#000, transparent, #000 0, #000 12%, #000 88%, transparent)
}
-.reasoning-contaizner.bottom {
+.reasoning-container.bottom {
mask-image: linear-gradient(transparent, #000, transparent 0, #000 12%, #000 88%, #000)
}
diff --git a/app/assets/css/reset.css b/app/assets/css/reset.css
index 65e79a7..410c1a3 100644
--- a/app/assets/css/reset.css
+++ b/app/assets/css/reset.css
@@ -67,10 +67,6 @@ h6 {
text-wrap: balance;
}
-a {
- color: #fff;
-}
-
a:hover {
text-decoration: none;
}
diff --git a/app/components/ModelInfo.vue b/app/components/ModelInfo.vue
index e0bb02f..1c07f4a 100644
--- a/app/components/ModelInfo.vue
+++ b/app/components/ModelInfo.vue
@@ -110,6 +110,14 @@ const handleEdit = () => {
class="w-4.5 h-4.5 bg-emerald/10 rounded flex items-center justify-center">
diff --git a/app/components/ModelSelector.vue b/app/components/ModelSelector.vue
index 5dda6f6..5aa2de8 100644
--- a/app/components/ModelSelector.vue
+++ b/app/components/ModelSelector.vue
@@ -1,6 +1,7 @@
@@ -162,21 +169,21 @@ const messageCount = computed(() => {
-
-
- {{ (message.focusedIndex || 0) + 1 }} / {{ messageCount }}
+ {{ currentChildIndex + 1 }} / {{ messageCount }}
-
-
+
+ :class="currentChildIndex + 1 === messageCount ? 'opacity-0' : ''">
diff --git a/app/composables/useChat.ts b/app/composables/useChat.ts
index 91028de..5c89c04 100644
--- a/app/composables/useChat.ts
+++ b/app/composables/useChat.ts
@@ -40,7 +40,10 @@ export const useChat = async (topicId: MaybeRef
, connect = true) => {
let sse: EventSource | undefined;
- const textDeltaBuffer: Map> = new Map();
+ const textDeltaBuffer: Map> = new Map();
let flushTimeout: ReturnType | undefined;
let flushCbs: Set<() => void> = new Set();
@@ -54,7 +57,8 @@ export const useChat = async (topicId: MaybeRef, connect = true) => {
for (const [partId, content] of parts) {
const part = msg.parts?.find(p => p.id === partId);
if (part) {
- part.content += content;
+ part.content += content.content;
+ part.lastUpdatedAt = new Date(content.lastUpdatedAt);
}
}
}
@@ -132,8 +136,8 @@ export const useChat = async (topicId: MaybeRef, connect = true) => {
textDeltaBuffer.set(payload.messageId, new Map());
}
const messageBuffer = textDeltaBuffer.get(payload.messageId)!;
- const existing = messageBuffer.get(payload.partId) || '';
- messageBuffer.set(payload.partId, existing + payload.content);
+ const existing = messageBuffer.get(payload.partId)?.content || '';
+ messageBuffer.set(payload.partId, { content: existing + payload.content, lastUpdatedAt: payload.lastUpdatedAt });
scheduleFlush();
break;
@@ -145,6 +149,7 @@ export const useChat = async (topicId: MaybeRef, connect = true) => {
if (part) {
nextFlush(() => {
part.content = payload.content;
+ part.lastUpdatedAt = payload.lastUpdatedAt;
part.finished = true;
});
}
@@ -328,7 +333,7 @@ export const useChat = async (topicId: MaybeRef, connect = true) => {
generation: null,
parentMessageId: null,
generationId: null,
- focusedIndex: null,
+ activeChildId: null,
deleted: null,
createdAt: new Date(),
updatedAt: new Date(),
@@ -457,11 +462,46 @@ export const useChat = async (topicId: MaybeRef, connect = true) => {
);
}
+ const deleteMessagesFocusedDescendant = async (messageId: string): Promise> => {
+ if (!data.value) return Err(new Error('No data'));
+
+ const msg = data.value.messages.find(m => m.id === messageId);
+ if (!msg) return Err(new Error('Message not found'));
+
+ const previousMessages = data.value!.messages;
+
+ const res = await $fetch(`/api/messages/${messageId}`, {
+ method: 'DELETE',
+ onRequest() {
+ if (!msg.activeChildId && (msg.parentMessageId === null || msg.parentMessageId === undefined)) {
+ msg.deleted = true;
+ return;
+ }
+
+ const parent = data.value!.messages.find(m => m.id === msg.parentMessageId);
+ data.value!.messages = data.value!.messages.filter(m => m.id !== msg.id);
+ if (parent?.deleted) {
+ data.value!.messages = data.value!.messages.filter(m => m.id !== parent.id);
+ }
+ },
+ onResponseError() {
+ data.value!.messages = previousMessages;
+ },
+ });
+
+ if (!res.ok) {
+ return Err(new Error('Failed to delete message'));
+ }
+
+ return Ok(undefined);
+ }
+
return {
topic,
sendMessage,
startGeneration,
regenerateMessage,
- patchMessageLocally
+ patchMessageLocally,
+ deleteMessagesFocusedDescendant
};
}
diff --git a/app/pages/agent/[id]/index.vue b/app/pages/agent/[id]/index.vue
index 3a5624c..d0455e3 100644
--- a/app/pages/agent/[id]/index.vue
+++ b/app/pages/agent/[id]/index.vue
@@ -30,7 +30,6 @@ const handleSubmit = async (message: BaseMessage, model: ModelWithProvider | nul
}
console.log("handleSubmit", message);
- if (!message.content) return;
pendingMessage.value = {
id: '',
@@ -43,7 +42,7 @@ const handleSubmit = async (message: BaseMessage, model: ModelWithProvider | nul
parentMessageId: null,
children: [],
generationId: null,
- focusedIndex: null,
+ activeChildId: null,
attachments: [],
deleted: false,
createdAt: new Date(),
diff --git a/app/pages/agent/[id]/topic/[topicId].vue b/app/pages/agent/[id]/topic/[topicId].vue
index 582c690..26f1556 100644
--- a/app/pages/agent/[id]/topic/[topicId].vue
+++ b/app/pages/agent/[id]/topic/[topicId].vue
@@ -16,7 +16,7 @@ const { addShortcut } = useKeyboardShortcuts();
const agent = getAgent(route.params.id as string);
const topicId = computed(() => route.params.topicId as string);
-const { topic, sendMessage, startGeneration, regenerateMessage, patchMessageLocally } = await useChat(topicId);
+const { topic, sendMessage, startGeneration, regenerateMessage, patchMessageLocally, deleteMessagesFocusedDescendant } = await useChat(topicId);
watch(() => topic.value?.name, (newTopicName) => {
if (newTopicName !== undefined) {
@@ -61,12 +61,8 @@ const handleRegenerate = async (message: Message) => {
}
let messageId: string;
- if (
- (message.focusedIndex !== undefined && message.focusedIndex !== null)
- && message.focusedIndex > 0
- && message.children.length > 0
- ) {
- messageId = message.children[message.focusedIndex - 1]!.id;
+ if (message.activeChildId && message.children.length > 0) {
+ messageId = message.activeChildId;
} else {
messageId = message.id;
}
@@ -98,9 +94,18 @@ const flatMessages = computed(() => {
});
const handleDelete = async (rootMessage: Message) => {
- await $fetch(`/api/messages/${rootMessage.id}`, {
- method: 'DELETE',
- });
+ let messageId: string;
+ if (rootMessage.activeChildId && rootMessage.children.length > 0) {
+ messageId = rootMessage.activeChildId;
+ } else {
+ messageId = rootMessage.id;
+ }
+
+ const result = await deleteMessagesFocusedDescendant(messageId);
+ if (!result.ok) {
+ console.error('Failed to delete message:', result.error);
+ return;
+ }
if (flatMessages.value.length === 0) {
await navigateTo(`/agent/${route.params.id}`);
@@ -108,6 +113,20 @@ const handleDelete = async (rootMessage: Message) => {
}
}
+const handleResize = () => {
+ const el = chatPaneWrapper.value;
+ if (!el) return;
+
+ const atBottom = (el.scrollHeight - el.scrollTop - el.clientHeight) <= 80;
+ if (!atBottom) return;
+
+ nextTick().then(() => {
+ requestAnimationFrame(() => {
+ scrollToBottom('instant');
+ });
+ });
+}
+
const activeGeneration = computed(() => {
if (topic.value === null) return null;
const generations = flatMessages.value.flatMap(message => message.generation);
@@ -155,8 +174,11 @@ addShortcut(['alt', '['], async (event) => {
const lastMessage = topic.value?.messages?.at(-1);
if (lastMessage && lastMessage.children.length > 0) {
- const newIndex = Math.max(0, (lastMessage.focusedIndex || 0) - 1);
- patchMessageLocally(lastMessage.id, { focusedIndex: newIndex });
+ const currentIdx = lastMessage.children.findIndex(c => c?.id === lastMessage.activeChildId);
+ const prevIdx = Math.max(0, currentIdx);
+ if (currentIdx > 0) {
+ patchMessageLocally(lastMessage.id, { activeChildId: lastMessage.children[prevIdx - 1]!.id });
+ }
}
})
@@ -165,10 +187,20 @@ addShortcut(['alt', ']'], async (event) => {
event.stopPropagation();
const lastMessage = topic.value?.messages?.at(-1);
- const messageCount = lastMessage ? (lastMessage.deleted ? lastMessage.children.length : lastMessage.children.length + 1) : 0;
if (lastMessage && lastMessage.children.length > 0) {
- const newIndex = Math.min(messageCount - 1, (lastMessage.focusedIndex || 0) + 1);
- patchMessageLocally(lastMessage.id, { focusedIndex: newIndex });
+ const currentIdx = lastMessage.children.findIndex(c => c?.id === lastMessage.activeChildId);
+ const maxIdx = lastMessage.deleted ? lastMessage.children.length - 1 : lastMessage.children.length;
+ const nextIdx = Math.min(maxIdx, currentIdx + 1);
+
+ if (lastMessage.deleted) {
+ patchMessageLocally(lastMessage.id, { activeChildId: lastMessage.children[nextIdx]?.id ?? null });
+ } else {
+ if (nextIdx === 0) {
+ patchMessageLocally(lastMessage.id, { activeChildId: null });
+ } else {
+ patchMessageLocally(lastMessage.id, { activeChildId: lastMessage.children[nextIdx - 1]?.id ?? null });
+ }
+ }
}
})
@@ -178,20 +210,32 @@ addShortcut(['ctrl', 'alt', 'arrowleft'], async (event) => {
event.preventDefault();
event.stopPropagation();
- const newIndex = Math.max(0, (lastMessage.focusedIndex || 0) - 1);
- patchMessageLocally(lastMessage.id, { focusedIndex: newIndex });
+ const currentIdx = lastMessage.children.findIndex(c => c?.id === lastMessage.activeChildId);
+ if (currentIdx > 0) {
+ patchMessageLocally(lastMessage.id, { activeChildId: lastMessage.children[currentIdx - 1]!.id });
+ }
}
})
addShortcut(['ctrl', 'alt', 'arrowright'], async (event) => {
const lastMessage = topic.value?.messages?.at(-1);
- const messageCount = lastMessage ? (lastMessage.deleted ? lastMessage.children.length : lastMessage.children.length + 1) : 0;
if (lastMessage && lastMessage.children.length > 0) {
event.preventDefault();
event.stopPropagation();
- const newIndex = Math.min(messageCount - 1, (lastMessage.focusedIndex || 0) + 1);
- patchMessageLocally(lastMessage.id, { focusedIndex: newIndex });
+ const currentIdx = lastMessage.children.findIndex(c => c?.id === lastMessage.activeChildId);
+ const maxIdx = lastMessage.deleted ? lastMessage.children.length - 1 : lastMessage.children.length;
+ const nextIdx = Math.min(maxIdx, currentIdx + 1);
+
+ if (lastMessage.deleted) {
+ patchMessageLocally(lastMessage.id, { activeChildId: lastMessage.children[nextIdx]?.id ?? null });
+ } else {
+ if (nextIdx === 0) {
+ patchMessageLocally(lastMessage.id, { activeChildId: null });
+ } else {
+ patchMessageLocally(lastMessage.id, { activeChildId: lastMessage.children[nextIdx - 1]?.id ?? null });
+ }
+ }
}
})
@@ -249,7 +293,8 @@ console.log("full page render took", Date.now() - rootStart);
+ :providers="providers?.filter(p => p.enabled)" @submit="submitMessage" @cancel="handleCancel"
+ @resize="handleResize" />
diff --git a/drizzle/migrations/20260409052841_powerful_alex_power/migration.sql b/drizzle/migrations/20260409052841_powerful_alex_power/migration.sql
deleted file mode 100644
index e69de29..0000000
diff --git a/drizzle/migrations/20260409052924_mute_patriot/migration.sql b/drizzle/migrations/20260409052924_mute_patriot/migration.sql
deleted file mode 100644
index 8903cfd..0000000
--- a/drizzle/migrations/20260409052924_mute_patriot/migration.sql
+++ /dev/null
@@ -1,16 +0,0 @@
-ALTER TABLE "agents" ADD COLUMN "config" jsonb DEFAULT '{}';--> statement-breakpoint
-ALTER TABLE "accounts" DROP CONSTRAINT "accounts_user_id_users_id_fkey", ADD CONSTRAINT "accounts_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "agents" DROP CONSTRAINT "agents_default_model_id_models_id_fkey", ADD CONSTRAINT "agents_default_model_id_models_id_fkey" FOREIGN KEY ("default_model_id") REFERENCES "models"("id") ON DELETE SET NULL;--> statement-breakpoint
-ALTER TABLE "attachments" DROP CONSTRAINT "attachments_file_id_files_id_fkey", ADD CONSTRAINT "attachments_file_id_files_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "attachments" DROP CONSTRAINT "attachments_message_id_messages_id_fkey", ADD CONSTRAINT "attachments_message_id_messages_id_fkey" FOREIGN KEY ("message_id") REFERENCES "messages"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "attachments" DROP CONSTRAINT "attachments_topic_id_topics_id_fkey", ADD CONSTRAINT "attachments_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id");--> statement-breakpoint
-ALTER TABLE "embeddings" DROP CONSTRAINT "embeddings_file_id_files_id_fkey", ADD CONSTRAINT "embeddings_file_id_files_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "generations" DROP CONSTRAINT "generations_topic_id_topics_id_fkey", ADD CONSTRAINT "generations_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "message_parts" DROP CONSTRAINT "message_parts_message_id_messages_id_fkey", ADD CONSTRAINT "message_parts_message_id_messages_id_fkey" FOREIGN KEY ("message_id") REFERENCES "messages"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "message_parts" DROP CONSTRAINT "message_parts_tool_call_id_tool_calls_id_fkey", ADD CONSTRAINT "message_parts_tool_call_id_tool_calls_id_fkey" FOREIGN KEY ("tool_call_id") REFERENCES "tool_calls"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "message_parts" DROP CONSTRAINT "message_parts_topic_id_topics_id_fkey", ADD CONSTRAINT "message_parts_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "messages" DROP CONSTRAINT "messages_generation_id_generations_id_fkey", ADD CONSTRAINT "messages_generation_id_generations_id_fkey" FOREIGN KEY ("generation_id") REFERENCES "generations"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "messages" DROP CONSTRAINT "messages_topic_id_topics_id_fkey", ADD CONSTRAINT "messages_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "models" DROP CONSTRAINT "models_provider_id_providers_id_fkey", ADD CONSTRAINT "models_provider_id_providers_id_fkey" FOREIGN KEY ("provider_id") REFERENCES "providers"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "sessions" DROP CONSTRAINT "sessions_user_id_users_id_fkey", ADD CONSTRAINT "sessions_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
-ALTER TABLE "topics" DROP CONSTRAINT "topics_agent_id_agents_id_fkey", ADD CONSTRAINT "topics_agent_id_agents_id_fkey" FOREIGN KEY ("agent_id") REFERENCES "agents"("id") ON DELETE CASCADE;
\ No newline at end of file
diff --git a/drizzle/migrations/20260505033406_powerful_arclight/migration.sql b/drizzle/migrations/20260505033406_powerful_arclight/migration.sql
new file mode 100644
index 0000000..db4b0b9
--- /dev/null
+++ b/drizzle/migrations/20260505033406_powerful_arclight/migration.sql
@@ -0,0 +1,218 @@
+CREATE TYPE "part_type" AS ENUM('reasoning', 'text', 'tool-call', 'file');--> statement-breakpoint
+CREATE TYPE "role" AS ENUM('user', 'assistant');--> statement-breakpoint
+CREATE TYPE "status" AS ENUM('pending', 'completed', 'failed', 'cancelled');--> statement-breakpoint
+CREATE TABLE "accounts" (
+ "id" text PRIMARY KEY,
+ "account_id" text NOT NULL,
+ "provider_id" text NOT NULL,
+ "user_id" text NOT NULL,
+ "access_token" text,
+ "refresh_token" text,
+ "id_token" text,
+ "access_token_expires_at" timestamp,
+ "refresh_token_expires_at" timestamp,
+ "scope" text,
+ "password" text,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "agents" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "name" text NOT NULL,
+ "system_prompt" text,
+ "image_url" text,
+ "default_model_id" text,
+ "config" jsonb DEFAULT '{}',
+ "created_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "attachments" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "topic_id" text NOT NULL,
+ "message_id" text NOT NULL,
+ "file_id" text NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "embeddings" (
+ "id" text PRIMARY KEY,
+ "file_id" text NOT NULL,
+ "content" text NOT NULL,
+ "embedding" vector(1536),
+ "metadata" jsonb
+);
+--> statement-breakpoint
+CREATE TABLE "files" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "name" text NOT NULL,
+ "mime_type" text NOT NULL,
+ "url" text NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "generations" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "topic_id" text NOT NULL,
+ "model_id" text NOT NULL,
+ "status" "status" NOT NULL,
+ "tokens" jsonb,
+ "error" text
+);
+--> statement-breakpoint
+CREATE TABLE "message_parts" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "topic_id" text NOT NULL,
+ "message_id" text NOT NULL,
+ "tool_call_id" text,
+ "type" "part_type" NOT NULL,
+ "content" text,
+ "provider_options" jsonb,
+ "finished" boolean DEFAULT false NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "last_updated_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "messages" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "topic_id" text NOT NULL,
+ "parent_message_id" text,
+ "generation_id" text,
+ "role" "role" NOT NULL,
+ "content" text,
+ "focused_index" integer,
+ "deleted" boolean DEFAULT false,
+ "updated_at" timestamp DEFAULT now() NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "models" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "external_id" text NOT NULL,
+ "provider_id" text NOT NULL,
+ "name" text NOT NULL,
+ "cost" jsonb DEFAULT '{}' NOT NULL,
+ "input_modalities" text[] DEFAULT '{}'::text[] NOT NULL,
+ "output_modalities" text[] DEFAULT '{}'::text[] NOT NULL,
+ "capabilities" text[] DEFAULT '{}'::text[] NOT NULL,
+ "context_window" integer,
+ "supported_parameters" text[],
+ "is_custom" boolean DEFAULT false NOT NULL,
+ "enabled" boolean DEFAULT true NOT NULL,
+ "released_at" timestamp
+);
+--> statement-breakpoint
+CREATE TABLE "providers" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "type" text NOT NULL,
+ "name" text NOT NULL,
+ "enabled" boolean DEFAULT true NOT NULL,
+ "config" jsonb DEFAULT '{}' NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "sessions" (
+ "id" text PRIMARY KEY,
+ "expires_at" timestamp NOT NULL,
+ "token" text NOT NULL UNIQUE,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp NOT NULL,
+ "ip_address" text,
+ "user_agent" text,
+ "user_id" text NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "settings" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "system_assistants" jsonb DEFAULT '{}' NOT NULL,
+ "appearance" jsonb
+);
+--> statement-breakpoint
+CREATE TABLE "tool_calls" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "tool_name" text NOT NULL,
+ "status" "status" DEFAULT 'pending'::"status" NOT NULL,
+ "input" jsonb,
+ "output" jsonb,
+ "error" jsonb,
+ "created_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "topics" (
+ "id" text PRIMARY KEY,
+ "user_id" text NOT NULL,
+ "agent_id" text NOT NULL,
+ "name" text NOT NULL,
+ "renaming" boolean DEFAULT false,
+ "created_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "users" (
+ "id" text PRIMARY KEY,
+ "name" text NOT NULL,
+ "email" text NOT NULL UNIQUE,
+ "email_verified" boolean DEFAULT false NOT NULL,
+ "image" text,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE TABLE "verifications" (
+ "id" text PRIMARY KEY,
+ "identifier" text NOT NULL,
+ "value" text NOT NULL,
+ "expires_at" timestamp NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+CREATE INDEX "accounts_userId_idx" ON "accounts" ("user_id");--> statement-breakpoint
+CREATE INDEX "agents_userId_idx" ON "agents" ("user_id");--> statement-breakpoint
+CREATE INDEX "attachments_topicId_idx" ON "attachments" ("topic_id");--> statement-breakpoint
+CREATE INDEX "attachments_messageId_idx" ON "attachments" ("message_id");--> statement-breakpoint
+CREATE INDEX "attachments_userId_idx" ON "attachments" ("user_id");--> statement-breakpoint
+CREATE INDEX "embeddings_fileId_idx" ON "embeddings" ("file_id");--> statement-breakpoint
+CREATE INDEX "files_userId_idx" ON "files" ("user_id");--> statement-breakpoint
+CREATE INDEX "generations_topicId_idx" ON "generations" ("topic_id");--> statement-breakpoint
+CREATE INDEX "generations_userId_idx" ON "generations" ("user_id");--> statement-breakpoint
+CREATE INDEX "message_parts_topicId_idx" ON "message_parts" ("topic_id");--> statement-breakpoint
+CREATE INDEX "message_parts_messageId_idx" ON "message_parts" ("message_id");--> statement-breakpoint
+CREATE INDEX "message_parts_userId_idx" ON "message_parts" ("user_id");--> statement-breakpoint
+CREATE INDEX "messages_topicId_idx" ON "messages" ("topic_id");--> statement-breakpoint
+CREATE INDEX "messages_parentMessageId_idx" ON "messages" ("parent_message_id");--> statement-breakpoint
+CREATE INDEX "messages_userId_idx" ON "messages" ("user_id");--> statement-breakpoint
+CREATE INDEX "models_providerId_idx" ON "models" ("provider_id");--> statement-breakpoint
+CREATE INDEX "models_userId_idx" ON "models" ("user_id");--> statement-breakpoint
+CREATE INDEX "providers_userId_idx" ON "providers" ("user_id");--> statement-breakpoint
+CREATE INDEX "sessions_userId_idx" ON "sessions" ("user_id");--> statement-breakpoint
+CREATE INDEX "settings_userId_idx" ON "settings" ("user_id");--> statement-breakpoint
+CREATE INDEX "tool_calls_userId_idx" ON "tool_calls" ("user_id");--> statement-breakpoint
+CREATE INDEX "topics_agentId_idx" ON "topics" ("agent_id");--> statement-breakpoint
+CREATE INDEX "topics_userId_idx" ON "topics" ("user_id");--> statement-breakpoint
+CREATE INDEX "verifications_identifier_idx" ON "verifications" ("identifier");--> statement-breakpoint
+ALTER TABLE "accounts" ADD CONSTRAINT "accounts_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "agents" ADD CONSTRAINT "agents_default_model_id_models_id_fkey" FOREIGN KEY ("default_model_id") REFERENCES "models"("id") ON DELETE SET NULL;--> statement-breakpoint
+ALTER TABLE "attachments" ADD CONSTRAINT "attachments_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "attachments" ADD CONSTRAINT "attachments_message_id_messages_id_fkey" FOREIGN KEY ("message_id") REFERENCES "messages"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "attachments" ADD CONSTRAINT "attachments_file_id_files_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "embeddings" ADD CONSTRAINT "embeddings_file_id_files_id_fkey" FOREIGN KEY ("file_id") REFERENCES "files"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "generations" ADD CONSTRAINT "generations_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "message_parts" ADD CONSTRAINT "message_parts_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "message_parts" ADD CONSTRAINT "message_parts_message_id_messages_id_fkey" FOREIGN KEY ("message_id") REFERENCES "messages"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "message_parts" ADD CONSTRAINT "message_parts_tool_call_id_tool_calls_id_fkey" FOREIGN KEY ("tool_call_id") REFERENCES "tool_calls"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "messages" ADD CONSTRAINT "messages_topic_id_topics_id_fkey" FOREIGN KEY ("topic_id") REFERENCES "topics"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "messages" ADD CONSTRAINT "messages_generation_id_generations_id_fkey" FOREIGN KEY ("generation_id") REFERENCES "generations"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "models" ADD CONSTRAINT "models_provider_id_providers_id_fkey" FOREIGN KEY ("provider_id") REFERENCES "providers"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "sessions" ADD CONSTRAINT "sessions_user_id_users_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE CASCADE;--> statement-breakpoint
+ALTER TABLE "topics" ADD CONSTRAINT "topics_agent_id_agents_id_fkey" FOREIGN KEY ("agent_id") REFERENCES "agents"("id") ON DELETE CASCADE;
\ No newline at end of file
diff --git a/drizzle/migrations/20260409052924_mute_patriot/snapshot.json b/drizzle/migrations/20260505033406_powerful_arclight/snapshot.json
similarity index 99%
rename from drizzle/migrations/20260409052924_mute_patriot/snapshot.json
rename to drizzle/migrations/20260505033406_powerful_arclight/snapshot.json
index 38e37f1..ade1965 100644
--- a/drizzle/migrations/20260409052924_mute_patriot/snapshot.json
+++ b/drizzle/migrations/20260505033406_powerful_arclight/snapshot.json
@@ -1,9 +1,9 @@
{
"version": "8",
"dialect": "postgres",
- "id": "5af4d48d-34c4-4952-aadf-c434cf32d55f",
+ "id": "fca582f6-c25d-4250-92f4-a51d1b57d3b4",
"prevIds": [
- "f031de7a-cc2b-4725-9667-e059eb7fb46c"
+ "00000000-0000-0000-0000-000000000000"
],
"ddl": [
{
@@ -2346,7 +2346,7 @@
"id"
],
"onUpdate": "NO ACTION",
- "onDelete": "NO ACTION",
+ "onDelete": "CASCADE",
"name": "attachments_topic_id_topics_id_fkey",
"entityType": "fks",
"schema": "public",
diff --git a/drizzle/migrations/20260511154808_slimy_annihilus/migration.sql b/drizzle/migrations/20260511154808_slimy_annihilus/migration.sql
new file mode 100644
index 0000000..f3b9d65
--- /dev/null
+++ b/drizzle/migrations/20260511154808_slimy_annihilus/migration.sql
@@ -0,0 +1,13 @@
+ALTER TABLE "files" ADD COLUMN "size" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
+ALTER TABLE "messages" ADD COLUMN "active_child_id" text;--> statement-breakpoint
+UPDATE "messages" m
+SET "active_child_id" = (
+ SELECT child."id"
+ FROM "messages" child
+ WHERE child."parent_message_id" = m."id"
+ ORDER BY child."created_at" ASC
+ OFFSET (m."focused_index" - 1)
+ LIMIT 1
+)
+WHERE m."focused_index" IS NOT NULL AND m."focused_index" > 0;--> statement-breakpoint
+ALTER TABLE "messages" DROP COLUMN "focused_index";
\ No newline at end of file
diff --git a/drizzle/migrations/20260409052841_powerful_alex_power/snapshot.json b/drizzle/migrations/20260511154808_slimy_annihilus/snapshot.json
similarity index 93%
rename from drizzle/migrations/20260409052841_powerful_alex_power/snapshot.json
rename to drizzle/migrations/20260511154808_slimy_annihilus/snapshot.json
index 40fc91f..43bd854 100644
--- a/drizzle/migrations/20260409052841_powerful_alex_power/snapshot.json
+++ b/drizzle/migrations/20260511154808_slimy_annihilus/snapshot.json
@@ -1,10 +1,10 @@
{
- "dialect": "postgres",
- "id": "f031de7a-cc2b-4725-9667-e059eb7fb46c",
- "prevIds": [
- "00000000-0000-0000-0000-000000000000"
- ],
"version": "8",
+ "dialect": "postgres",
+ "id": "00f5b66f-e79e-40f4-89e3-9ff1d2dbf757",
+ "prevIds": [
+ "fca582f6-c25d-4250-92f4-a51d1b57d3b4"
+ ],
"ddl": [
{
"values": [
@@ -133,110 +133,6 @@
"entityType": "tables",
"schema": "public"
},
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "settings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "verifications"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "topics"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "attachments"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
{
"type": "text",
"typeSchema": null,
@@ -250,136 +146,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "embeddings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "id",
- "entityType": "columns",
- "schema": "public",
- "table": "files"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "topics"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "files"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
{
"type": "text",
"typeSchema": null,
@@ -393,214 +159,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "identifier",
- "entityType": "columns",
- "schema": "public",
- "table": "verifications"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "name",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "settings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "attachments"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "expires_at",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "file_id",
- "entityType": "columns",
- "schema": "public",
- "table": "embeddings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "token",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "type",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "value",
- "entityType": "columns",
- "schema": "public",
- "table": "verifications"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "name",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
{
"type": "text",
"typeSchema": null,
@@ -614,331 +172,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "topic_id",
- "entityType": "columns",
- "schema": "public",
- "table": "attachments"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "email",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "content",
- "entityType": "columns",
- "schema": "public",
- "table": "embeddings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "name",
- "entityType": "columns",
- "schema": "public",
- "table": "files"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "topic_id",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "topic_id",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "agent_id",
- "entityType": "columns",
- "schema": "public",
- "table": "topics"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "topic_id",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "tool_name",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "external_id",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "'{}'",
- "generated": null,
- "identity": null,
- "name": "system_assistants",
- "entityType": "columns",
- "schema": "public",
- "table": "settings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "message_id",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "mime_type",
- "entityType": "columns",
- "schema": "public",
- "table": "files"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "name",
- "entityType": "columns",
- "schema": "public",
- "table": "topics"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "vector(1536)",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "embedding",
- "entityType": "columns",
- "schema": "public",
- "table": "embeddings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "parent_message_id",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "message_id",
- "entityType": "columns",
- "schema": "public",
- "table": "attachments"
- },
- {
- "type": "boolean",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "false",
- "generated": null,
- "identity": null,
- "name": "email_verified",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "status",
- "typeSchema": "public",
- "notNull": true,
- "dimensions": 0,
- "default": "'pending'",
- "generated": null,
- "identity": null,
- "name": "status",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "name",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "system_prompt",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "provider_id",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "expires_at",
- "entityType": "columns",
- "schema": "public",
- "table": "verifications"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "model_id",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
{
"type": "text",
"typeSchema": null,
@@ -952,71 +185,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "appearance",
- "entityType": "columns",
- "schema": "public",
- "table": "settings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "url",
- "entityType": "columns",
- "schema": "public",
- "table": "files"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "tool_call_id",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "boolean",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": "false",
- "generated": null,
- "identity": null,
- "name": "renaming",
- "entityType": "columns",
- "schema": "public",
- "table": "topics"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "image_url",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
{
"type": "text",
"typeSchema": null,
@@ -1030,149 +198,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "metadata",
- "entityType": "columns",
- "schema": "public",
- "table": "embeddings"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "image",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "file_id",
- "entityType": "columns",
- "schema": "public",
- "table": "attachments"
- },
- {
- "type": "boolean",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "true",
- "generated": null,
- "identity": null,
- "name": "enabled",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "updated_at",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "generation_id",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "status",
- "typeSchema": "public",
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "status",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "name",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "input",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "verifications"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "updated_at",
- "entityType": "columns",
- "schema": "public",
- "table": "verifications"
- },
{
"type": "text",
"typeSchema": null,
@@ -1186,266 +211,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "default_model_id",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "files"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "tokens",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
- {
- "type": "part_type",
- "typeSchema": "public",
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "type",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "role",
- "typeSchema": "public",
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "role",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "'{}'",
- "generated": null,
- "identity": null,
- "name": "cost",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "'{}'",
- "generated": null,
- "identity": null,
- "name": "config",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "ip_address",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "output",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "topics"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_agent",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "content",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "agents"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "error",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "updated_at",
- "entityType": "columns",
- "schema": "public",
- "table": "users"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "error",
- "entityType": "columns",
- "schema": "public",
- "table": "generations"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "content",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 1,
- "default": "'{}'",
- "generated": null,
- "identity": null,
- "name": "input_modalities",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
{
"type": "text",
"typeSchema": null,
@@ -1472,110 +237,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "updated_at",
- "entityType": "columns",
- "schema": "public",
- "table": "providers"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 1,
- "default": "'{}'",
- "generated": null,
- "identity": null,
- "name": "output_modalities",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "integer",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "focused_index",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "tool_calls"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "user_id",
- "entityType": "columns",
- "schema": "public",
- "table": "sessions"
- },
- {
- "type": "jsonb",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "provider_options",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "text",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 1,
- "default": "'{}'",
- "generated": null,
- "identity": null,
- "name": "capabilities",
- "entityType": "columns",
- "schema": "public",
- "table": "models"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "attachments"
- },
{
"type": "timestamp",
"typeSchema": null,
@@ -1589,32 +250,6 @@
"schema": "public",
"table": "accounts"
},
- {
- "type": "boolean",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "false",
- "generated": null,
- "identity": null,
- "name": "finished",
- "entityType": "columns",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "type": "boolean",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": "false",
- "generated": null,
- "identity": null,
- "name": "deleted",
- "entityType": "columns",
- "schema": "public",
- "table": "messages"
- },
{
"type": "text",
"typeSchema": null,
@@ -1629,17 +264,17 @@
"table": "accounts"
},
{
- "type": "integer",
+ "type": "text",
"typeSchema": null,
"notNull": false,
"dimensions": 0,
"default": null,
"generated": null,
"identity": null,
- "name": "context_window",
+ "name": "password",
"entityType": "columns",
"schema": "public",
- "table": "models"
+ "table": "accounts"
},
{
"type": "timestamp",
@@ -1649,10 +284,569 @@
"default": "now()",
"generated": null,
"identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "accounts"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
"name": "updated_at",
"entityType": "columns",
"schema": "public",
- "table": "messages"
+ "table": "accounts"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "system_prompt",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "image_url",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "default_model_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "config",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "agents"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "topic_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "message_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "file_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "embeddings"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "file_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "embeddings"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "content",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "embeddings"
+ },
+ {
+ "type": "vector(1536)",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "embedding",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "embeddings"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "metadata",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "embeddings"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "mime_type",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "integer",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "0",
+ "generated": null,
+ "identity": null,
+ "name": "size",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "url",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "files"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "topic_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "model_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "status",
+ "typeSchema": "public",
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "status",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "tokens",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "error",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "generations"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "topic_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "message_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "tool_call_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "part_type",
+ "typeSchema": "public",
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "type",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "content",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "provider_options",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "type": "boolean",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "false",
+ "generated": null,
+ "identity": null,
+ "name": "finished",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "message_parts"
},
{
"type": "timestamp",
@@ -1680,6 +874,136 @@
"schema": "public",
"table": "message_parts"
},
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "topic_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "parent_message_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "generation_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "role",
+ "typeSchema": "public",
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "role",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "content",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "active_child_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "boolean",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": "false",
+ "generated": null,
+ "identity": null,
+ "name": "deleted",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "updated_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "messages"
+ },
{
"type": "timestamp",
"typeSchema": null,
@@ -1693,6 +1017,136 @@
"schema": "public",
"table": "messages"
},
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "external_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "provider_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "cost",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 1,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "input_modalities",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 1,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "output_modalities",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 1,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "capabilities",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
+ {
+ "type": "integer",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "context_window",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "models"
+ },
{
"type": "text",
"typeSchema": null,
@@ -1706,19 +1160,6 @@
"schema": "public",
"table": "models"
},
- {
- "type": "text",
- "typeSchema": null,
- "notNull": false,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "password",
- "entityType": "columns",
- "schema": "public",
- "table": "accounts"
- },
{
"type": "boolean",
"typeSchema": null,
@@ -1732,32 +1173,6 @@
"schema": "public",
"table": "models"
},
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": "now()",
- "generated": null,
- "identity": null,
- "name": "created_at",
- "entityType": "columns",
- "schema": "public",
- "table": "accounts"
- },
- {
- "type": "timestamp",
- "typeSchema": null,
- "notNull": true,
- "dimensions": 0,
- "default": null,
- "generated": null,
- "identity": null,
- "name": "updated_at",
- "entityType": "columns",
- "schema": "public",
- "table": "accounts"
- },
{
"type": "boolean",
"typeSchema": null,
@@ -1784,15 +1199,626 @@
"schema": "public",
"table": "models"
},
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "type",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "boolean",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "true",
+ "generated": null,
+ "identity": null,
+ "name": "enabled",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "config",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "updated_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "providers"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "expires_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "token",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "updated_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "ip_address",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_agent",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "sessions"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "settings"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "settings"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "'{}'",
+ "generated": null,
+ "identity": null,
+ "name": "system_assistants",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "settings"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "appearance",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "settings"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "tool_name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "status",
+ "typeSchema": "public",
+ "notNull": true,
+ "dimensions": 0,
+ "default": "'pending'",
+ "generated": null,
+ "identity": null,
+ "name": "status",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "input",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "output",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "jsonb",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "error",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "tool_calls"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "topics"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "user_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "topics"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "agent_id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "topics"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "topics"
+ },
+ {
+ "type": "boolean",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": "false",
+ "generated": null,
+ "identity": null,
+ "name": "renaming",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "topics"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "topics"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "name",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "email",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "boolean",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "false",
+ "generated": null,
+ "identity": null,
+ "name": "email_verified",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": false,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "image",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "updated_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "users"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "id",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "verifications"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "identifier",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "verifications"
+ },
+ {
+ "type": "text",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "value",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "verifications"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": null,
+ "generated": null,
+ "identity": null,
+ "name": "expires_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "verifications"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "created_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "verifications"
+ },
+ {
+ "type": "timestamp",
+ "typeSchema": null,
+ "notNull": true,
+ "dimensions": 0,
+ "default": "now()",
+ "generated": null,
+ "identity": null,
+ "name": "updated_at",
+ "entityType": "columns",
+ "schema": "public",
+ "table": "verifications"
+ },
{
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1809,11 +1835,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1830,32 +1856,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "topic_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "message_id"
- }
- ],
- "isUnique": false,
- "where": null,
- "with": "",
- "method": "btree",
- "concurrently": false,
- "name": "attachments_messageId_idx",
- "entityType": "indexes",
- "schema": "public",
- "table": "attachments"
- },
- {
- "nameExplicit": true,
- "columns": [
- {
- "asc": true,
- "nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "topic_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1872,11 +1877,32 @@
"nameExplicit": true,
"columns": [
{
+ "value": "message_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
+ "opclass": null
+ }
+ ],
+ "isUnique": false,
+ "where": null,
+ "with": "",
+ "method": "btree",
+ "concurrently": false,
+ "name": "attachments_messageId_idx",
+ "entityType": "indexes",
+ "schema": "public",
+ "table": "attachments"
+ },
+ {
+ "nameExplicit": true,
+ "columns": [
+ {
+ "value": "user_id",
"isExpression": false,
- "value": "user_id"
+ "asc": true,
+ "nullsFirst": false,
+ "opclass": null
}
],
"isUnique": false,
@@ -1893,11 +1919,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "file_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "file_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1914,11 +1940,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1935,11 +1961,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "topic_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "topic_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1956,11 +1982,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -1977,32 +2003,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "topic_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "message_id"
- }
- ],
- "isUnique": false,
- "where": null,
- "with": "",
- "method": "btree",
- "concurrently": false,
- "name": "message_parts_messageId_idx",
- "entityType": "indexes",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "nameExplicit": true,
- "columns": [
- {
- "asc": true,
- "nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "topic_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2019,11 +2024,32 @@
"nameExplicit": true,
"columns": [
{
+ "value": "message_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
+ "opclass": null
+ }
+ ],
+ "isUnique": false,
+ "where": null,
+ "with": "",
+ "method": "btree",
+ "concurrently": false,
+ "name": "message_parts_messageId_idx",
+ "entityType": "indexes",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "nameExplicit": true,
+ "columns": [
+ {
+ "value": "user_id",
"isExpression": false,
- "value": "user_id"
+ "asc": true,
+ "nullsFirst": false,
+ "opclass": null
}
],
"isUnique": false,
@@ -2040,32 +2066,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "topic_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "parent_message_id"
- }
- ],
- "isUnique": false,
- "where": null,
- "with": "",
- "method": "btree",
- "concurrently": false,
- "name": "messages_parentMessageId_idx",
- "entityType": "indexes",
- "schema": "public",
- "table": "messages"
- },
- {
- "nameExplicit": true,
- "columns": [
- {
- "asc": true,
- "nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "topic_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2082,11 +2087,32 @@
"nameExplicit": true,
"columns": [
{
+ "value": "parent_message_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
+ "opclass": null
+ }
+ ],
+ "isUnique": false,
+ "where": null,
+ "with": "",
+ "method": "btree",
+ "concurrently": false,
+ "name": "messages_parentMessageId_idx",
+ "entityType": "indexes",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "nameExplicit": true,
+ "columns": [
+ {
+ "value": "user_id",
"isExpression": false,
- "value": "user_id"
+ "asc": true,
+ "nullsFirst": false,
+ "opclass": null
}
],
"isUnique": false,
@@ -2103,11 +2129,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "provider_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "provider_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2124,11 +2150,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2145,11 +2171,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2166,11 +2192,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2187,11 +2213,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2208,11 +2234,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2229,11 +2255,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "agent_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "agent_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2250,11 +2276,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "user_id",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "user_id"
+ "opclass": null
}
],
"isUnique": false,
@@ -2271,11 +2297,11 @@
"nameExplicit": true,
"columns": [
{
+ "value": "identifier",
+ "isExpression": false,
"asc": true,
"nullsFirst": false,
- "opclass": null,
- "isExpression": false,
- "value": "identifier"
+ "opclass": null
}
],
"isUnique": false,
@@ -2289,7 +2315,7 @@
"table": "verifications"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"user_id"
],
@@ -2306,7 +2332,7 @@
"table": "accounts"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"default_model_id"
],
@@ -2323,24 +2349,24 @@
"table": "agents"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
- "file_id"
+ "topic_id"
],
"schemaTo": "public",
- "tableTo": "files",
+ "tableTo": "topics",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
"onDelete": "CASCADE",
- "name": "attachments_file_id_files_id_fkey",
+ "name": "attachments_topic_id_topics_id_fkey",
"entityType": "fks",
"schema": "public",
"table": "attachments"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"message_id"
],
@@ -2357,24 +2383,24 @@
"table": "attachments"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
- "topic_id"
+ "file_id"
],
"schemaTo": "public",
- "tableTo": "topics",
+ "tableTo": "files",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
- "onDelete": "NO ACTION",
- "name": "attachments_topic_id_topics_id_fkey",
+ "onDelete": "CASCADE",
+ "name": "attachments_file_id_files_id_fkey",
"entityType": "fks",
"schema": "public",
"table": "attachments"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"file_id"
],
@@ -2391,7 +2417,7 @@
"table": "embeddings"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"topic_id"
],
@@ -2408,41 +2434,7 @@
"table": "generations"
},
{
- "nameExplicit": true,
- "columns": [
- "message_id"
- ],
- "schemaTo": "public",
- "tableTo": "messages",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "NO ACTION",
- "onDelete": "CASCADE",
- "name": "message_parts_message_id_messages_id_fkey",
- "entityType": "fks",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "nameExplicit": true,
- "columns": [
- "tool_call_id"
- ],
- "schemaTo": "public",
- "tableTo": "tool_calls",
- "columnsTo": [
- "id"
- ],
- "onUpdate": "NO ACTION",
- "onDelete": "CASCADE",
- "name": "message_parts_tool_call_id_tool_calls_id_fkey",
- "entityType": "fks",
- "schema": "public",
- "table": "message_parts"
- },
- {
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"topic_id"
],
@@ -2459,24 +2451,41 @@
"table": "message_parts"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
- "generation_id"
+ "message_id"
],
"schemaTo": "public",
- "tableTo": "generations",
+ "tableTo": "messages",
"columnsTo": [
"id"
],
"onUpdate": "NO ACTION",
"onDelete": "CASCADE",
- "name": "messages_generation_id_generations_id_fkey",
+ "name": "message_parts_message_id_messages_id_fkey",
"entityType": "fks",
"schema": "public",
- "table": "messages"
+ "table": "message_parts"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
+ "columns": [
+ "tool_call_id"
+ ],
+ "schemaTo": "public",
+ "tableTo": "tool_calls",
+ "columnsTo": [
+ "id"
+ ],
+ "onUpdate": "NO ACTION",
+ "onDelete": "CASCADE",
+ "name": "message_parts_tool_call_id_tool_calls_id_fkey",
+ "entityType": "fks",
+ "schema": "public",
+ "table": "message_parts"
+ },
+ {
+ "nameExplicit": false,
"columns": [
"topic_id"
],
@@ -2493,7 +2502,24 @@
"table": "messages"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
+ "columns": [
+ "generation_id"
+ ],
+ "schemaTo": "public",
+ "tableTo": "generations",
+ "columnsTo": [
+ "id"
+ ],
+ "onUpdate": "NO ACTION",
+ "onDelete": "CASCADE",
+ "name": "messages_generation_id_generations_id_fkey",
+ "entityType": "fks",
+ "schema": "public",
+ "table": "messages"
+ },
+ {
+ "nameExplicit": false,
"columns": [
"provider_id"
],
@@ -2510,7 +2536,7 @@
"table": "models"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"user_id"
],
@@ -2527,7 +2553,7 @@
"table": "sessions"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"agent_id"
],
@@ -2547,183 +2573,183 @@
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "accounts_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "accounts"
+ "table": "accounts",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "agents_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "agents"
+ "table": "agents",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "attachments_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "attachments"
+ "table": "attachments",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "embeddings_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "embeddings"
+ "table": "embeddings",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "files_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "files"
+ "table": "files",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "generations_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "generations"
+ "table": "generations",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "message_parts_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "message_parts"
+ "table": "message_parts",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "messages_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "messages"
+ "table": "messages",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "models_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "models"
+ "table": "models",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "providers_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "providers"
+ "table": "providers",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "sessions_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "sessions"
+ "table": "sessions",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "settings_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "settings"
+ "table": "settings",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "tool_calls_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "tool_calls"
+ "table": "tool_calls",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "topics_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "topics"
+ "table": "topics",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "users_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "users"
+ "table": "users",
+ "entityType": "pks"
},
{
"columns": [
"id"
],
- "nameExplicit": true,
+ "nameExplicit": false,
"name": "verifications_pkey",
- "entityType": "pks",
"schema": "public",
- "table": "verifications"
+ "table": "verifications",
+ "entityType": "pks"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"token"
],
"nullsNotDistinct": false,
"name": "sessions_token_key",
- "entityType": "uniques",
"schema": "public",
- "table": "sessions"
+ "table": "sessions",
+ "entityType": "uniques"
},
{
- "nameExplicit": true,
+ "nameExplicit": false,
"columns": [
"email"
],
"nullsNotDistinct": false,
"name": "users_email_key",
- "entityType": "uniques",
"schema": "public",
- "table": "users"
+ "table": "users",
+ "entityType": "uniques"
}
],
"renames": []
diff --git a/drizzle/schema.ts b/drizzle/schema.ts
index 1bf5eac..ecd6d5c 100644
--- a/drizzle/schema.ts
+++ b/drizzle/schema.ts
@@ -55,7 +55,7 @@ export const providers = pgTable('providers', {
apiProxyUrl?: string;
}>().default({}),
createdAt: timestamp('created_at').notNull().defaultNow(),
- updatedAt: timestamp('updated_at').notNull().defaultNow(),
+ updatedAt: timestamp('updated_at').notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()),
}, (table) => [
index('providers_userId_idx').on(table.userId),
]);
@@ -134,7 +134,7 @@ export const messages = pgTable('messages', {
generationId: text('generation_id').references(() => generations.id, { onDelete: 'cascade' }),
role: roleEnum('role').notNull(),
content: text('content'),
- focusedIndex: integer('focused_index'),
+ activeChildId: text('active_child_id'),
deleted: boolean('deleted').default(false),
updatedAt: timestamp('updated_at').notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()),
createdAt: timestamp('created_at').notNull().defaultNow(),
@@ -155,7 +155,7 @@ export const messageParts = pgTable('message_parts', {
providerOptions: jsonb('provider_options'),
finished: boolean('finished').notNull().default(false),
createdAt: timestamp('created_at').notNull().defaultNow(),
- lastUpdatedAt: timestamp('last_updated_at').notNull().defaultNow(),
+ lastUpdatedAt: timestamp('last_updated_at').notNull().defaultNow().$onUpdate(() => /* @__PURE__ */ new Date()),
}, (table) => [
index('message_parts_topicId_idx').on(table.topicId),
index('message_parts_messageId_idx').on(table.messageId),
@@ -212,6 +212,7 @@ export const files = pgTable('files', {
userId: text('user_id').notNull(),
name: text('name').notNull(),
mimeType: text('mime_type').notNull(),
+ size: integer('size').notNull().default(0),
url: text('url').notNull(),
createdAt: timestamp('created_at').notNull().defaultNow(),
}, (table) => [
diff --git a/server/api/file/[id[.delete.ts b/server/api/file/[id].delete.ts
similarity index 100%
rename from server/api/file/[id[.delete.ts
rename to server/api/file/[id].delete.ts
diff --git a/server/api/messages/[messageId]/index.delete.ts b/server/api/messages/[messageId]/index.delete.ts
index 00fdb09..3cf041d 100644
--- a/server/api/messages/[messageId]/index.delete.ts
+++ b/server/api/messages/[messageId]/index.delete.ts
@@ -77,7 +77,9 @@ export default defineEventHandler(async (event) => {
}
if (rootMessage.deleted === true) {
- const childMessage = rootMessage.children[rootMessage.focusedIndex!];
+ const childMessage = rootMessage.activeChildId
+ ? rootMessage.children.find(c => c.id === rootMessage.activeChildId)
+ : rootMessage.children[0];
if (!childMessage) {
console.error('Message not found');
return { ok: false };
@@ -88,27 +90,15 @@ export default defineEventHandler(async (event) => {
const remainingChildren = rootMessage.children.filter(child => child!.id !== childMessage.id);
if (remainingChildren.length === 0) {
await deeplyDeleteMessage(rootMessage.id, topicId, userId);
- } else {
- const newFocusedIndex = rootMessage.focusedIndex && rootMessage.focusedIndex > 0
- ? Math.min(rootMessage.focusedIndex - 1, remainingChildren.length - 1)
- : 0;
-
- await db.update(messages).set({ focusedIndex: newFocusedIndex }).where(sql`${messages.id} = ${rootMessage.id} AND ${messages.userId} = ${userId}`);
-
- topicEvents.emit(topicId, {
- type: 'MESSAGE_UPDATED',
- payload: { ...rootMessage, focusedIndex: newFocusedIndex },
- });
}
return { ok: true };
}
if (
- (rootMessage.focusedIndex !== undefined && rootMessage.focusedIndex !== null)
- && rootMessage.focusedIndex > 0
+ rootMessage.activeChildId
&& rootMessage.children.length > 0
) {
- const childMessage = rootMessage.children[rootMessage.focusedIndex - 1];
+ const childMessage = rootMessage.children.find(c => c.id === rootMessage.activeChildId);
if (!childMessage) {
console.error('Message not found');
return { ok: false };
@@ -116,17 +106,6 @@ export default defineEventHandler(async (event) => {
await deeplyDeleteMessage(childMessage.id, topicId, userId);
- const remainingChildren = rootMessage.children.filter(child => child!.id !== childMessage.id);
- const newFocusedIndex = remainingChildren.length > 0
- ? Math.min(rootMessage.focusedIndex - 1, remainingChildren.length - 1)
- : 0;
-
- await db.update(messages).set({ focusedIndex: newFocusedIndex }).where(sql`${messages.id} = ${rootMessage.id} AND ${messages.userId} = ${userId}`);
-
- topicEvents.emit(topicId, {
- type: 'MESSAGE_UPDATED',
- payload: { ...rootMessage, focusedIndex: newFocusedIndex },
- });
return { ok: true };
}
diff --git a/server/api/topic/[topicId]/chat/index.post.ts b/server/api/topic/[topicId]/chat/index.post.ts
index ffd0271..44c0574 100644
--- a/server/api/topic/[topicId]/chat/index.post.ts
+++ b/server/api/topic/[topicId]/chat/index.post.ts
@@ -260,8 +260,8 @@ export default defineEventHandler(async (event) => {
});
}
- await db.update(messages).set({ focusedIndex: (parentMessage.focusedIndex ?? 0) + 1 }).where(eq(messages.id, parentMessageId));
- events.push({ type: 'MESSAGE_UPDATED', payload: { focusedIndex: (parentMessage.focusedIndex ?? 0) + 1 } });
+ await db.update(messages).set({ activeChildId: agentmessage.id }).where(eq(messages.id, parentMessageId));
+ events.push({ type: 'MESSAGE_UPDATED', payload: { id: parentMessageId, activeChildId: agentmessage.id } });
// we need to make the topic messages all the messages excluding the ones after the message we wish to regenerate
// and if parentMessageId is undefined, then excluding the last message
@@ -392,7 +392,13 @@ type SearchTheWebConfig = SearchTheWebRerankedConfig | SearchTheWebUnrankedConfi
export const searchTheWeb = (config: SearchTheWebConfig) => {
return async (query: string) => {
- const results = await $fetch(`${process.env.SEARXNG_URL}/search`, {
+ const results = await $fetch<{
+ results: Array<{
+ title: string;
+ url: string;
+ content: string;
+ }>;
+ }>(`${process.env.SEARXNG_URL}/search`, {
query: {
q: query,
format: 'json',
@@ -675,6 +681,7 @@ async function generateResponse(
payload: {
messageId: message.id,
partId: part.id,
+ lastUpdatedAt: new Date(),
content: part.accumulatedContent,
}
})
@@ -850,6 +857,7 @@ async function generateResponse(
payload: {
messageId: message.id,
partId: part.id,
+ lastUpdatedAt: new Date(),
content: token.text,
}
})
@@ -903,6 +911,7 @@ async function generateResponse(
payload: {
messageId: message.id,
partId: part.id,
+ lastUpdatedAt: dbPart.lastUpdatedAt,
content: part.accumulatedContent,
}
})
@@ -1177,7 +1186,7 @@ async function generateResponse(
error: {
type: outputType as ToolCallType,
value: outputValue as string,
- }
+ },
}
})
} else {
diff --git a/utils/message.ts b/utils/message.ts
index 028dd11..647372c 100644
--- a/utils/message.ts
+++ b/utils/message.ts
@@ -22,20 +22,12 @@ export const buildFocusedMessageTree = (messages: Readonly): MessageE
let focusedMessageTree: MessageEntity[] = [];
for (const message of messages) {
- if (message.focusedIndex) {
- if (message.focusedIndex === 0) {
- focusedMessageTree.push(message);
- continue;
- }
-
- const activeChild = message.children[Math.min(Math.max(message.focusedIndex! - 1, 0), message.children.length - 1)]
+ if (message.activeChildId && message.children.length > 0) {
+ const activeChild = message.children.find(c => c?.id === message.activeChildId);
if (activeChild) {
focusedMessageTree.push(activeChild);
- } else {
- focusedMessageTree.push(message);
+ continue;
}
-
- continue;
}
focusedMessageTree.push(message);
From a0f2e8915476483e32abbd24281182000f788866 Mon Sep 17 00:00:00 2001
From: Zoe <62722391+juls0730@users.noreply.github.com>
Date: Mon, 11 May 2026 17:42:28 -0500
Subject: [PATCH 13/18] feat: add resources page with file management
- Add /resources page with file listing, filtering, and bulk operations
- Add useResources composable for file state management
- Add sidenav header and nav components for resources section
- Add files list API endpoint (GET /api/files)
- Track file size during upload
- Add resources link to home navigation
---
app/components/FileSelector.vue | 9 +-
app/components/Sidenav/HeaderResources.vue | 22 ++
app/components/Sidenav/NavHome.vue | 7 +-
app/components/Sidenav/NavResources.vue | 33 +++
app/components/Sidenav/index.vue | 3 +
app/composables/useResources.ts | 186 +++++++++++++++
app/pages/resources.vue | 264 +++++++++++++++++++++
server/api/file/index.post.ts | 4 +-
server/api/files.get.ts | 17 ++
9 files changed, 533 insertions(+), 12 deletions(-)
create mode 100644 app/components/Sidenav/HeaderResources.vue
create mode 100644 app/components/Sidenav/NavResources.vue
create mode 100644 app/composables/useResources.ts
create mode 100644 app/pages/resources.vue
create mode 100644 server/api/files.get.ts
diff --git a/app/components/FileSelector.vue b/app/components/FileSelector.vue
index 5ca115c..b73ce13 100644
--- a/app/components/FileSelector.vue
+++ b/app/components/FileSelector.vue
@@ -90,6 +90,7 @@ const uploadFile = async (file: File) => {
id,
name: fileName,
mimeType: fileType,
+ size: file.size,
url: assetUrl,
},
})
@@ -146,14 +147,6 @@ watch(files, async (newFiles, oldFiles) => {
}
if (removedFile.url.startsWith('blob:')) {
- // we knpw that if the url starts with blob: it was the first time we uploaded it
- // so we can just delete it
- if (removedFile.status === 'uploaded') {
- await $fetch(`/api/file/${removedFile.id}`, {
- method: 'DELETE',
- })
- }
-
URL.revokeObjectURL(removedFile.url);
}
}
diff --git a/app/components/Sidenav/HeaderResources.vue b/app/components/Sidenav/HeaderResources.vue
new file mode 100644
index 0000000..59ad04d
--- /dev/null
+++ b/app/components/Sidenav/HeaderResources.vue
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Resources
+
+
+
+
diff --git a/app/components/Sidenav/NavHome.vue b/app/components/Sidenav/NavHome.vue
index 3d02f09..9c74431 100644
--- a/app/components/Sidenav/NavHome.vue
+++ b/app/components/Sidenav/NavHome.vue
@@ -1,6 +1,6 @@
+
+
+
+
diff --git a/app/components/Sidenav/index.vue b/app/components/Sidenav/index.vue
index eba88bb..3c9e520 100644
--- a/app/components/Sidenav/index.vue
+++ b/app/components/Sidenav/index.vue
@@ -96,6 +96,7 @@ onUnmounted(() => {
const navKind = computed(() => {
if (route.path === '/') return 'home';
if (route.path.startsWith('/agent/')) return 'agent';
+ if (route.path === '/resources') return 'resources';
return null;
});
@@ -123,6 +124,7 @@ const navKind = computed(() => {
class="z-25 bg-[var(--bg-base)] relative flex flex-row gap-2 justify-between items-center shrink-0 pb-1.5 h-13 md:h-11 pt-2">
+
@@ -155,6 +157,7 @@ const navKind = computed(() => {
+
diff --git a/app/composables/useResources.ts b/app/composables/useResources.ts
new file mode 100644
index 0000000..16b2f57
--- /dev/null
+++ b/app/composables/useResources.ts
@@ -0,0 +1,186 @@
+import { attempt } from "~~/types/result";
+import * as schema from '~~/drizzle/schema';
+
+export type ResourceFile = typeof schema.files.$inferSelect;
+
+export type ResourceCategory = 'all' | 'documents' | 'images' | 'audio' | 'videos';
+
+const categoryMimeMap: Record
boolean> = {
+ all: () => true,
+ documents: (mime) =>
+ mime === 'application/pdf' ||
+ mime.startsWith('text/') ||
+ mime.includes('document') ||
+ mime.includes('spreadsheet') ||
+ mime.includes('presentation'),
+ images: (mime) => mime.startsWith('image/'),
+ audio: (mime) => mime.startsWith('audio/'),
+ videos: (mime) => mime.startsWith('video/'),
+};
+
+export const useResources = async () => {
+ const files = useState('resources:files', () => []);
+ const loaded = useState('resources:loaded', () => false);
+ const selectedIds = useState>('resources:selected', () => new Set());
+ const category = useState('resources:category', () => 'all');
+
+ const { refresh } = await useFetch('/api/files', {
+ key: 'resources_files_request',
+ immediate: !loaded.value,
+ onRequest() {
+ loaded.value = true;
+ },
+ onResponse({ response }) {
+ if (response.ok) {
+ files.value = response._data ?? [];
+ }
+ },
+ });
+
+ const filteredFiles = computed(() => {
+ const filter = categoryMimeMap[category.value];
+ return files.value.filter(f => filter(f.mimeType));
+ });
+
+ const setCategory = (cat: ResourceCategory) => {
+ category.value = cat;
+ clearSelection();
+ };
+
+ const categoryCount = (cat: ResourceCategory): number => {
+ const filter = categoryMimeMap[cat];
+ return files.value.filter(f => filter(f.mimeType)).length;
+ };
+
+ const toggleSelect = (id: string) => {
+ const next = new Set(selectedIds.value);
+ if (next.has(id)) {
+ next.delete(id);
+ } else {
+ next.add(id);
+ }
+ selectedIds.value = next;
+ };
+
+ const selectAll = () => {
+ selectedIds.value = new Set(filteredFiles.value.map(f => f.id));
+ };
+
+ const clearSelection = () => {
+ selectedIds.value = new Set();
+ };
+
+ const isAllSelected = computed(() =>
+ filteredFiles.value.length > 0 && selectedIds.value.size === filteredFiles.value.length
+ );
+
+ const hasSelection = computed(() => selectedIds.value.size > 0);
+
+ const selectedCount = computed(() => selectedIds.value.size);
+
+ const deleteFile = async (id: string) => {
+ const file = files.value.find(f => f.id === id);
+ if (!file) return;
+
+ const res = await attempt($fetch(`/api/file/${id}`, {
+ method: 'DELETE',
+ onRequest() {
+ files.value = files.value.filter(f => f.id !== id);
+ const next = new Set(selectedIds.value);
+ next.delete(id);
+ selectedIds.value = next;
+ },
+ onRequestError() {
+ files.value = [...files.value, file].sort(
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
+ );
+ },
+ onResponseError() {
+ files.value = [...files.value, file].sort(
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
+ );
+ },
+ }));
+
+ return res;
+ };
+
+ const deleteSelected = async () => {
+ const ids = Array.from(selectedIds.value);
+ clearSelection();
+
+ const results = await Promise.allSettled(
+ ids.map(id => deleteFile(id))
+ );
+
+ await refresh();
+ return results;
+ };
+
+ const copyLink = async (file: ResourceFile) => {
+ const url = file.url;
+ await navigator.clipboard.writeText(url);
+ };
+
+ const downloadFile = (file: ResourceFile) => {
+ const url = file.url;
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = file.name;
+ document.body.appendChild(a);
+ a.click();
+ document.body.removeChild(a);
+ };
+
+ const getFileIcon = (mimeType: string): string => {
+ if (mimeType.startsWith('image/')) return 'i-mynaui-image';
+ if (mimeType === 'application/pdf') return 'i-tabler-file-type-pdf';
+ if (mimeType.startsWith('text/')) return 'i-mynaui-file-text';
+ if (mimeType.startsWith('video/')) return 'i-mynaui-video';
+ if (mimeType.startsWith('audio/')) return 'i-mynaui-music';
+ return 'i-mynaui-file-text';
+ };
+
+ const isImage = (mimeType: string): boolean => mimeType.startsWith('image/');
+
+ const formatSize = (bytes: number): string => {
+ if (bytes === 0) return '-';
+ const units = ['B', 'KB', 'MB', 'GB'];
+ const i = Math.floor(Math.log(bytes) / Math.log(1024));
+ const size = bytes / Math.pow(1024, i);
+ return `${size.toFixed(i === 0 ? 0 : 1)} ${units[i]}`;
+ };
+
+ const formatDate = (date: Date | string): string => {
+ const d = new Date(date);
+ return d.toLocaleDateString('en-US', {
+ month: 'short',
+ day: 'numeric',
+ year: 'numeric',
+ });
+ };
+
+ return {
+ files,
+ filteredFiles,
+ selectedIds,
+ selectedCount,
+ hasSelection,
+ isAllSelected,
+ category,
+ setCategory,
+ categoryCount,
+ toggleSelect,
+ selectAll,
+ clearSelection,
+ deleteFile,
+ deleteSelected,
+ copyLink,
+ downloadFile,
+ getFileIcon,
+ isImage,
+ formatSize,
+ formatDate,
+ refresh,
+ };
+};
diff --git a/app/pages/resources.vue b/app/pages/resources.vue
new file mode 100644
index 0000000..b325abf
--- /dev/null
+++ b/app/pages/resources.vue
@@ -0,0 +1,264 @@
+
+
+
+
+
+
+
+
+
+ No files found
+
+
+
+
+
+
+
+
Name
+
Size
+
Date
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ file.name }}
+
+
+
+
+ {{ formatSize(file.size) }}
+
+
+
+ {{ formatDate(file.createdAt) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ selectedCount }} selected
+
+
+
+
+ Delete
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Copy Link
+
+
+
+
+ Download
+
+
+
+
+
+
+ Delete
+
+
+
+
+
+
+
+
+
+
diff --git a/server/api/file/index.post.ts b/server/api/file/index.post.ts
index eae29b2..5e0eb31 100644
--- a/server/api/file/index.post.ts
+++ b/server/api/file/index.post.ts
@@ -13,6 +13,7 @@ export default defineEventHandler(async (event) => {
id: z.string(),
name: z.string(),
mimeType: z.string(),
+ size: z.number(),
url: z.string(),
})
.safeParse(body),
@@ -24,13 +25,14 @@ export default defineEventHandler(async (event) => {
});
}
- const { id, name, mimeType, url } = result.data;
+ const { id, name, mimeType, size, url } = result.data;
const file = await db.insert(files).values({
id,
userId,
name,
mimeType,
+ size,
url,
createdAt: new Date(),
}).returning();
diff --git a/server/api/files.get.ts b/server/api/files.get.ts
new file mode 100644
index 0000000..bd775a8
--- /dev/null
+++ b/server/api/files.get.ts
@@ -0,0 +1,17 @@
+import { db } from "~~/server/lib/db";
+
+export default defineEventHandler(async (event) => {
+ await protectRoute(event);
+ const userId = event.context.user!.id as string;
+
+ const result = await db.query.files.findMany({
+ where: {
+ userId,
+ },
+ orderBy: {
+ createdAt: 'desc',
+ }
+ });
+
+ return result;
+});
From a1aeed51e2026817b21b8f702d28c8f201d46fc8 Mon Sep 17 00:00:00 2001
From: Zoe <62722391+juls0730@users.noreply.github.com>
Date: Mon, 11 May 2026 17:43:02 -0500
Subject: [PATCH 14/18] feat: add huggingface provider and new model logos
- Add HuggingFace as AI provider with model fetching
- Add Poolside, Tencent, and HuggingFace logo components
- Update model mappings for new providers
- Add @ai-sdk/huggingface dependency
- Bump longcat-ai-sdk-provider to 0.0.5
---
app/components/Logo/HuggingFace.vue | 48 +++++++++++++++++++++++++
app/components/Logo/Poolside.vue | 52 +++++++++++++++++++++++++++
app/components/Logo/Tencent.vue | 24 +++++++++++++
app/utils/model-mapping.ts | 15 ++++++--
bun.lock | 11 +++---
package.json | 3 +-
server/utils/providers/huggingface.ts | 51 ++++++++++++++++++++++++++
server/utils/providers/index.ts | 2 ++
8 files changed, 197 insertions(+), 9 deletions(-)
create mode 100644 app/components/Logo/HuggingFace.vue
create mode 100644 app/components/Logo/Poolside.vue
create mode 100644 app/components/Logo/Tencent.vue
create mode 100644 server/utils/providers/huggingface.ts
diff --git a/app/components/Logo/HuggingFace.vue b/app/components/Logo/HuggingFace.vue
new file mode 100644
index 0000000..4737600
--- /dev/null
+++ b/app/components/Logo/HuggingFace.vue
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
diff --git a/app/components/Logo/Poolside.vue b/app/components/Logo/Poolside.vue
new file mode 100644
index 0000000..060cde5
--- /dev/null
+++ b/app/components/Logo/Poolside.vue
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
diff --git a/app/components/Logo/Tencent.vue b/app/components/Logo/Tencent.vue
new file mode 100644
index 0000000..3b2ce58
--- /dev/null
+++ b/app/components/Logo/Tencent.vue
@@ -0,0 +1,24 @@
+
+
+
+
+
diff --git a/app/utils/model-mapping.ts b/app/utils/model-mapping.ts
index 7219c82..436361f 100644
--- a/app/utils/model-mapping.ts
+++ b/app/utils/model-mapping.ts
@@ -52,6 +52,9 @@ import {
LogoInflection,
LogoVllm,
LogoClosedRouter,
+ LogoPoolside,
+ LogoTencent,
+ LogoHuggingFace,
} from '#components';
import { markRaw } from 'vue';
@@ -161,7 +164,7 @@ const MODEL_MAPPINGS: ModelConfig[] = [
},
{
Icon: markRaw(LogoZAI),
- keywords: [/^glm-4/, /\/glm-4/, /zai-/, /-glm-4/, /glm-\d/]
+ keywords: [/zai-/, /(^|\/|-)?glm-?\d/]
},
{
Icon: markRaw(LogoGLMV),
@@ -314,6 +317,14 @@ const MODEL_MAPPINGS: ModelConfig[] = [
{
Icon: markRaw(LogoInflection),
keywords: [/inflection-/, /^inflection\//]
+ },
+ {
+ Icon: markRaw(LogoPoolside),
+ keywords: [/poolside\//, /laguna/]
+ },
+ {
+ Icon: markRaw(LogoTencent),
+ keywords: [/tencent\//, /hy/],
}
];
@@ -324,7 +335,7 @@ export const providerIcons: Record = {
azure: null,
anthropic: markRaw(LogoAnthropic),
cohere: markRaw(LogoCohere),
- huggingface: null,
+ huggingface: markRaw(LogoHuggingFace),
openrouter: markRaw(LogoOpenrouter),
cerebras: markRaw(LogoCerebras),
longcat: markRaw(LogoLongCat),
diff --git a/bun.lock b/bun.lock
index a22c872..93e0838 100644
--- a/bun.lock
+++ b/bun.lock
@@ -9,6 +9,7 @@
"@ai-sdk/cerebras": "^2.0.45",
"@ai-sdk/cohere": "^3.0.30",
"@ai-sdk/google": "^3.0.61",
+ "@ai-sdk/huggingface": "^1.0.43",
"@ai-sdk/mistral": "^3.0.30",
"@ai-sdk/openai": "^3.0.52",
"@ai-sdk/openai-compatible": "^2.0.41",
@@ -30,7 +31,7 @@
"comlink": "^4.4.2",
"drizzle-orm": "^1.0.0-beta.21",
"glob": "^13.0.6",
- "longcat-ai-sdk-provider": "^0.0.4",
+ "longcat-ai-sdk-provider": "^0.0.5",
"nanoid": "^5.1.7",
"nuxt": "^4.4.2",
"pg": "^8.20.0",
@@ -80,6 +81,8 @@
"@ai-sdk/google": ["@ai-sdk/google@3.0.61", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-jEKU1Mjcy5CoicejdJQIzM0ntYwyXR8vtYgAZYriKaOuLAiAhiiU538++fGU3CC9HJH/mL1OfsCwMM3gFiCNsw=="],
+ "@ai-sdk/huggingface": ["@ai-sdk/huggingface@1.0.43", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.41", "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4" } }, "sha512-bEHZNmQNabbs7zYjRa7e0Hz1RFiVwm/hjfZ2YFwTFsxC0WmPSSvjyG5SqRM8DApbSC2EtGP5K/zO2IKEXZrYyQ=="],
+
"@ai-sdk/mistral": ["@ai-sdk/mistral@3.0.30", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-+j4IXRSk9E661cFSafmIr+XHOzwjFagawwzMOlSqwL6U4Sq4PCFLDF+oHbX5NUqNjUL7FD1zi/9lBIfa41pUvw=="],
"@ai-sdk/openai": ["@ai-sdk/openai@3.0.52", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.23" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4Rr8NCGmfWTz6DCUvixn9UmyZcMatiHn0zWoMzI3JCUe9R1P/vsPOpCBALKoSzVYOjyJnhtnVIbfUKujcS39uw=="],
@@ -1778,7 +1781,7 @@
"lodash.uniq": ["lodash.uniq@4.5.0", "", {}, "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ=="],
- "longcat-ai-sdk-provider": ["longcat-ai-sdk-provider@0.0.4", "", { "dependencies": { "@ai-sdk/openai-compatible": "^2.0.37", "@ai-sdk/provider": "^3.0.8", "@ai-sdk/provider-utils": "^4.0.21" }, "peerDependencies": { "ai": ">=6.0.0" } }, "sha512-cAyxpYZIO9jRq7UJCt6tPqoBXUpIvKsvWJsJF1pMtRBGxm6SF96rgHDRupxpA5XX4ODqDo7LRE1hs3viEcLxoA=="],
+ "longcat-ai-sdk-provider": ["longcat-ai-sdk-provider@0.0.5", "", { "dependencies": { "@ai-sdk/openai-compatible": "^2.0.37", "@ai-sdk/provider": "^3.0.8", "@ai-sdk/provider-utils": "^4.0.21" }, "peerDependencies": { "ai": ">=6.0.0" } }, "sha512-VbuhUuJNXnjoRYnpKBi3TSqFsHJaRRlzjFC+Rv4cxbzgHl6KTcohNeVvgbB95p49lMl4kGH6I/VxgdPOSkAi8A=="],
"longest-streak": ["longest-streak@3.1.0", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="],
@@ -2862,10 +2865,6 @@
"listhen/pathe": ["pathe@1.1.2", "", {}, "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ=="],
- "longcat-ai-sdk-provider/@ai-sdk/openai-compatible": ["@ai-sdk/openai-compatible@2.0.37", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@ai-sdk/provider-utils": "4.0.21" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-+POSFVcgiu47BK64dhsI6OpcDC0/VAE2ZSaXdXGNNhpC/ava++uSRJYks0k2bpfY0wwCTgpAWZsXn/dG2Yppiw=="],
-
- "longcat-ai-sdk-provider/@ai-sdk/provider-utils": ["@ai-sdk/provider-utils@4.0.21", "", { "dependencies": { "@ai-sdk/provider": "3.0.8", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-MtFUYI1/8mgDvRmaBDjbLJPFFrMG777AvSgyIFQtZHIMzm88R/12vYBBpnk7pfiWLFE1DSZzY4WDYzGbKAcmiw=="],
-
"magic-regexp/unplugin": ["unplugin@2.3.11", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "acorn": "^8.15.0", "picomatch": "^4.0.3", "webpack-virtual-modules": "^0.6.2" } }, "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww=="],
"magicast/@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="],
diff --git a/package.json b/package.json
index c6134e5..d669c72 100644
--- a/package.json
+++ b/package.json
@@ -14,6 +14,7 @@
"@ai-sdk/cerebras": "^2.0.45",
"@ai-sdk/cohere": "^3.0.30",
"@ai-sdk/google": "^3.0.61",
+ "@ai-sdk/huggingface": "^1.0.43",
"@ai-sdk/mistral": "^3.0.30",
"@ai-sdk/openai": "^3.0.52",
"@ai-sdk/openai-compatible": "^2.0.41",
@@ -35,7 +36,7 @@
"comlink": "^4.4.2",
"drizzle-orm": "^1.0.0-beta.21",
"glob": "^13.0.6",
- "longcat-ai-sdk-provider": "^0.0.4",
+ "longcat-ai-sdk-provider": "^0.0.5",
"nanoid": "^5.1.7",
"nuxt": "^4.4.2",
"pg": "^8.20.0",
diff --git a/server/utils/providers/huggingface.ts b/server/utils/providers/huggingface.ts
new file mode 100644
index 0000000..07e40b9
--- /dev/null
+++ b/server/utils/providers/huggingface.ts
@@ -0,0 +1,51 @@
+import { createHuggingFace } from '@ai-sdk/huggingface';
+import { GatewayFetchError } from '~~/server/utils/ai-provider';
+import { Err, Ok } from '~~/types/result';
+import type { ProviderModule } from '.';
+import { getModelData } from './helpers';
+
+export default {
+ id: 'huggingface',
+ baseUrl: 'https://router.huggingface.co/v1',
+ modelsEndpoint: null,
+
+ createGateway({ apiKey, baseURL }) {
+ if (apiKey === undefined) {
+ return Err(GatewayFetchError.NoProviderApiKey);
+ }
+
+ return Ok({
+ gateway: createHuggingFace({ apiKey, baseURL }),
+ streamTransformer: undefined,
+ textTransformer: undefined,
+ });
+ },
+
+ getAuthHeaders(apiKey) {
+ return apiKey ? { Authorization: `Bearer ${apiKey}` } : {};
+ },
+
+ async fetchModels({ baseURL, apiKey, modelsDevData }) {
+ const res = await fetch(
+ 'https://huggingface.co/api/models?pipeline_tag=text-generation&sort=downloads',
+ {
+ method: 'GET',
+ headers: apiKey ? { Authorization: `Bearer ${apiKey}` } : {},
+ },
+ );
+ const data = await res.json();
+
+ if (!res.ok) {
+ throw createError({ statusCode: res.status, message: JSON.stringify(data) });
+ }
+
+ return data
+ .filter((model: any) => model.tags?.includes('text-generation-inference'))
+ .map((model: any) => ({
+ ...getModelData(model.id, 'huggingface', modelsDevData),
+ id: model.id,
+ name: model.id,
+ releasedAt: model.createdAt,
+ }));
+ },
+} satisfies ProviderModule;
diff --git a/server/utils/providers/index.ts b/server/utils/providers/index.ts
index ab673f7..a1e80b7 100644
--- a/server/utils/providers/index.ts
+++ b/server/utils/providers/index.ts
@@ -12,6 +12,7 @@ import nvidia from './nvidia';
import xiaomi from './xiaomi';
import openai from './openai';
import anthropic from './anthropic';
+import huggingface from './huggingface';
import type { Result } from '~~/types/result';
import type { Gateway, GatewayFetchError } from '~~/server/utils/ai-provider';
import type { Model as ModelDrizzle } from '~/composables/useModels';
@@ -65,6 +66,7 @@ const providers = [
xiaomi,
openai,
anthropic,
+ huggingface,
];
type ProviderId = typeof providers[number]['id'];
From 30a425744dc497fcd48275df1ad2c8a6f89ec3f6 Mon Sep 17 00:00:00 2001
From: Zoe <62722391+juls0730@users.noreply.github.com>
Date: Mon, 11 May 2026 17:43:13 -0500
Subject: [PATCH 15/18] feat: add startup migration script and improve Docker
setup
- Add scripts/start.ts to run drizzle migrations before server start
- Update Dockerfile to copy migration files and install prod deps
- Change entrypoint to use migration-aware startup script
- Add deployment documentation
---
DEPLOY.md | 186 +++++++++++++++++++++++++++++++++++++++++++++++
Dockerfile | 15 +++-
scripts/start.ts | 27 +++++++
3 files changed, 227 insertions(+), 1 deletion(-)
create mode 100644 DEPLOY.md
create mode 100644 scripts/start.ts
diff --git a/DEPLOY.md b/DEPLOY.md
new file mode 100644
index 0000000..e767923
--- /dev/null
+++ b/DEPLOY.md
@@ -0,0 +1,186 @@
+# Deploying Veridian
+
+Self-hosted deployment guide using Docker Compose on a VPS.
+
+## Prerequisites
+
+- A VPS with Docker and Docker Compose installed
+- A domain name pointed at your VPS IP address
+- An external reverse proxy (Caddy, Nginx, etc.) for HTTPS termination
+
+## First Deploy
+
+### 1. Clone the repository
+
+```bash
+git clone https://gitea.wildcardproject.com/zoeissleeping/veridian.git
+cd veridian
+```
+
+### 2. Configure environment variables
+
+```bash
+cp .env.example .env
+```
+
+Edit `.env` and set the required values:
+
+```bash
+# Generate a secure auth secret
+openssl rand -base64 32
+
+# Set these in .env
+POSTGRES_PASSWORD=
+BETTER_AUTH_SECRET=