/** * Brain panel controller — opens the panel and translates settings-view * key actions into BrainPanelHost mutations (live apply + persist on the * CLI side), refreshing the snapshot and surfacing errors as panel hints. * Extracted from app.tsx (hotspot guardrail). */ import React from 'react'; import type { Action } from '../app-action-type.js'; import type { BrainRiskLevel } from '../brain-contracts.js'; import { type BrainPanelHost, type BrainPanelRow } from '../brain-panel-model.js'; /** Selection returned by the shared model-pick overlay (null = cancelled). */ export type ModelPickSelection = { providerId: string; model: string; } | null; export interface UseBrainPanelOptions { dispatch: React.Dispatch; getBrainData?: (() => { riskLevel: BrainRiskLevel; log: Array<{ kind: string; question: string; outcome: string; age: string; }>; }) | undefined; brainPanelHost?: BrainPanelHost | undefined; /** * The SHARED two-step model picker (same overlay as /model), invoked in * 'pick' mode: resolves with the selection instead of switching the * session model. Provided by App's requestModelPick. */ requestModelPick?: ((title: string) => Promise) | undefined; } export interface BrainPanelController { openBrainPanel: () => void; handleBrainAdjust: (row: BrainPanelRow, delta: number) => void; handleBrainEnter: (row: BrainPanelRow) => void; handleBrainDelete: (row: BrainPanelRow) => void; handleBrainVoterMod: (index: number, mod: 'persona' | 'veto') => void; } export declare function useBrainPanel(opts: UseBrainPanelOptions): BrainPanelController; //# sourceMappingURL=use-brain-panel.d.ts.map