import { Container } from "@gajae-code/tui"; import type { AutoroutingProvenance, AutoroutingProviderOrderHint, AutoroutingSetup, TierMap } from "../../config/autorouting-contract"; import type { AutoroutingSourceIdentity } from "../../config/autorouting-generator"; /** Longest rendered panel line before truncation. */ export declare const MAX_PANEL_LINE_WIDTH = 200; export type SmartRoutingPreview = { readonly setup: AutoroutingSetup; readonly tiers: TierMap; readonly provenance: AutoroutingProvenance; readonly sourceIdentity: AutoroutingSourceIdentity; }; export type SmartRoutingIntent = { kind: "apply"; draft: AutoroutingSetup; preview: SmartRoutingPreview; confirmHandEdit?: boolean; } | { kind: "refresh"; confirmHandEdit?: boolean; } | { kind: "clear"; } | { kind: "toggle"; enabled: boolean; }; export type SmartRoutingPanelMode = "editing" | "confirming" | "committing" | "done" | "error"; export type SmartRoutingConfirmation = "clear" | "hand-edit" | undefined; export interface SmartRoutingPanelOptions { setup: AutoroutingSetup; tiers?: TierMap; provenance?: AutoroutingProvenance; /** Advisory drift between the recorded declaration and current provider priority. */ providerOrderHint?: AutoroutingProviderOrderHint; enabled: boolean; readOnly: boolean; stale: boolean; preview: SmartRoutingPreview; generatePreview: (draft: AutoroutingSetup) => SmartRoutingPreview; onSelect: (intent: SmartRoutingIntent) => undefined | Promise; onCancel: () => void; } /** * Presentational smart-routing setup editor. It owns only ephemeral draft and * preview state; all durable changes are emitted as typed intents. */ export declare class SmartRoutingPanelComponent extends Container { #private; constructor(options: SmartRoutingPanelOptions); get mode(): SmartRoutingPanelMode; get confirmation(): SmartRoutingConfirmation; getDraft(): AutoroutingSetup; getPreviewPayload(): SmartRoutingPreview; getProviderOrder(): readonly string[]; /** * Advisory-only, non-destructive hint update. * * `refreshState` deliberately replaces the draft and clears editor state, so it * must never be used for a background settings change: an external * `modelProviderOrder` edit would then discard the user's unsaved reordering, * allowlist buffer, cursor, and confirmation. This replaces the hint and nothing * else. */ updateProviderOrderHint(hint: AutoroutingProviderOrderHint | undefined): void; /** Replace the panel's persisted snapshot after a controller mutation. */ refreshState(options: { setup: AutoroutingSetup; tiers?: TierMap; provenance?: AutoroutingProvenance; enabled: boolean; providerOrderHint?: AutoroutingProviderOrderHint; stale: boolean; preview: SmartRoutingPreview; }): void; handleInput(data: string): void; __testApply(): Promise; /** Test hook mirroring an in-panel provider reorder/edit: mutates the draft and re-previews. */ __testSetProviders(providers: string[]): void; __testRefresh(confirmHandEdit?: boolean): Promise; __testToggle(enabled?: boolean): Promise; __testClear(): Promise; __testConfirm(): Promise; }