import type { ProjectType } from "../core/config.js";
/** Subdirectory inside `.opencode/` where OpenCode discovers project plugins */
export declare const OPENCODE_PLUGIN_SUBDIR = "plugin";
/** Filename of the OpenCode project config merged at the host root */
export declare const OPENCODE_CONFIG_FILENAME = "opencode.json";
/** Subdirectory inside `.opencode/` for Lisa rule instruction files. */
export declare const OPENCODE_LISA_RULES_SUBDIR = "lisa-rules";
/** OpenCode instruction glob that loads Lisa eager rules every session. */
export declare const OPENCODE_EAGER_RULES_INSTRUCTION = ".opencode/lisa-rules/eager/*.md";
/** Result of the OpenCode hooks install pass */
export interface OpencodeHooksInstallResult {
    /** Files written, relative to `.opencode/` (added to the manifest). */
    readonly managedFiles: readonly string[];
    /** Number of plugin templates emitted into `.opencode/plugin/`. */
    readonly pluginCount: number;
    /** Whether `opencode.json` was created (vs merged into an existing file). */
    readonly configCreated: boolean;
    /** Stale Lisa plugin files removed because they're no longer shipped. */
    readonly deleted: readonly string[];
}
/**
 * Install Lisa's OpenCode hooks: merge `permission.bash` deny rules into
 * `opencode.json`, mirror Lisa rule files for `instructions`, and emit the
 * applicable `.opencode/plugin/lisa-*.ts` modules.
 * @param lisaDir - Absolute path to the Lisa repo root or installed package.
 *
 * `opencode.json` lives at the host ROOT (outside `.opencode/`), is a shared
 * merged file, and is intentionally NOT returned in `managedFiles` — the
 * `.opencode/`-relative manifest never deletes it. Plugin files under
 * `.opencode/plugin/` ARE tracked so renames clean up stale modules.
 * @param destDir - Absolute path to the host project root.
 * @param detectedTypes - Project types Lisa detected; gates stack-specific
 *   plugins. Universal plugins/config install regardless.
 * @param previousManagedFiles - Files Lisa managed last run (relative to
 *   `.opencode/`); used to detect stale plugin modules.
 * @returns Result describing what was written + removed.
 */
export declare function installHooks(lisaDir: string, destDir: string, detectedTypes: readonly ProjectType[], previousManagedFiles: readonly string[]): Promise<OpencodeHooksInstallResult>;
/**
 * Merge the `block-no-verify` deny globs into an `opencode.json` (JSONC) body.
 * Pure function for testability; `mergeOpencodeConfig` is the I/O wrapper.
 *
 * Empty input yields a clean Lisa-authored document. A host `permission.bash`
 * set to a bare string (e.g. `"allow"`) is re-seeded as a `{ "*": <string> }`
 * catch-all so the host's posture survives alongside the deny rules. Otherwise
 * each deny glob is added as its own key, preserving host bash patterns. `$schema`
 * is set only when absent. Throws on invalid JSONC so a corrupt host file is
 * surfaced, not silently overwritten.
 * @param existingJsonc - Current contents of `opencode.json` (or "").
 * @returns Merged JSON/JSONC string with host content preserved.
 */
export declare function mergeNoVerifyDenyRules(existingJsonc: string): string;
/**
 * Enumerate the Lisa plugin filenames currently present in a host's
 * `.opencode/plugin/` directory. Exposed for tests/diagnostics.
 * @param destDir - Absolute path to the host project root.
 * @returns Sorted list of `lisa-*.ts` filenames (empty if the dir is absent).
 */
export declare function listInstalledPluginFiles(destDir: string): Promise<readonly string[]>;
//# sourceMappingURL=hooks-installer.d.ts.map