/** * `ruflo mods install|uninstall` (ADR-404): enable the ruflo mods for one * project, and take back exactly what was added. * * Writes three kinds of key in a Claude Code settings file: one * `enabledPlugins` entry per plugin in MOD_PLUGINS, the `ruflo` entry of * `extraKnownMarketplaces` when absent, and `env.CLAUDE_CODE_ENABLE_FUNCTION_HOOKS`. * `ruflo init` writes them to the committed `.claude/settings.json` (project * scope); a standalone `ruflo mods install` defaults to * `.claude/settings.local.json`. What was added is recorded per settings file * in `.claude-flow/mods/install.json`, so uninstall removes those and nothing * a person set themselves. Classic hooks are never touched: they stay the * fallback (a mod takes an event over at runtime only). */ export declare const MOD_PLUGIN_ID = "ruflo-mods@ruflo"; export declare const MARKETPLACE_NAME = "ruflo"; export declare const MARKETPLACE_SOURCE: { readonly source: { readonly source: "github"; readonly repo: "ruvnet/ruflo"; }; }; /** An `extraKnownMarketplaces` entry: github ruvnet/ruflo, or a local ruflo checkout (dogfooding). */ export type MarketplaceEntry = { source: { source: 'github'; repo: string; } | { source: 'directory'; path: string; }; }; export declare function directoryMarketplace(path: string): MarketplaceEntry; export declare const ENABLE_ENV = "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS"; export declare const INSTALL_RECORD: string; export interface ModPlugin { id: string; /** * Missing from a ruflo marketplace clone means the clone is stale (a * failure). A plugin not yet released on main is `required: false`: missing * is "pending", never a failure. Flip it once the plugin lands. */ required: boolean; } /** Every plugin `ruflo mods install` and `ruflo init` enable. The one list to edit. */ export declare const MOD_PLUGINS: readonly ModPlugin[]; export declare const MOD_PLUGIN_IDS: readonly string[]; export type Scope = 'local' | 'project'; export interface Added { plugins: string[]; marketplace: boolean; env: boolean; /** * Plugins ruflo itself installed with `claude plugin install` (absent * before, enabled by ruflo); uninstall runs `claude plugin uninstall` for * exactly these. */ claudeInstalled?: string[]; } /** ADR-509 §2.2: an install that went ahead past a high scan finding because of --accept-risk . */ export interface AcceptedRisk { plugin: string; at: string; /** The high findings accepted, as printed (`[high] plugin: file (rule) detail`). */ findings: string[]; } export interface InstallRecord { version: 2; installedAt: string; /** What install added, per settings file it wrote. */ files: Record; /** ADR-509 §2.2: every --accept-risk override, newest last. */ acceptedRisk?: AcceptedRisk[]; } type Settings = Record & { enabledPlugins?: Record; extraKnownMarketplaces?: Record; env?: Record; }; export declare function settingsFileFor(projectRoot: string, scope: Scope): string; /** Reads a settings file; absent is `{}`, anything unparseable throws (never overwritten). */ export declare function readSettingsFile(path: string): Settings; /** The settings after install, and what install added (pure). Existing values are kept. */ export declare function withModEnabled(settings: Settings, plugins?: readonly string[], marketplace?: MarketplaceEntry): { next: Settings; added: Added; }; /** The settings after uninstall: only what the record says install added (pure). */ export declare function withModRemoved(settings: Settings, added: Added): Settings; export interface InstallResult { settingsFile: string; backup?: string; /** What this run added (empty on a re-run). */ added: Added; dryRun: boolean; next: Settings; } export declare function installMod(projectRoot: string, scope: Scope, dryRun?: boolean, plugins?: readonly string[], marketplace?: MarketplaceEntry): InstallResult; /** The install record, v1 (3.50.0: one file, ruflo-mods only) read as v2. */ export declare function readRecord(projectRoot: string): InstallRecord | null; /** ADR-509 §2.2: record an --accept-risk override in .claude-flow/mods/install.json. */ export declare function recordAcceptedRisk(projectRoot: string, entries: readonly AcceptedRisk[]): void; /** Note plugins ruflo installed with `claude plugin install` for one settings file. */ export declare function recordClaudeInstalled(projectRoot: string, settingsFile: string, ids: readonly string[]): void; /** * ADR-509 §2.2: a plugin whose scan blocked it must not stay enabled — Claude * Code loads an enabled plugin straight from the marketplace clone, with or * without an install. Removes `enabledPlugins[id]` (only when it is `true`: a * `false` someone set is already off) and drops the id from what the record * says ruflo added. Returns the ids it turned off. */ export declare function disableBlockedPlugins(projectRoot: string, settingsFile: string, ids: readonly string[]): string[]; /** The scope a recorded settings file was written at. */ export declare function scopeOfSettingsFile(file: string): Scope; export declare function uninstallMod(projectRoot: string, dryRun?: boolean): { settingsFiles: string[]; removed: boolean; dryRun: boolean; }; export {}; //# sourceMappingURL=install.d.ts.map