/** * New hook operation — scaffolds a new hook directory with the manifest and a * starter entrypoint. * * @experimental This API is unstable and may change without notice. */ import * as FileSystem from "effect/FileSystem"; import * as Path from "effect/Path"; import type { Handle } from "../../extensions/handle.js"; import type { OperationHandler } from "../../plan/apply-plan.js"; import type { Operation } from "../../plan/plan.js"; import { WorkspaceMutations } from "../../workspace/service-interface.js"; import { type HookEvent, type HookRuntime } from "../manifest-schema.js"; /** * Args for the new-hook operation. */ export interface NewHookOperationArgs { /** Hook name (validated, lowercase with hyphens). */ readonly name: string; /** Owner (e.g., "@myorg"). */ readonly owner: Handle; /** Interpreter family for the entrypoint. */ readonly runtime: HookRuntime; /** Canonical hook event the scaffold binds to. */ readonly event: HookEvent; /** Optional raw matcher (only meaningful for tool.pre/tool.post). */ readonly matcher: string | undefined; } /** * Scaffold a new hook in the workspace. * * @experimental This API is unstable and may change without notice. */ export type NewHookOperation = Operation<"new-hook", NewHookOperationArgs>; /** * New-hook operation handler. * * 1. Compute managed extension directory path * 2. Check if the hook already exists (directory or settings entry) * 3. Create the managed extension + src directories * 4. Write hook.json manifest * 5. Write starter entrypoint in src/ */ export declare const newHook: OperationHandler; //# sourceMappingURL=new-hook.d.ts.map