/** * Managed hook-group editing for agent JSON settings files. * * Kept free of service dependencies so workspace cleanup can strip AXM-managed * hook groups without importing the hook manager, which requires * `WorkspaceMutations` and would form a layer cycle. * * @experimental This API is unstable and may change without notice. */ import * as Effect from "effect/Effect"; import { type AppError } from "../app-error/index.js"; interface ManagedHookCommand { readonly type: "command"; readonly command: string; readonly "x-axm": { readonly v: 1; readonly managed: true; readonly unit: string; readonly source: string; readonly ref: string; }; } export declare const isManagedHookEntry: (value: unknown) => value is ManagedHookCommand; /** Commands recovered from AXM-owned hook entries in one hooks object. */ export declare const managedHookCommands: (hooks: unknown) => ReadonlyArray; export declare const ambiguousHookCommands: (hooks: unknown) => ReadonlyArray; /** Parse a native config and recover commands only from its managed hook unit. */ export declare const readManagedHookCommands: (configPath: string, settingsKey: string, raw: string) => Effect.Effect, AppError>; export declare const readAmbiguousHookCommands: (configPath: string, settingsKey: string, raw: string) => Effect.Effect, AppError>; export declare const stripManagedHookGroups: (hooks: Record) => Record; /** * Rewrite `settingsKey` so it holds `renderedHooks` plus every user-authored * group already present. Edits go through jsonc-parser so comments and * formatting in user-owned settings files survive. */ export declare const updateHooksJson: (configPath: string, settingsKey: string, raw: string, renderedHooks: Record) => Effect.Effect; /** * Remove every AXM-managed hook group from `settingsKey`, retaining * user-authored groups. Used when an agent is removed from the workspace and * its rendered hooks must stop running. */ export declare const stripManagedHooksFromJson: (configPath: string, settingsKey: string, raw: string) => Effect.Effect; export {}; //# sourceMappingURL=managed-groups.d.ts.map