Commit Graph

123 Commits

Author SHA1 Message Date
MythEclipse
d8aeefb739 fix: preserve ui state broadcasts in routes 2026-05-14 19:58:37 +07:00
MythEclipse
08cd515d8a fix: preserve ui state broadcasts in routes 2026-05-14 19:55:26 +07:00
MythEclipse
c81a499535 refactor: split api routes by concern 2026-05-14 19:46:47 +07:00
MythEclipse
3fb1fcb72c fix: remove unused analysis import 2026-05-14 19:41:18 +07:00
MythEclipse
243a18ecad fix: harden analysis queue scheduling 2026-05-14 19:39:25 +07:00
MythEclipse
f14e893cb7 feat: debounce ai analysis by conversation 2026-05-14 19:32:44 +07:00
MythEclipse
54cd4e0386 fix: type llm moderation test fixtures 2026-05-14 19:28:56 +07:00
MythEclipse
65ab5ecb32 fix: harden llm moderation parsing 2026-05-14 19:26:54 +07:00
MythEclipse
81253e4ffe feat: add strict llm moderation client 2026-05-14 19:21:15 +07:00
MythEclipse
ce35b335d0 test: cover conversation context edge cases 2026-05-14 19:16:46 +07:00
MythEclipse
2b4e2a7ab7 feat: add conversation context builder 2026-05-14 19:10:13 +07:00
MythEclipse
2d511e08db style: format message query changes 2026-05-14 19:06:17 +07:00
MythEclipse
13078e7c3c fix: resolve message query test diagnostics 2026-05-14 19:02:19 +07:00
MythEclipse
298fc968cf test: cover message query pagination 2026-05-14 19:01:01 +07:00
MythEclipse
7a8883f623 test: cover message query pagination 2026-05-14 19:00:03 +07:00
MythEclipse
0c54ac4ba8 test: cover message query pagination 2026-05-14 18:54:13 +07:00
MythEclipse
9f5f8a3090 feat: add cursor-based message queries 2026-05-14 18:48:02 +07:00
MythEclipse
8ab7aaa32d fix: harden moderation broadcaster 2026-05-14 18:44:47 +07:00
MythEclipse
01dc9b1836 feat: add typed moderation broadcaster
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 18:40:34 +07:00
MythEclipse
49d4bbf781 chore: remove obsolete migration documentation files 2026-05-14 16:40:43 +07:00
MythEclipse
4fbbc056bb docs: add postgresql setup completion documentation 2026-05-14 16:26:12 +07:00
MythEclipse
47ae7f8650 chore: remove temporary test files 2026-05-14 16:25:45 +07:00
MythEclipse
35269b5bef feat: configure postgresql as primary database with neon connection
- Updated .env to use PostgreSQL (neondb) instead of SQLite
- Updated drizzle.ts to support DATABASE_URL connection string
- Regenerated migrations for PostgreSQL syntax
- Bot successfully connects and operates with PostgreSQL
- All database operations working correctly
2026-05-14 16:25:39 +07:00
MythEclipse
c63a61460c docs: add comprehensive drizzle orm migration final summary 2026-05-14 16:21:35 +07:00
MythEclipse
9889d20edd feat: add programmatic migration runner for better PostgreSQL support 2026-05-14 16:21:02 +07:00
MythEclipse
b580430eb6 docs: add drizzle orm migration completion summary 2026-05-14 16:17:25 +07:00
MythEclipse
b9d0a06d01 fix: update drizzle config to read env vars directly for CLI compatibility 2026-05-14 16:14:48 +07:00
MythEclipse
b600dad011 fix: correct import ordering and update tests for drizzle-orm migration 2026-05-14 15:47:03 +07:00
MythEclipse
50d4517079 refactor: remove old database adapter files 2026-05-14 15:43:52 +07:00
MythEclipse
9ff0f0bede feat: update application initialization for drizzle 2026-05-14 15:43:16 +07:00
MythEclipse
1c4b0afbce refactor: migrate messageStore to drizzle-orm
- Replace all raw SQL queries in messageStore.ts with Drizzle ORM queries
- Remove DatabaseAdapter dependency from messageStore functions
- Update all function signatures to be async and remove db parameter
- Functions now use getDatabase() internally for database access
- Update all call sites in messageCapture.ts, attachmentUploader.ts, aiAnalyzer.ts, webserver.ts, and index.ts
- All functions remain backward compatible in behavior
- TypeScript typecheck passes with no errors
- All tests pass (11 passed)
2026-05-14 15:41:11 +07:00
MythEclipse
dfe3444018 refactor: migrate muxer-queue to drizzle-orm 2026-05-14 15:35:55 +07:00
MythEclipse
7e528a473b feat: create drizzle database client 2026-05-14 15:33:45 +07:00
MythEclipse
4e28cf9671 feat: add drizzle configuration and initial migrations 2026-05-14 15:33:10 +07:00
MythEclipse
52b36c963f feat: create drizzle schema definitions 2026-05-14 15:32:20 +07:00
MythEclipse
b833b6d978 feat: add drizzle-orm and drizzle-kit dependencies 2026-05-14 15:31:08 +07:00
MythEclipse
d1282f2f57 fix: organize imports and apply linting fixes 2026-05-14 15:02:23 +07:00
MythEclipse
1623c612c3 docs: add PostgreSQL migration guide 2026-05-14 15:00:35 +07:00
MythEclipse
8c9e8aa64d test: add PostgreSQL connection tests 2026-05-14 14:59:37 +07:00
MythEclipse
c5297da795 feat: initialize database adapter on startup 2026-05-14 14:58:28 +07:00
MythEclipse
dbc11bbd16 feat: add data migration script from SQLite to PostgreSQL 2026-05-14 14:57:08 +07:00
MythEclipse
3c918692cb refactor: update messageStore to use database adapter 2026-05-14 14:56:14 +07:00
MythEclipse
94a3acf12e refactor: update muxer-queue to use database adapter
- Replace direct better-sqlite3 imports with DatabaseAdapter pattern
- Make all muxer-queue functions async to support both SQLite and PostgreSQL
- Update database initialization to use adapter's getDatabase()
- Export DatabaseAdapter as SqliteDatabase for backward compatibility
- Update index.ts to handle async database initialization
- Update webserver.ts to await async database operations
- All functions now work with both SQLite and PostgreSQL backends
- Tests pass, no TypeScript errors
2026-05-14 14:55:21 +07:00
MythEclipse
84e20ae373 feat: add database adapter layer for SQLite/PostgreSQL abstraction 2026-05-14 14:46:35 +07:00
MythEclipse
caf90ea9e6 feat: add PostgreSQL client and migration runner 2026-05-14 14:45:21 +07:00
MythEclipse
818a059121 feat: add PostgreSQL config and dependencies 2026-05-14 14:44:01 +07:00
MythEclipse
0eee7b9390 fix: cap AI batch size and split failed batches
Reduce effective AI batch size so streaming requests finish before timeout. Keep token-based batching but cap each request to 80 messages or about 9k content tokens, and recursively split failed batches instead of marking the whole batch failed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 04:48:20 +07:00
MythEclipse
81bb9cc6ab perf: maximize AI batches by token budget
Batch AI moderation by estimated token budget instead of fixed message count. Send as many messages as fit within an 80k token request budget while keeping one concurrent API request. Include message metadata and chronological conversation context so the model can judge provocation and replies from surrounding discussion.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 04:42:28 +07:00
MythEclipse
4ff79bea73 chore: relax moderation prompt for casual chat
Remove unclear-message and low-quality-message warning criteria because this is a casual group. Keep short, ambiguous, informal, and light profanity messages clean unless they target someone or provoke conflict.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 04:36:59 +07:00
MythEclipse
9ff1261239 feat: merge warn and flagged messages into one review panel
Combine the right-side Warned and Flagged panels into a single Needs Review panel. Keep ordering by the existing newest-first message list.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 04:33:48 +07:00