core: remove @effect/language-service plugin and optimize hot path type performance

- Removed @effect/language-service from both packages/core and packages/opencode tsconfig files and dependencies

- Wrapped mergeDeep calls in config loading and LLM streaming to avoid expensive remeda conditional merge type instantiations in hot paths

- Narrowed Drizzle migrate() overload signature to avoid expensive variance checks during database initialization

These changes reduce TypeScript type-checking overhead and improve startup and runtime performance for config loading, LLM streaming, and database migrations.
This commit is contained in:
Dax Raad
2026-04-30 23:20:20 -04:00
parent 8b56d77ea1
commit ff55a40749
7 changed files with 30 additions and 37 deletions

View File

@@ -48,6 +48,13 @@ type Client = SQLiteBunDatabase
type Journal = { sql: string; timestamp: number; name: string }[]
// Drizzle's migrate overloads trigger expensive variance checks here; narrow to the journal overload we actually use.
const migrateFromJournal = migrate as unknown as (db: SQLiteBunDatabase, entries: Journal) => void
function applyMigrations(db: SQLiteBunDatabase, entries: Journal) {
migrateFromJournal(db, entries)
}
function time(tag: string) {
const match = /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/.exec(tag)
if (!match) return 0
@@ -108,7 +115,7 @@ export const Client = lazy(() => {
item.sql = "select 1;"
}
}
migrate(db, entries)
applyMigrations(db, entries)
}
return db