chore: codebase audit — remove dead code, unused deps, clean configs

Phase 1: Delete 19 dead component/service/tool files (4,200+ lines)
Phase 2: Remove 13 unused npm packages (Radix UI, shadcn utilities, ytdl-core, etc.)
Phase 3: Database schema — drop agent_delegations, add performance indexes
Phase 4: Remove 12 dead types from database.ts/analytics.ts/helpers.ts
Phase 5: Strip shadcn/ui theme from tailwind config
Phase 6: Clean env vars, fix broken imports (LocalKeyGate, MapViewer)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
“BeeRad”
2026-01-29 08:52:15 +11:00
co-authored by Claude Opus 4.5
parent 65d22315e1
commit 9b2db68751
33 changed files with 13 additions and 5683 deletions
+8 -14
View File
@@ -264,20 +264,8 @@ CREATE INDEX IF NOT EXISTS idx_chat_memory_thread ON chat_memory_state(thread_id
SQL
fi
echo "Ensuring agent_delegations table exists..."
"$SQLITE_BIN" "$DB_PATH" <<'SQL'
CREATE TABLE IF NOT EXISTS agent_delegations (
id INTEGER PRIMARY KEY AUTOINCREMENT,
session_id TEXT UNIQUE NOT NULL,
task TEXT NOT NULL,
context TEXT,
expected_outcome TEXT,
status TEXT NOT NULL DEFAULT 'queued',
summary TEXT,
created_at TEXT DEFAULT CURRENT_TIMESTAMP,
updated_at TEXT DEFAULT CURRENT_TIMESTAMP
);
SQL
echo "Dropping legacy agent_delegations table if present..."
"$SQLITE_BIN" "$DB_PATH" "DROP TABLE IF EXISTS agent_delegations;"
if ! has_table node_dimensions; then
"$SQLITE_BIN" "$DB_PATH" <<'SQL'
@@ -573,6 +561,12 @@ if has_table helpers && has_col helpers fluid_context; then
"$SQLITE_BIN" "$DB_PATH" "ALTER TABLE helpers DROP COLUMN fluid_context;" || true
fi
echo "Ensuring performance indexes exist..."
"$SQLITE_BIN" "$DB_PATH" <<'SQL'
CREATE INDEX IF NOT EXISTS idx_nodes_updated_at ON nodes(updated_at DESC);
CREATE INDEX IF NOT EXISTS idx_chats_created_at ON chats(created_at DESC);
SQL
echo "Running VACUUM and ANALYZE..."
"$SQLITE_BIN" "$DB_PATH" "VACUUM; ANALYZE;"