/** * Menu navigation controller. * * Renders card menus and routes button / dropdown selections to the per-chat * driver (`MenuHost`). The driver owns session / queue / lock runtime state; * this controller only needs the read-only hosts (messages, adapter, bindings) * plus the side-effect callbacks that perform an action, so the menu concern is * split out without the controller reaching into the driver's mutable state. * @module dsh-connect/menu-controller */ import type { Context } from "@deepseek-ai/cordis"; import type { ModelSelection } from "@deepseek-ai/dsh-agent"; import type { Messages, Language } from "./i18n.js"; import type { ChannelAdapter, InboundMessage, OutboundTarget } from "./types.js"; import type { BindingStore } from "./binding.js"; import type { NotifyLevel } from "./stream.js"; import { type MenuId } from "./menus.js"; /** Read-only surface `MenuController` needs from the per-chat driver. */ export interface MenuHost { readonly t: Messages; workDir: string; readonly adapter: ChannelAdapter; readonly language: Language; readonly bindings: BindingStore; readonly channel: string; readonly chatKey: string; readonly notifyLevel: NotifyLevel; readonly progressTimeoutMs: number; readonly autoCompact: boolean; readonly autoCompactThresholdPct: number; readonly ctx: Context; defaultSelection(): ModelSelection; listWorkspaces(): { path: string; title: string; }[]; menuTitle(menuId: MenuId): string; rootMenuSections(): readonly { title: string; ids: readonly string[]; columnsPerRow?: number; }[]; newChat(msg: InboundMessage): Promise; setLanguage(lang: Language, target: OutboundTarget, msg: InboundMessage): Promise; setReasoning(effort: string | undefined, msg: InboundMessage): Promise; setNotifyLevel(level: NotifyLevel, target: OutboundTarget, msg: InboundMessage): Promise; setProgressTimeout(ms: number, target: OutboundTarget, msg: InboundMessage): Promise; setAutoCompact(on: boolean, target: OutboundTarget, pct?: number): Promise; setModel(provider: string, model: string, msg: InboundMessage): Promise; showStatus(target: OutboundTarget): Promise; showTasks(target: OutboundTarget): Promise; showHistory(target: OutboundTarget, limit: number): Promise; showGoals(target: OutboundTarget): Promise; showSchedule(target: OutboundTarget): Promise; showPlugins(target: OutboundTarget): Promise; showSettings(target: OutboundTarget): Promise; compact(target: OutboundTarget): Promise; collectWorkdirSessions(): Promise<{ sessionId: string; title: string; }[]>; switchTo(sessionId: string, ownerKey: string): Promise; confirmAction(target: OutboundTarget, promptText: string, messageId?: string): Promise; } export declare class MenuController { private readonly host; constructor(host: MenuHost); openMenu(target: OutboundTarget, msg: InboundMessage, menuId: MenuId, stack?: MenuId[], cardId?: string): Promise; private menuItems; private modelMenuItems; private reasoningMenuItems; private listModelChoices; } //# sourceMappingURL=menu-controller.d.ts.map