/** Permission-preset policy for pending and active TUI sessions. */ import type { Context } from '@deepseek-ai/cordis'; import type { PermissionPresetService } from '@deepseek-ai/dsh-permission-presets'; import type { Session } from '@deepseek-ai/dsh-session'; /** One selectable permission preset row for the /permission panel. */ export interface PermissionRow { readonly id: string; readonly description?: string; } /** Public compatibility alias for the official upstream permission service. */ export type PermissionPresetsService = PermissionPresetService; /** Read the optional Harness service without importing its runtime package. */ export declare function permissionPresetsFrom(ctx: Context): PermissionPresetsService | undefined; /** Effective label for either an active session or the not-yet-created first one. */ export declare function effectivePermission(service: PermissionPresetsService, session: Session | undefined, pending: string | undefined): string; /** Validate a preset and write it only when a durable session already exists. */ export declare function selectPermission(service: PermissionPresetsService, session: Session | undefined, preset: string): string; /** Cycle table order from the active, pending, or configured-default value. */ export declare function cyclePermission(service: PermissionPresetsService, session: Session | undefined, pending: string | undefined): string; /** Materialize a pre-session choice after Harness creates the first session. */ export declare function applyPendingPermission(service: PermissionPresetsService, session: Session, pending: string | undefined): void; /** * List every switchable preset for the /permission panel, table order kept. * Description lookup failures degrade to an undocumented row, never a failed * panel load — `optionOf` rejects names its table no longer knows. */ export declare function listPermissionRows(service: PermissionPresetsService): readonly PermissionRow[];