/** * 0.19.0-α.15 — `slowcook garnish` trailer helpers. * * When a human (or another agent) commits a tweak on top of an agent's * work, we mark the commit with `Tweaks-output-of:` git trailer lines — * one per file the tweak touched, naming the upstream agent + sha. A * future `slowcook reflect` command mines these trailers to surface * learning signal for the upstream agent (eval-set fixtures, prompt * amendment candidates, drift catalogs). * * Trailer format (one line per file): * * Tweaks-output-of: agent= sha= file= * * Examples: * Tweaks-output-of: agent=vibe sha=a7df238 file=mock/src/components/Foo.tsx * Tweaks-output-of: agent=plate sha=00905ae file=mock/src/components/Bar.tsx * * Pure module — no IO. Caller composes the trailer lines into the commit * message and runs git separately. */ export interface UpstreamRef { /** Upstream agent name (vibe / plate / brew / chef / etc). */ agent: string; /** Upstream commit SHA (short or full; renderer trims to 7). */ sha: string; /** Repo-relative file path the tweak touched. */ file: string; } /** * Format a list of upstream refs into trailer lines (one per ref). * Pure: returns a single string with `\n` separators, no leading or * trailing newline. Caller appends to the commit-message body. */ export declare function formatTrailer(refs: UpstreamRef[]): string; /** * Parse a single trailer line, returning the parsed ref or null if the * line doesn't match the expected shape. Tolerates leading/trailing * whitespace + the optional " " indent some `git interpret-trailers` * outputs add. */ export declare function parseTrailerLine(line: string): UpstreamRef | null; /** * Parse all `Tweaks-output-of:` trailers from a full commit-message * body (multi-line). Returns refs in the order they appeared. */ export declare function parseTrailers(commitBody: string): UpstreamRef[]; /** * Inspect a git author line + return the upstream agent name, if the * author follows slowcook's agent convention. Otherwise null. * * Conventions detected: * slowcook-vibe[bot] → "vibe" * slowcook-plate[bot] → "plate" * slowcook-brew[bot] → "brew" * slowcook-chef[bot] → "chef" * slowcook-refine[bot] → "refine" * slowcook-testgen[bot] → "testgen" * slowcook-recipe[bot] → "recipe" * anything else → null (human or unrelated bot) * * Pure: no IO. Caller pipes git author through it. */ export declare function agentFromAuthor(author: string): string | null; /** * Compose the full commit message body for a garnish commit: a one-line * subject naming the touched files, a blank line, optional user-provided * body, a blank line, then the trailer block. * * Pure: caller passes the staged-file list + the parsed upstream refs + * the optional user message. Returns the body string ready for `git * commit -F`. */ export declare function composeCommitMessage(args: { touchedFiles: string[]; upstreamRefs: UpstreamRef[]; userMessage?: string; }): string; //# sourceMappingURL=trailer.d.ts.map