refactor(web): delete dead code (R2) — 1736 lines removed

Tool-renderer registry (21 files, ~1.5k lines):
- src/lib/tool-renderers.ts — registry + getToolRenderer (exported, never
  imported anywhere)
- src/lib/renderers/index.ts + 10 .ts registrars + 10 .svelte components
- main.ts: removed the requestAnimationFrame(() => import('./lib/renderers'))
  that was the only thing keeping the dead subsystem alive

Dead components (never imported):
- ToolCallGroup, PlanProgress, GoalHeader, InlineApproval, SessionDigest

Dead store exports (written, never read):
- context.ts: pendingApprovals writable (+ Approval type import)
- events.ts: connectionState writable (+ its .set() calls)

Dead API surface:
- api.ts: SessionDigest interface + fetchSessionDigest (only caller was the
  dead SessionDigest.svelte)

Dead npm deps:
- mode-watcher (0 imports; superseded by stores/theme.svelte.ts)
- @internationalized/date (0 imports)

Also: fix stale comments referencing deleted symbols, update plan R1/R2
status. Build clean (4683 modules, down from 4706; one Svelte 5 warning
gone — the dead HealthSummary.svelte was emitting state_referenced_locally).
This commit is contained in:
2026-07-17 22:10:27 +02:00
parent c3973e7ac9
commit 0a3654b08f
35 changed files with 8 additions and 1736 deletions

View File

@@ -1,5 +1,5 @@
import { writable, get } from 'svelte/store'
import { fetchDashboardSummary, fetchApprovals, type DashboardSummary, type Approval } from '$lib/api'
import { fetchDashboardSummary, fetchApprovals, type DashboardSummary } from '$lib/api'
import { liveEvents, subscribeEvents, type OikosEvent } from './events'
// Shared operational context: dashboard summary + pending approvals,
@@ -7,7 +7,6 @@ import { liveEvents, subscribeEvents, type OikosEvent } from './events'
// so the poll only runs while something on screen displays it.
export const summary = writable<DashboardSummary | null>(null)
export const pendingApprovals = writable<Approval[]>([])
let refs = 0
let pollTimer: ReturnType<typeof setInterval> | null = null
@@ -16,9 +15,8 @@ let unsubscribeStore: (() => void) | null = null
let lastSeenEventId = 0
export async function refreshContext() {
const [s, approvals] = await Promise.all([fetchDashboardSummary(), fetchApprovals('pending')])
const [s] = await Promise.all([fetchDashboardSummary(), fetchApprovals('pending')])
if (s) summary.set(s)
pendingApprovals.set(approvals)
}
function onEvent(ev: OikosEvent) {