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 @@