import { type PeaksHookEntry } from './hooks-codegate-superpowers.js'; import type { HookEntryTarget, HookMatcherEntry, HookTarget } from './hooks-settings-types.js'; /** True when `target` already holds everything the install would write to it. */ export declare function targetIsSatisfied(target: HookTarget, allSentinels: ReadonlyArray): boolean; /** Flatten the resolved targets into one `{ matcher, sentinel, settingsPath }` row per entry. */ export declare function describeEntryTargets(targets: ReadonlyArray): HookEntryTarget[]; /** Read a settings file as an object, or `{}` when it does not exist yet. */ export declare function readSettingsFile(settingsPath: string): Record; /** Read the existing hook array entries for the adapter's hookEvent (tolerant of any prior shape). */ export declare function readHookEventEntries(settings: Record, eventKey: string): HookMatcherEntry[]; /** Read the existing hook array entries from a `settings.hooks` object (already extracted). */ export declare function readHookEntriesFromHooks(hooks: Record, eventKey: string): HookMatcherEntry[]; /** True when every command handler in the entry matches a known peaks sentinel for the given IDE. */ export declare function entryIsPeaksManaged(entry: HookMatcherEntry, sentinels: ReadonlyArray): boolean; export declare function isInstalledForEntries(settings: Record, entries: ReadonlyArray): boolean; /** * Slice #014: detect the "stale progress entry after pre-#014 install" * case. The desired shape is gate-enforce-only. If the file currently * has a peaks-managed progress-start entry (left behind by a pre-#014 * install), the install is NOT a no-op — it must strip the stale * entry. This helper returns true exactly when the desired shape is * fully reflected on disk: gate-enforce present AND no legacy * progress-start present. */ export declare function shapeMatchesDesired(settings: Record, entries: ReadonlyArray, allPeaksSentinels: ReadonlyArray): boolean; /** * Merge a target's peaks-managed hook entries into `settings`, preserving * all other keys and hooks. Entries routed to a DIFFERENT settings file are * not part of `entries`, so the legacy-sentinel filter below strips them * from this file (that is what migrates a gate-enforce entry that an older * peaks release wrote into the shared file). */ export declare function withHooksInstalled(settings: Record, entries: ReadonlyArray, allSentinels: ReadonlyArray): Record; /** * Strip every peaks-managed hook row from one target's settings file, on every * event key the file carries — a pre-#014 install could have left the legacy * progress-start entry on a different event than the gate-enforce one. Returns * the rewritten settings plus whether anything was actually removed. */ export declare function stripPeaksEntries(target: HookTarget, sentinels: ReadonlyArray): { settings: Record; removed: boolean; };