import { type EffectiveProfileDumpReader } from './profile-setup.js'; export interface PluginSetupTarget { dshHome: string; /** Omit to use `DSH_PROFILE` or the only profile under `$DSH_HOME/profiles`. */ profile?: string; } export interface PluginSetupOptions { /** Test seam; defaults to the approved Host `--dump-config`. */ readDump?: EffectiveProfileDumpReader; /** Compute and report the change without writing. */ dryRun?: boolean; } export interface ProfilePluginSummary { id: string; slug: string; packageName: string; /** Loader row gate (`disabled: true` means the plugin is not loaded). */ loaded: boolean; /** Top-level `enabled` config gate when the plugin has one. */ enabled?: boolean; /** Feature flags: top-level `*Enabled` booleans and one-level `.enabled`. */ flags: Record; /** True when the profile patch already overrides this row. */ overridden: boolean; } export interface PluginChange { id: string; key: string; from: unknown; to: unknown; } export interface PluginSkip { id: string; reason: string; } export interface PluginWriteResult { profile: string; patchPath: string; changed: boolean; dryRun: boolean; changes: PluginChange[]; skipped: PluginSkip[]; } export declare function resolvePluginProfile(target: PluginSetupTarget): Promise; /** Secret-bearing key names; handles/env names/paths/ttls are not secrets. */ export declare function isSecretConfigKey(name: string): boolean; /** Map `work-items`, `assistant-work-items`, `@dsh-enhanced/assistant-work-items` or the row id to an installed row id. */ export declare function resolvePluginId(name: string, installed: Iterable): string | undefined; /** * Convert a CLI string to the type of the current effective value. Unknown keys * need `force`; documented optional keys are typed from a small table. */ export declare function coerceConfigValue(id: string, key: string, raw: string, current: unknown, force?: boolean): unknown; export declare function listProfilePlugins(target: PluginSetupTarget, options?: PluginSetupOptions): Promise<{ profile: string; patchPath: string; plugins: ProfilePluginSummary[]; }>; /** Effective config of one plugin with secret-like values redacted. */ export declare function showProfilePlugin(target: PluginSetupTarget & { plugin: string; }, options?: PluginSetupOptions): Promise<{ profile: string; summary: ProfilePluginSummary; config: string; }>; /** * Enable or disable one plugin: flips the loader row gate and, when the plugin * has a top-level `enabled` config gate, that gate too. */ export declare function setPluginEnabled(target: PluginSetupTarget & { plugin: string; enabled: boolean; }, options?: PluginSetupOptions): Promise; /** Set one config key (dotted path) after validating it against the effective value type. */ export declare function setPluginConfigValue(target: PluginSetupTarget & { plugin: string; key: string; value: string; force?: boolean; }, options?: PluginSetupOptions): Promise; /** Remove one config key from the profile override so the plugin default applies. */ export declare function unsetPluginConfigValue(target: PluginSetupTarget & { plugin: string; key: string; }, options?: PluginSetupOptions): Promise; export interface PresetItem { id: string; purpose: string; set: ReadonlyArray; } /** * The `recommended` preset deliberately turns on opt-in features that stay off * by default. It edits only plugins that are installed and loaded, never loads * a disabled plugin, never touches credentials, Policy, owner routes or sealed * plugin state, and leaves the automations scheduler to the RSI/supervised setup. */ export declare const recommendedPluginPreset: readonly PresetItem[]; export declare const pluginPresets: ReadonlyMap; /** * Apply a named plugin preset (default `recommended`) to one profile in a * single verified write. Intended for onboarding flows: * * ```ts * import { applyRecommendedPluginPreset } from '@dsh-enhanced/assistant-policy/plugin-setup' * const result = await applyRecommendedPluginPreset({ dshHome, profile: 'web' }) * ``` * * Idempotent: re-running reports no changes. */ export declare function applyPluginPreset(target: PluginSetupTarget & { preset?: string; }, options?: PluginSetupOptions): Promise; /** Onboarding entry point: apply the `recommended` plugin preset. */ export declare function applyRecommendedPluginPreset(target: PluginSetupTarget, options?: PluginSetupOptions): Promise; export type PluginSetupCommand = 'list' | 'show' | 'enable' | 'disable' | 'set' | 'unset' | 'preset' | 'guided'; export interface PluginSetupArgs { command: PluginSetupCommand; positionals: string[]; dshHome: string; profile?: string; force: boolean; dryRun: boolean; yes: boolean; json: boolean; help: boolean; } export declare function parsePluginSetupArgs(argv: readonly string[]): PluginSetupArgs; export declare function pluginSetupUsage(): string; export interface PluginSetupIo { write(text: string): void; isTTY: boolean; /** Ask one question; resolves to the trimmed answer. */ ask?(question: string): Promise; } export declare function runPluginSetup(argv?: string[], io?: PluginSetupIo, options?: Omit): Promise; //# sourceMappingURL=plugin-setup.d.ts.map