refactor: low-regret cleanup across core, engine, dashboard
- core: extract ai-engine-loader.ts to share @fusion/engine dynamic-import boilerplate between ai-summarize and memory-compaction (incl. AgentMessage type); collapse getInbox/getOutbox, listInsights/countInsights, listRuns/countRuns, and three hasProjectDb* variants behind shared helpers. - core: drop unused pluginLoaderLog export; tighten two `any` casts (db.walCheckpoint row, plugin-loader error.code). - engine: extract resolveRoleFallback helper from buildSessionSkillContext/Sync; remove 22 stale `eslint-disable no-explicit-any` directives across project-engine, self-healing, triage, worktree-pool. - dashboard: apply ESLint autofix (let→const, empty `interface extends`→type). All three packages: typecheck clean, full test suites pass (14,414 tests), builds clean. Net lint: -31 warnings. No public behavior changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -89,7 +89,7 @@ function formatModelTag(provider?: string | null, modelId?: string | null): stri
|
||||
|
||||
// Gemini models: "gemini-2.5-pro" -> "Gemini 2.5 Pro"
|
||||
if (normalizedModel.includes("gemini")) {
|
||||
let formatted = modelId
|
||||
const formatted = modelId
|
||||
.replace(/^gemini[- ]/i, "Gemini ")
|
||||
.replace(/pro[- ](\d+)[- ](\d+)/i, "Pro $1.$2")
|
||||
.replace(/pro[- ](\d+)/i, "Pro $1")
|
||||
@@ -100,7 +100,7 @@ function formatModelTag(provider?: string | null, modelId?: string | null): stri
|
||||
}
|
||||
|
||||
// Generic fallback: capitalize first letter, replace hyphens with spaces
|
||||
let formatted = modelId
|
||||
const formatted = modelId
|
||||
.replace(/-/g, " ")
|
||||
.replace(/^\w/, (c) => c.toUpperCase())
|
||||
.replace(/\s+/g, " ")
|
||||
|
||||
@@ -255,8 +255,8 @@ export interface MissionWithHierarchy extends Mission {
|
||||
export type MissionEventType = CoreMissionEventType;
|
||||
|
||||
/** Mission lifecycle event persisted in the mission event log. */
|
||||
export interface MissionEvent extends CoreMissionEvent {}
|
||||
export type MissionEvent = CoreMissionEvent
|
||||
|
||||
/** Computed mission health snapshot returned by observability APIs. */
|
||||
export interface MissionHealth extends CoreMissionHealth {}
|
||||
export type MissionHealth = CoreMissionHealth
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ export function saveOnboardingState(
|
||||
|
||||
// Determine completed and dismissed flags
|
||||
// completed takes precedence over dismissed
|
||||
let completed = options.completed ?? DEFAULT_COMPLETED;
|
||||
const completed = options.completed ?? DEFAULT_COMPLETED;
|
||||
let dismissed = options.dismissed ?? DEFAULT_DISMISSED;
|
||||
|
||||
// If completed is true, dismissed should be false
|
||||
|
||||
@@ -299,7 +299,7 @@ export function useInsights(projectId?: string): UseInsightsResult {
|
||||
}, [sections]);
|
||||
|
||||
// Initial load - intentionally runs once on mount
|
||||
// eslint-disable-next-line
|
||||
|
||||
useMemo(() => {
|
||||
void refresh();
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user