/** * Hook subject module: declared/resolved/actual payloads, scanner composition, * and projections via the shared helper. * * Declared hooks come from `settings.hooks`; resolved hooks come from * `axm-lock.yaml` `hooks`. Actual occurrences come exclusively from the * canonical-extensions scanner (`type === "hook"`), which enumerates * project-authored `hooks//src`, project-acquired * `agent_extensions//`, and user-scope packages. * * The hook installer also writes agent-side derived artifacts — managed hook * groups inside agent settings files and the advisory-rule fallback region. * Those are renderings of an installed hook, not separate materializations, so * they are deliberately NOT occurrences: the family derives `actual` from the * canonical scanner alone and an agent-side rendering never produces an * unmanaged row. */ import * as Effect from "effect/Effect"; import * as Option from "effect/Option"; import { type ExtensionName } from "../../../extensions/common.js"; import type { HookLockEntry, Lockfile } from "../../../lockfile/schema.js"; import type { HookEntry, Settings } from "../../../settings/schema.js"; import type { Diagnostics } from "../diagnostics.js"; import type { LockfileReadError, SettingsReadError } from "../errors.js"; import type { CanonicalExtensionOccurrence } from "../scanners/types.js"; import type { ActivationState, ExtensionKey, InstallationOrigin, InstalledPackRef, Scope } from "../types.js"; export type HookDetectionOrigin = { readonly _tag: "canonical-axm-hook"; } | { readonly _tag: "external-axm-hook"; }; export interface DeclaredHook { readonly name: ExtensionName; readonly entry: HookEntry; } export type DeclaredHooks = ReadonlyArray; export interface ResolvedHook { readonly name: ExtensionName; readonly lockEntry: HookLockEntry; } export type ResolvedHooks = ReadonlyArray; export interface ActualHook { readonly key: ExtensionKey<"hook">; readonly origin: HookDetectionOrigin; readonly contentRoot: string; readonly packageRoot: string | null; } export type ActualHooks = ReadonlyArray; export interface HookPackMember { readonly name: ExtensionName; readonly providingPack: InstalledPackRef; } export interface InstalledHook { readonly key: ExtensionKey<"hook">; readonly installationOrigin: InstallationOrigin; readonly activation: ActivationState; readonly resolved: Option.Option; readonly actual: ReadonlyArray; readonly providingPacks: ReadonlyArray; } export interface UnmanagedHook { readonly key: ExtensionKey<"hook">; readonly actual: ActualHook; } /** * Hook scanners. Hook packages materialize only in canonical package roots, * so the canonical scanner is the sole input; agent-side managed hook groups are * renderings of an installed hook rather than independent materializations. */ export interface HookScanners { readonly canonical: Effect.Effect>; } export interface HookScopedLoaders { readonly settings: Effect.Effect, SettingsReadError>; readonly lockfile: Effect.Effect, LockfileReadError>; } export interface InstalledPackForHooks { readonly ref: InstalledPackRef; readonly hooks: ReadonlyArray; } export interface HookExtensionsApiDeps { readonly scope: Scope; readonly loaders: HookScopedLoaders; readonly scanners: HookScanners; readonly installedPacks: Effect.Effect, SettingsReadError | LockfileReadError>; readonly diagnostics: Diagnostics; } export interface HookExtensionsApi { readonly declared: Effect.Effect, SettingsReadError>; readonly resolved: Effect.Effect, LockfileReadError>; readonly actual: Effect.Effect; readonly installed: Effect.Effect, SettingsReadError | LockfileReadError>; readonly byName: (name: string) => Effect.Effect, SettingsReadError | LockfileReadError>; readonly declaredByName: (name: string) => Effect.Effect, SettingsReadError>; readonly active: Effect.Effect, SettingsReadError | LockfileReadError>; readonly unmanaged: Effect.Effect, SettingsReadError | LockfileReadError>; } /** * Build the hook subject API. Returns an `Effect` because the projection * cell is wrapped in `Effect.cached` so the four derived cells share one * in-flight execution per scope, mirroring `state.ts`. */ export declare const makeHookExtensionsApi: (deps: HookExtensionsApiDeps) => Effect.Effect; //# sourceMappingURL=hook.d.ts.map