import type { Action } from './app-reducer.js'; import type { PluginPickerItem } from './components/plugin-picker.js'; /** * Action strings that the bridge recognises. Mirrored from the reducer's * `Action` type union but kept as a string allow-list here so an unrecognised * action can return `false` (text fallback) without crashing. */ export type PanelAction = 'pluginPickerOpen' | 'mcpPickerOpen' | 'toolsPickerOpen' | 'brainOpen' | 'helpOpen' | 'shadowOpen' | 'projectPickerOpen' | 'statuslineOpen' | 'authOpen' | 'authOauthOpen' | 'modePickerOpen' | 'toggleMonitor' | 'toggleAuditPanel' | 'toggleAgentsMonitor' | 'toggleWorktreeMonitor' | 'togglePlanPanel' | 'toggleKanbanPanel' | 'toggleTodosMonitor' | 'toggleQueuePanel' | 'toggleProcessList' | 'toggleCronMonitor' | 'toggleContextPanel' | 'toggleConnectionsPanel' | 'toggleGoalPanel' | 'toggleGoalKanbanPanel' | 'toggleSessionsPanel' | 'toggleCoordinatorMonitor' | (string & {}); export interface PanelOpenDeps { /** * Reducer dispatcher. For an action that has typed reducer cases the * caller passes a narrowed `Dispatch`; for the action-typed-aliasing * cases below we widen via `dispatch as (a: Action) => void` internally. */ dispatch: (action: Action) => void; /** Async opener for the project picker panel (F1). Fetches items first. */ openProjectPicker: () => void | Promise; /** Opener for the statusline picker; computes the hiddenItems snapshot. */ openStatuslinePicker: () => void; /** * Opener for the interactive auth panel (`/auth`). Returns false when the * CLI didn't provide an auth host — the slash command then falls back to * its plain-text output. Optional so older hosts keep working. */ openAuthPanel?: ((view?: 'list' | 'oauth') => boolean) | undefined; /** * Async opener for the mode picker (`/mode`). Fetches all modes + active * mode from the host and dispatches modePickerOpen with the populated list. */ openModePicker?: (() => void | Promise) | undefined; /** * Async opener for the Brain panel (`/brain`). Fetches current risk level * and decision log from the host, then dispatches brainOpen. */ openBrainPanel?: (() => void | Promise) | undefined; /** * Async opener for the Shadow Agent panel (`/shadow`). Fetches shadow state * from the host, then dispatches shadowOpen. */ openShadowPanel?: (() => void | Promise) | undefined; /** * Opener for the Help panel (`/help`). Builds entries from the slash * command registry and dispatches helpOpen with the populated list. */ openHelpPanel?: (() => void | Promise) | undefined; } /** * Build the dispatcher that lives at `onPanelOpen.current(action)`. * * Returns `true` when the action was handled (so the slash command suppresses * its text fallback), or `false` when the action is not in the catalogue * (so the slash command can print its plain-text response — the headless / * REPL fallback path). */ export declare function createPanelOpenDispatcher(deps: PanelOpenDeps): (action: string) => boolean; /** * Re-export PluginPickerItem so consumers of the dispatcher can construct * typed items without an extra import. Kept as a re-export rather than a * duplicate so the type lives in one place. */ export type { PluginPickerItem }; //# sourceMappingURL=on-panel-open.d.ts.map