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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user