/** * The Apso co-author git trailer. Appended to commits that include * Apso-generated work so Apso is credited as a co-author. */ export declare const APSO_COAUTHOR_TRAILER = "Co-authored-by: Apso "; /** * Relative path (from the repo top-level) where the managed hook is installed. * Modern git resolves a relative `core.hooksPath` from the repository root. */ export declare const APSO_HOOKS_DIR = ".apso/hooks"; /** * Builds the `prepare-commit-msg` bash script that appends the Apso co-author * trailer to commits that touch Apso-generated paths. * * Pure function (no side effects) so it can be unit-tested directly. * * Behaviour of the generated script: * - Skips merge/squash commits (`$2` is `merge` or `squash`). * - Honors the `APSO_NO_COAUTHOR=1` opt-out. * - Only acts when the staged changes include an Apso-generated path * (a path segment named `autogen/`). * - Adds the trailer idempotently via `git interpret-trailers`, which handles * trailer-block formatting + dedupe and coexists with other `Co-authored-by` * trailers (e.g. Claude). */ export declare function buildCoAuthorHookScript(): string; export interface InstallCoAuthorHookOptions { /** When true, skip installation (e.g. `.apsorc` set `coAuthor: false`). */ disabled?: boolean; } export interface InstallCoAuthorHookResult { installed: boolean; reason?: "disabled" | "not-a-git-repo" | "custom-hookspath" | "error"; } /** * Installs the Apso co-author `prepare-commit-msg` hook into a project. * * Best-effort: never throws. Callers can log the result. * * - Respects the `disabled` option and the `APSO_NO_COAUTHOR=1` env opt-out. * - No-ops (returns `not-a-git-repo`) outside a git work tree. * - Writes `/.apso/hooks/prepare-commit-msg` (mode 0755). * - Sets the repo-local `core.hooksPath` to `.apso/hooks` when unset; leaves it * alone (and reports success) when it's already `.apso/hooks`; refuses to * clobber a custom `core.hooksPath` (husky etc.) and reports * `custom-hookspath` so the caller can guide the user. */ export declare function installCoAuthorHook(projectRoot: string, opts?: InstallCoAuthorHookOptions): InstallCoAuthorHookResult;